/* Tailor Dashboard Design - Matching XFIT KIDS Template */
@import url("sidebar-modern.css");
:root,
[data-theme="light"] {
  --sidebar-dark: #1e3a8a;
  --sidebar-active-bg: #60a5fa;
  --bg-light: #f3f4f6;
  --white: #ffffff;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --blue: #3b82f6;
  --red: #ef4444;
  --danger: #ef4444;
  --light-red: #fca5a5;
  --orange: #f59e0b;
  --green: #10b981;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
  --bg-light: #111827;
  --white: #1f2937;
  --surface: #1f2937;
  --border: #374151;
  --text-dark: #f9fafb;
  --text-muted: #9ca3af;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
}
[data-theme="dark"] .stat-card-primary {
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="dark"] .recent-orders-status-pending { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }
[data-theme="dark"] .recent-orders-status-in-progress { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
[data-theme="dark"] .recent-orders-status-completed,
[data-theme="dark"] .recent-orders-status-delivered { background: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
[data-theme="dark"] .recent-orders-status-cancelled { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
  margin: 0; 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; 
  background: var(--bg-light); 
  color: var(--text-dark); 
  min-height: 100vh;
  font-size: 14px;
}

/* Toast notifications */
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dark);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-weight: 600;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(16,185,129,0.35); }
.toast-error { border-color: rgba(239,68,68,0.35); }

/* Main Container - White rounded card */
.dashboard-container {
  max-width: 1600px;
  margin: 20px auto;
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: visible;
  display: flex;
  min-height: calc(100vh - 40px);
  position: relative;
}

/* Dashboard entry animation (slow, from top) */
.dashboard-enter {
  animation: dashboardSlideDown 900ms ease-out;
  transform-origin: 50% 0;
}

@keyframes dashboardSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Sidebar - Professional dark */
.sidebar {
  width: 260px;
  background: var(--sidebar-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  border-radius: 24px 0 0 24px;
  overflow: hidden;
}
.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sidebar-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}
.sidebar-logo-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: #fff;
}
.sidebar-logo-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sidebar-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.sidebar-logo-tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  padding: 16px 12px 8px;
  margin-top: 4px;
}
.sidebar-nav-label:first-child {
  margin-top: 0;
  padding-top: 0;
}
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
  position: relative;
  cursor: pointer;
}
.sidebar-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.sidebar-nav-link.active {
  color: #fff;
  background: var(--sidebar-active-bg);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: #fff;
  border-radius: 0 2px 2px 0;
  opacity: 0.9;
}
.sidebar-nav-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.9);
}
.sidebar-nav-link.active .sidebar-nav-icon {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.sidebar-nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Report nav - no highlight; consistent sidebar blue, white text throughout */
.report-nav-parent { margin-top: 4px; }
.report-nav-main {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  transition: color 0.2s ease, background 0.2s ease;
}
.report-nav-main:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.report-nav-main.active {
  color: #fff;
  font-weight: 600;
  background: transparent;
  box-shadow: none;
}
.report-nav-main.active::before {
  content: none;
}
.report-nav-main.active .sidebar-nav-icon {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.report-nav-main .sidebar-nav-text { flex: 0 1 auto; }
.badge-new {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #22c55e 0%, #3b82f6 100%);
  color: #fff;
}
.report-nav-chevron {
  font-size: 10px;
  color: #fff;
  margin-left: auto;
  transition: transform 0.2s ease;
}
.report-nav-sub {
  display: flex;
  flex-direction: column;
  padding-left: 44px;
  margin-top: 4px;
  gap: 2px;
  overflow: hidden;
  transition: opacity 0.2s ease;
}
.report-nav-sub.collapsed {
  display: none;
}
.report-nav-sub-link {
  padding: 8px 12px;
  font-size: 13px;
  color: #fff;
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease;
}
.report-nav-sub-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.report-nav-sub-link.active {
  color: #fff;
  font-weight: 600;
  background: transparent;
}

.report-inline-nav {
  margin-bottom: 20px;
}
.report-inline-sub.report-nav-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 0 !important;
  margin-top: 0;
}
.report-inline-sub .report-nav-sub-link {
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dark);
}
.report-inline-sub .report-nav-sub-link:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}
.report-inline-sub .report-nav-sub-link.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--blue);
}

/* Report page filters & table */
.report-filters { margin-bottom: 20px; }
.report-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.report-filter-group { margin: 0; max-width: 180px; }
.report-filter-group label { display: block; margin-bottom: 6px; font-size: 12px; }
.report-table-card { overflow: auto; }
.report-loading, .report-empty, .report-error {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.report-error { color: var(--danger, #dc2626); }
.report-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.report-pagination-btns { display: flex; gap: 8px; }

/* Orders report filter card (match screenshot style) */
.orders-filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px 22px;
  margin-bottom: 20px;
}

.orders-filter-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  margin: 2px 0 18px 0;
}

.orders-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.orders-filter-date-range {
  margin-top: 12px;
  max-width: 320px;
}

.orders-filter-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.orders-filter-select {
  width: 100%;
}

.orders-filter-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.product-filter-card {
  max-width: 620px;
  margin: 0 auto 20px;
  padding: 20px 22px 24px;
}

.product-filter-title {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
}

.product-filter-grid {
  grid-template-columns: 1fr;
}

.product-filter-card .product-filter-grid .orders-filter-field {
  max-width: 380px;
  margin: 0 auto;
}

.product-filter-card .product-filter-grid .orders-filter-field label {
  text-align: center;
}

#productReportSelect.orders-filter-select {
  height: 44px;
  font-size: 16px;
  border-radius: 6px;
}

#btnApplyProductFilters {
  min-width: 320px;
  height: 50px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.product-report-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transactions-filter-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.report-helper-text {
  color: var(--text-muted);
  margin: -6px 0 14px;
  font-size: 14px;
}

.account-history-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.account-history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.account-history-card-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.account-history-card-value {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.account-history-card-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 8px;
}

.account-activity-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.account-activity-item {
  text-align: center;
  padding: 6px 4px;
}
.account-activity-item strong {
  font-size: 30px;
  display: block;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.account-activity-item span {
  color: var(--text-muted);
  font-size: 13px;
}

.report-toolbar-lite {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 12px;
}
.report-toolbar-lite .search-input { max-width: 260px; }

/* Account history panel polish */
#accountsReportPanel .report-table-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

#accountsReportPanel .order-report-section-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

#accountsReportPanel .customers-table thead th {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.01em;
}

#accountsReportPanel .customers-table tbody td {
  vertical-align: top;
  font-size: 14px;
}

#accountsReportPanel .badge {
  font-size: 11px;
  border-radius: 999px;
  padding: 4px 10px;
}

.swaps-filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

#swapsFilterCard {
  padding: 22px 22px 20px;
}

#swapsFilterCard .orders-filter-actions {
  margin-top: 16px;
}

