/* ===========================
   AURA HELPDESK — BRAND COLORS
   Primary   : #9FA1FF (violet)
   Light     : #B5BAFF (soft violet)
   Accent    : #AEE2FF (sky blue)
   Success   : #D9F9DF (mint green)
   Background: #0C0E1F (deep navy)
   =========================== */
:root {
  --primary: #2563EB;
  --primary-light: #60A5FA;
  --primary-dark: #1D4ED8;
  --accent: #06B6D4;
  --accent2: #4F46E5;
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-soft: rgba(37,99,235,0.12);
  --blue-soft2: rgba(37,99,235,0.08);
  --orange: #F59E0B;
  --green: #10B981;
  --green-text: #059669;
  --red: #EF4444;
  --ink: #111827;
  --ink2: #374151;
  --muted: #6B7280;
  --line: rgba(0,0,0,0.1);
  --line2: rgba(0,0,0,0.05);
  --bg: #FFFFFF;
  --bg2: #F3F4F6;
  --bg3: #E5E7EB;
  --card: #FFFFFF;
  --card2: #F9FAFB;
  --shadow: 0 4px 20px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-glow: 0 0 16px rgba(37,99,235,0.15);
  --grad: linear-gradient(135deg, #2563EB, #06B6D4);
  --grad2: linear-gradient(135deg, #2563EB, #4F46E5);
  --grad3: linear-gradient(135deg, #06B6D4, #10B981);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;
}

.dark-theme {
  --primary: #3B82F6;
  --primary-light: #60A5FA;
  --primary-dark: #2563EB;
  --accent: #22D3EE;
  --accent2: #818CF8;
  --blue: #3B82F6;
  --blue-dark: #2563EB;
  --blue-soft: rgba(59,130,246,0.15);
  --blue-soft2: rgba(59,130,246,0.08);
  --orange: #FBBF24;
  --green: #34D399;
  --green-text: #10B981;
  --red: #F87171;
  --ink: #F9FAFB;
  --ink2: #E5E7EB;
  --muted: #9CA3AF;
  --line: rgba(255,255,255,0.1);
  --line2: rgba(255,255,255,0.05);
  --bg: #111827;
  --bg2: #1F2937;
  --bg3: #374151;
  --card: #1F2937;
  --card2: #374151;
  --shadow: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 24px rgba(59,130,246,0.18);
}

/* =================== RESET =================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; transition: all .2s; }
.hidden { display: none !important; }

/* =================== UTILS =================== */
.eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.muted { color: var(--muted); }

/* =================== LOGIN SCREEN =================== */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--bg);
}

.login-brand {
  background: var(--bg);
  color: var(--ink);
  padding: 10vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.login-brand::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--blue-soft) 0%, transparent 65%);
  border-radius: 50%;
  right: -200px; top: -150px;
  pointer-events: none;
}

.login-brand::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--blue-soft2) 0%, transparent 65%);
  border-radius: 50%;
  left: -150px; bottom: -100px;
  pointer-events: none;
}

.logo-mark {
  width: 42px; height: 42px;
  background: var(--blue-soft);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  position: relative;
  overflow: hidden;
}
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.logo-mark.large { width: 68px; height: 68px; border-radius: 20px; font-size: 38px; margin-bottom: 28px; }

.login-brand h1 {
  font: 800 clamp(36px, 4.5vw, 64px)/1.1 'Inter';
  margin: 10px 0 18px;
  max-width: 680px;
  letter-spacing: -2px;
  color: var(--ink);
}

.login-brand > p:not(.eyebrow) {
  font-size: 17px;
  line-height: 1.75;
  max-width: 560px;
  color: var(--muted);
}

.login-metrics {
  display: flex;
  gap: 36px;
  margin-top: 52px;
}
.login-metrics div { display: flex; flex-direction: column; gap: 4px; }
.login-metrics strong {
  font: 800 22px 'Inter';
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-metrics span { font-size: 12px; color: var(--muted); }

/* LOGIN PANEL (right side) */
.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background: var(--bg2);
}

.login-card {
  width: min(420px, 100%);
  background: var(--card);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.login-card h2 { font: 800 26px 'Inter'; margin: 5px 0 0; color: var(--ink); }

.login-card label, .form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 18px;
  color: var(--ink2);
}

.login-card input, .form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  background: var(--bg3);
  color: var(--ink);
  outline: none;
  transition: all .25s;
}
.login-card input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(159,161,255,0.15);
  background: var(--card2);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  font-size: 12px;
  color: var(--muted);
}
.form-row a { color: var(--primary); text-decoration: none; font-weight: 700; }
.form-row a:hover { color: var(--primary-light); }

.check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  margin: 0 !important;
  gap: 8px;
}

