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

:root {
  --primary:        #1a1f36;
  --primary-light:  #2d3561;
  --accent:         #e8372a;
  --accent-light:   #ff4d3d;
  --accent-muted:   #fef2f1;
  --surface:        #ffffff;
  --surface-2:      #f8f9fc;
  --surface-3:      #f0f2f8;
  --border:         #e4e7ef;
  --border-strong:  #cdd1df;
  --text-primary:   #1a1f36;
  --text-secondary: #6b7399;
  --text-muted:     #9ba3bf;
  --sidebar-w:      260px;
  --header-h:       64px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --shadow-sm:      0 1px 3px rgba(26,31,54,.08), 0 1px 2px rgba(26,31,54,.04);
  --shadow:         0 4px 12px rgba(26,31,54,.10), 0 1px 3px rgba(26,31,54,.06);
  --shadow-lg:      0 10px 30px rgba(26,31,54,.14), 0 4px 8px rgba(26,31,54,.06);
  --green:   #059669; --green-bg:  #ecfdf5; --green-text: #065f46;
  --blue:    #2563eb; --blue-bg:   #eff6ff; --blue-text:  #1e40af;
  --amber:   #d97706; --amber-bg:  #fffbeb; --amber-text: #92400e;
  --red:     #dc2626; --red-bg:    #fef2f2; --red-text:   #991b1b;
  --purple:  #7c3aed; --purple-bg: #f5f3ff; --purple-text:#4c1d95;
  --gray:    #6b7280; --gray-bg:   #f9fafb; --gray-text:  #374151;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--surface-2);
  color: var(--text-primary);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---- LAYOUT ---- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo img { height: 32px; width: auto; }

.sidebar-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.sidebar-logo-text span {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  color: rgba(255,255,255,.45);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }

.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 18px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; }

.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.8);
  font-size: .7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); color: #fff; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  font-size: .8rem;
  transition: background .15s;
}
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}
.topbar-breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
}
.topbar-breadcrumb span { color: var(--text-primary); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 28px; flex: 1; }
.content-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.content-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem; font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.content-subtitle {
  font-size: .83rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .85rem; font-weight: 600;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); }

.btn-dark { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-dark:hover { background: var(--primary-light); }

.btn-outline {
  background: var(--surface); color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--surface-3); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text-primary); }

.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-warning { background: var(--amber); color: #fff; border-color: var(--amber); }
.btn-blue { background: var(--blue); color: #fff; border-color: var(--blue); }

.btn-sm { padding: 5px 11px; font-size: .8rem; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }
.btn-icon { padding: 8px; }

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 22px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: .95rem; font-weight: 600;
  color: var(--text-primary);
}
.card-body { padding: 20px 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.stat-card.green::before { background: var(--green); }
.stat-card.blue::before  { background: var(--blue); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.purple::before{ background: var(--purple); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  margin-bottom: 14px;
}
.stat-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
.stat-icon.red    { background: var(--red-bg);    color: var(--red); }
.stat-icon.green  { background: var(--green-bg);  color: var(--green); }
.stat-icon.blue   { background: var(--blue-bg);   color: var(--blue); }
.stat-icon.amber  { background: var(--amber-bg);  color: var(--amber); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.7rem; font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: .8rem; color: var(--text-secondary); font-weight: 500; }
.stat-change {
  font-size: .75rem; font-weight: 600;
  margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
}
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--border); }
th {
  padding: 11px 14px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 13px 14px;
  font-size: .85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.table-actions { display: flex; align-items: center; gap: 6px; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.badge-green  { background: var(--green-bg);  color: var(--green-text); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue-text); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber-text); }
.badge-red    { background: var(--red-bg);    color: var(--red-text); }
.badge-purple { background: var(--purple-bg); color: var(--purple-text); }
.badge-gray   { background: var(--gray-bg);   color: var(--gray-text); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
label .req { color: var(--accent); }

input[type=text], input[type=email], input[type=tel],
input[type=number], input[type=date], input[type=password],
input[type=url], select, textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: .87rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,55,42,.12);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24' stroke='%236b7399' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
}
textarea { resize: vertical; min-height: 90px; }

.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .75rem; color: var(--red); margin-top: 4px; }
.input-group { display: flex; gap: 0; }
.input-group input { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .btn  { border-radius: 0 var(--radius) var(--radius) 0; white-space: nowrap; }
.input-prefix {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--surface-3); border: 1.5px solid var(--border-strong);
  border-right: none; border-radius: var(--radius) 0 0 var(--radius);
  font-size: .85rem; color: var(--text-secondary); white-space: nowrap;
}
.input-prefix + input { border-radius: 0 var(--radius) var(--radius) 0; }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,31,54,.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform .2s;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1080px; }
.modal-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  background: var(--surface);
}
.modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface-3);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background .15s;
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }
.modal-close svg { width: 16px; height: 16px; stroke-width: 2.5; }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 0;
  max-height: calc(100vh - 200px);
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  flex-shrink: 0;
}