#btnApplySwapsFilters {
  min-width: 120px;
  height: 42px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.tx-summary-gradient {
  background: linear-gradient(90deg, #2cc9b5 0%, #3b82f6 100%);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

.tx-summary-title {
  color: #fff;
  margin-bottom: 14px;
}

.tx-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tx-summary-card {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}

.tx-summary-label {
  color: #ecfeff;
  font-weight: 700;
  margin-bottom: 8px;
}

.tx-summary-value {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
}

.exchange-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.order-report-summary-panel {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.order-report-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.order-report-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 12px 10px;
  text-align: center;
}

.order-report-stat-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}

.order-report-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.order-report-stat-value.stat-cash { color: #0ea5a4; }
.order-report-stat-value.stat-mpesa { color: #a855f7; }
.order-report-stat-value.stat-orders { color: #2563eb; }
.order-report-stat-value.stat-profit { color: #16a34a; }

.order-report-section-title {
  text-align: center;
  margin: 4px 0 10px;
}

@media (max-width: 900px) {
  .orders-filter-title {
    font-size: 28px;
  }
  .orders-filter-grid {
    grid-template-columns: 1fr;
  }
  .order-report-stats-grid {
    grid-template-columns: 1fr;
  }
  .product-filter-title {
    font-size: 30px;
  }
  .product-report-stats-grid {
    grid-template-columns: 1fr;
  }
  .swaps-filter-grid {
    grid-template-columns: 1fr;
  }
  .account-history-cards {
    grid-template-columns: 1fr;
  }
  .account-activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tx-summary-grid {
    grid-template-columns: 1fr;
  }
  .exchange-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Store page */
.store-page-title { color: var(--blue); font-weight: 700; font-size: 1.5rem; }
.btn-add-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.25); margin-right: 8px; font-size: 16px; line-height: 1; }
.store-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.store-card { background: var(--white); border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid var(--border); }
.store-card-title { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; padding-bottom: 8px; border-bottom: 2px solid var(--blue); }
.store-card-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.store-card-value { font-size: 1.25rem; font-weight: 700; color: var(--blue); }
.store-card-unit { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.store-filter-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.store-table-card { margin-top: 0; }

/* Accounts Dashboard (Store page – transaction money summary) */
.accounts-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.account-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.account-card-header {
  height: 6px;
  background: linear-gradient(90deg, #4f46e5 0%, #a78bfa 100%);
}
.account-card-body { padding: 20px; }
.account-card-currency {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue);
}
.account-card-created {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.account-balance {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.account-balance-digital { background: rgba(59, 130, 246, 0.12); }
.account-balance-cash { background: rgba(34, 197, 94, 0.12); }
.account-balance-total { background: rgba(168, 85, 247, 0.12); }
.account-balance-icon {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
}
.account-balance-icon-cash { color: var(--green); }
.account-balance-icon-total { color: #9333ea; }
.account-balance-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.account-balance-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blue);
}
.account-balance-value-green { color: var(--green); }
.account-balance-value-purple { color: #9333ea; }
.account-balance-bar {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.account-balance-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.account-balance-fill-digital { background: var(--blue); }
.account-balance-fill-cash { background: var(--green); }
.account-balance-fill-total { background: #9333ea; }
.account-card-error {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

/* Register New Account modal */
.register-account-modal .form-group { margin-bottom: 16px; }
.register-account-default-wrap { margin-top: 8px; }
.register-account-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-dark);
}
.register-account-checkbox-label input[type="checkbox"] { width: 18px; height: 18px; }
.register-account-default-wrap .form-help { margin-top: 6px; margin-bottom: 0; }
.register-account-btn {
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  padding: 12px 20px;
}
.register-account-btn:hover { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }

/* Sidebar footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.sidebar-theme-btn {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  font-size: 18px;
  cursor: pointer;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.sidebar-theme-btn:hover {
  background: rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 8px;
}
.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--sidebar-active-bg);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-transform: capitalize;
}
.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}
.sidebar-logout:hover {
  color: #fff;
  background: rgba(239,68,68,0.25);
}

/* Main Content Area */
.main-content { 
  flex: 1; 
  padding: 32px; 
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.welcome-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.search-wrap {
  position: relative;
  width: 220px;
}
.search-wrap .search-input {
  padding: 10px 14px 10px 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-light);
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap .search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  padding: 10px 16px 10px 40px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 14px;
  width: 200px;
  position: relative;
}
.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  position: relative;
  transition: background 0.2s;
}
.header-icon-btn:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}
.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red);
  color: white;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.header-user-wrap {
  position: relative;
}
.user-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.2s;
}
.user-dropdown:hover {
  background: var(--bg-light);
}
.header-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-avatar-small {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.user-avatar-small.avatar-neutral {
  background: var(--border);
  color: var(--text-muted);
}
.user-avatar-small.avatar-neutral svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
.sidebar-user-avatar.avatar-neutral {
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
}
.sidebar-user-avatar.avatar-neutral svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px 0;
  z-index: 100;
  display: none;
}
.user-dropdown-menu.show {
  display: block;
}
.user-dropdown-menu a,
.user-dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text-dark);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  font-family: inherit;
}
.user-dropdown-menu a:hover,
.user-dropdown-menu button:hover {
  background: var(--bg-light);
}
.user-dropdown-menu .dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 100;
  display: none;
}
.notification-panel.show {
  display: block;
}
.notification-panel h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.notification-panel-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
}
.notification-item {
  padding: 12px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.notification-item-read {
  background: var(--surface);
  border-color: var(--border);
  opacity: 0.85;
}
.notification-item-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 4px;
}
.notification-item-qty {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.notification-item-mark-read {
  font-size: 11px;
  padding: 4px 10px;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.notification-item-mark-read:hover {
  background: var(--blue);
  color: white;
}
.notification-panel-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.notification-panel-actions .btn {
  font-size: 12px;
  padding: 6px 12px;
}
.dashboard-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.dashboard-empty-state a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.dashboard-empty-state a:hover {
  text-decoration: underline;
}
a.performer-card {
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
a.performer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Summary Statistic Cards - Total, Completed, Pending, In Progress */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid var(--border);
}
.stat-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.stat-card-primary {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
  padding: 24px;
}
.stat-card-primary:hover {
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.18);
}
.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon-primary {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}
.stat-card-icon-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}
.stat-card-icon-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--orange);
}
.stat-card-icon-info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue);
}
.stat-card-content {
  flex: 1;
  min-width: 0;
}
.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.stat-card-primary .stat-card-value {
  font-size: 32px;
  letter-spacing: -1px;
}
.stat-card-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-card-primary .stat-card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

/* Variant backgrounds to match soft overview cards */
.stat-card-mint {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(56,189,248,0.05));
}
.stat-card-lilac {
  background: linear-gradient(135deg, rgba(129,140,248,0.12), rgba(236,72,153,0.05));
}
.stat-card-sky {
  background: linear-gradient(135deg, rgba(45,212,191,0.10), rgba(56,189,248,0.06));
}
.stat-card-rose {
  background: linear-gradient(135deg, rgba(244,114,182,0.12), rgba(251,113,133,0.06));
}