.demo-hint {
  text-align: center;
  background: var(--blue-soft);
  color: var(--primary-light);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  margin-top: 20px;
  border: 1px solid rgba(159,161,255,0.2);
}

.mobile-logo { display: none; }

/* =================== BUTTONS =================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn.primary {
  background: var(--grad2);
  color: #fff;
  box-shadow: 0 8px 28px rgba(159,161,255,0.35);
}
.btn.primary:hover { opacity: .88; transform: translateY(-1px); box-shadow: 0 12px 32px rgba(159,161,255,0.45); }

.btn.ghost {
  background: var(--blue-soft2);
  border: 1px solid var(--line);
  color: var(--ink2);
}
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--blue-soft); }

.btn.danger {
  background: rgba(255,123,123,0.1);
  border: 1px solid rgba(255,123,123,0.2);
  color: var(--red);
}
.btn.danger:hover { background: rgba(255,123,123,0.2); }

.btn.wide { width: 100%; margin-top: 10px; }

/* =================== APP LAYOUT =================== */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

/* =================== SIDEBAR =================== */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--line);
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand div:last-child { display: flex; flex-direction: column; }
.brand strong { font: 800 17px 'Inter'; color: var(--ink); }
.brand small { font-size: 10px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; }

.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar nav p {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 800;
  margin: 20px 12px 6px;
  text-transform: uppercase;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  transition: all .18s;
}
.nav-item span { font-size: 17px; width: 20px; text-align: center; }
.nav-item:hover { background: var(--blue-soft2); color: var(--ink2); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(159,161,255,0.18), rgba(174,226,255,0.1));
  color: var(--primary);
  font-weight: 700;
  border: 1px solid rgba(159,161,255,0.2);
  box-shadow: var(--shadow-glow);
}
.nav-item b {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
}

/* Support Card */
.support-card {
  margin-top: auto;
  background: linear-gradient(135deg, rgba(159,161,255,0.15), rgba(174,226,255,0.08));
  border: 1px solid rgba(159,161,255,0.2);
  border-radius: 16px;
  color: var(--ink);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}
.support-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(174,226,255,0.1), transparent);
  pointer-events: none;
}
.support-card div { font-size: 22px; }
.support-card strong { color: var(--primary-light); }
.support-card span { color: var(--muted); }
.support-card button {
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  padding: 9px;
  background: var(--grad2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(159,161,255,0.3);
}

/* Profile */
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding: 16px 8px 0;
  font-size: 12px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid rgba(159,161,255,0.25);
}
.profile div:nth-child(2) { display: flex; flex-direction: column; }
.profile strong { color: var(--ink); }
.profile span { color: var(--muted); font-size: 10px; }

/* =================== TOPBAR =================== */
.topbar {
  height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(19,21,46,0.85);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
}

.search-wrap {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  width: min(480px, 50vw);
  color: var(--muted);
  transition: all .2s;
  gap: 8px;
}
.search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(159,161,255,0.12);
  background: var(--card2);
}
.search-wrap input {
  border: 0;
  background: transparent;
  outline: none;
  padding: 12px 0;
  width: 100%;
  font-size: 13px;
  color: var(--ink);
}
.search-wrap input::placeholder { color: var(--muted); }

kbd {
  font-size: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  white-space: nowrap;
  font-family: monospace;
  font-weight: 600;
  color: var(--muted);
}

.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: all .2s;
}
.icon-btn:hover { color: var(--primary); border-color: rgba(159,161,255,0.4); background: var(--blue-soft); }
.notification { position: relative; }
.notification b {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  right: 8px; top: 8px;
  border: 2px solid var(--card);
}
.menu-btn { display: none; }

/* =================== CONTENT =================== */
.content { padding: 28px 32px; max-width: 1600px; margin: auto; }

.bottom-nav { display: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-head h1 { font: 800 26px 'Inter'; margin: 0 0 5px; letter-spacing: -.5px; color: var(--ink); }
.page-head p { font-size: 13px; color: var(--muted); margin: 0; }
.page-actions { display: flex; gap: 12px; }

/* =================== METRICS =================== */
.metrics {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.metric {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .25s;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow), var(--shadow-glow); border-color: rgba(159,161,255,0.3); }
.metric::after {
  content: '';
  position: absolute;
  height: 3px;
  left: 0; right: 0; bottom: 0;
  background: var(--grad);
  border-radius: 0 0 4px 4px;
}
.metric::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(159,161,255,0.06), transparent);
}
.metric .metric-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 16px;
  border: 1px solid rgba(159,161,255,0.2);
}
.metric strong {
  font: 800 26px 'Inter';
  display: block;
  margin-top: 14px;
  white-space: nowrap;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.metric span { font-size: 11px; color: var(--muted); display: block; margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

/* =================== CARDS =================== */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; margin-bottom: 22px; }
.grid-even { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .2s;
}
.card:hover { border-color: rgba(159,161,255,0.25); }

.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(159,161,255,0.03);
}
.card-head h3 { font: 800 14px 'Inter'; margin: 0; color: var(--ink); }
.card-head p { font-size: 11px; color: var(--muted); margin: 4px 0 0; }

