.order-type-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  z-index: 220;
}

.order-type-card {
  background: #fff;
  border-radius: 22px;
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  text-align: center;
}

.order-type-card h2 {
  margin: 0;
  font-size: 1.35rem;
  color: #0f172a;
}

.order-type-card p {
  margin: 0;
  color: var(--muted);
}

.order-type-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.order-type-btn {
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 16px;
  padding: 0.9rem 0.75rem;
  background: rgba(37, 99, 235, 0.07);
  color: #1e3a8a;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.order-type-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.14);
}

.order-type-btn .emoji {
  font-size: 1.6rem;
}

.sale-basics,
.sale-customer,
.sale-payments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.sale-customer input[type='tel'] {
  letter-spacing: 0.4px;
}

.assistive-text {
  font-size: 0.68rem;
  color: #64748b;
}

.assistive-text::before {
  content: 'ℹ️ ';
  font-size: 0.62rem;
}

.platform-field[hidden] {
  display: none !important;
}

.platform-field {
  grid-column: 1 / -1;
}

.dine-in-only[hidden] {
  display: none !important;
}

.order-type-modal[hidden] {
  display: none !important;
}
.purchases-shell,
.expenses-shell {
  display: flex;
  min-height: 100%;
  height: auto;
  background: #eef3ff;
}

.purchases-main,
.expenses-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 2rem;
  gap: 1.5rem;
}

.purchases-topbar,
.expenses-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  padding: 1rem 1.5rem;
  padding-top: max(1rem, env(safe-area-inset-top, 1rem));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.purchases-actions,
.expenses-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.purchases-actions .primary,
.expenses-actions .primary {
  padding: 0.55rem 1.2rem;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.utility-btn {
  width: auto;
  padding: 0.45rem 0.95rem;
  border-radius: 9px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.utility-btn.ghost {
  background: #fff;
  color: #1e293b;
  border-color: rgba(148, 163, 184, 0.45);
}

.utility-btn:hover {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.32);
}

.date-filter-group {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.date-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.dashboard-content > .date-filter-bar {
  grid-column: 1 / -1;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0;
  font-size: 0.68rem;
  color: #475569;
  font-weight: 600;
}

.filter-field span {
  font-size: 0.68rem;
  color: inherit;
}

.date-filter-group input {
  width: auto;
  min-width: 130px;
  padding: 0.4rem 0.55rem;
}

.date-range-chip {
  background: #f9fafb;
  color: #374151;
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.pill-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: #fff;
  color: var(--primary);
  font-size: 0.72rem;
  cursor: pointer;
}

.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.purchases-content,
.expenses-content {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

.vendor-list {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vendor-list header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#vendor-items,
#category-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
}

.vendor-item {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.vendor-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.purchase-details {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.purchase-details .details-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.purchase-details .metrics {
  display: flex;
  gap: 0.75rem;
}

.line-items-block {
  background: rgba(248, 250, 252, 0.75);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.line-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.line-items-header h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

.purchase-line-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.purchase-line-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 80px 110px 110px 40px;
  gap: 0.55rem;
  align-items: center;
}

.purchase-line-row input {
  width: 100%;
}

.purchase-line-row input,
.purchase-line-row select,
.purchase-line-row .line-total {
  border: 1px solid #475569;
  border-radius: 9px;
}

.purchase-line-row .line-total {
  background: rgba(241, 245, 249, 0.65);
  font-weight: 600;
  font-size: 0.78rem;
}

.purchase-line-row input:focus,
.purchase-line-row select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  outline: 2px solid rgba(37, 99, 235, 0.18);
}

.remove-line-item {
  border: none;
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
  border-radius: 10px;
  height: 36px;
  width: 36px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-line-item:hover {
  background: rgba(248, 113, 113, 0.3);
}

.metric-card.small {
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
}

.tab-group {
  display: flex;
  gap: 0.5rem;
}

.tab {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: #fff;
  font-size: 0.72rem;
  cursor: pointer;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.category-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.04);
  border: 1px dashed rgba(37, 99, 235, 0.2);
}

.purchases-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  border-radius: 14px;
  overflow: hidden;
  min-width: 800px;
}

.purchases-table thead th {
  background: #f8fafc;
  padding: 0.65rem;
  text-align: left;
  font-size: 0.72rem;
  border-bottom: 1px solid #e2e8f0;
}

.purchases-table tbody td {
  padding: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}

.purchases-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.purchases-table td:last-child {
  text-align: right;
}

#purchase-drawer {
  display: none;
}

#purchase-drawer.open {
  display: flex;
}

.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

#cancel-purchase-btn {
  width: auto;
}
:root {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fb;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.4;
  --bg-sidebar: #111826;
  --bg-main: #f5f7fb;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #0ea5e9;
  --danger: #dc2626;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Style the friendly date display next to the date input */
.date-display-label {
  display: inline-block;
  margin-top: 6px;
  margin-left: 6px;
  color: #586070; /* muted */
  font-size: 0.95rem;
  vertical-align: middle;
}

/* When you want the label on a new line (mobile) */
@media (max-width: 600px) {
  .date-display-label {
    display: block;
    margin-left: 0.25rem;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  background: var(--bg-main);
}

.dashboard-body {
  background: #f9fafb;
}

a {
  text-decoration: none;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
}

.app-shell {
  display: flex;
  min-height: 100%;
  height: auto;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  gap: 1.5rem;
  flex-shrink: 0;
  overflow-y: auto;
  height: auto;
  min-height: 100%;
}

.sidebar h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
  margin: 0.5rem 0;
  border: none;
}

.nav-link[href="#"] {
  cursor: pointer;
}

.nav-link[href="#"]:hover {
  opacity: 0.8;
}

.nav-link {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: #cbd5f5;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  /* Fixed dimensions to prevent shifting */
  min-height: 2.25rem;
  box-sizing: border-box;
  /* Ensure consistent spacing */
  margin: 0;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(37, 99, 235, 0.2);
  color: #ffffff;
  /* Keep same border to prevent shifting */
  border: 2px solid transparent;
  /* Ensure no position changes */
  position: relative;
  left: 0;
  right: 0;
  /* Prevent any width changes */
  width: 100%;
  flex-shrink: 0;
}

/* Ensure only ONE nav-link can be active at a time */
.sidebar-nav .nav-link.active ~ .nav-link.active {
  background: rgba(37, 99, 235, 0.1);
  color: #cbd5f5;
}

.nav-link[style*="color: #ef4444"],
.nav-link#sidebar-logout-btn {
  color: #ef4444 !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.nav-link[style*="color: #ef4444"]:hover,
.nav-link#sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444 !important;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem;
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: auto;
  min-width: 0;
}