.stat-card-trend {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-card-trend-up {
  color: var(--green);
}
.stat-card-trend-down {
  color: var(--red);
}

/* Order Status Cards (Pending, In Progress, Completed) - Horizontal */
.order-status-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.order-status-card {
  background: var(--white);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid var(--border);
}
.order-status-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.order-status-card-pending {
  border-left: 4px solid var(--red);
}
.order-status-card-progress {
  border-left: 4px solid var(--blue);
}
.order-status-card-completed {
  border-left: 4px solid var(--green);
}
.order-status-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.order-status-card-pending .order-status-card-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}
.order-status-card-progress .order-status-card-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}
.order-status-card-completed .order-status-card-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}
.order-status-card-content {
  flex: 1;
  min-width: 0;
}
.order-status-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
  margin-bottom: 4px;
  letter-spacing: -1px;
}
.order-status-card-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.order-status-card-percent {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}
.order-status-card-pending .order-status-card-percent {
  color: var(--red);
}
.order-status-card-progress .order-status-card-percent {
  color: var(--blue);
}
.order-status-card-completed .order-status-card-percent {
  color: var(--green);
}

/* Legacy summary card link (if used elsewhere) */
.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
a.summary-card-link {
  background: var(--white);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid var(--border);
}
a.summary-card-link:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.summary-card-icon { width: 56px; height: 56px; border-radius: 12px; background: #dbeafe; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.summary-card-content { flex: 1; }
.summary-card-value { font-size: 32px; font-weight: 700; color: var(--text-dark); line-height: 1; margin-bottom: 4px; letter-spacing: -1px; }
.summary-card-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* Recent Orders card */
.recent-orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.recent-orders-view-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
}
.recent-orders-view-all:hover {
  text-decoration: underline;
}
.recent-orders-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.recent-orders-loading,
.recent-orders-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.recent-orders-empty a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.recent-orders-empty a:hover {
  text-decoration: underline;
}
.recent-orders-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.recent-orders-row:last-child {
  border-bottom: none;
}
.recent-orders-row:hover {
  background: var(--bg-light);
  margin: 0 -12px;
  padding: 12px;
  border-radius: 8px;
}
.recent-orders-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-orders-date {
  font-size: 13px;
  color: var(--text-muted);
}
.recent-orders-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: capitalize;
}
.recent-orders-status-pending {
  background: #fef3c7;
  color: #92400e;
}
.recent-orders-status-in-progress {
  background: #dbeafe;
  color: #1e40af;
}
.recent-orders-status-completed,
.recent-orders-status-delivered {
  background: #d1fae5;
  color: #065f46;
}
.recent-orders-status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Dashboard Grid */
.dashboard-grid,
.dashboard-grid-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.dashboard-card {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.dashboard-card-hover:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Stock page – quantity by type cards (Fabric, Qamiis, Shaati, etc.) */
.stock-type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stock-type-card {
  background: var(--white);
  border-radius: 14px;
  padding: 20px 18px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.stock-type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue, #3b82f6) 0%, rgba(59, 130, 246, 0.4) 100%);
  opacity: 0.9;
}
.stock-type-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  border-color: rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}
.stock-type-card-value {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stock-type-card-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  line-height: 1.3;
}
/* Highlight cards with stock */
.stock-type-card.has-stock::before {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
  opacity: 1;
}
.stock-type-card.has-stock .stock-type-card-value {
  color: var(--blue, #2563eb);
}

.dashboard-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
}

/* Today's Status Card */
.today-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.today-metric {
  text-align: center;
}
.today-metric-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 8px;
}
.today-metric-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.today-featured {
  margin-top: 24px;
  padding: 20px;
  background: #fef2f2;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: background 0.2s;
}
.today-featured:hover {
  background: #fee2e2;
}
.today-featured-accent {
  width: 4px;
  height: 60px;
  background: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}
