﻿/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Khata Wallah — Shared Design Token System
   theme.css  •  Load on EVERY User App page
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* â”€â”€ Design Tokens â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
  /* Brand */
  --brand:        #4f46e5;
  --brand-dark:   #3730a3;
  --brand-light:  #eef2ff;
  --brand-grd:    linear-gradient(135deg, #4f46e5, #7c3aed);

  /* Semantic */
  --success:      #10b981;
  --success-bg:   #ecfdf5;
  --danger:       #ef4444;
  --danger-bg:    #fef2f2;
  --warning:      #f59e0b;
  --warning-bg:   #fffbeb;
  --info:         #3b82f6;
  --info-bg:      #eff6ff;

  /* Neutrals */
  --ink:          #0f172a;
  --ink-2:        #1e293b;
  --ink-3:        #334155;
  --muted:        #64748b;
  --muted-2:      #94a3b8;
  --border:       #e2e8f0;
  --border-2:     #f1f5f9;
  --bg:           #f5f7fa;
  --surface:      #ffffff;

  /* Typography */
  --font:         'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing Scale (8px grid) */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   12px;
  --sp-4:   16px;
  --sp-5:   20px;
  --sp-6:   24px;

  /* Border Radius */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;

  /* Elevation */
  --shadow-sm: 0 1px 4px rgba(15,23,42,.06);
  --shadow:    0 2px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 8px 32px rgba(15,23,42,.13);

  /* Navigation */
  --nav-h:    68px;
  --header-h: 56px;
}

/* â”€â”€ Global Reset â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* â”€â”€ Bottom Navigation (shared across all pages) â”€â”€â”€â”€â”€ */
.bottom-nav {
  display: flex;
  align-items: center;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 16px rgba(15,23,42,.06);
  z-index: 300;
}
.bnav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--muted-2);
  font-size: .58rem; font-weight: 700;
  padding: 8px 0;
  transition: color .18s;
}
.bnav-item i { font-size: 1.2rem; }
.bnav-item.active { color: var(--brand); }
.bnav-fab {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--brand-grd);
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(79,70,229,.35);
  margin-top: -18px;
  flex: none;
  display: flex; align-items: center; justify-content: center;
}
.bnav-fab i { font-size: 1.3rem; }

/* â”€â”€ Desktop Sidebar (shared) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.side-nav {
  display: none;
  width: 230px;
  flex-shrink: 0;
  background: var(--ink);
  padding: 28px 12px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 400;
  flex-direction: column;
}
.side-nav .brand-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px 24px;
  font-size: 1.1rem; font-weight: 800; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 14px;
}
.side-nav .brand-logo i {
  background: var(--brand-grd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.35rem;
}
.side-nav .nav-links { display: flex; flex-direction: column; gap: 2px; }
.side-nav .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md);
  color: #7b8fb3;
  font-size: .875rem; font-weight: 600;
  transition: all .18s;
}
.side-nav .nav-item i { width: 18px; text-align: center; }
.side-nav .nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav .nav-item.active { background: rgba(79,70,229,.18); color: var(--brand); }

/* â”€â”€ Common Top Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.top-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink);
  padding: 14px 18px;
  padding-top: max(14px, calc(12px + env(safe-area-inset-top)));
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
}
.top-bar-title { flex: 1; color: #fff; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.top-bar .back-btn, .top-bar .icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-md); border: none;
  background: rgba(255,255,255,.08); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; transition: background .18s; flex-shrink: 0;
}
.top-bar .back-btn:hover, .top-bar .icon-btn:hover { background: rgba(255,255,255,.15); }

/* â”€â”€ Common Button Styles â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: var(--r-lg);
  background: var(--brand-grd); color: #fff;
  font-size: .9rem; font-weight: 700; border: none;
  box-shadow: 0 6px 20px rgba(79,70,229,.3);
  transition: transform .18s, box-shadow .18s;
  cursor: pointer;
}
.btn-primary:hover   { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(79,70,229,.38); }
.btn-primary:active  { transform: scale(.98); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--r-lg);
  background: var(--surface); color: var(--muted);
  font-size: .9rem; font-weight: 700;
  border: 1.5px solid var(--border);
  transition: background .18s;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--border-2); }

/* â”€â”€ Common Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
}

/* â”€â”€ Status Pills â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.pill {
  display: inline-flex; align-items: center;
  font-size: .63rem; font-weight: 800;
  padding: 4px 11px; border-radius: 99px;
  letter-spacing: .02em;
}
.pill-success { background: var(--success-bg); color: #047857; }
.pill-danger  { background: var(--danger-bg);  color: #b91c1c; }
.pill-warning { background: var(--warning-bg); color: #92400e; }
.pill-info    { background: var(--info-bg);    color: #1e40af; }
.pill-neutral { background: var(--border-2);   color: var(--muted); }

/* â”€â”€ Skeleton Loader â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e8edf5 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s infinite;
  border-radius: var(--r-lg);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* â”€â”€ Toast â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#toast {
  position: fixed; bottom: 160px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff;
  padding: 11px 22px; border-radius: 99px;
  font-size: .82rem; font-weight: 600;
  opacity: 0; transition: all .28s;
  z-index: 9999; white-space: nowrap; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* â”€â”€ Spinner â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin .75s linear infinite; }

/* â”€â”€ Desktop Breakpoints â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (min-width: 768px) {
  .side-nav { display: flex; }
  .bottom-nav { display: none; }
  .main-content { margin-left: 230px; }
  .pay-wrap { left: 230px; }
}
@media (min-width: 1100px) {
  .main-content { max-width: 900px; }
}