.dashboard-shell .sidebar {
  gap: 1rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.brand-sub {
  font-size: 0.7rem;
  color: rgba(226, 232, 240, 0.65);
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: visible;
  height: auto;
  min-height: 100%;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}


.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
  backdrop-filter: blur(10px);
  padding: 1.25rem 1.5rem;
  padding-top: max(1.25rem, env(safe-area-inset-top, 1.25rem));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.top-search {
  flex: 1;
  min-width: 240px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-search input {
  width: 100%;
  border: none;
  font-size: 0.8rem;
  color: var(--muted);
  background: transparent;
}

.top-search input:focus {
  outline: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 480px;
  display: flex;
  flex-direction: column;
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.notifications-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.clear-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.clear-btn:hover {
  background: #f1f5f9;
}

.notifications-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.notification-item {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.2s;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item.unread {
  background: #f0f9ff;
}

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.notification-message {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.notification-time {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.notification-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 0.5rem 0;
  overflow: hidden;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9rem;
  color: #0f172a;
}

.profile-dropdown-item:hover {
  background: #f8fafc;
}

.profile-dropdown-item span:first-child {
  font-size: 1.1rem;
}

.profile-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.5rem 0;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(59, 130, 246, 0.15) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.profile-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.profile-role {
  display: block;
  font-size: 0.6875rem;
  color: rgba(107, 114, 128, 0.8);
  font-weight: 500;
  line-height: 1.2;
}

.dashboard-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.5rem;
  min-height: 0;
  height: auto;
  overflow: visible;
  width: 100%;
}

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
  width: 100%;
  overflow: visible;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  width: 100%;
  overflow: visible;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  color: #1f2937;
  border-radius: 20px;
  border: none;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.3;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Beautiful gradient backgrounds for metric cards - like nutrition app */
.metric-card:nth-child(1) {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(16, 185, 129, 0.08) 50%, rgba(255, 255, 255, 1) 100%);
  color: #059669;
}

.metric-card:nth-child(1)::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.metric-card:nth-child(2) {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.12) 0%, rgba(249, 115, 22, 0.08) 50%, rgba(255, 255, 255, 1) 100%);
  color: #ea580c;
}

.metric-card:nth-child(2)::before {
  background: linear-gradient(90deg, #f97316, #ea580c);
}

.metric-card:nth-child(3) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(37, 99, 235, 0.08) 50%, rgba(255, 255, 255, 1) 100%);
  color: #2563eb;
}

.metric-card:nth-child(3)::before {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.metric-card:nth-child(4) {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(147, 51, 234, 0.08) 50%, rgba(255, 255, 255, 1) 100%);
  color: #9333ea;
}

.metric-card:nth-child(4)::before {
  background: linear-gradient(90deg, #a855f7, #9333ea);
}

.metric-card:nth-child(5) {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(219, 39, 119, 0.08) 50%, rgba(255, 255, 255, 1) 100%);
  color: #db2777;
}

.metric-card:nth-child(5)::before {
  background: linear-gradient(90deg, #ec4899, #db2777);
}

.metric-card:nth-child(6) {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.08) 50%, rgba(255, 255, 255, 1) 100%);
  color: #d97706;
}

.metric-card:nth-child(6)::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.metric-card:nth-child(7) {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(220, 38, 38, 0.08) 50%, rgba(255, 255, 255, 1) 100%);
  color: #dc2626;
}

.metric-card:nth-child(7)::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.metric-card:nth-child(8) {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(79, 70, 229, 0.08) 50%, rgba(255, 255, 255, 1) 100%);
  color: #4f46e5;
}

.metric-card:nth-child(8)::before {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.metric-card .metric-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: none;
}

.metric-card .metric-label {
  color: #374151;
}

.metric-card .metric-subtext {
  color: #6b7280;
}

.metric-card strong {
  color: #111827;
}

.metric-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: inherit;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: none;
}