.today-featured-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.today-featured-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Batch Performance Chart */
.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dark);
}
.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.chart-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.bar-chart-container {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 0 20px;
}
.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bar {
  width: 100%;
  max-width: 48px;
  margin: 0 auto;
  border-radius: 8px 8px 0 0;
  min-height: 8px;
  transition: height 0.3s;
}
.bar-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 4px;
}
.bar-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Revenue Donut Chart */
.donut-chart-container {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut-center {
  position: absolute;
  text-align: center;
}
.donut-center-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.donut-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.donut-tooltip {
  position: absolute;
  background: var(--white);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: none;
  z-index: 10;
}

/* Top Performer Cards */
.top-performer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.period-selector {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
}
.performer-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.performer-card {
  border-radius: 12px;
  padding: 20px;
  color: white;
  text-align: center;
}
.performer-card.red { background: var(--red); }
.performer-card.blue { background: var(--blue); }
.performer-card.pink { background: var(--light-red); }
.performer-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 3px solid rgba(255,255,255,0.3);
}
.performer-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.performer-batch {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 8px;
}
.performer-attendance {
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 500;
}
.performer-badge {
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

/* Bottom Row */
.dashboard-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover { background: #f9fafb; }

/* Forms */
input, select, textarea { 
  width: 100%; 
  padding: 10px 12px; 
  border-radius: 8px; 
  border: 1px solid #e5e7eb; 
  background: var(--white); 
  color: var(--text-dark); 
  font-size: 14px; 
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { 
  outline: none; 
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
label { 
  display: block; 
  margin-bottom: 6px; 
  color: var(--text-dark); 
  font-size: 13px; 
  font-weight: 500; 
}
.form-group { margin-bottom: 16px; }
.label-optional { color: var(--danger, #dc2626); font-weight: 400; }
.form-help { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Buttons */
.btn { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  padding: 10px 20px; 
  border-radius: 8px; 
  border: none; 
  cursor: pointer; 
  font-size: 14px; 
  background: var(--blue); 
  color: white; 
  transition: all 0.15s; 
  font-weight: 500;
}
.btn:hover { background: #2563eb; }
.btn-secondary { background: #f3f4f6; color: var(--text-dark); }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Modal */
.modal { 
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,0.5); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  z-index: 1000; 
  padding: 16px; 
}
.modal-content { 
  background: var(--white); 
  border-radius: 16px; 
  max-width: 500px; 
  width: 100%; 
  max-height: 90vh; 
  overflow-y: auto; 
  padding: 24px; 
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.modal-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 24px; 
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { 
  margin: 0; 
  font-size: 20px; 
  font-weight: 600; 
  color: var(--text-dark);
}
.modal-header .btn-sm {
  min-width: 32px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

/* Order Form modal (line items + payments) */
.order-form-modal {
  max-width: 920px;
  padding: 28px 28px 24px;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}
.order-form-product-card.order-form-modal {
  margin: 0 auto;
  padding: 1.5rem 1.75rem 1.75rem;
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.08);
}
.order-form-card-title {
  margin: 0 0 4px 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e3a5f;
  letter-spacing: -0.02em;
}
[data-theme="dark"] .order-form-card-title {
  color: #e2e8f0;
}
.order-form-card-subtitle {
  margin: 0 0 18px 0;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 1.2em;
}
.order-form-card-subtitle:empty {
  display: none;
}
.order-form-account-section {
  margin: 20px 0 4px;
}
.order-form-account-section label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.order-form-account-section select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-dark);
  font-family: inherit;
}
[data-theme="dark"] .order-form-account-section select {
  background: var(--surface);
}
.order-form-modal-header .modal-header {
  border-bottom: none;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.order-form-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e3a5f;
}
[data-theme="dark"] .order-form-modal-header h3 {
  color: #e2e8f0;
}
.order-form-modal .form-group label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 6px;
}
/* Customer field: no native dropdown chevron (order form only) */
.order-form-modal select#customer_id {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  padding-right: 14px;
}
.order-lines-wrap {
  margin: 18px 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.order-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.order-lines-table thead {
  background: #f3f4f6;
}
[data-theme="dark"] .order-lines-table thead {
  background: #374151;
}
.order-lines-table th {
  text-align: left;
  padding: 10px 8px;
  font-weight: 700;
  color: #4b5563;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .order-lines-table th {
  color: #d1d5db;
}
.order-lines-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.order-lines-table tbody tr:last-child td {
  border-bottom: none;
}
.order-lines-table select,
.order-lines-table input[type="number"],
.order-lines-table input[type="text"].line-custom-name {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--white);
  color: var(--text-dark);
  font-family: inherit;
}
.line-product-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.line-custom-name {
  display: none;
}
.line-custom-name.is-visible {
  display: block;
}
.order-lines-table .line-total {
  font-weight: 600;
  padding: 8px 10px;
  display: block;
  border: 1px solid transparent;
}
.order-line-remove {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #ef4444;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.order-line-remove:hover {
  background: rgba(239, 68, 68, 0.12);
}
.btn-add-product {
  margin: 14px 16px 16px;
  padding: 10px 20px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.btn-add-product:hover {
  background: #059669;
}
.order-payment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 600px) {
  .order-payment-row {
    grid-template-columns: 1fr;
  }
}
.order-subtotal-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 20px;
  padding-right: 4px;
}
.order-subtotal-label {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 15px;
}
.order-subtotal-value {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-dark);
  min-width: 5rem;
  text-align: right;
}
.btn-create-order {
  width: 100%;
  padding: 14px 20px;
  background: #8bacef;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
}
.btn-create-order:hover {
  filter: brightness(0.95);
}
.order-form-cancel-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.order-more-options {
  margin: 16px 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--bg-light);
}
.order-more-options summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
}

/* Tailor Order modal (measurement-set based UI) */
.order-form-tailor-modal {
  max-width: 980px;
}

.tailor-order-fullpage-modal {
  background: transparent;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.tailor-order-fullpage-modal.modal {
  /* Keep sidebar visible: modal starts after the 260px sidebar. */
  background: transparent;
  padding: 0;
  inset: auto;
  top: 0;
  bottom: 0;
  left: 260px;
  right: 0;
  align-items: stretch;
  justify-content: flex-start;
  z-index: 1001;
}

.tailor-order-fullpage-modal.modal .modal-content {
  height: 100%;
  max-height: none;
  overflow-y: auto;
}

.tailor-order-fullpage-modal.modal .modal-content {
  max-width: none;
}

@media (max-width: 768px) {
  .tailor-order-fullpage-modal.modal {
    left: 0;
  }
}

.tailor-order-fullpage-modal .modal-content {
  background: var(--white);
  border-radius: 0;
  max-width: none;
  width: 100%;
  height: 100vh;
  max-height: none;
  padding: 24px 24px 32px;
  box-shadow: none;
}

[data-theme="dark"] .tailor-order-fullpage-modal .modal-content {
  background: var(--surface);
}

/* Full-page right panel: Swap/Add Swap modal */
.swap-fullpage-modal.modal {
  /* Keep sidebar visible: modal starts after the 260px sidebar. */
  background: transparent;
  padding: 0;
  inset: auto;
  top: 0;
  bottom: 0;
  left: 260px;
  right: 0;
  align-items: stretch;
  justify-content: flex-start;
  z-index: 1002;
}

.swap-fullpage-modal.modal .modal-content {
  height: 100%;
  max-height: none;
  overflow-y: auto;
  max-width: none !important;
  background: var(--white);
  border-radius: 0;
  width: 100%;
  padding: 24px 24px 32px;
  box-shadow: none;
}

/* Full-page right panel: Stock Edit/Add modal */
.stock-fullpage-modal.modal {
  /* Keep sidebar visible: modal starts after the 260px sidebar. */
  background: transparent;
  padding: 0;
  inset: auto;
  top: 0;
  bottom: 0;
  left: 260px;
  right: 0;
  align-items: stretch;
  justify-content: flex-start;
  z-index: 1002;
}

.stock-fullpage-modal.modal .modal-content {
  height: 100%;
  max-height: none;
  overflow-y: auto;
  max-width: none !important;
  background: var(--white);
  border-radius: 0;
  width: 100%;
  padding: 24px 24px 32px;
  box-shadow: none;
}

@media (max-width: 768px) {
  .swap-fullpage-modal.modal,
  .stock-fullpage-modal.modal {
    left: 0;
  }
}

.swap-fullpage-modal.modal .modal-content,
.stock-fullpage-modal.modal .modal-content {
  box-sizing: border-box;
}

.swap-fullpage-modal .modal-content,
.stock-fullpage-modal .modal-content {
  /* Ensure text/forms inherit the theme colors */
  color: var(--text);
}

[data-theme="dark"] .swap-fullpage-modal .modal-content,
[data-theme="dark"] .stock-fullpage-modal .modal-content {
  background: var(--surface);
}

.tailor-order-modal-header {
  gap: 16px;
  border-bottom: none;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.tailor-order-prices-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tailor-order-payment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 720px) {
  .tailor-order-prices-row,
  .tailor-order-payment-row {
    grid-template-columns: 1fr;
  }
}

.tailor-order-measurements-section {
  margin-top: 16px;
}

.tailor-order-measurements-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.tailor-measurements-title {
  font-weight: 700;
  color: var(--text-dark);
}

.tailor-measurements-hint {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-add-measurement-set {
  padding: 10px 16px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.btn-add-measurement-set:hover {
  background: #059669;
}

.tailor-measurement-sets {
  margin-top: 4px;
}

.tailor-measurement-set-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: var(--white);
  box-sizing: border-box;
  margin-top: 14px;
}

[data-theme="dark"] .tailor-measurement-set-card {
  background: var(--surface);
}

.tailor-measurement-set-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tailor-measurement-set-title {
  font-weight: 800;
  font-size: 14px;
  color: #111827;
}

[data-theme="dark"] .tailor-measurement-set-title {
  color: #f3f4f6;
}

.tailor-measurement-remove {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #ef4444;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.tailor-measurement-remove:hover {
  background: rgba(239, 68, 68, 0.12);
}

.tailor-measurements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 18px;
}

@media (max-width: 900px) {
  .tailor-measurements-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .tailor-measurements-grid {
    grid-template-columns: 1fr;
  }
}

.tailor-measurement-custom label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.tailor-measurement-custom textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  box-sizing: border-box;
}

.tailor-custom-text-wrap {
  position: relative;
}

.tailor-custom-text-wrap textarea {
  padding-right: 36px;
}

.tailor-custom-edit-icon {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.order-form-tailor-modal input[type="number"],
.order-form-tailor-modal input[type="date"],
.order-form-tailor-modal input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--text-dark);
  box-sizing: border-box;
}

