/* ============================================================
   Shekhawati Fashion ERP — Design System
   Premium Dark SaaS Admin Dashboard
   ============================================================ */

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

/* ========================
   CSS VARIABLES
   ======================== */
:root {
  /* Backgrounds */
  --bg-base:      #080d18;
  --bg-surface:   #0d1426;
  --bg-elevated:  #111827;
  --sidebar-bg:   #070c17;
  --navbar-bg:    rgba(8, 13, 24, 0.96);

  /* Brand / Accent */
  --primary:        #7c3aed;
  --primary-hover:  #6d28d9;
  --primary-light:  rgba(124, 58, 237, 0.18);
  --primary-glow:   rgba(124, 58, 237, 0.35);
  --secondary:      #f59e0b;
  --secondary-light:rgba(245, 158, 11, 0.15);
  --indigo:         #6366f1;
  --teal:           #14b8a6;
  --pink:           #ec4899;

  /* Semantic */
  --success:        #10b981;
  --success-light:  rgba(16, 185, 129, 0.15);
  --danger:         #ef4444;
  --danger-light:   rgba(239, 68, 68, 0.15);
  --warning:        #f59e0b;
  --warning-light:  rgba(245, 158, 11, 0.15);
  --info:           #3b82f6;
  --info-light:     rgba(59, 130, 246, 0.15);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-accent:    #a78bfa;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(255, 255, 255, 0.14);
  --border-active:  rgba(124, 58, 237, 0.5);

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow:     0 4px 24px rgba(0,0,0,0.45);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.55);
  --shadow-xl:  0 16px 64px rgba(0,0,0,0.65);
  --glow-purple: 0 0 30px rgba(124, 58, 237, 0.3);

  /* Layout */
  --sidebar-width: 260px;
  --navbar-height: 64px;

  /* Radii */
  --r-xs:   4px;
  --r-sm:   8px;
  --r:      12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Glass */
  --glass-bg:     rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.08);
  --glass-blur:   blur(24px);

  /* Transitions */
  --t:      all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: all 0.15s ease;
  --t-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================
   RESET & BASE
   ======================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.45); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ========================
   APP LAYOUT
   ======================== */
.app-wrapper { display: flex; min-height: 100vh; }

/* ========================
   SIDEBAR
   ======================== */
.sidebar {
  position: fixed; left: 0; top: 0;
  height: 100vh; width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1000; transition: var(--t-slow);
  overflow: hidden;
}

/* Logo */
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  min-height: var(--navbar-height);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--primary-glow);
  font-family: 'Poppins', sans-serif;
}
.logo-text { overflow: hidden; }
.logo-title {
  font-size: 13.5px; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; font-family: 'Poppins', sans-serif; line-height: 1.3;
}
.logo-subtitle { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }

/* Nav */
.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-muted);
  padding: 10px 10px 6px; margin-top: 4px;
}
.nav-item { margin-bottom: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; border-radius: var(--r-sm);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  transition: var(--t); position: relative; white-space: nowrap;
}
.nav-link:hover { background: var(--primary-light); color: var(--text-primary); }
.nav-link.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(99,102,241,0.14));
  color: #c4b5fd;
  border: 1px solid rgba(124,58,237,0.22);
}
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 20%; height: 60%;
  width: 3px; background: linear-gradient(to bottom, var(--primary), var(--indigo));
  border-radius: 0 3px 3px 0;
}
.nav-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-full); line-height: 1.6;
}

/* Sidebar Footer */
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  transition: var(--t); cursor: pointer;
}
.user-card:hover { background: var(--glass-bg); }
.user-avatar {
  width: 34px; height: 34px; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white; flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10.5px; color: var(--text-muted); }
.user-logout { color: var(--text-muted); font-size: 13px; transition: var(--t-fast); }
.user-logout:hover { color: var(--danger); }

/* ========================
   MAIN CONTENT AREA
   ======================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: var(--t-slow);
}

/* ========================
   TOP NAVBAR
   ======================== */