.metric-icon.sales {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.metric-icon.purchases {
  background: linear-gradient(135deg, #f97316, #fb923c);
}

.metric-icon.expenses {
  background: linear-gradient(135deg, #facc15, #fbbf24);
}

.metric-icon.credits {
  background: linear-gradient(135deg, #ec4899, #f472b6);
}

.metric-icon.profit {
  background: linear-gradient(135deg, #22c55e, #4ade80);
}

.metric-icon.profit-percent {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.metric-icon.profit-month {
  background: linear-gradient(135deg, #9333ea, #a855f7);
}

.metric-icon.profit-percent-month {
  background: linear-gradient(135deg, #f97316, #fb923c);
}

.metric-icon.orders {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(31, 41, 55, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: block;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.metric-info strong {
  font-size: 1.875rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  display: block;
  letter-spacing: -0.5px;
}

.metric-subtext {
  font-size: 0.8125rem;
  color: rgba(107, 114, 128, 0.8);
  display: block;
  margin-top: 0.375rem;
  font-weight: 500;
}

.metric-subtext.positive {
  color: #16a34a;
}
.card.profit-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08), #fff);
  border: 2px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
  border-radius: 18px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profit-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card.cashbook-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(52, 211, 153, 0.08), #fff);
  border: 2px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
  border-radius: 18px;
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  grid-column: 1 / -1;
}

.cashbook-header {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.cashbook-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #0f172a;
}

.cashbook-header p {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.65);
}

.cashbook-opening-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.cashbook-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cashbook-section h3 {
  margin: 0;
  font-size: 0.88rem;
  color: #111827;
}

.cashbook-subheading {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.32px;
  color: rgba(15, 23, 42, 0.55);
}

.cashbook-row {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  align-items: flex-start;
  font-size: 0.82rem;
  color: #1f2937;
}

.cashbook-row.total strong {
  font-size: 1.05rem;
}

.cashbook-breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.cashbook-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.78rem;
  color: #1f2937;
}

.cashbook-breakdown .method-label {
  font-weight: 500;
  color: #1f2937;
}

.cashbook-breakdown .method-amount {
  font-weight: 600;
}

.cashbook-empty {
  font-style: italic;
  color: rgba(15, 23, 42, 0.6);
}

.cashbook-note {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(15, 23, 42, 0.6);
}

.cashbook-section.closing {
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.85rem;
}

.cashbook-formula {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  color: rgba(15, 23, 42, 0.6);
  max-width: 360px;
}

/* Items Performance Card - Clean Professional Style */
.card.items-performance-card {
  grid-column: 1 / -1;
  background: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
}

.card.items-performance-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.card.items-performance-card header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.card.items-performance-card header p {
  margin: 0.25rem 0 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

.items-performance-summary {
  display: flex;
  gap: 2rem;
  padding: 1rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.items-summary-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.items-summary-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.items-summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.items-performance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.items-chart-section h3 {
  margin: 0 0 1rem 0;
  font-size: 0.9375rem;
  color: #111827;
  font-weight: 600;
}

.items-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
}

.item-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.item-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.item-name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.item-quantity {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  margin-left: 0.5rem;
}

.item-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.item-bar {
  height: 24px;
  border-radius: 6px;
  min-width: 5%;
  transition: width 0.3s ease;
  position: relative;
}

.item-bar.top-item {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.8), rgba(52, 211, 153, 0.9));
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.item-bar.bottom-item {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.8), rgba(248, 113, 113, 0.9));
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.item-bar-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

.empty-chart-message {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 1024px) {
  .items-performance-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}


.metric-subtext.negative {
  color: #dc2626;
}

.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.chart-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  min-height: 220px;
}

.chart-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

.chart-card header h2 {
  margin: 0;
  font-size: 0.9rem;
}

.chart-card header p {
  margin: 0.1rem 0 0;
  font-size: 0.68rem;
  color: var(--muted);
}

.chart-card footer {
  font-size: 0.65rem;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.65rem;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
}

.legend-dot.dine {
  background: #2563eb;
}

.legend-dot.online {
  background: #f97316;
}

.sparkline {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  height: 140px;
}

.spark-bar {
  flex: 1;
  min-width: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.75), rgba(37, 99, 235, 0.2));
  position: relative;
  overflow: hidden;
}

.spark-bar::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  border-radius: inherit;
  background: inherit;
  height: var(--bar-height, 10%);
}

.dual-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.55rem;
  align-items: end;
  height: 140px;
}

.dual-col {
  display: grid;
  gap: 0.2rem;
  justify-items: center;
  font-size: 0.6rem;
  color: var(--muted);
}

.dual-bar {
  width: 12px;
  border-radius: 6px;
}

.dual-bar.dine {
  background: rgba(37, 99, 235, 0.75);
}

.dual-bar.online {
  background: rgba(249, 115, 22, 0.75);
}

.card.review-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.review-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: #0f172a;
}

.notes-list .empty {
  color: var(--muted);
}

.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-height: 0;
}

.side-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.side-card header h3 {
  margin: 0;
  font-size: 0.85rem;
}

.side-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.72rem;
}

.side-stats span {
  color: var(--muted);
}

.side-stats strong {
  display: block;
  font-size: 0.9rem;
  color: #0f172a;
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 0.7rem;
  color: #0f172a;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.activity-list time {
  color: var(--muted);
  font-size: 0.65rem;
}

.activity-list .empty {
  color: var(--muted);
  justify-content: center;
}

.hr-placeholder {
  background: rgba(148, 163, 184, 0.1);
  border: 1px dashed #cbd5f5;
  border-radius: 12px;
  padding: 0.9rem;
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hr-snapshot-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hr-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.hr-metric:last-child {
  border-bottom: none;
}

.hr-metric-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}

.hr-metric strong {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.small-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.small-link.disabled {
  color: rgba(148, 163, 184, 0.6);
  cursor: not-allowed;
}

.invoice-preview {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 300;
}

.invoice-card {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  display: grid;
  gap: 1.2rem;
  padding: 1.8rem;
  font-size: 0.82rem;
  color: #0f172a;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
  position: relative;
}

.invoice-close {
  position: absolute;
  top: -10px;
  right: -6px;
  background: rgba(15, 23, 42, 0.06);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.2rem;
  cursor: pointer;
  color: #1f2937;
}

.invoice-close:hover {
  background: rgba(15, 23, 42, 0.15);
}

.invoice-header h1 {
  margin: 0;
  font-size: 1.15rem;
}

.invoice-subtitle {
  margin: 0.2rem 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.invoice-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.invoice-meta-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  align-items: flex-end;
}

.invoice-meta-block span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.65rem;
}

.invoice-party {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
}