.order-form-tailor-modal textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--text-dark);
  box-sizing: border-box;
}

.order-form-tailor-modal select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-dark);
  font-family: inherit;
  box-sizing: border-box;
}

[data-theme="dark"] .order-form-tailor-modal select {
  background: var(--surface);
}

[data-theme="dark"] .order-form-tailor-modal input[type="number"],
[data-theme="dark"] .order-form-tailor-modal input[type="date"],
[data-theme="dark"] .order-form-tailor-modal input[type="text"],
[data-theme="dark"] .order-form-tailor-modal textarea {
  background: var(--surface);
}

/* Badges */
.badge { 
  display: inline-block; 
  padding: 4px 8px; 
  border-radius: 4px; 
  font-size: 12px; 
  font-weight: 600; 
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-progress { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-delivered { background: #e0e7ff; color: #3730a3; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* Page Content */
.page-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Settings page */
.settings-page .settings-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
}
.settings-section-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.settings-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 8px 0;
}
.settings-section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.settings-page .settings-two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px 24px;
  margin-top: 8px;
}
.settings-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.settings-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0 18px;
}
.settings-form-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 20px;
}
.settings-actions {
  justify-content: flex-end;
}
.settings-notifications {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.settings-toggle input {
  display: none;
}
.settings-toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background 0.2s ease;
}
.settings-toggle-switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.settings-toggle input:checked + .settings-toggle-switch {
  background: var(--blue, #2563eb);
}
.settings-toggle input:checked + .settings-toggle-switch::before {
  transform: translateX(18px);
}
.settings-toggle-text {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: var(--text-dark);
}
.settings-toggle-text small {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Customers Header Actions (Search + Add Button) */
.customers-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.customers-header-actions .search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}
.customers-header-actions .btn {
  white-space: nowrap;
}

/* Customers Table */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.customers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.customers-table thead {
  background: var(--bg-light);
  border-bottom: 2px solid var(--border);
}
.customers-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.customers-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
}
.customers-table tbody tr {
  transition: background 0.15s;
}
.customers-table tbody tr:hover {
  background: var(--bg-light);
}
.customers-table tbody tr:last-child td {
  border-bottom: none;
}
.table-pagination {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.btn-primary {
  background: var(--blue);
  color: white;
}
.btn-primary:hover {
  background: #2563eb;
}
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
textarea {
  resize: vertical;
  min-height: 80px;
}

/* Utilities */
.hidden { display: none !important; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mb-1 { margin-bottom: 8px; }

/* Responsive */
@media (max-width: 1200px) {
  .stat-cards,
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .order-status-cards { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid,
  .dashboard-grid-main { grid-template-columns: 1fr; }
  .dashboard-bottom-row { grid-template-columns: 1fr; }
  .performer-cards { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dashboard-container { flex-direction: column; margin: 0; border-radius: 0; }
  .sidebar { width: 100%; }
  .stat-cards,
  .summary-cards { grid-template-columns: 1fr; }
  .stock-type-cards { grid-template-columns: repeat(2, 1fr); }
  .order-status-cards { grid-template-columns: 1fr; }
  .today-status { grid-template-columns: 1fr; }
  .recent-orders-row { grid-template-columns: 1fr auto; }
  .recent-orders-date { grid-column: 1; font-size: 12px; }
  .customers-header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .customers-header-actions .search-wrap {
    max-width: 100%;
  }
  .customers-table {
    font-size: 13px;
  }
  .customers-table th,
  .customers-table td {
    padding: 10px 12px;
  }
  .customers-table th:nth-child(3),
  .customers-table td:nth-child(3),
  .customers-table th:nth-child(4),
  .customers-table td:nth-child(4) {
    display: none;
  }
  .table-pagination {
    text-align: center;
  }
  .pagination-info {
    text-align: center;
  }
}

/* Body Measurements card - green header, 3-column form */
.measurements-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 960px;
}
.measurements-card-header {
  background: #22c55e;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
}
.measurements-card-header svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  stroke: currentColor;
}
.measurements-card-body {
  padding: 24px;
  background: var(--white);
}
[data-theme="dark"] .measurements-card-body {
  background: var(--surface);
}

/* Orders page — dashboard table layout (reference UI) */
.orders-page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.orders-page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  margin: 0;
}
.btn-add-order-primary {
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, opacity 0.15s;
}
a.btn-add-order-primary {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}
.btn-add-order-primary:hover {
  background: #000;
}
[data-theme="dark"] .btn-add-order-primary {
  background: #f9fafb;
  color: #111827;
}
[data-theme="dark"] .btn-add-order-primary:hover {
  background: #e5e7eb;
}
.orders-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.orders-filter-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-dark);
  font-family: inherit;
}
.orders-filter-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.orders-toolbar-spacer {
  flex: 1;
  min-width: 8px;
}
.btn-select-columns {
  background: var(--white);
  color: var(--text-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.btn-select-columns:hover {
  background: var(--bg-light);
}
.orders-col-menu-wrap {
  position: relative;
}
.orders-col-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 50;
}
.orders-col-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-dark);
}
.orders-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.orders-status-banner strong {
  color: var(--text-dark);
  text-transform: capitalize;
}
.orders-status-banner button {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.orders-table-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.orders-table-card .customers-table thead {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}
.orders-table-card .customers-table th {
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 14px;
}
.orders-table-card .customers-table th.col-hidden,
.orders-table-card .customers-table td.col-hidden {
  display: none;
}
.orders-table-card .price-cell {
  font-weight: 700;
}
.orders-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.btn-action-view,
.btn-action-edit,
.btn-action-delete,
.btn-action-pdf {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  transition: opacity 0.15s;
}
.btn-action-view {
  background: #3b82f6;
}
.btn-action-edit {
  background: #f59e0b;
}
.btn-action-delete {
  background: #ef4444;
}
.btn-action-pdf {
  background: #0f766e;
}
.btn-action-view:hover,
.btn-action-edit:hover,
.btn-action-delete:hover,
.btn-action-pdf:hover {
  opacity: 0.92;
}
.btn-action-delete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.orders-page .table-pagination {
  border-top: none;
  margin-top: 0;
  padding-top: 16px;
}
.orders-page .swaps-pagination {
  justify-content: flex-end;
}

/* Transactions page UI (match screenshot layout) */
.transactions-page-root .main-header {
  display: none;
}

.transactions-page {
  padding: 0 0 24px;
}

.transactions-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.transactions-hero-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
}

