@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --font-primary: 'Kanit', sans-serif;
  --font-numeric: 'Inter', 'Kanit', sans-serif;
  --transition-speed: 0.25s;
  
  /* Light Theme */
  --bg-primary: #f1f5f9;          /* Slate 100 */
  --bg-secondary: #ffffff;
  --bg-sidebar: #0f172a;          /* Slate 900 */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-primary: #ffffff;
  --text-on-sidebar: #94a3b8;
  --text-on-sidebar-active: #ffffff;
  
  --color-primary: #0d9488;       /* Teal 600 */
  --color-primary-hover: #0f766e; /* Teal 700 */
  --color-primary-light: #ccfbf1; /* Teal 100 */
  --color-secondary: #0ea5e9;     /* Sky 500 */
  --color-accent: #f43f5e;        /* Rose 500 */
  --color-accent-hover: #e11d48;  /* Rose 600 */
  --color-success: #10b981;       /* Emerald 500 */
  --color-warning: #f59e0b;       /* Amber 500 */
  
  --border-color: #e2e8f0;        /* Slate 200 */
  --sidebar-active-bg: #1e293b;   /* Slate 800 */
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.02);
  --modal-bg: rgba(15, 23, 42, 0.6);
  --input-focus-ring: rgba(13, 148, 136, 0.2);
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-primary: #0f172a;          /* Slate 900 */
  --bg-secondary: #1e293b;        /* Slate 800 */
  --bg-sidebar: #020617;          /* Slate 950 */
  --text-primary: #f8fafc;        /* Slate 50 */
  --text-secondary: #94a3b8;      /* Slate 400 */
  --text-muted: #64748b;          /* Slate 500 */
  
  --color-primary: #14b8a6;       /* Teal 500 */
  --color-primary-hover: #0d9488; /* Teal 600 */
  --color-primary-light: #115e59; /* Teal 800 */
  --color-secondary: #38bdf8;     /* Sky 400 */
  --color-accent: #f43f5e;        /* Rose 500 */
  --color-accent-hover: #e11d48;  
  --color-success: #34d399;       /* Emerald 400 */
  --color-warning: #fbbf24;       /* Amber 400 */
  
  --border-color: #334155;        /* Slate 700 */
  --sidebar-active-bg: #1e293b;   
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --modal-bg: rgba(2, 6, 17, 0.85);
  --input-focus-ring: rgba(20, 184, 166, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Application Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-on-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
}

.brand-section {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.brand-name span {
  color: var(--color-primary);
}

.nav-section {
  flex-grow: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-on-sidebar);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav-link:hover {
  color: var(--text-on-sidebar-active);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active .nav-link {
  color: var(--text-on-sidebar-active);
  background-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-dot.online {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.status-dot.offline {
  background-color: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

/* Main Workspace */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Header Bar */
.header-bar {
  height: 70px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.page-title-section {
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme Toggle & Sync button */
.icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-speed);
}

.icon-btn:hover {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Workspace Views */
.view-container {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  position: relative;
  height: calc(100vh - 70px);
}

.page-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
  flex-direction: column;
  gap: 24px;
  min-height: 100%;
}

.page-view.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* UI Elements: Cards */
.card {
  background-color: var(--bg-secondary);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-primary);
}

.card-body {
  padding: 24px;
  flex-grow: 1;
}

/* Stats Dashboard Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  background-color: var(--bg-secondary);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, background-color var(--transition-speed);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper.primary {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.stat-icon-wrapper.secondary {
  background-color: #e0f2fe;
  color: var(--color-secondary);
}

.stat-icon-wrapper.accent {
  background-color: #ffe4e6;
  color: var(--color-accent);
}

.stat-icon-wrapper.warning {
  background-color: #fef3c7;
  color: var(--color-warning);
}

.stat-icon-wrapper.success {
  background-color: #d1fae5;
  color: var(--color-success);
}

.stat-icon-wrapper svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-numeric);
}

/* POS Screen Custom Grid Layout */
.pos-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100vh - 118px);
  min-height: 500px;
}

.cart-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cart-card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.cart-table-container {
  flex-grow: 1;
  overflow-y: auto;
  min-height: 150px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cart-table th {
  padding: 14px 16px;
  background-color: var(--bg-primary);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.cart-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  vertical-align: middle;
}

.cart-table tr:hover {
  background-color: rgba(13, 148, 136, 0.02);
}

.cart-item-desc {
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-weight: 500;
}

.cart-item-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-barcode {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-numeric);
}

.cart-item-promo {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-item-promo svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all var(--transition-speed);
}

.qty-btn:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.qty-input {
  width: 44px;
  height: 28px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-numeric);
  font-size: 0.9rem;
  font-weight: 600;
}

.cart-price-col {
  font-family: var(--font-numeric);
  font-weight: 500;
}

.cart-total-col {
  font-family: var(--font-numeric);
  font-weight: 600;
}

.price-original {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-right: 4px;
}

.del-btn {
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--transition-speed);
}

.del-btn:hover {
  color: var(--color-accent);
}

.del-btn svg {
  width: 18px;
  height: 18px;
}

.empty-cart-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  padding: 40px;
  gap: 16px;
}

.empty-cart-state svg {
  width: 64px;
  height: 64px;
  stroke: var(--text-muted);
  stroke-width: 1.5;
}

/* POS Screen Right Control Panel */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
  padding-right: 2px;
}

.barcode-search-box {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.checkout-card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.checkout-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.summary-row.total {
  border-top: 2px dashed var(--border-color);
  padding-top: 16px;
  margin-top: 8px;
  color: var(--text-primary);
}

.summary-label {
  font-weight: 500;
}

.summary-value {
  font-family: var(--font-numeric);
  font-weight: 600;
}

.summary-row.total .summary-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary);
}