.invoice-party span {
  display: block;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.invoice-table thead th {
  text-align: left;
  background: #f8fafc;
  padding: 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #e2e8f0;
}

.invoice-table tbody td {
  padding: 0.6rem;
  border-bottom: 1px solid #f1f5f9;
}

.invoice-table .right {
  text-align: right;
}

.invoice-summary {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.remarks {
  flex: 1;
  font-size: 0.72rem;
  color: var(--muted);
}

.summary-values {
  min-width: 220px;
  display: grid;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.summary-values div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-values span {
  color: var(--muted);
}

.summary-values .total {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.4rem;
  margin-top: 0.2rem;
  font-weight: 600;
}

.invoice-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid #e2e8f0;
  padding-top: 0.8rem;
}

.invoice-footnote {
  margin: 0.2rem 0 0;
}

@media print {
  body {
    background: #fff;
  }
  .app-shell,
  .floating-form-toggle,
  .drawer {
    display: none !important;
  }
  .invoice-preview {
    display: block !important;
    position: static;
    background: none;
    padding: 0;
  }
  .invoice-card {
    display: block;
    box-shadow: none;
    padding: 0;
    font-size: 11pt;
    width: 100%;
    border-radius: 0;
  }
  .invoice-card h1 {
    font-size: 18pt;
  }
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  padding: 1rem 1.5rem;
  padding-top: max(1rem, env(safe-area-inset-top, 1rem));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.top-bar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  flex: 1;
  min-width: 240px;
}

.top-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
}

.new-bill-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(145deg, #2563eb, #0f172a);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.new-bill-btn::before,
.new-bill-btn::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 4px;
  background: #fff;
  border-radius: 2px;
  transform: translate(-50%, -50%);
}

.new-bill-btn::after {
  width: 4px;
  height: 22px;
}

.new-bill-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.new-bill-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.3);
}

.search-box {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.search-box input {
  flex: 1;
  border: none;
  font-size: 0.85rem;
  color: var(--muted);
}

.search-box input:focus {
  outline: none;
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  border-radius: 9999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.content-area {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

.panel {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.detail-panel {
  padding-top: 0.85rem;
  align-self: flex-start;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.load-more-btn {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(37, 99, 235, 0.04);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.load-more-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--primary);
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.order-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.order-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.order-card-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.88rem;
}

.order-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.order-meta.subtle {
  font-size: 0.7rem;
  color: rgba(71, 85, 105, 0.9);
}

.order-meta.subtle span:last-child {
  font-weight: 600;
  color: #0f172a;
  text-align: right;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-open {
  background: rgba(251, 191, 36, 0.18);
  color: #b45309;
}

.status-paid {
  background: rgba(34, 197, 94, 0.18);
  color: #047857;
}

.status-credit {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.status-split {
  background: rgba(14, 165, 233, 0.18);
  color: #0369a1;
}

.status-partial {
  background: rgba(251, 191, 36, 0.18);
  color: #b45309;
}

.order-amount {
  font-weight: 600;
  font-size: 0.88rem;
  color: #0f172a;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 1.75rem 1rem;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.25rem;
}

.details-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.details-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.details-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
  width: 100%;
}

.btn {
  border-radius: 10px;
  padding: 0.5rem 1.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  border: none;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.btn-success {
  background: rgba(14, 165, 233, 0.16);
  color: #0369a1;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(37, 99, 235, 0.08);
}

.icon-btn {
  border: none;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  background: rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

.icon-btn.delete {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.icon-btn.delete:hover {
  background: rgba(239, 68, 68, 0.22);
}

.table-action-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.55px;
  margin-bottom: 0.5rem;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: #0f172a;
}

.item-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.item-note-text {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  font-style: italic;
  color: #475569;
  white-space: pre-wrap;
}

.item-thumb {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
}

.item-quantity {
  color: var(--muted);
  font-size: 0.68rem;
}

.totals-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
  border: 1px solid #e2e8f0;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-row strong {
  font-size: 0.85rem;
}

.detail-grid {
  display: grid;
  gap: 1rem;
}

.detail-grid.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-card span {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.info-card strong {
  font-size: 0.82rem;
  color: #111827;
}

.details-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-height: 0;
  margin-top: 0;
}

.detail-placeholder {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: left;
  padding: 0.75rem 1.5rem;
}

.floating-form-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.floating-form-toggle span {
  pointer-events: none;
}

.floating-form-toggle:hover {
  transform: translateY(-2px);
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 250;
}

.drawer.open {
  display: flex;
}

.drawer-panel {
  background: #fff;
  width: min(720px, 100%);
  max-height: 95vh;
  border-radius: 20px 20px 0 0;
  padding: 1.4rem;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.drawer-header h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

form {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: none;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  color: #0f172a;
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #64748b;
  border-radius: 9px;
  font-size: 0.76rem;
  background: #fff;
  color: #0f172a;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--primary);
}

.button-row {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.button-row button {
  width: auto;
  padding-inline: 1.2rem;
}

.secondary {
  background-color: rgba(148, 163, 184, 0.25);
  color: #1e293b;
}

.primary {
  background: var(--primary);
  color: #fff;
}

#line-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.line-item-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 70px 110px 110px 70px 40px;
  gap: 0.6rem;
  align-items: end;
}

.item-note-section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem 0.6rem;
  background: rgba(15, 23, 42, 0.03);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.item-note-section button.item-note-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease, transform 0.15s ease;
}

.item-note-section.has-note button.item-note-toggle {
  color: #0f172a;
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.4);
}

.item-note-section button.item-note-toggle:hover {
  transform: translateY(-1px);
}

.item-note-preview {
  font-size: 0.72rem;
  color: #475569;
  line-height: 1.35;
  white-space: pre-wrap;
}

.item-note-input {
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  font-size: 0.72rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #fff;
  color: #0f172a;
}

.item-note-section textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}

.line-item-row label {
  font-size: 0.7rem;
}
.gst-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
}

.gst-toggle input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.gst-toggle span {
  font-size: 0.7rem;
  font-weight: 600;
  color: #1e293b;
}


.item-total-input,
.item-price {
  text-align: right;
}

.remove-line-item {
  background-color: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.remove-line-item:hover {
  background-color: rgba(248, 113, 113, 0.3);
}

.add-item-btn {
  width: auto;
  margin-bottom: 0;
}

.totals-summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  margin: 0.3rem 0 1rem;
}

.charges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tax-summary-card {
  background: rgba(241, 245, 249, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  font-size: 0.74rem;
}

.tax-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #0f172a;
}

.tax-row span {
  color: var(--muted);
}

.tax-row strong {
  font-size: 0.82rem;
}

.tax-row.grand-total {
  border-top: 1px dashed #cbd5f5;
  padding-top: 0.5rem;
  margin-top: 0.35rem;
  font-weight: 600;
}

.tax-row.grand-total strong {
  font-size: 0.9rem;
  color: #0f172a;
}

.total-strong strong {
  font-size: 0.95rem;
}

.split-payments {
  background-color: rgba(241, 245, 249, 0.6);
  border: 1px solid #94a3b8;
  border-radius: 12px;
  padding: 0.8rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.split-payments > h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
}

/* ==========================================================================
 * SALES SUMMARY CARDS (Zomato / Swiggy / Dine-In / Total)
 * ========================================================================== */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.summary-card {
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.12s ease;
}

.summary-card.online {
  background: rgba(37, 99, 235, 0.04);
  border-color: rgba(37, 99, 235, 0.4);
}

.summary-card.total {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.55);
}

.summary-card:hover {
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.summary-label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.split-payments > button {
  align-self: flex-start;
}

#purchase-split-rows,
#expense-split-rows,
.split-payments-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 1080px) {
  .content-area {
    grid-template-columns: 1fr;
  }

  .dashboard-content {
    grid-template-columns: 1fr;
  }

  .dashboard-content > .date-filter-bar {
    grid-column: auto;
  }

  .purchase-line-row {
    grid-template-columns: minmax(150px, 1fr) 70px 100px 100px 36px;
  }
}

/* Mobile Sidebar - Hamburger Menu */
.mobile-menu-toggle {
  display: none;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--primary);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.sidebar.mobile-open {
  transform: translateX(0);
}

@media (max-width: 768px) {
  /* Hide desktop sidebar, show mobile toggle */
  .mobile-menu-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100dvh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
  }
  
  /* When sidebar is not open (hidden), it should not affect layout */
  .sidebar:not(.mobile-open) {
    position: fixed;
  }

  .mobile-menu-overlay.active {
    display: block;
  }

  .app-shell {
    flex-direction: column;
  }

  .dashboard-main,
  .main-area {
    width: 100% !important;
    padding: 0 !important;
    margin-left: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 100% !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
  }
  
  /* Force all dashboard grids to stack vertically on mobile */
  .dashboard-content {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
  }
  
  .metric-grid,
  .kpi-cards-grid,
  .dashboard-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    overflow: visible !important;
    width: 100% !important;
  }
  
  .metric-grid {
    grid-template-columns: 1fr !important;
  }
  
  .dashboard-main > .dashboard-content {
    padding: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
  }
  
  /* Ensure all dashboard sections are visible */
  .dashboard-grid > *,
  .dashboard-content > * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Mobile: Professional Business Card Layout */
  .metric-card {
    flex-direction: row !important;
    align-items: flex-start !important;
    padding: 1rem 1.25rem !important;
    gap: 1rem !important;
    min-height: auto !important;
  }
  
  .metric-card .metric-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }
  
  .metric-card .metric-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.375rem !important;
    min-width: 0 !important;
    align-items: flex-start !important;
  }
  
  .metric-card .metric-label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: rgba(31, 41, 55, 0.7) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    line-height: 1.3 !important;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
  }
  
  .metric-card .metric-info strong {
    font-size: 1.875rem !important;
    font-weight: 800 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #111827 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: -0.5px !important;
  }
  
  .metric-card .metric-subtext {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: rgba(107, 114, 128, 0.8) !important;
    margin: 0.375rem 0 0 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
  }
  
  .metric-grid {
    grid-template-columns: 1fr !important;
    gap: 0.875rem !important;
  }
  
  /* Ensure dashboard content has proper spacing from topbar */
  .dashboard-content {
    padding-top: 1rem !important;
  }
  
  .reports-executive {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .reports-executive > .reports-top-section {
    padding-top: 0.5rem;
  }

  .sidebar-nav {
    flex-direction: column;
    gap: 0.35rem;
  }

  .drawer-panel {
    border-radius: 0;
    width: 100%;
  }

  .dashboard-topbar {
    flex-direction: row !important;
    align-items: center;
    padding: 0.875rem 1rem !important;
    padding-top: max(0.875rem, env(safe-area-inset-top, 0.875rem)) !important;
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 0 !important;
  }

  /* Prevent horizontal scroll, but allow vertical scroll */
  body {
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
    height: auto;
    min-height: 100%;
  }

  html {
    overflow-x: auto;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }
}