.transactions-page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}

.btn-transaction-categories {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.btn-transaction-categories:hover {
  filter: brightness(1.03);
}

.btn-transaction-add {
  padding: 10px 18px;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.btn-transaction-add:hover {
  filter: brightness(1.03);
}

.transactions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.transactions-filter-input {
  flex: 1;
  max-width: 520px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 14px;
}

.transactions-filter-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.transactions-table-card .customers-table thead th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}

.transactions-data-table td .orders-actions-cell {
  justify-content: flex-end;
}

.transactions-table-card .orders-actions-cell {
  justify-content: flex-end;
}

.transactions-page .table-pagination {
  display: none;
}

/* Transaction View modal (match screenshot) */
.transaction-view-modal.modal {
  background: transparent;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.transaction-view-modal-content {
  max-width: 760px;
  width: 100%;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .transaction-view-modal-content {
  background: var(--surface);
}

.transaction-view-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.transaction-view-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: 800;
  color: #fff;
}

.transaction-view-pill--credit {
  background: #22c55e;
}

.transaction-view-pill--debit {
  background: #ef4444;
}

.transaction-view-body {
  font-size: 18px;
  color: var(--text-dark);
}

.transaction-view-row {
  margin: 14px 0;
}

.transaction-view-label {
  font-weight: 700;
  color: var(--text-dark);
  margin-right: 6px;
}

.transaction-view-value {
  font-weight: 500;
  color: var(--text-dark);
}
.stock-data-table .stock-qty-cell {
  font-weight: 700;
}

/* Customer Management page */
.customer-management-page {
  gap: 20px;
}
.customer-mgmt-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.customer-mgmt-titles {
  flex: 1;
  min-width: 200px;
}
.customer-mgmt-title {
  margin: 0 0 8px 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(105deg, #2563eb 0%, #7c3aed 55%, #9333ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .customer-mgmt-title {
  background: linear-gradient(105deg, #60a5fa 0%, #a78bfa 50%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.customer-mgmt-subtitle {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.5;
}
.btn-add-new-customer {
  padding: 12px 22px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
  transition: background 0.15s, transform 0.15s;
}
.btn-add-new-customer:hover {
  background: #16a34a;
}
[data-theme="dark"] .btn-add-new-customer {
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.25);
}
.customer-mgmt-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .customer-mgmt-kpis {
    grid-template-columns: 1fr;
  }
}
.customer-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .customer-kpi-card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.customer-kpi-text .customer-kpi-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.customer-kpi-text .customer-kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.customer-kpi-value.is-blue { color: #2563eb; }
.customer-kpi-value.is-green { color: #16a34a; }
.customer-kpi-value.is-purple { color: #7c3aed; }
[data-theme="dark"] .customer-kpi-value.is-blue { color: #60a5fa; }
[data-theme="dark"] .customer-kpi-value.is-green { color: #4ade80; }
[data-theme="dark"] .customer-kpi-value.is-purple { color: #c084fc; }
.customer-kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.customer-kpi-icon svg {
  width: 26px;
  height: 26px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.customer-kpi-icon--blue { background: linear-gradient(145deg, #3b82f6, #2563eb); }
.customer-kpi-icon--green { background: linear-gradient(145deg, #22c55e, #16a34a); }
.customer-kpi-icon--purple { background: linear-gradient(145deg, #a855f7, #7c3aed); }
.customer-directory-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
.customer-directory-head {
  margin-bottom: 18px;
}
.customer-directory-title {
  margin: 0 0 6px 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
}
.customer-directory-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}
.customer-directory-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.customer-directory-toolbar .orders-filter-input {
  max-width: 320px;
  flex: 1;
  min-width: 200px;
}
.customers-data-table th .th-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.customers-data-table th .th-icon {
  display: inline-flex;
  color: var(--text-muted);
  opacity: 0.85;
}
.customers-data-table th.th-sortable {
  cursor: pointer;
  user-select: none;
}
.customers-data-table th.th-sortable:hover {
  color: var(--blue);
}
.badge-measurements {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.2);
}
.badge-measurements.is-missing {
  background: #f3f4f6;
  color: #6b7280;
  border-color: var(--border);
}
[data-theme="dark"] .badge-measurements {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
[data-theme="dark"] .badge-measurements.is-missing {
  background: #374151;
  color: #9ca3af;
}
.customer-row-created {
  color: var(--text-muted);
  font-size: 13px;
}
.btn-customer-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #2563eb;
}
.btn-customer-view:hover {
  background: rgba(37, 99, 235, 0.08);
}
.btn-customer-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid #f59e0b;
  background: var(--surface);
  color: #b45309;
}
.btn-customer-edit:hover {
  background: rgba(245, 158, 11, 0.1);
}
[data-theme="dark"] .btn-customer-edit {
  color: #fbbf24;
  border-color: #f59e0b;
}
.btn-customer-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: #ef4444;
  color: #fff;
}
.btn-customer-delete:hover {
  background: #dc2626;
}
.customer-actions-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.customer-directory-card .customers-data-table thead {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}
.customer-directory-card .customers-data-table th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.customer-directory-card .customers-data-table th.col-hidden,
.customer-directory-card .customers-data-table td.col-hidden {
  display: none;
}

/* Add Customer full page */
.add-customer-main .page-content.add-customer-page {
  max-width: 920px;
  margin: 0 auto;
  padding-bottom: 32px;
}
.add-customer-page .measurements-card {
  max-width: none;
  width: 100%;
}
.add-customer-measure-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.btn-back-customer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}
.btn-back-customer:hover {
  background: var(--bg-light);
}
.add-customer-page-title {
  margin: 16px 0 8px;
  font-size: 1.85rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: -0.02em;
}
[data-theme="dark"] .add-customer-page-title {
  color: #60a5fa;
}
.add-customer-page-sub {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}
.customer-selection-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.customer-selection-card-bar {
  background: linear-gradient(90deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.customer-selection-card-bar svg {
  flex-shrink: 0;
  opacity: 0.95;
}
.customer-selection-card-body {
  padding: 22px 24px 26px;
}
.customer-type-switch {
  display: flex;
  background: var(--bg-light);
  border-radius: 12px;
  padding: 5px;
  gap: 4px;
  margin-bottom: 22px;
}
.customer-type-switch button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.customer-type-switch button.is-active {
  background: var(--surface);
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.customer-select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-dark);
}
.customer-select-label svg {
  color: var(--text-muted);
}
.customer-select-help {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}
.new-customer-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
@media (max-width: 600px) {
  .new-customer-fields-grid {
    grid-template-columns: 1fr;
  }
}
.new-customer-fields-grid .form-group label {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}
.add-customer-measurements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 22px;
}
@media (max-width: 900px) {
  .add-customer-measurements-grid {
    grid-template-columns: 1fr;
  }
}
.add-customer-profile-row {
  margin-bottom: 20px;
  max-width: 280px;
}
.add-customer-profile-row label {
  font-weight: 700;
  font-size: 13px;
  display: block;
  margin-bottom: 8px;
}
.add-customer-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.btn-cancel-customer {
  padding: 12px 22px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: var(--text-dark);
  font-family: inherit;
  cursor: pointer;
}
.btn-cancel-customer:hover {
  background: var(--bg-light);
}
.btn-save-customer {
  padding: 12px 22px;
  border-radius: 11px;
  border: none;
  background: #22c55e;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.35);
}
.btn-save-customer:hover {
  background: #16a34a;
}
.btn-save-customer svg {
  flex-shrink: 0;
}

/* Add / edit stock quantity modal */
.stock-quantity-modal {
  max-width: 440px;
  padding: 28px 28px 24px;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}
.stock-quantity-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 0;
  border-bottom: none;
}
.stock-quantity-modal-header .modal-header-text {
  flex: 1;
  min-width: 0;
}
.stock-quantity-modal-header h3 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}
[data-theme="dark"] .stock-quantity-modal-header h3 {
  color: #f9fafb;
}
.stock-form-subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.45;
}
[data-theme="dark"] .stock-form-subtitle {
  color: #9ca3af;
}
.stock-quantity-modal .form-group {
  margin-bottom: 18px;
}
.stock-quantity-modal .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}
[data-theme="dark"] .stock-quantity-modal .form-group label {
  color: #f3f4f6;
}
.stock-quantity-modal textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--text-dark);
  min-height: 72px;
  resize: vertical;
  box-sizing: border-box;
}
.stock-quantity-modal select,
.stock-quantity-modal input[type="number"],
.stock-quantity-modal input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--text-dark);
  min-height: 44px;
  box-sizing: border-box;
}
.stock-quantity-modal select:disabled {
  opacity: 0.85;
  cursor: not-allowed;
  background: var(--bg-light);
}
.stock-new-product-block {
  display: none;
  padding: 16px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--bg-light);
}
.stock-new-product-block.is-visible {
  display: block;
}
.stock-quantity-modal .stock-form-actions {
  margin-top: 24px;
  padding-top: 0;
  border-top: none;
  display: flex;
  justify-content: flex-start;
}
.btn-stock-submit {
  padding: 11px 28px;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
}
.btn-stock-submit:hover {
  background: #000;
}
[data-theme="dark"] .btn-stock-submit {
  background: #f9fafb;
  color: #111827;
}
[data-theme="dark"] .btn-stock-submit:hover {
  background: #e5e7eb;
}

/* Full-page add stock (/stock/add) — wide horizontal layout */
.stock-add-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 24px 48px;
  box-sizing: border-box;
}
.stock-add-back {
  margin: 0 0 20px 0;
}
.stock-add-back a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}
.stock-add-back a:hover {
  color: var(--text-dark);
}
.stock-add-card.stock-quantity-modal {
  max-width: none;
  width: 100%;
  padding: 32px 32px 36px;
  box-sizing: border-box;
}
.stock-add-card {
  border: 1px solid var(--border);
  background: var(--white);
}
.stock-add-card-header {
  margin-bottom: 28px;
}
.stock-add-title {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}
[data-theme="dark"] .stock-add-title {
  color: #f9fafb;
}
.stock-add-fields-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 20px 24px;
  align-items: end;
}
.stock-add-card .stock-add-fields-grid .form-group {
  margin-bottom: 0;
}
.stock-add-new-product {
  margin-top: 22px;
  margin-bottom: 0;
}
.stock-add-new-grid-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 24px;
  align-items: end;
}
.stock-add-card .stock-add-new-grid-inner .form-group {
  margin-bottom: 0;
}
.stock-add-card .stock-form-actions {
  margin-top: 28px;
}
@media (max-width: 1100px) {
  .stock-add-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .stock-add-page {
    padding: 20px 16px 40px;
  }
  .stock-add-card.stock-quantity-modal {
    padding: 24px 20px 28px;
  }
  .stock-add-fields-grid {
    grid-template-columns: 1fr;
  }
  .stock-add-new-grid-inner {
    grid-template-columns: 1fr;
  }
}