/* ---- ITEM DETAILS SUB-ROW ---- */
.item-details-row { background: var(--surface-2); }
.item-details-row > td { padding: 4px 10px 10px !important; border-bottom: 1px solid var(--border) !important; }
.item-details-row textarea {
  width: 100%;
  min-height: 50px;
  font-size: .82rem;
  resize: vertical;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
}
.item-details-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232,55,42,.12);
}
.btn-detail-toggle.has-details { color: var(--accent); }


/* ---- ALERT / TOAST ---- */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 18px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-bg); color: var(--green-text); border: 1px solid #a7f3d0; }
.alert-error   { background: var(--red-bg);   color: var(--red-text);   border: 1px solid #fecaca; }
.alert-warning { background: var(--amber-bg); color: var(--amber-text); border: 1px solid #fde68a; }
.alert-info    { background: var(--blue-bg);  color: var(--blue-text);  border: 1px solid #bfdbfe; }

#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--primary); color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: .85rem;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  max-width: 340px;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.toast.show { transform: translateX(0); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--accent); }
.toast-info    { border-left: 3px solid var(--blue); }

/* ---- SEARCH BAR ---- */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 380px;
}
.search-bar svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke-width: 2;
  color: var(--text-muted);
  pointer-events: none;
}
.search-bar input {
  padding-left: 36px;
  background: var(--surface-2);
  border-color: var(--border);
}
.search-bar input:focus { background: var(--surface); }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 30px;
  color: var(--text-secondary);
}
.empty-state svg {
  width: 52px; height: 52px;
  stroke-width: 1.2;
  color: var(--text-muted);
  margin: 0 auto 18px;
  display: block;
}
.empty-state h3 {
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 6px;
}
.empty-state p { font-size: .85rem; max-width: 320px; margin: 0 auto 18px; }

/* ---- INVOICE ITEMS TABLE ---- */
.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  background: var(--surface-2);
  padding: 9px 12px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.items-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.items-table tbody tr:last-child td { border-bottom: none; }
.item-row-drag { cursor: move; color: var(--text-muted); }
.item-row-drag svg { width: 16px; height: 16px; }

/* ---- TOTALS ---- */
.totals-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
}
.totals-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0;
  font-size: .87rem;
}
.totals-row.total {
  padding-top: 12px; margin-top: 8px;
  border-top: 2px solid var(--border-strong);
}
.totals-row.total .totals-label {
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
}
.totals-row.total .totals-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem; font-weight: 700; color: var(--primary);
}
.totals-label { color: var(--text-secondary); }
.totals-value { font-weight: 600; color: var(--text-primary); }

/* ---- CUSTOMER AVATAR ---- */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar-blue  { background: var(--blue-bg);  color: var(--blue); }
.avatar-green { background: var(--green-bg); color: var(--green); }

/* ---- MISC ---- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: .8rem; }
.font-mono { font-family: 'Space Grotesk', sans-serif; font-weight: 600; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.w-full { width: 100%; }

/* ---- LOGIN ---- */
.login-page {
  min-height: 100vh;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary);
  margin-top: 12px;
}
.login-logo p { font-size: .83rem; color: var(--text-secondary); margin-top: 4px; }
.login-brand {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px;
  background: var(--primary);
  border-radius: 16px;
}
.login-brand svg { width: 30px; height: 30px; color: #fff; stroke-width: 1.5; }

/* ---- CHART ---- */
.chart-wrap { position: relative; height: 240px; }

/* ---- PROGRESS ---- */
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }

/* ---- TABS ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab {
  padding: 10px 18px;
  font-size: .85rem; font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  cursor: pointer;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- SIDEBAR TOGGLE (mobile) ---- */
.sidebar-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}
.sidebar-toggle svg { width: 20px; height: 20px; }

/* ---- SIDEBAR OVERLAY (mobile backdrop) ---- */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 299;
  cursor: pointer;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); z-index: 300; }
  .sidebar.open { transform: translateX(0); }
  .sb-overlay.active { display: block; }
  .main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal { max-width: calc(100vw - 24px); }
  .modal-lg, .modal-xl { max-width: calc(100vw - 24px); }
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; padding: 10px 12px; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .content-header { flex-direction: column; align-items: stretch; }
  .content-header .btn { justify-content: center; }
  table { font-size: .8rem; }
  th, td { padding: 9px 8px; }
  .hide-mobile { display: none !important; }
  .modal-body { max-height: calc(100dvh - 160px); }
  #toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
}

/* ---- PRINT ---- */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin-left: 0; }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ---- DRAG HIGHLIGHT ---- */
.drag-over { background: var(--accent-muted) !important; }
.sortable-ghost { opacity: .4; }

/* ---- STATUS DOT ---- */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px;
}
.dot-green  { background: var(--green); }
.dot-blue   { background: var(--blue); }
.dot-amber  { background: var(--amber); }
.dot-red    { background: var(--red); }
.dot-gray   { background: var(--gray); }
.dot-purple { background: var(--purple); }