.member-selection {
  background-color: var(--bg-primary);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* Barcode Scanner Simulator Panel */
.simulator-card-body {
  padding: 16px;
  max-height: 240px;
  overflow-y: auto;
}

.simulator-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sim-barcode-btn {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.sim-barcode-btn:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.sim-btn-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: left;
}

.sim-btn-code {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-numeric);
}

.sim-btn-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 4px;
}

/* Interactive Elements: Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-row {
  display: flex;
  gap: 16px;
  width: 100%;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.form-input-icon svg {
  width: 100%;
  height: 100%;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  font-size: 0.95rem;
  transition: all var(--transition-speed);
}

.form-input-wrapper .form-input {
  padding-left: 40px;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

/* Interactive Elements: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--text-on-primary);
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-danger {
  background-color: var(--color-accent);
  color: white;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
  background-color: var(--color-accent-hover);
}

.btn-success {
  background-color: var(--color-success);
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background-color: #059669;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1.1rem;
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background-color: var(--modal-bg);
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-secondary);
  border-radius: 18px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.2s ease-out;
  border: 1px solid var(--border-color);
}

@keyframes modalSlide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-speed);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-close svg {
  width: 24px;
  height: 24px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

[data-theme="dark"] .badge-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

[data-theme="dark"] .badge-danger {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .badge-warning {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.badge-info {
  background-color: #e0f2fe;
  color: #075985;
}

[data-theme="dark"] .badge-info {
  background-color: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
}

/* Tables for Back-office views */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-primary);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.data-table th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s, color 0.2s;
}

.data-table th[data-sort-key]:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.sorted-active {
  color: var(--color-primary) !important;
}

.sorted-active .sort-icon {
  opacity: 1;
  color: var(--color-primary);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] .data-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.table-search-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
}

/* Checkout Receipt Preview */
.receipt-preview {
  background-color: #ffffff;
  color: #000000;
  font-family: 'Courier New', Courier, monospace;
  padding: 20px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  max-height: 350px;
  overflow-y: auto;
}

.receipt-preview * {
  font-family: 'Courier New', Courier, monospace !important;
}

/* Dynamic SVG Charts */
.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.chart-wrapper {
  background-color: var(--bg-secondary);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}

.chart-svg {
  width: 100%;
  height: 240px;
  margin-top: 16px;
}

.chart-bar {
  fill: var(--color-primary);
  transition: fill 0.2s, height 0.3s, y 0.3s;
  cursor: pointer;
}

.chart-bar:hover {
  fill: var(--color-primary-hover);
}

.chart-grid-line {
  stroke: var(--border-color);
  stroke-width: 1;
  stroke-dasharray: 4, 4;
}

.chart-axis-text {
  fill: var(--text-secondary);
  font-size: 11px;
}

.chart-tooltip {
  background-color: var(--bg-sidebar);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  position: absolute;
  pointer-events: none;
  font-size: 0.8rem;
  display: none;
  z-index: 50;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Floating Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--color-primary);
  color: var(--text-primary);
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

@keyframes toastIn {
  from { transform: translateX(100%) translateY(20px); opacity: 0; }
  to { transform: translateX(0) translateY(0); opacity: 1; }
}

.toast.success {
  border-left-color: var(--color-success);
}
.toast.error {
  border-left-color: var(--color-accent);
}
.toast.warning {
  border-left-color: var(--color-warning);
}

.toast-message {
  font-size: 0.9rem;
  font-weight: 500;
  flex-grow: 1;
}

/* Instructions card inside Settings */
.settings-instruction {
  background-color: var(--bg-primary);
  border-radius: 10px;
  padding: 16px;
  border-left: 4px solid var(--color-primary);
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-instruction h4 {
  font-weight: 600;
  color: var(--text-primary);
}

.settings-instruction ol {
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.settings-instruction code {
  background-color: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.code-block-wrapper {
  position: relative;
  margin-top: 8px;
}

.code-block {
  background-color: #1e293b;
  color: #f8fafc;
  font-family: 'Courier New', Courier, monospace;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: pre;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .pos-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .cart-panel {
    height: 500px;
  }
  .control-panel {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 70px;
  }
  .brand-name, .sidebar-footer, .nav-link span {
    display: none;
  }
  .brand-section {
    padding: 16px 10px;
    justify-content: center;
  }
  .nav-link {
    padding: 12px;
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .header-bar {
    padding: 0 16px;
  }
  .view-container {
    padding: 16px;
  }
}

/* Custom Search Dropdown Component Styles */
.dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  transition: background-color 0.15s;
  color: var(--text-primary);
}

.dropdown-item:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.dropdown-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-numeric);
}

/* Printable Quotation Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #modal-quotation, #modal-quotation * {
    visibility: visible;
  }
  #modal-quotation {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: none !important;
    box-shadow: none !important;
    display: block !important;
    overflow: visible !important;
  }
  #modal-quotation .modal-content {
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #modal-quotation .modal-header,
  #modal-quotation .modal-footer {
    display: none !important;
  }
  #print-quotation-area {
    border: none !important;
    background: white !important;
    color: black !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Sub-Tabs Navigation Styles */
.sub-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  transition: all 0.2s ease-in-out;
}

.sub-tab-btn:hover {
  background-color: var(--bg-primary);
  color: var(--color-primary);
}

.sub-tab-btn.active {
  background-color: var(--color-primary) !important;
  color: white !important;
}