.measurements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 24px;
}
.measurement-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.measurement-field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 14px;
}
.measurement-field-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #1e40af;
}
.measurement-field-icon.icon-green { color: #16a34a; }
.measurement-field-icon.icon-gray { color: var(--text-muted); }
.measurement-field-icon.icon-gold { color: #b45309; }
.measurement-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-dark);
}
.measurement-field input::placeholder {
  color: var(--text-muted);
}
.measurement-field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.measurement-field-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.measurements-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .measurements-grid {
    grid-template-columns: 1fr;
  }
}

/* Add Transaction form - two-column layout */
.add-transaction-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
  max-width: 900px;
}
.add-transaction-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
}
.add-transaction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.add-transaction-grid .form-group {
  margin-bottom: 0;
}
.add-transaction-grid .form-group.full-width {
  grid-column: 1 / -1;
}
.add-transaction-grid label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  font-size: 14px;
}
.add-transaction-grid input[type="text"],
.add-transaction-grid input[type="number"],
.add-transaction-grid input[type="datetime-local"],
.add-transaction-grid select,
.add-transaction-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-dark);
}
.add-transaction-grid textarea {
  min-height: 80px;
  resize: vertical;
}
.transaction-type-radio {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
}
.transaction-type-radio label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}
.add-transaction-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .add-transaction-grid {
    grid-template-columns: 1fr;
  }
}

/* Add Swap form - horizontal layout */
.add-swap-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
  max-width: 720px;
}
.add-swap-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 20px;
}

/* Horizontal form layout - rows with fields side by side */
.add-swap-form-horizontal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.add-swap-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
}
.add-swap-row-label {
  flex-shrink: 0;
  width: 48px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
  padding-bottom: 8px;
}
.add-swap-row .form-group {
  flex: 1;
  min-width: 120px;
  margin-bottom: 0;
}
.add-swap-row-from .form-group,
.add-swap-row-to .form-group {
  flex: 1;
  min-width: 100px;
  max-width: 180px;
}
.add-swap-row-optional .form-group {
  flex: 1;
  min-width: 180px;
}
.add-swap-row label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  font-size: 13px;
}
.add-swap-row input[type="text"],
.add-swap-row input[type="number"],
.add-swap-row select,
.add-swap-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-dark);
}
.add-swap-row textarea {
  min-height: 64px;
  resize: vertical;
}

/* Legacy add-swap-grid (modal uses form-horizontal now, but keep for any other use) */
.add-swap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.add-swap-grid .form-group {
  margin-bottom: 0;
}
.add-swap-grid .form-group.full-width {
  grid-column: 1 / -1;
}
.add-swap-grid label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  font-size: 14px;
}
.add-swap-grid input,
.add-swap-grid select,
.add-swap-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-dark);
}
.add-swap-grid textarea {
  min-height: 70px;
  resize: vertical;
}
.add-swap-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Responsive - stack on mobile */
@media (max-width: 768px) {
  .add-swap-row {
    flex-direction: column;
    align-items: stretch;
  }
  .add-swap-row-label {
    width: auto;
    padding-bottom: 4px;
  }
  .add-swap-row-from .form-group,
  .add-swap-row-to .form-group {
    max-width: none;
  }
}