.topnav {
  position: sticky; top: 0;
  height: var(--navbar-height);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex; align-items: center;
  padding: 0 24px; gap: 14px; z-index: 100;
}
.sidebar-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: none;
  background: none; color: var(--text-secondary);
  transition: var(--t); font-size: 16px;
}
.sidebar-toggle:hover { background: var(--glass-bg); color: var(--text-primary); }
.page-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  font-family: 'Poppins', sans-serif; flex: 1;
}
.topnav-search { position: relative; }
.topnav-search input {
  background: var(--glass-bg); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 8px 16px 8px 38px;
  color: var(--text-primary); font-size: 13px; width: 220px;
  transition: var(--t); outline: none;
}
.topnav-search input:focus { border-color: var(--border-active); width: 260px; background: var(--primary-light); }
.topnav-search input::placeholder { color: var(--text-muted); }
.topnav-search .si { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }
.topnav-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: none; background: none;
  color: var(--text-secondary); transition: var(--t); position: relative; font-size: 15px;
}
.icon-btn:hover { background: var(--glass-bg); color: var(--text-primary); }
.badge-dot {
  position: absolute; top: 7px; right: 7px; width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--navbar-bg);
}
.nav-user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px;
  background: var(--glass-bg); border: 1px solid var(--border);
  border-radius: var(--r-full); cursor: pointer; transition: var(--t);
}
.nav-user-pill:hover { border-color: var(--border-hover); }
.nav-user-pill .av {
  width: 28px; height: 28px; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
}
.nav-user-pill .uname { font-size: 12px; font-weight: 600; color: var(--text-primary); }

/* ========================
   PAGE CONTENT
   ======================== */
.page-content { flex: 1; padding: 24px; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header-left h1 { font-size: 21px; font-weight: 700; color: var(--text-primary); font-family: 'Poppins', sans-serif; }
.page-header-left p { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--text-muted); transition: var(--t-fast); }
.breadcrumb a:hover { color: var(--text-accent); }
.breadcrumb span { opacity: 0.5; }
.page-header-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ========================
   CARDS (GLASSMORPHISM)
   ======================== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: var(--t);
  overflow: hidden;
}
.card:hover { border-color: var(--border-hover); }
.card-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-title {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--text-accent); font-size: 14px; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); }

/* ========================
   KPI STAT CARDS
   ======================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: var(--t); position: relative; overflow: hidden; cursor: default;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--stat-color, var(--primary));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-hover); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.si-purple { --stat-color: var(--primary); background: var(--primary-light); color: #c4b5fd; }
.si-blue   { --stat-color: var(--info); background: var(--info-light); color: #60a5fa; }
.si-green  { --stat-color: var(--success); background: var(--success-light); color: #34d399; }
.si-gold   { --stat-color: var(--secondary); background: var(--secondary-light); color: #fbbf24; }
.si-red    { --stat-color: var(--danger); background: var(--danger-light); color: #f87171; }
.si-indigo { --stat-color: var(--indigo); background: rgba(99,102,241,0.15); color: #a5b4fc; }
.si-teal   { --stat-color: var(--teal); background: rgba(20,184,166,0.15); color: #2dd4bf; }
.si-pink   { --stat-color: var(--pink); background: rgba(236,72,153,0.15); color: #f472b6; }
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1.2; font-family: 'Poppins', sans-serif; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.stat-change { font-size: 11px; margin-top: 7px; display: flex; align-items: center; gap: 4px; font-weight: 600; }
.stat-up { color: var(--success); }
.stat-down { color: var(--danger); }

/* ========================
   GRID HELPERS
   ======================== */
.g-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.g-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.g-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.g-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.g-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.g-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: 20px; }