@media (max-width: 900px) {
  .dashboard-main {
    padding: 1rem;
  }

  .main-area {
    padding: 1rem;
  }

  .dashboard-topbar {
    flex-direction: row !important;
    align-items: center !important;
    padding: 0.75rem 1rem !important;
    padding-top: max(0.75rem, env(safe-area-inset-top, 0.75rem)) !important;
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 0 !important;
    gap: 0.75rem;
  }

  .top-actions {
    justify-content: space-between;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .dashboard-content {
    grid-template-columns: 1fr;
  }

  .purchase-line-row {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .purchase-line-row .line-total {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .purchase-line-row {
    grid-template-columns: 1fr;
  }

  .purchase-line-row .line-total {
    text-align: left;
  }

  .remove-line-item {
    justify-self: flex-end;
    width: 32px;
    height: 32px;
  }

  .line-item-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .line-item-row > div:nth-child(1),
  .line-item-row > div:nth-child(2),
  .line-item-row > div:nth-child(3),
  .line-item-row > div:nth-child(4) {
    grid-column: span 2;
  }

  .line-item-row > button {
    grid-column: span 2;
    justify-self: flex-end;
  }

  .button-row {
    justify-content: center;
  }

  .totals-summary {
    justify-content: center;
  }

  .split-row {
    grid-template-columns: 1fr;
  }

  .split-row .remove-split {
    justify-self: flex-end;
  }

  .top-actions {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .profile-pill {
    width: 100%;
    justify-content: center;
  }

  .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
  }
  
  /* Ensure metric labels are visible on mobile */
  .metric-card .metric-label {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
  }
  
  .metric-card .metric-info strong {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ffffff !important;
    margin: 0.25rem 0;
  }
  
  .metric-card {
    padding: 1rem !important;
    min-height: auto;
  }
  
  .metric-card .metric-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.25rem !important;
    flex-shrink: 0;
  }

  .sparkline,
  .dual-bars {
    height: 120px;
  }

  .charges-grid {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    justify-content: flex-start;
  }
}

.field-with-action {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.field-row input,
.field-row select {
  flex: 1;
}

.icon-add,
.icon-manage {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.icon-add {
  border: 1px dashed #2563eb;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-size: 1.1rem;
}

.icon-add:hover {
  background: rgba(37, 99, 235, 0.18);
}

.icon-manage {
  border: 1px solid #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
  font-size: 1rem;
}

.icon-manage:hover {
  background: rgba(71, 85, 105, 0.16);
  border-color: #64748b;
}

.line-items-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ta-dropdown {
  position: absolute;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  z-index: 400;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  font-size: 0.8rem;
}

.ta-option {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #0f172a;
}

.ta-option:hover,
.ta-option.ta-option-active {
  background: rgba(37, 99, 235, 0.12);
}

.manager-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 2rem;
}

.manager-panel {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
  width: min(720px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.manager-header h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #0f172a;
}

.manager-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.manager-close:hover {
  color: #0f172a;
}

.manager-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
}

.manager-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.manager-empty {
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
  padding: 1.5rem 0;
}

.manager-empty.error {
  color: #dc2626;
}

.manager-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) auto;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  background: #f8fafc;
}

.manager-row.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.manager-row:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  background: #fff;
}