/* Swaps page - matching reference design */
.swaps-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.swaps-page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}
.swaps-add-btn {
  background: var(--text-dark) !important;
  color: #fff !important;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.swaps-add-btn:hover {
  background: #374151 !important;
  color: #fff !important;
}
.swaps-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.swaps-filter-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  color: var(--text-dark);
}
.swaps-filter-input::placeholder {
  color: var(--text-muted);
}
.swaps-select-columns-btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text-dark);
  font-size: 14px;
  cursor: pointer;
}
.swaps-table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
}
.swaps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.swaps-table th,
.swaps-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.swaps-table th {
  font-weight: 600;
  color: var(--text-dark);
  background: var(--bg-light);
}
.swaps-table tbody tr:hover {
  background: rgba(0,0,0,0.02);
}
.swaps-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}
.swaps-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.swaps-pagination-rows {
  font-size: 13px;
  color: var(--text-muted);
}
.swaps-pagination-rows select {
  margin-left: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--white);
}
.swaps-pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}
.swaps-pagination-nav {
  display: flex;
  gap: 4px;
}
.swaps-pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-dark);
  font-size: 14px;
  cursor: pointer;
}
.swaps-pagination-btn:hover:not(:disabled) {
  background: var(--bg-light);
}
.swaps-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.add-swap-modal-content {
  max-width: 640px;
}

/* Banks page - action buttons */
.banks-action-view {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-light);
  color: var(--text-dark);
  cursor: pointer;
  margin-right: 4px;
}
.banks-action-view:hover {
  background: var(--border);
}
.banks-action-edit {
  padding: 6px 12px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  background: #fcd34d;
  color: #1f2937;
  cursor: pointer;
  margin-right: 4px;
}
.banks-action-edit:hover {
  background: #fbbf24;
}
.banks-action-delete {
  padding: 6px 12px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
}
.banks-action-delete:hover {
  background: #dc2626;
}

/* Swap Summary - auto-calculator */
.swap-summary {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.swap-summary-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 12px 0;
}
.swap-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.swap-summary-block {
  padding: 12px;
  background: var(--white);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-dark);
}
.swap-summary-block strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}
.swap-summary-block > div {
  padding: 4px 0;
}
.swap-summary-total {
  margin-top: 8px;
  padding-top: 8px !important;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

/* Customer Details View (modal) */
#viewModal.modal {
  /* Fill only the main content area so the sidebar stays visible */
  background: transparent;
  padding: 0;
  position: fixed;
  left: 260px; /* matches .sidebar width */
  right: 0;
  top: 0;
  bottom: 0;
  align-items: stretch;
  justify-content: stretch;
  z-index: 1001;
}

.customer-view-modal {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  padding: 24px !important;
  border-radius: 0 !important;
  overflow-y: auto;
  background: var(--white);
}

#viewModal.modal .customer-view-modal {
  width: 100% !important;
  max-width: none !important;
  min-height: 100%;
  border-radius: 0 !important;
}

.customer-view {
  width: 100%;
  font-family: inherit;
}

.customer-view-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.customer-view-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.customer-view-back:hover { background: var(--bg-light); color: var(--text-dark); }

.customer-view-titles { min-width: 0; }
.customer-view-title {
  font-size: 26px;
  font-weight: 900;
  color: #111827;
  letter-spacing: -0.02em;
  margin: 0;
}
.customer-view-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}

.customer-view-edit-btn {
  margin-top: 2px;
  white-space: nowrap;
}
.customer-view-edit-btn.btn-customer-edit {
  padding: 10px 16px;
  border-radius: 10px;
  border-width: 2px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.customer-view-content {
  display: grid;
  grid-template-columns: 0.95fr 1.55fr;
  gap: 24px;
  align-items: start;
}

.customer-view-info-card {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
}

.customer-view-info-header {
  padding: 18px 20px;
  color: #fff;
  font-weight: 900;
  font-size: 22px;
}
.customer-view-info-header--blue {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.customer-view-info-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.customer-view-info-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.customer-view-info-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}
.customer-view-info-icon--blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.customer-view-info-icon--green { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.customer-view-info-icon--purple { background: rgba(139, 92, 246, 0.14); color: #7c3aed; }
.customer-view-info-icon--gold { background: rgba(245, 158, 11, 0.16); color: #b45309; }

.customer-view-info-text { min-width: 0; }
.customer-view-info-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.customer-view-info-value {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  line-height: 1.25;
  word-break: break-word;
}

.customer-view-meas-card {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  padding-bottom: 18px;
}

.customer-view-meas-header {
  padding: 18px 20px;
  color: #fff;
  font-weight: 900;
  font-size: 22px;
}
.customer-view-meas-header--green {
  background: linear-gradient(135deg, #16a34a 0%, #059669 100%);
}

.customer-view-meas-subheader {
  padding: 14px 20px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.customer-view-meas-latest {
  color: var(--text-muted);
  font-size: 14px;
}
.customer-view-meas-sets {
  font-size: 13px;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.25);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.customer-view-meas-grid {
  padding: 18px 18px 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
}

.customer-view-meas-item {
  background: #f9fafb;
  border: 1px solid rgba(229,231,235,0.9);
  border-radius: 14px;
  padding: 14px 14px 12px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
}

.customer-view-meas-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #1e40af;
  background: rgba(37, 99, 235, 0.08);
}
.customer-view-meas-icon.is-blue { color: #1e40af; background: rgba(37, 99, 235, 0.10); }
.customer-view-meas-icon.is-green { color: #065f46; background: rgba(34, 197, 94, 0.12); }
.customer-view-meas-icon.is-gray { color: #6b7280; background: rgba(107, 114, 128, 0.12); }
.customer-view-meas-icon.is-gold { color: #b45309; background: rgba(245, 158, 11, 0.14); }

.customer-view-meas-label {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
  line-height: 1.1;
}

.customer-view-meas-value-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-top: 2px;
}
.customer-view-meas-value-num {
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  line-height: 1;
  padding-bottom: 2px;
  border-bottom: 2px solid rgba(15,23,42,0.15);
  min-width: 48px;
  display: inline-block;
}
.customer-view-meas-unit {
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-bottom: 2px;
}

.customer-view-meas-footer {
  padding: 12px 20px 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.customer-view-update-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 10px;
  background: #f59e0b;
  color: #1f2937;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.28);
}
.customer-view-update-btn:hover { filter: brightness(1.03); background: #fbbf24; }

@media (max-width: 980px) {
  .customer-view-content { grid-template-columns: 1fr; }
  .customer-view-meas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .customer-view-topbar { flex-direction: column; align-items: flex-start; }
  .customer-view-meas-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  #viewModal.modal {
    /* If sidebar collapses, keep the view visible (fallback) */
    left: 0;
  }
}