.link-btn { border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 700; }
.link-btn:hover { color: var(--primary-light); }
.link-btn.danger { color: var(--red); }

/* =================== TABLE =================== */
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.data-table th {
  text-align: left;
  background: rgba(159,161,255,0.04);
  color: var(--muted);
  padding: 13px 18px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--line2); white-space: nowrap; color: var(--ink2); }
.data-table tbody tr { transition: all .15s; }
.data-table tbody tr:hover { background: rgba(159,161,255,0.04); }
.data-table strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.sub { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }

/* =================== BADGES =================== */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: var(--blue-soft);
  color: var(--primary-light);
}
.badge.Open         { background: rgba(159,161,255,0.1);  color: #B5BAFF; }
.badge.Assigned     { background: rgba(174,226,255,0.1);  color: #AEE2FF; }
.badge.In-Progress  { background: rgba(255,213,128,0.1);  color: #FFD580; }
.badge.Waiting-for-Parts,
.badge.On-Hold      { background: rgba(255,183,107,0.1);  color: #FFB76B; }
.badge.Completed,
.badge.Closed,
.badge.Paid,
.badge.Active,
.badge.Available    { background: rgba(217,249,223,0.12); color: #D9F9DF; }
.badge.Emergency,
.badge.Renewal-Due,
.badge.Pending      { background: rgba(255,123,123,0.1);  color: #FF7B7B; }

/* =================== PRIORITY =================== */
.priority { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.priority::before { content: ''; width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--muted); }
.priority.High::before,
.priority.Emergency::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
.priority.Medium::before    { background: var(--orange); }

/* =================== CHARTS =================== */
.chart { height: 200px; padding: 24px; display: flex; align-items: flex-end; gap: 10px; }
.bar {
  flex: 1;
  background: var(--grad);
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 10px;
  transition: all .3s;
  opacity: 0.8;
}
.bar:hover { opacity: 1; }
.bar:hover::after {
  content: attr(data-value);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  background: var(--card2);
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.donut-wrap { padding: 28px; display: flex; align-items: center; justify-content: center; gap: 36px; }
.donut {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: conic-gradient(#9FA1FF 0 37%, #AEE2FF 37% 61%, #D9F9DF 61% 78%, rgba(159,161,255,0.15) 78%);
  position: relative;
}
.donut::after {
  content: '';
  position: absolute;
  inset: 32px;
  background: var(--card);
  border-radius: 50%;
  box-shadow: inset 0 4px 12px rgba(0,0,0,.3);
}
.legend { font-size: 11px; font-weight: 600; display: flex; flex-direction: column; gap: 12px; color: var(--ink2); }
.legend span { display: flex; align-items: center; }
.legend span::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--color);
  margin-right: 8px;
}

/* =================== LISTS =================== */
.list { padding: 8px 22px 22px; }
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line2);
  font-size: 12px;
}
.list-item:last-child { border: 0; }
.list-item > div:nth-child(2) { flex: 1; }
.list-item .avatar { width: 40px; height: 40px; font-size: 14px; border-radius: 14px; }
.list-item strong { display: block; font-size: 13px; margin-bottom: 2px; color: var(--ink); }
.list-item span { color: var(--muted); font-size: 11px; }

.progress { height: 5px; background: rgba(159,161,255,0.1); border-radius: 6px; margin-top: 7px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad3); border-radius: 6px; }

/* =================== TOOLBAR =================== */
.toolbar {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(159,161,255,0.02);
}
.toolbar input, .toolbar select {
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  outline: none;
  transition: all .2s;
}
.toolbar input:focus, .toolbar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(159,161,255,0.12);
}
.toolbar input { min-width: 280px; }

/* =================== MISC =================== */
.empty { padding: 60px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 500; }

/* =================== TOAST =================== */
.toast {
  position: fixed;
  right: 28px; bottom: 28px;
  z-index: 9999;
  background: var(--card2);
  color: var(--ink);
  border: 1px solid var(--primary);
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 20px 50px rgba(0,0,0,.4), 0 0 20px rgba(159,161,255,0.2);
  transform: translateY(120px);
  opacity: 0;
  transition: all .35s cubic-bezier(0.4,0,0.2,1);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* =================== MODAL FORM =================== */
.form-view { animation: fadeIn .3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.modal-card { padding: 28px 28px 56px; max-width: 1600px; margin: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head p { margin: 0; }
.modal-head h2 { font-size: 26px; margin-top: 4px; letter-spacing: -.5px; color: var(--ink); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.span-2 { grid-column: span 2; }
.modal-actions {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* =================== SETTINGS =================== */
.settings-grid { align-items: start; }
.settings-form { padding: 18px; }
.settings-form .form-grid { margin-top: 12px; }
.settings-logo { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-logo > div:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 11px; }
.settings-logo span { color: var(--muted); font-size: 9px; }
.logo-preview { width: 82px; height: 82px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--bg3); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-btn { margin-top: 7px; }
.upload-btn input { display: none; }
.settings-section { padding: 4px 18px 20px; }
.toggle-list { display: flex; flex-direction: column; }
.toggle-list label { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line2); }
.toggle-list label:last-child { border: 0; }
.toggle-list div { display: flex; flex-direction: column; gap: 3px; font-size: 10px; color: var(--ink2); }
.toggle-list span { color: var(--muted); font-size: 8px; }
.toggle-list input { width: 17px; height: 17px; accent-color: var(--primary); }
.row-actions { display: inline-flex; align-items: center; gap: 3px; margin-left: 5px; }
.row-actions .link-btn { padding: 3px 5px; }

/* =================== DOCUMENT =================== */
.document-card {}
.line-editor-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; font-size: 12px; color: var(--ink2); }
.line-items { display: flex; flex-direction: column; gap: 7px; }
.line-item, .line-item-header { display: grid; grid-template-columns: 2fr 90px 80px 100px 70px 100px 35px; gap: 7px; align-items: center; }
.line-item-header { font-size: 13px; font-weight: 600; color: var(--ink-light); padding: 0 4px; margin-top: 4px; margin-bottom: -2px; }
.line-item input { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: var(--bg3); color: var(--ink); min-width: 0; }
.line-total { text-align: right; font-size: 10px; color: var(--muted); }
.document-totals { display: flex; justify-content: flex-end; gap: 22px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.document-totals span { display: flex; flex-direction: column; gap: 3px; text-align: right; color: var(--muted); }
.document-totals b { font-size: 14px; color: var(--ink); }
.document-notes { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 700; margin-top: 14px; }
.document-notes textarea { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: var(--bg3); color: var(--ink); }

/* =================== DARK MODE (toggle) =================== */
.dark {
  --ink: #EEF0FF;
  --ink2: #C7CAE8;
  --muted: #7B7FA0;
  --line: rgba(159,161,255,0.15);
  --bg: #0C0E1F;
  --bg2: #10122A;
  --bg3: #161832;
  --card: #13152E;
  --card2: #1A1C38;
  --blue-soft: rgba(159,161,255,0.12);
  --blue-soft2: rgba(159,161,255,0.06);
}

/* =================== PLAN BANNER =================== */
#plan-banner {
  background: rgba(255,123,123,0.08);
  border: 1px solid rgba(255,123,123,0.2);
  color: var(--red);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 12px;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 1200px) {
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .app { grid-template-columns: 220px 1fr; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .support-card { display: none; }
}

@media (max-width: 850px) {
  .login-screen { grid-template-columns: 1fr; background: var(--bg2); }
  .login-brand { display: none; }
  .mobile-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
  .app { display: block; }
  .sidebar {
    position: fixed;
    left: -260px;
    width: 248px;
    z-index: 100;
    transition: left .25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }
  .sidebar.open { left: 0; }
  .menu-btn { display: block; }
  .topbar { padding: 0 14px; }
  .search-wrap { width: auto; flex: 1; }
  .search-wrap kbd { display: none; }
  .top-actions .icon-btn { display: none; }
  .top-actions .btn { font-size: 0; padding: 10px; }
  .top-actions .btn::after { content: '+'; font-size: 18px; }
  .content { padding: 18px 14px 80px; }
  
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg2);
    border-top: 1px solid var(--line);
    z-index: 90;
    padding: 8px 14px 12px;
    justify-content: space-between;
    backdrop-filter: blur(10px);
  }
  .bottom-nav .nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    font-size: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--muted);
  }
  .bottom-nav .nav-item span { font-size: 20px; }
  .bottom-nav .nav-item.active { color: var(--primary); background: transparent; border: none; box-shadow: none; font-weight: 800; }
  
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-even { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .page-actions .btn.ghost { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .toolbar { overflow: auto; }
  .toolbar input { min-width: 190px; }
  .login-panel { padding: 24px; background: var(--bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
  .line-item, .line-item-header { grid-template-columns: 1fr 60px 60px 70px 50px 35px; overflow-x: auto; }
  .line-total { display: none; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 28px 20px; }
}