/* ========================
   TABLES
   ======================== */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt thead th {
  background: rgba(255,255,255,0.03); color: var(--text-muted);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; padding: 11px 16px; text-align: left;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
.dt tbody tr { border-bottom: 1px solid var(--border); transition: var(--t-fast); }
.dt tbody tr:last-child { border-bottom: none; }
.dt tbody tr:hover { background: rgba(255,255,255,0.02); }
.dt td { padding: 13px 16px; color: var(--text-secondary); vertical-align: middle; }
.dt td.fw { color: var(--text-primary); font-weight: 500; }
.dt td.mono { font-family: 'Courier New', monospace; font-size: 12px; color: var(--text-accent); }
.dt-actions { display: flex; gap: 6px; align-items: center; }

/* ========================
   STATUS BADGES
   ======================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
}
.badge::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.b-pending   { background: rgba(245,158,11,0.15); color: #fbbf24; }
.b-cutting   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.b-stitching { background: rgba(124,58,237,0.15); color: #c4b5fd; }
.b-trial     { background: rgba(249,115,22,0.15); color: #fb923c; }
.b-ready     { background: rgba(16,185,129,0.15); color: #34d399; }
.b-delivered { background: rgba(100,116,139,0.15); color: #94a3b8; }
.b-success   { background: var(--success-light); color: #34d399; }
.b-danger    { background: var(--danger-light); color: #f87171; }
.b-warning   { background: var(--warning-light); color: #fbbf24; }
.b-info      { background: var(--info-light); color: #60a5fa; }
.b-primary   { background: var(--primary-light); color: #c4b5fd; }
.b-gray      { background: rgba(100,116,139,0.12); color: var(--text-muted); }
.b-admin     { background: rgba(236,72,153,0.15); color: #f472b6; }
.b-staff     { background: rgba(20,184,166,0.15); color: #2dd4bf; }
.b-gst       { background: rgba(245,158,11,0.15); color: #fbbf24; }
.b-cash      { background: rgba(16,185,129,0.12); color: #34d399; }
.b-upi       { background: rgba(59,130,246,0.12); color: #60a5fa; }
.b-card      { background: rgba(124,58,237,0.12); color: #c4b5fd; }

/* ========================
   BUTTONS
   ======================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r); font-size: 13px;
  font-weight: 600; border: none; transition: var(--t);
  white-space: nowrap; outline: none; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  color: white; box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 7px 22px var(--primary-glow); filter: brightness(1.1); }
.btn-secondary {
  background: var(--glass-bg); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: var(--border); color: var(--text-primary); border-color: var(--border-hover); }
.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white; box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 7px 22px rgba(16,185,129,0.4); }
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white; box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 7px 22px rgba(239,68,68,0.4); }
.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white; box-shadow: 0 4px 15px rgba(245,158,11,0.3);
}
.btn-warning:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-info {
  background: linear-gradient(135deg, var(--info), #2563eb);
  color: white; box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.btn-info:hover { transform: translateY(-1px); }
.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white; box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover { transform: translateY(-1px); box-shadow: 0 7px 22px rgba(37,211,102,0.4); }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--text-accent); background: var(--primary-light); }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.btn-icon-sm { width: 28px; height: 28px; font-size: 12px; border-radius: var(--r-xs); }

/* ========================
   FORMS
   ======================== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 11.5px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-control, .form-select {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 13px; color: var(--text-primary);
  font-size: 13.5px; outline: none; transition: var(--t);
}
.form-control:focus, .form-select:focus {
  border-color: var(--border-active);
  background: rgba(124,58,237,0.08);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
.form-select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  background-size: 15px; padding-right: 34px; cursor: pointer;
}
.form-select option { background: var(--bg-elevated); color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .form-control { padding-left: 38px; }
.ig-icon { position: absolute; left: 12px; color: var(--text-muted); font-size: 13px; pointer-events: none; }
.ig-suffix { position: absolute; right: 12px; color: var(--text-muted); font-size: 12px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.form-check label { font-size: 13px; color: var(--text-secondary); cursor: pointer; }

/* ========================
   MODALS
   ======================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; visibility: hidden;
  transition: var(--t); padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-xl); width: 100%; max-width: 540px;
  max-height: 92vh; overflow-y: auto;
  transform: scale(0.92) translateY(16px);
  transition: var(--t); box-shadow: var(--shadow-xl);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1000px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); font-family: 'Poppins', sans-serif; }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); background: none; border: none;
  color: var(--text-muted); transition: var(--t); font-size: 16px;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ========================
   TABS
   ======================== */
.tabs {
  display: flex; gap: 3px; padding: 4px;
  background: rgba(255,255,255,0.03); border-radius: var(--r-sm);
  border: 1px solid var(--border); margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  flex: 1; min-width: fit-content; padding: 8px 16px;
  border-radius: var(--r-xs); border: none; background: none;
  color: var(--text-muted); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: var(--t); white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.tab-btn.active { background: var(--primary); color: white; box-shadow: 0 2px 10px var(--primary-glow); }
.tab-btn:hover:not(.active) { color: var(--text-primary); background: var(--glass-bg); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

/* ========================
   DROPDOWN
   ======================== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 7px; min-width: 180px;
  box-shadow: var(--shadow-xl); z-index: 2000;
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: var(--t);
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-secondary); font-size: 13px;
  cursor: pointer; transition: var(--t-fast);
  border: none; background: none; width: 100%; text-align: left;
  font-family: 'Inter', sans-serif;
}
.dropdown-item:hover { background: var(--glass-bg); color: var(--text-primary); }
.dropdown-item.di-danger { color: var(--danger); }
.dropdown-item.di-danger:hover { background: var(--danger-light); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }

/* ========================
   FILTERS BAR
   ======================== */
.filters-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.filter-sel {
  background: var(--glass-bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 30px 8px 12px;
  color: var(--text-secondary); font-size: 12.5px;
  font-family: 'Inter', sans-serif; outline: none; cursor: pointer;
  transition: var(--t); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 13px;
}
.filter-sel:focus { border-color: var(--border-active); }
.filter-sel option { background: var(--bg-elevated); color: var(--text-primary); }
.search-bar { position: relative; flex: 1; max-width: 280px; }
.search-bar input {
  width: 100%; background: var(--glass-bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 12px 8px 32px;
  color: var(--text-primary); font-size: 13px; outline: none; transition: var(--t);
  font-family: 'Inter', sans-serif;
}
.search-bar input:focus { border-color: var(--border-active); }
.search-bar i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; }
.filter-tag { margin-left: auto; font-size: 12px; color: var(--text-muted); }

/* ========================
   PAGINATION
   ======================== */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 5px; padding: 14px 20px; border-top: 1px solid var(--border); }
.page-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--glass-bg); color: var(--text-secondary);
  font-size: 12px; cursor: pointer; transition: var(--t-fast);
  font-family: 'Inter', sans-serif;
}
.page-btn:hover, .page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-info { font-size: 12px; color: var(--text-muted); margin-right: auto; }

/* ========================
   QUICK ACTIONS
   ======================== */
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.qa-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--r-lg);
  background: var(--glass-bg); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: var(--t);
  font-size: 13px; font-weight: 500; text-decoration: none;
}
.qa-btn:hover { border-color: var(--border-active); background: var(--primary-light); color: var(--text-primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.qa-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* ========================
   PROGRESS
   ======================== */
.progress { height: 6px; background: rgba(255,255,255,0.06); border-radius: var(--r-full); overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--primary), var(--indigo));
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.progress-bar.green { background: linear-gradient(90deg, var(--success), #059669); }
.progress-bar.gold  { background: linear-gradient(90deg, var(--secondary), #d97706); }

/* ========================
   ALERTS
   ======================== */
.alert {
  padding: 12px 16px; border-radius: var(--r-sm);
  border-left: 3px solid; font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--success-light); border-color: var(--success); color: #34d399; }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: #f87171; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #fbbf24; }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: #60a5fa; }

/* ========================
   TOAST NOTIFICATIONS
   ======================== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 13px 16px;
  display: flex; align-items: center; gap: 12px;
  min-width: 260px; max-width: 360px;
  box-shadow: var(--shadow-xl);
  animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
  border-left: 3px solid var(--primary);
}
.t-success { border-left-color: var(--success); }
.t-error   { border-left-color: var(--danger); }
.t-warning { border-left-color: var(--warning); }
.toast i   { font-size: 17px; }
.t-success i { color: var(--success); }
.t-error i   { color: var(--danger); }
.t-warning i { color: var(--warning); }
.toast span  { font-size: 13px; color: var(--text-primary); font-weight: 500; flex: 1; }

/* ========================
   EMPTY STATE
   ======================== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 44px; margin-bottom: 14px; opacity: 0.35; display: block; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ========================
   SECTION LABEL
   ======================== */
.section-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted);
  padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 7px;
}

/* ========================
   LOGIN PAGE
   ======================== */
.login-page {
  min-height: 100vh; background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 80% at 20% 50%, rgba(124,58,237,0.16) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(59,130,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 60% 80%, rgba(16,185,129,0.08) 0%, transparent 50%);
}
.login-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}
.login-card {
  position: relative; z-index: 10;
  width: 100%; max-width: 420px;
  background: rgba(11, 17, 32, 0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xl); padding: 42px 40px;
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: slideUp 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.login-logo {
  display: flex; flex-direction: column;
  align-items: center; gap: 14px; margin-bottom: 34px;
}
.login-logo-icon {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: white;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 0 50px rgba(124,58,237,0.45), 0 8px 30px rgba(0,0,0,0.4);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%,100% { box-shadow: 0 0 50px rgba(124,58,237,0.45), 0 8px 30px rgba(0,0,0,0.4); }
  50%      { box-shadow: 0 0 70px rgba(124,58,237,0.65), 0 8px 30px rgba(0,0,0,0.4); }
}
.login-logo h1 { font-size: 20px; font-weight: 800; color: var(--text-primary); font-family: 'Poppins', sans-serif; }
.login-logo p  { font-size: 12px; color: var(--text-muted); margin-top: -8px; }
.login-divider { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 22px; }
.login-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  color: white; border: none; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: var(--t); font-family: 'Inter', sans-serif;
  box-shadow: 0 6px 24px var(--primary-glow); margin-top: 8px;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 35px rgba(124,58,237,0.55); filter: brightness(1.08); }
.login-footer { text-align: center; margin-top: 22px; font-size: 11.5px; color: var(--text-muted); }

/* ========================
   STAFF CARDS
   ======================== */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 20px; }
.staff-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 24px; transition: var(--t);
  position: relative; overflow: hidden;
}
.staff-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--indigo));
}
.staff-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-hover); }
.staff-avatar {
  width: 58px; height: 58px; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: white; margin-bottom: 14px;
}
.staff-name { font-size: 15px; font-weight: 700; color: var(--text-primary); font-family: 'Poppins', sans-serif; }
.staff-role { font-size: 11.5px; color: var(--text-muted); margin-bottom: 16px; }
.staff-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.staff-stat { background: rgba(255,255,255,0.03); border-radius: var(--r-sm); padding: 10px 12px; text-align: center; }
.ssv { font-size: 20px; font-weight: 800; color: var(--text-primary); font-family: 'Poppins', sans-serif; }
.ssl { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ========================
   INVOICE STYLES
   ======================== */
.invoice-wrap { background: var(--bg-elevated); border-radius: var(--r-lg); overflow: hidden; }
.invoice-preview {
  background: white; color: #1a1a2e; min-height: 600px;
  border-radius: var(--r); margin: 20px; padding: 40px;
  font-family: 'Inter', Arial, sans-serif; font-size: 13px;
}
.inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px solid #f0f0f0; }
.inv-brand h2 { font-size: 22px; font-weight: 800; color: #7c3aed; margin-bottom: 4px; font-family: 'Poppins', Arial, sans-serif; }
.inv-brand p  { font-size: 12px; color: #64748b; line-height: 1.7; margin: 0; }
.inv-meta { text-align: right; }
.inv-no   { font-size: 22px; font-weight: 800; color: #1a1a2e; font-family: 'Poppins', sans-serif; }
.inv-date { font-size: 12px; color: #64748b; margin-top: 4px; }
.inv-tag  { display: inline-block; margin-top: 8px; background: #f3e8ff; color: #7c3aed; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.inv-party h4 { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 8px; font-weight: 700; }
.inv-party .pname { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 3px; }
.inv-party p { font-size: 12px; color: #374151; line-height: 1.6; margin: 0; }
.inv-table table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.inv-table thead th { background: #7c3aed; color: white; padding: 9px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.inv-table tbody tr:nth-child(even) { background: #f8f9ff; }
.inv-table tbody td { padding: 10px 12px; color: #374151; border-bottom: 1px solid #e5e7eb; }
.inv-totals { margin-left: auto; width: 240px; }
.inv-tr { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: #374151; border-bottom: 1px solid #e5e7eb; }
.inv-tr:last-child { border: none; }
.inv-tr.grand { font-size: 16px; font-weight: 800; color: #7c3aed; padding-top: 10px; }
.inv-tr.balance-due { color: #ef4444; font-weight: 700; }
.inv-tr.advance { color: #10b981; }
.inv-footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid #e5e7eb; text-align: center; font-size: 12px; color: #94a3b8; }
.inv-footer strong { color: #7c3aed; }

/* ========================
   MEASUREMENT FORM
   ======================== */
.meas-form { display: flex; gap: 22px; align-items: flex-start; }
.body-illus { flex-shrink: 0; width: 150px; }
.body-illus svg { width: 100%; height: auto; }
.meas-inputs { flex: 1; }
.meas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mf { display: flex; flex-direction: column; gap: 4px; }
.mf label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.mf input {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: 7px 10px;
  color: var(--text-primary); font-size: 13px; outline: none; transition: var(--t);
  font-family: 'Inter', sans-serif;
}
.mf input:focus { border-color: var(--border-active); background: var(--primary-light); }

/* ========================
   REPORTS
   ======================== */
.report-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg); overflow: hidden; }
.report-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.report-title { font-size: 14px; font-weight: 700; color: var(--text-primary); font-family: 'Poppins', sans-serif; }
.export-btns { display: flex; gap: 8px; }

/* Settings */
.settings-sec { margin-bottom: 28px; }
.settings-sec-title { font-size: 13px; font-weight: 700; color: var(--text-primary); padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-family: 'Poppins', sans-serif; }
.settings-sec-title i { color: var(--text-accent); }

/* ========================
   ANIMATIONS / KEYFRAMES
   ======================== */
@keyframes fadeIn   { from { opacity:0; transform: translateY(8px); }  to { opacity:1; transform: translateY(0); } }
@keyframes slideUp  { from { opacity:0; transform: translateY(24px); } to { opacity:1; transform: translateY(0); } }
@keyframes toastIn  { from { opacity:0; transform: translateX(100px); } to { opacity:1; transform: translateX(0); } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes pulse    { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
@keyframes shimmer  { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.fade-in { animation: fadeIn 0.3s ease both; }
.stagger > *:nth-child(1) { animation: slideUp 0.35s ease 0.05s both; }
.stagger > *:nth-child(2) { animation: slideUp 0.35s ease 0.10s both; }
.stagger > *:nth-child(3) { animation: slideUp 0.35s ease 0.15s both; }
.stagger > *:nth-child(4) { animation: slideUp 0.35s ease 0.20s both; }
.stagger > *:nth-child(5) { animation: slideUp 0.35s ease 0.25s both; }
.stagger > *:nth-child(6) { animation: slideUp 0.35s ease 0.30s both; }
.stagger > *:nth-child(7) { animation: slideUp 0.35s ease 0.35s both; }
.stagger > *:nth-child(8) { animation: slideUp 0.35s ease 0.40s both; }

.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-sm);
}

/* ========================
   UTILITIES
   ======================== */
.d-flex  { display: flex; }
.d-grid  { display: grid; }
.d-none  { display: none !important; }
.align-center { align-items: center; }
.just-between { justify-content: space-between; }
.just-center  { justify-content: center; }
.flex-wrap    { flex-wrap: wrap; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.mt-0{margin-top:0} .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-0{margin-bottom:0} .mb-2{margin-bottom:8px} .mb-3{margin-bottom:12px} .mb-4{margin-bottom:16px} .mb-6{margin-bottom:24px}
.p-0{padding:0} .p-3{padding:12px} .p-4{padding:16px} .p-5{padding:20px}
.text-left{text-align:left} .text-center{text-align:center} .text-right{text-align:right}
.text-primary-c { color: var(--text-primary) !important; }
.text-secondary-c { color: var(--text-secondary) !important; }
.text-muted-c  { color: var(--text-muted) !important; }
.text-accent-c { color: var(--text-accent) !important; }
.text-success-c{ color: var(--success) !important; }
.text-danger-c { color: var(--danger) !important; }
.text-warning-c{ color: var(--warning) !important; }
.text-info-c   { color: var(--info) !important; }
.fw-bold    { font-weight: 700; }
.fw-semi    { font-weight: 600; }
.fw-normal  { font-weight: 400; }
.fs-11{font-size:11px} .fs-12{font-size:12px} .fs-13{font-size:13px} .fs-14{font-size:14px} .fs-16{font-size:16px} .fs-20{font-size:20px}
.font-mono  { font-family: 'Courier New', monospace; }
.font-poppins { font-family: 'Poppins', sans-serif; }
.w-100 { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sidebar overlay for mobile */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }
.sidebar-overlay.active { display: block; }

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2,1fr); }
  .g-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 992px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main-content { margin-left: 0 !important; }
  .g-2   { grid-template-columns: 1fr; }
  .g-2-1 { grid-template-columns: 1fr; }
  .g-3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .stats-grid  { grid-template-columns: repeat(2,1fr); }
  .form-row    { grid-template-columns: 1fr; }
  .form-row-3  { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 14px; }
  .topnav-search { display: none; }
  .g-3   { grid-template-columns: 1fr; }
  .staff-grid { grid-template-columns: 1fr; }
  .meas-form  { flex-direction: column; }
  .body-illus { display: none; }
  .inv-parties { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; max-width: 95vw; }
  .form-row-3 { grid-template-columns: 1fr; }
  .quick-actions { gap: 8px; }
  .qa-btn { padding: 10px 14px; font-size: 12px; }
}

/* ========================
   PRINT STYLES
   ======================== */
@media print {
  .sidebar,.topnav,.page-header,.invoice-actions,.no-print,.topnav { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .invoice-preview { margin: 0; border-radius: 0; }
  body { background: white; color: black; }
  .page-content { padding: 0; }
}