.manager-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #475569;
}

.manager-field input {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 0.55rem 0.6rem;
  font-size: 0.8rem;
  color: #0f172a;
  width: 100%;
}

.manager-row-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.manager-row-actions button {
  font-size: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  background: #fff;
  color: #0f172a;
}

.manager-row-actions .manager-save {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
}

.manager-row-actions .manager-save:hover {
  background: rgba(37, 99, 235, 0.18);
}

.manager-row-actions .manager-delete {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.3);
  color: #dc2626;
}

.manager-row-actions .manager-delete:hover {
  background: rgba(248, 113, 113, 0.2);
}

.manager-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  justify-content: flex-end;
}

.manager-add {
  border: none;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.manager-add:hover {
  background: rgba(37, 99, 235, 0.18);
}

.manager-toast {
  position: absolute;
  bottom: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(37, 99, 235, 0.95);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: 0.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
}

.manager-toast.error {
  background: rgba(220, 38, 38, 0.95);
}

/* ============================================
   Phase 1 Dashboard - Clean Professional Styles
   ============================================ */

/* Top 6 KPI Cards Grid - Professional Reference Style */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: #ffffff;
  border-radius: 6px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s ease;
  min-height: 100px;
}

.kpi-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kpi-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f9fafb;
}

.kpi-icon.sales {
  color: #059669;
}

.kpi-icon.orders {
  color: #2563eb;
}

.kpi-icon.aov {
  color: #7c3aed;
}

.kpi-icon.tables {
  color: #ea580c;
}

.kpi-icon.online {
  color: #db2777;
}

.kpi-icon.kot {
  color: #0284c7;
}

.kpi-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kpi-label {
  display: block;
  font-size: 0.6875rem;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.2;
}

.kpi-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  margin: 0.25rem 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.5px;
}

.kpi-trend {
  display: block;
  font-size: 0.6875rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* Chart Cards - Clean Professional Style */
.chart-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
}

.chart-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.chart-card header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.chart-card header p {
  margin: 0.25rem 0 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

.chart-controls {
  display: flex;
  gap: 0.5rem;
}

.chart-toggle {
  padding: 0.375rem 0.875rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-toggle:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.chart-toggle.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

/* Enhanced Item Performance - Clean Style */
.items-performance-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.items-performance-table {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem;
  max-height: 350px;
  overflow-y: auto;
}

.items-performance-table table {
  width: 100%;
  border-collapse: collapse;
}

.items-performance-table th,
.items-performance-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.items-performance-table th {
  font-weight: 600;
  color: #374151;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.items-performance-table td {
  color: #111827;
  font-size: 0.875rem;
}

.items-performance-table tr:hover {
  background: #f9fafb;
}

/* KOT Performance Metrics - Clean Style */
.kot-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
}

.kot-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.kot-metric {
  text-align: center;
  padding: 1rem;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 6px;
}

.kot-metric-label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kot-metric-value {
  display: block;
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
}

/* Financial Summary Cards - Clean Style */
.financial-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
}

.financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.financial-metric {
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.financial-metric.positive {
  border-left: 3px solid #059669;
}

.financial-metric.negative {
  border-left: 3px solid #dc2626;
}

.financial-metric.net-profit {
  background: #f9fafb;
  border: 2px solid #111827;
  grid-column: span 2;
}

.financial-label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.financial-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

.financial-metric.net-profit .financial-value {
  font-size: 2rem;
  color: #111827;
}

/* Responsive Design for Dashboard */
@media (max-width: 1400px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .items-performance-grid-enhanced {
    grid-template-columns: 1fr;
  }
  
  .financial-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  
  .financial-metric.net-profit {
    grid-column: span 1;
  }
  
  .kpi-value {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .kpi-card {
    padding: 1rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .kpi-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .kpi-value {
    font-size: 1.75rem;
  }
  
  .chart-card header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .chart-controls {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Base Card Styling - Clean Professional */
article.card {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
}

article.card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

article.card header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

article.card header p {
  margin: 0.25rem 0 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

/* Full-width dashboard support */
.dashboard-shell.full-width .sidebar {
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.dashboard-shell.full-width .dashboard-main {
  margin-left: 0;
  width: 100%;
}

/* Payment History Section */
.payment-history-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.payment-history-section label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
}

.payment-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.payment-history-entry {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.payment-history-entry:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.payment-history-entry.created {
  border-left: 3px solid #3b82f6;
}

.payment-history-entry.payment {
  border-left: 3px solid #10b981;
}

.payment-history-entry.adjustment {
  border-left: 3px solid #f59e0b;
}

.payment-history-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.payment-history-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.payment-history-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.payment-history-info strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
}

.payment-history-date {
  font-size: 0.75rem;
  color: #6b7280;
}

.payment-history-amount {
  font-size: 1rem;
  font-weight: 700;
  color: #059669;
  flex-shrink: 0;
}

.payment-history-delete {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  opacity: 0.7;
}

.payment-history-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  opacity: 1;
}

.payment-history-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.8125rem;
}

.payment-history-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.payment-history-detail-row > span:first-child {
  color: #6b7280;
  font-weight: 500;
}

.payment-history-detail-row > span:last-child {
  color: #1f2937;
  font-weight: 600;
}

.text-warning {
  color: #f59e0b;
}

.text-success {
  color: #10b981;
}

@media (max-width: 640px) {
  .payment-history-details {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   EXECUTIVE REPORTS PAGE STYLES
   ============================================ */

.reports-executive {
  background: #f8fafc;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
}

/* Override dashboard-content grid for reports */
.dashboard-content.reports-executive {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* TOP SECTION: Sticky Date Chip */
.reports-top-section {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  z-index: 998;
  background: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
  margin-top: 0;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.reports-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  line-height: 1.4;
}

.reports-date-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.date-chip-icon {
  font-size: 1rem;
}

.date-chip-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1e293b;
}

.date-chip-change-btn {
  padding: 0.25rem 0.625rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.date-chip-change-btn:hover {
  background: #1d4ed8;
}

.reports-top-filters {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.reports-date-filter-group {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

/* SECTION 1: Executive Summary (4 Big KPIs) */
.executive-summary-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
  margin-bottom: 0;
}

.executive-kpi-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e5e7eb;
}

.executive-kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.executive-kpi-sales {
  border-color: rgba(37, 99, 235, 0.25);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.04) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.executive-kpi-sales .executive-kpi-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.executive-kpi-purchases {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.04) 0%, rgba(248, 113, 113, 0.04) 100%);
}

.executive-kpi-purchases .executive-kpi-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.executive-kpi-expenses {
  border-color: rgba(249, 115, 22, 0.25);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.04) 0%, rgba(251, 146, 60, 0.04) 100%);
}

.executive-kpi-expenses .executive-kpi-icon {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
}

.executive-kpi-net {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(5, 150, 105, 0.06) 100%);
  position: relative;
  overflow: hidden;
}

.executive-kpi-net::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.executive-kpi-net .executive-kpi-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.executive-kpi-icon {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.executive-kpi-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  overflow: visible;
}

.executive-kpi-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  line-height: 1.5;
}

.executive-kpi-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.executive-kpi-trend {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.executive-kpi-trend.positive {
  color: #10b981;
}

.executive-kpi-trend.negative {
  color: #ef4444;
}

/* SECTION 2: Operations KPIs (Compact Single-Line) */
.operations-kpis-section {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  background: #ffffff;
  padding: 0.875rem;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
  visibility: visible !important;
  opacity: 1 !important;
}

.operations-kpi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem;
  border-radius: 6px;
  background: #f8fafc;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.operations-kpi-item:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.operations-kpi-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.operations-kpi-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* SECTION 3: Sales Trend (Hero Chart) */
.sales-trend-section {
  margin-bottom: 0;
}

.hero-chart-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
}

.hero-chart-header {
  margin-bottom: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-chart-header {
  margin-bottom: 0.875rem;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  visibility: visible !important;
  opacity: 1 !important;
}

.hero-chart-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  line-height: 1.4;
}

.hero-chart-meta {
  font-size: 0.75rem;
  color: #64748b;
}

.hero-chart-container {
  min-height: 220px;
  margin-bottom: 0.875rem;
  width: 100%;
  position: relative;
  overflow: visible;
}

.hero-chart-container:empty::after {
  content: 'Loading chart data...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #94a3b8;
  font-size: 0.875rem;
}

.hero-chart-container > div {
  width: 100%;
  height: 100%;
}

.hero-chart-footer {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.hero-chart-insight {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.insight-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.insight-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
}

/* View Toggle */
.reports-view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0;
}

.view-toggle-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #64748b;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.view-toggle-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* SECTION 4: Daily P&L Table (Finance-grade) */
.daily-pl-section {
  margin-bottom: 0;
}

.pl-table-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
}

.pl-table-header {
  margin-bottom: 0.875rem;
}

.pl-table-header {
  margin-bottom: 0.875rem;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.pl-table-header h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  line-height: 1.4;
}

.pl-table-header p {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
}

