/* ======================================================
   ZADOK TAILORING — Design System
   Premium tailor management PWA
   ====================================================== */

/* ---- CSS Custom Properties ---- */
:root {
  /* Primary palette (gold) */
  --primary-50: #FBF7EC;
  --primary-100: #F5ECD0;
  --primary-200: #EDDCAA;
  --primary-300: #DFCA78;
  --primary-400: #D4B84E;
  --primary-500: #C8A336;
  --primary-600: #A8882D;
  --primary-700: #8A6F24;
  --primary-800: #6B561C;
  --primary-900: #4A3B13;

  /* Neutrals */
  --neutral-50: #FAFAFA;
  --neutral-100: #F5F3F7;
  --neutral-200: #E5E1EA;
  --neutral-300: #D1CDD8;
  --neutral-400: #B0ABB9;
  --neutral-500: #8E8A96;
  --neutral-600: #6E687A;
  --neutral-700: #4A4555;
  --neutral-800: #2D2937;
  --neutral-900: #1A1523;

  /* Status colors */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* Accent */
  --accent: #B45309;
  --accent-light: #FDE68A;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --bottom-bar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(26, 21, 35, 0.04);
  --shadow-sm: 0 1px 3px rgba(26, 21, 35, 0.06), 0 1px 2px rgba(26, 21, 35, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(26, 21, 35, 0.07), 0 2px 4px -1px rgba(26, 21, 35, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(26, 21, 35, 0.08), 0 4px 6px -2px rgba(26, 21, 35, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(26, 21, 35, 0.1), 0 10px 10px -5px rgba(26, 21, 35, 0.04);
  --shadow-primary: 0 4px 14px rgba(200, 163, 54, 0.35);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--neutral-900);
  background: var(--neutral-100);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary-700); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-500); }

img { max-width: 100%; height: auto; display: block; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--neutral-900);
}
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
p { color: var(--neutral-600); }

/* ---- Layout: App Shell ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* -- Sidebar (desktop) -- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--neutral-900);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

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

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--neutral-400);
  font-weight: 400;
}

.sidebar-nav { flex: 1; padding: 8px 12px; }

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-500);
  padding: 16px 8px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--neutral-400);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.sidebar-link.active {
  background: var(--primary-700);
  color: white;
  box-shadow: var(--shadow-primary);
}

.sidebar-link .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-link .badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.sidebar-user:hover { background: rgba(255,255,255,0.06); }

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.sidebar-user-email {
  font-size: 0.65rem;
  color: var(--neutral-500);
}

/* -- Main content -- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* -- Top Header -- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.top-header-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--neutral-900);
}

.top-header-spacer { flex: 1; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--neutral-700);
  font-size: 1.5rem;
}

/* -- Page Content -- */
.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

/* -- Bottom Tab Bar (mobile) -- */
.bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-height);
  background: white;
  border-top: 1px solid var(--neutral-200);
  z-index: 100;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-bar-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 100%;
}

.bottom-bar-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  color: var(--neutral-400);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

.bottom-bar-link .icon { font-size: 1.3rem; }

.bottom-bar-link.active {
  color: var(--primary-700);
}

.bottom-bar-link.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--primary-700);
  border-radius: 0 0 3px 3px;
}

/* ---- Cards ---- */
.card {
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-600);
}

.card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--neutral-900);
  margin-top: 4px;
}

