/* ── RESET & ROOT ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #00aeed;
  --brand-light: #24c6ff;
  --brand-glow: rgba(0, 174, 237, 0.2);
  --bg: #060f1a;
  --bg2: #0a1628;
  --bg3: #0f1f38;
  --surface: rgba(255, 255, 255, 0.06);
  --surface2: rgba(255, 255, 255, 0.10);
  --border: rgba(0, 174, 237, 0.14);
  --text: #e8f4fd;
  --text-muted: #7ab8d4;
  --text-dim: #3d6b88;
  --sidebar-width: 240px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --success: #3ecf6e;
  --danger: #e05252;
  --warning: #f0a030;
  --info: #4a9eff;
}

/* ── LIGHT MODE ─────────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --brand: #0057b7;
  --brand-light: #0073e6;
  --brand-glow: rgba(0, 87, 183, 0.15);
  --bg: #eef3f9;
  --bg2: #ffffff;
  --bg3: #f4f7fb;
  --surface: rgba(0, 0, 0, 0.04);
  --surface2: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 87, 183, 0.12);
  --text: #0d1a26;
  --text-muted: #4a6a88;
  --text-dim: #9ab4c8;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  transition: background 0.25s, color 0.25s;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

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

/* ── SIDEBAR ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s, background 0.25s, border-color 0.25s;
}

.sidebar-logo {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
}
.sidebar-logo-img {
  width: 140px;
  height: auto;
  object-fit: contain;
  display: block;
}
/* Hide/show logo based on theme */
.sidebar-logo-img-dark  { display: block; }
.sidebar-logo-img-light { display: none; }
[data-theme="light"] .sidebar-logo-img-dark  { display: none; }
[data-theme="light"] .sidebar-logo-img-light { display: block; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-item.active {
  background: rgba(0, 174, 237, 0.14);
  color: var(--brand-light);
  font-weight: 600;
}
[data-theme="light"] .nav-item.active {
  background: rgba(0, 87, 183, 0.1);
  color: var(--brand);
}
.nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.sidebar-user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

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

/* ── TOPBAR ─────────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.25s, border-color 0.25s;
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.topbar-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-breadcrumb .sep { color: var(--text-dim); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── THEME TOGGLE ───────────────────────────────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 16px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--surface2);
  color: var(--brand-light);
  border-color: var(--brand);
}
.theme-toggle .icon-dark  { display: block; }
.theme-toggle .icon-light { display: none; }
[data-theme="light"] .theme-toggle .icon-dark  { display: none; }
[data-theme="light"] .theme-toggle .icon-light { display: block; }

/* ── PAGE CONTENT ───────────────────────────────────────────────────────────── */
.page-content {
  padding: 28px 24px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── STATS CARDS ────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: background 0.25s, border-color 0.25s;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.brand  { background: rgba(0, 174, 237, 0.12); }
.stat-icon.green  { background: rgba(62, 207, 110, 0.12); }
.stat-icon.blue   { background: rgba(74, 158, 255, 0.12); }
.stat-icon.orange { background: rgba(240, 160, 48, 0.12); }
[data-theme="light"] .stat-icon.brand { background: rgba(0, 87, 183, 0.1); }
.stat-info {}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-change {
  font-size: 11px;
  color: var(--success);
  margin-top: 2px;
}

/* ── CARDS ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: background 0.25s, border-color 0.25s;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.card-body {
  padding: 20px;
}

/* ── TABLES ─────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(0, 174, 237, 0.04); }
[data-theme="light"] tbody tr:hover { background: rgba(0, 87, 183, 0.04); }

.td-img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg3);
  display: block;
}
.td-img-placeholder {
  width: 44px; height: 44px;
  background: var(--bg3);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 20px;
}

/* ── FORMS ──────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.25s;
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-control::placeholder { color: var(--text-dim); }
textarea.form-control {
  resize: vertical;
  min-height: 90px;
}
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 34px;
}
select.form-control option { background: var(--bg2); color: var(--text); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.color-preview-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-preview {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* File upload */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.file-upload-area:hover {
  border-color: var(--brand);
  background: rgba(0, 174, 237, 0.05);
}
[data-theme="light"] .file-upload-area:hover {
  background: rgba(0, 87, 183, 0.05);
}
.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-upload-icon { font-size: 28px; margin-bottom: 8px; }
.file-upload-text { font-size: 13px; color: var(--text-muted); }
.file-upload-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.img-preview {
  max-width: 160px;
  max-height: 120px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-top: 10px;
  border: 1px solid var(--border);
}

/* ── BUTTONS ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s, transform 0.15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #0057b7 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 174, 237, 0.22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-light) 0%, #0068d6 100%);
}
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #0057b7 0%, #0040a0 100%);
  box-shadow: 0 4px 14px rgba(0, 87, 183, 0.22);
}
[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, #0068d6 0%, #0052c9 100%);
}
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface2); }
.btn-danger { background: rgba(224, 82, 82, 0.15); color: var(--danger); border: 1px solid rgba(224, 82, 82, 0.2); }
.btn-danger:hover { background: rgba(224, 82, 82, 0.25); }
.btn-success { background: rgba(62, 207, 110, 0.15); color: var(--success); border: 1px solid rgba(62, 207, 110, 0.2); }
.btn-success:hover { background: rgba(62, 207, 110, 0.25); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { background: var(--surface2); color: var(--text); }

/* ── BADGES / PILLS ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green  { background: rgba(62, 207, 110, 0.12); color: var(--success); }
.badge-red    { background: rgba(224, 82, 82, 0.12); color: var(--danger); }
.badge-orange { background: rgba(240, 160, 48, 0.12); color: var(--warning); }
.badge-blue   { background: rgba(74, 158, 255, 0.12); color: var(--info); }
.badge-gray   { background: var(--surface); color: var(--text-muted); }
.badge-brand  { background: rgba(0, 174, 237, 0.12); color: var(--brand-light); }
[data-theme="light"] .badge-brand { background: rgba(0, 87, 183, 0.1); color: var(--brand); }

/* ── ALERTS ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: rgba(62, 207, 110, 0.1); border: 1px solid rgba(62, 207, 110, 0.2); color: var(--success); }
.alert-danger  { background: rgba(224, 82, 82, 0.1); border: 1px solid rgba(224, 82, 82, 0.2); color: var(--danger); }
.alert-warning { background: rgba(240, 160, 48, 0.1); border: 1px solid rgba(240, 160, 48, 0.2); color: var(--warning); }
.alert-info    { background: rgba(74, 158, 255, 0.1); border: 1px solid rgba(74, 158, 255, 0.2); color: var(--info); }

/* ── MODAL ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s, background 0.25s;
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── PROJECT CARDS ──────────────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.25s;
}
.project-card:hover {
  border-color: rgba(0, 174, 237, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
[data-theme="light"] .project-card:hover {
  border-color: rgba(0, 87, 183, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.project-card-header {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 12px 16px;
}
.project-card-logo {
  max-width: 100%;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
.project-card-logo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 0 8px;
  line-height: 1.3;
  word-break: break-word;
}
.project-card-body {
  padding: 14px 16px;
}
.project-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.project-card-slug {
  font-size: 11px;
  color: var(--brand-light);
  font-family: monospace;
  margin-bottom: 8px;
}
.project-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}
.project-card-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── PRODUCT THUMB ──────────────────────────────────────────────────────────── */
.product-row-img {
  display: flex;
  align-items: center;
  gap: 12px;
}
.thumb {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
}
.thumb-placeholder {
  width: 48px; height: 48px;
  background: var(--bg3);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.product-name-cell {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.product-desc-cell {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── ORDER ROWS ─────────────────────────────────────────────────────────────── */
.order-items-list { font-size: 12px; color: var(--text-muted); }
.order-items-list span { display: inline-block; margin-right: 6px; }
.status-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

/* ── FILTER BAR ─────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.filter-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--brand); }

/* ── DIVIDER ────────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── EMPTY STATE ────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}
.empty-state-icon { font-size: 48px; margin-bottom: 14px; }
.empty-state p { font-size: 14px; color: var(--text-muted); }
.empty-state .btn { margin-top: 16px; }

/* ── QUICK LINKS ────────────────────────────────────────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.quick-link {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.quick-link:hover {
  background: rgba(0, 174, 237, 0.08);
  color: var(--brand-light);
  border-color: rgba(0, 174, 237, 0.3);
}
[data-theme="light"] .quick-link:hover {
  background: rgba(0, 87, 183, 0.07);
  color: var(--brand);
  border-color: rgba(0, 87, 183, 0.25);
}
.quick-link-icon { font-size: 24px; }

/* ── LOGIN PAGE ─────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-icon {
  width: 56px; height: 56px;
  background: var(--brand);
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 12px;
}
.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── HAMBURGER BUTTON ───────────────────────────────────────────────────────── */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s;
}
.hamburger:hover { background: var(--surface2); }
.hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s, width 0.25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── SIDEBAR OVERLAY ────────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 150;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hamburger visible */
  .hamburger { display: flex; }

  /* Sidebar — hidden off-screen, above overlay */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.6);
  }

  /* Main content fills full width */
  .main-wrap { margin-left: 0; }

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-center { flex: 1; min-width: 0; }
  .topbar-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-breadcrumb { display: none; }
  .topbar-actions .btn-secondary { display: none; }

  /* Page content */
  .page-content { padding: 14px 12px; }

  /* Page header — stack on mobile */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 10px;
  }
  .page-header > *:last-child { width: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
  .page-title { font-size: 18px; }

  /* Stats — 2 columns */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 9px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  /* Cards */
  .card-header { padding: 12px 14px; }
  .card-body { padding: 14px; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }
  .form-control { font-size: 16px; } /* prevents iOS zoom on focus */

  /* Tables — scroll horizontally */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
  }
  table { min-width: 480px; }
  tbody td { padding: 10px 10px; }
  thead th { padding: 8px 10px; }

  /* Buttons — bigger touch targets */
  .btn { padding: 10px 18px; min-height: 40px; }
  .btn-sm { padding: 8px 12px; font-size: 12px; min-height: 34px; }

  /* Tab nav — horizontal scroll */
  .tab-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
    gap: 6px;
  }
  .tab-nav::-webkit-scrollbar { display: none; }
  .tab-btn { flex-shrink: 0; padding: 8px 14px; font-size: 12px; }

  /* Project info card */
  .project-info-card { padding: 14px; gap: 10px; }
  .project-info-card h2 { font-size: 17px; }

  /* Filter bar */
  .filter-bar { flex-direction: column; gap: 10px; }
  .filter-group { flex: unset; width: 100%; }
  .filter-select, .filter-input { width: 100%; }

  /* Quick actions in card-header */
  .card-header { flex-wrap: wrap; gap: 8px; }
}

/* Very small screens */
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 20px; }
}

/* ── UTILITIES ──────────────────────────────────────────────────────────────── */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-mono { font-family: monospace; }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.flex-wrap { flex-wrap: wrap; }
.text-dim { color: var(--text-dim); }

/* ── PROJECT VIEW TABS ──────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 9px 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--brand) 0%, #0057b7 100%);
  border-color: var(--brand);
  color: #fff;
}
[data-theme="light"] .tab-btn.active {
  background: linear-gradient(135deg, #0057b7 0%, #0040a0 100%);
  border-color: #0057b7;
}
.tab-btn:hover:not(.active) {
  background: var(--surface2);
  border-color: rgba(0, 174, 237, 0.25);
  color: var(--text);
}

/* ── PROJECT INFO CARD ──────────────────────────────────────────────────────── */
.project-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.project-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.project-info-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}
.project-info-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 4px 0 0;
}

/* ── PRODUCT THUMB (inline) ─────────────────────────────────────────────────── */
.product-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