.pl-table-wrapper {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.pl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.pl-table thead {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 5;
}

.pl-table thead th {
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569 !important;
  border-bottom: 1px solid #e5e7eb;
  display: table-cell !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.pl-table thead th.right {
  text-align: right;
}

.pl-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.pl-table tbody tr:hover {
  background: #f8fafc;
}

.pl-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.pl-table tbody tr:nth-child(even):hover {
  background: #f1f5f9;
}

.pl-table tbody td {
  padding: 0.625rem 0.875rem;
  color: #1e293b;
  font-weight: 500;
  vertical-align: top;
}

.pl-table tbody td > div:first-child {
  margin-bottom: 0.125rem;
}

.pl-table tbody td .net-percentage {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.6875rem;
}

.pl-table tbody td.right {
  text-align: right;
}

.pl-table tbody td.net-positive {
  color: #10b981;
  font-weight: 700;
}

.pl-table tbody td.net-negative {
  color: #ef4444;
  font-weight: 700;
}

.pl-table tbody td.net-percentage {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.pl-table-empty {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
}

.pl-table tfoot {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
}

.pl-table tfoot th {
  padding: 0.75rem 0.875rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.875rem;
  color: #0f172a;
}

.pl-table tfoot th.right {
  text-align: right;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .executive-summary-section {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .operations-kpis-section {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .executive-kpi-value {
    font-size: 1.25rem;
  }
  
  .executive-kpi-icon {
    width: 44px;
    height: 44px;
    font-size: 1.375rem;
  }
}

@media (max-width: 768px) {
  .reports-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .reports-title {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .hero-chart-header {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .hero-chart-header h2 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .pl-table-header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .pl-table-header h2 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .operations-kpis-section {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .operations-kpi-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .operations-kpi-value {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .hero-chart-header h2 {
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
  }
  
  .pl-table-header h2 {
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
  }
  
  .pl-table thead th {
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    padding: 0.75rem 0.875rem !important;
  }
  
  .executive-summary-section {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  
  .executive-kpi-card {
    padding: 1.5rem !important;
    gap: 1.25rem !important;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
  }
  
  .executive-kpi-icon {
    width: 64px !important;
    height: 64px !important;
    font-size: 2rem !important;
    flex-shrink: 0;
  }
  
  .executive-kpi-label {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    margin-bottom: 0.5rem !important;
    color: #475569 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 1.4 !important;
  }
  
  .executive-kpi-value {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #0f172a !important;
    display: block !important;
  }
  
  .executive-kpi-content {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .executive-kpi-trend {
    font-size: 0.8125rem !important;
    display: block !important;
  }
  
  .operations-kpis-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .operations-kpi-label {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .operations-kpi-value {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .hero-chart-footer {
    flex-direction: column;
    gap: 1rem;
  }
  
  .reports-date-chip {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .date-chip-label {
    font-size: 0.875rem !important;
  }
}

@media (max-width: 480px) {
  .operations-kpis-section {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .reports-executive {
    padding: 0.5rem;
  }
  
  .reports-top-section {
    padding: 1rem !important;
    display: block !important;
    visibility: visible !important;
  }
  
  .reports-header {
    display: flex !important;
    visibility: visible !important;
  }
  
  .hero-chart-header {
    display: flex !important;
    visibility: visible !important;
  }
  
  .pl-table-header {
    display: block !important;
    visibility: visible !important;
  }
  
  .executive-kpi-card {
    padding: 1.25rem !important;
    gap: 1rem !important;
  }
  
  .executive-kpi-icon {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.75rem !important;
  }
  
  .executive-kpi-label {
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    margin-bottom: 0.375rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .executive-kpi-value {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    display: block !important;
  }
  
  .hero-chart-card,
  .pl-table-card {
    padding: 1rem;
  }
  
  .dashboard-main {
    padding: 0 !important;
  }
  
  .dashboard-main > .dashboard-content {
    padding: 0.75rem !important;
  }
}

/* Pull-to-refresh indicator */
.pull-to-refresh-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: rgba(37, 99, 235, 0.9);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 12px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1000;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Touch-friendly buttons on mobile */
@media (max-width: 768px) {
  button, .btn, .utility-btn, .view-toggle-btn, .date-chip-change-btn,
  .nav-link, a.button, .action-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 0.75rem 1rem !important;
    touch-action: manipulation;
  }

  /* Remove hover effects on touch devices */
  @media (hover: none) {
    *:hover {
      background-color: inherit !important;
      transform: none !important;
    }
  }

  .sidebar-header {
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sidebar-header .mobile-menu-close,
  .sidebar-close-btn {
    order: -1;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 1rem;
    flex-shrink: 0;
  }
}

/* Prevent text size adjustment on iOS */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Bottom Navigation Bar (Mobile Only) - Like Nutrition App */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(75, 85, 99, 0.3);
  padding: 0.75rem 0;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0.75rem));
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  justify-content: space-around;
  align-items: center;
  gap: 0.5rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem 0.5rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 0;
  color: rgba(156, 163, 175, 0.8);
  position: relative;
}

.bottom-nav-item:active {
  transform: scale(0.95);
}

.bottom-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.bottom-nav-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bottom-nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.1);
}

.bottom-nav-item:not(.active):hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

/* Show bottom nav only on mobile */
@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
  }
  
  /* Add padding to main content to prevent overlap */
  .dashboard-main,
  .main-area,
  .purchases-main,
  .expenses-main {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Hide on desktop */
@media (min-width: 769px) {
  .bottom-nav {
    display: none !important;
  }
}

/* Fix viewport units on mobile - use min-height instead of fixed height */
@supports (height: 100dvh) {
  .app-shell {
    min-height: 100%;
    height: auto;
  }
  
  /* Sidebar can use 100dvh when open (drawer), but main content should not */
  .sidebar.mobile-open {
    height: 100dvh;
  }
  
  .dashboard-main,
  .dashboard-content {
    min-height: 100%;
    height: auto;
  }
}

/* High-contrast overrides for key dashboard metrics on light cards */
.metric-card .metric-label,
.metric-card .metric-subtext,
.metric-card strong,
.executive-kpi-label,
.executive-kpi-value,
.hero-chart-header h2,
.hero-chart-footer .insight-value,
.hero-chart-footer .insight-label {
  color: #000000 !important;
}
/* Explicit overrides: ensure metric amounts on the first dashboard metric card
   (Daily Sales) are pure black and not tinted by the card color. */
.metric-card:nth-child(1) .metric-info strong {
  color: #000000 !important;
  text-shadow: none !important;
}
/* Global override: ensure all metric amounts use solid black text on light cards */
.metric-card .metric-info strong {
  color: #000000 !important;
  text-shadow: none !important;
}
/* Top brand header replacing search + profile area */
.top-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.top-brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.top-brand-text {
  display: flex;
  flex-direction: column;
}

.top-brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.top-brand-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
}
/* Responsive layout for Purchases & Expenses: stack list above details on small screens */
@media (max-width: 900px) {
  .purchases-content,
  .expenses-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .vendor-list,
  .purchase-details {
    width: 100%;
  }

  #vendor-items,
  #category-items {
    max-height: 220px;
  }
}