.card-footer {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--neutral-500);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card.purple::before { background: var(--primary-700); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.blue::before { background: var(--info); }
.stat-card.red::before { background: var(--danger); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.stat-icon.purple { background: var(--primary-50); color: var(--primary-700); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--neutral-900);
  margin-top: 2px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.stat-change.up { background: var(--success-light); color: #059669; }
.stat-change.down { background: var(--danger-light); color: var(--danger); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary-700);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-600); color: white; box-shadow: var(--shadow-primary); }

.btn-secondary {
  background: white;
  color: var(--neutral-700);
  border: 1px solid var(--neutral-200);
}
.btn-secondary:hover { background: var(--neutral-50); color: var(--neutral-900); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; color: white; }

.btn-warning { background: var(--warning); color: white; }

.btn-ghost {
  background: transparent;
  color: var(--neutral-600);
}
.btn-ghost:hover { background: var(--neutral-100); color: var(--neutral-900); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-icon.sm { width: 32px; height: 32px; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending { background: var(--warning-light); color: #92400E; }
.badge-in_progress, .badge-in-progress { background: var(--info-light); color: #1E40AF; }
.badge-ready { background: #FBF7EC; color: #8A6F24; }
.badge-delivered { background: var(--success-light); color: #065F46; }
.badge-cancelled { background: var(--danger-light); color: #991B1B; }
.badge-draft { background: var(--neutral-100); color: var(--neutral-600); }
.badge-sent { background: var(--info-light); color: #1E40AF; }
.badge-paid { background: var(--success-light); color: #065F46; }

.badge-cash { background: var(--success-light); color: #065F46; }
.badge-bank_transfer { background: var(--info-light); color: #1E40AF; }
.badge-mobile_money { background: var(--warning-light); color: #92400E; }
.badge-card { background: #FBF7EC; color: #8A6F24; }

/* ---- Forms ---- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neutral-700);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--neutral-900);
  background: white;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(200, 163, 54, 0.2);
}

.form-input::placeholder { color: var(--neutral-400); }

.form-textarea { resize: vertical; min-height: 100px; }

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 4px;
}

.form-hint {
  font-size: 0.7rem;
  color: var(--neutral-400);
  margin-top: 4px;
}

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

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--neutral-200);
}

/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: white;
}

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

.table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--neutral-50);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  border-bottom: 1px solid var(--neutral-200);
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-100);
  color: var(--neutral-700);
  vertical-align: middle;
}

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

.table tr:hover td { background: var(--neutral-50); }

.table-actions {
  display: flex;
  gap: 6px;
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.5rem;
}

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

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--neutral-200);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-link {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neutral-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-link:hover { color: var(--neutral-700); }
.tab-link.active {
  color: var(--primary-700);
  border-bottom-color: var(--primary-700);
}

/* ---- Status Timeline ---- */
.status-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 24px 0;
}

.status-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}

.status-step::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--neutral-200);
}

.status-step:last-child::after { display: none; }
.status-step:last-child { flex: 0; }

.status-step.completed::after { background: var(--success); }

.status-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--neutral-200);
  color: var(--neutral-500);
}

.status-step.completed .status-dot {
  background: var(--success);
  color: white;
}

.status-step.current .status-dot {
  background: var(--primary-700);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-100);
}

.status-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--neutral-400);
  white-space: nowrap;
}

.status-step.completed .status-label { color: var(--success); }
.status-step.current .status-label { color: var(--primary-700); }

/* ---- Modals ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 21, 35, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.modal-header h3 { font-size: 1.1rem; }

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

/* ---- Empty States ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--neutral-700);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--neutral-400);
  margin-bottom: 24px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Alerts ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: var(--success-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger { background: var(--danger-light); color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: var(--info-light); color: #1E40AF; border: 1px solid #93C5FD; }

/* ---- Search & Filter Bar ---- */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

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

.search-input-wrap::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
}

.filter-group {
  display: flex;
  gap: 6px;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  background: white;
  border: 1px solid var(--neutral-200);
  color: var(--neutral-600);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.filter-chip:hover { border-color: var(--primary-300); color: var(--primary-700); }
.filter-chip.active {
  background: var(--primary-700);
  color: white;
  border-color: var(--primary-700);
}

/* ---- Chart Container ---- */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neutral-600);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination a:hover { background: var(--neutral-100); }
.pagination .active span {
  background: var(--primary-700);
  color: white;
}

/* ---- Client / Order Cards ---- */
.client-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
}

.client-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.client-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-50);
  color: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 600; color: var(--neutral-900); font-size: 0.9rem; }
.client-meta { font-size: 0.75rem; color: var(--neutral-500); margin-top: 2px; }

.client-stats {
  display: flex;
  gap: 16px;
  text-align: center;
}

.client-stat-value { font-weight: 700; color: var(--neutral-900); font-size: 0.85rem; }
.client-stat-label { font-size: 0.65rem; color: var(--neutral-500); }

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.animate-in {
  animation: slideUp 0.4s ease forwards;
}

/* ---- Utility Classes ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-muted { color: var(--neutral-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-700); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-50) 0%, #fff 50%, var(--primary-50) 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  animation: slideUp 0.5s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: var(--primary-700);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: white;
}

.login-logo h1 {
  font-size: 1.5rem;
  color: var(--neutral-900);
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--neutral-500);
  margin-top: 4px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .main-content {
    margin-left: 0;
    padding-bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0));
  }

  .bottom-bar { display: block; }

  .mobile-menu-btn { display: flex; }

  .page-content { padding: 16px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.25rem; }

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

  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: stretch; }
  .page-header-actions { justify-content: flex-end; }

  .table-wrap { font-size: 0.8rem; }

  .search-bar { flex-direction: column; }

  .status-timeline { flex-wrap: wrap; gap: 8px; }

  .client-card { flex-wrap: wrap; }
  .client-stats { width: 100%; justify-content: space-around; padding-top: 12px; border-top: 1px solid var(--neutral-100); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 1.1rem; }
  .stat-label { font-size: 0.65rem; }

  .login-card { padding: 24px; }

  .card { padding: 16px; }
}

/* ---- Print styles ---- */
@media print {
  .sidebar, .bottom-bar, .top-header, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  .page-content { padding: 0; }
  body { background: white; }
}
