/* ── Theme Variables ─────────────────────────────────────────────── */
:root {
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --radius: 10px;
  --transition: .2s ease;
}

[data-theme="dark"] {
  --bg:       #0f172a;
  --surface:  #1e293b;
  --surface2: #273549;
  --border:   #334155;
  --text:     #e2e8f0;
  --text2:    #94a3b8;
  --accent:   #3b82f6;
  --accent-h: #2563eb;
  --success:  #22c55e;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --sidebar-bg: #0f172a;
  --topbar-bg:  #1e293b;
}

[data-theme="light"] {
  --bg:       #f1f5f9;
  --surface:  #ffffff;
  --surface2: #f8fafc;
  --border:   #e2e8f0;
  --text:     #0f172a;
  --text2:    #64748b;
  --accent:   #2563eb;
  --accent-h: #1d4ed8;
  --success:  #16a34a;
  --warning:  #d97706;
  --danger:   #dc2626;
  --sidebar-bg: #1e3a5f;
  --topbar-bg:  #ffffff;
}

/* ── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

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

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

.sidebar-brand .brand-sub {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
  display: block;
}

.sidebar-user {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .9rem;
  flex-shrink: 0;
}

.sidebar-user .user-info { overflow: hidden; }
.sidebar-user .user-name { font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: .72rem; color: rgba(255,255,255,.5); }

.sidebar-nav { padding: 10px 0; flex: 1; }

.nav-section-title {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 12px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.nav-item.active {
  background: rgba(59,130,246,.15);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

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

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Theme Toggle ────────────────────────────────────────────────── */
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .85rem;
  color: var(--text);
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); }

/* ── Page Content ────────────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--accent); }
.card-header { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: .95rem; font-weight: 600; }

/* ── Stat Cards ──────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.stat-icon.blue  { background: rgba(59,130,246,.15);  color: #3b82f6; }
.stat-icon.green { background: rgba(34,197,94,.15);   color: #22c55e; }
.stat-icon.amber { background: rgba(245,158,11,.15);  color: #f59e0b; }
.stat-icon.red   { background: rgba(239,68,68,.15);   color: #ef4444; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text2); margin-top: 2px; }

/* ── Table ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th {
  padding: 11px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text2);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: .83rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary  { background: var(--accent);  color: #fff; }
.btn-primary:hover  { background: var(--accent-h); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-outline  { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost    { background: transparent; border-color: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-icon { padding: 7px; border-radius: 7px; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .8rem; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: .87rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-blue   { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-green  { background: rgba(34,197,94,.15);   color: #4ade80; }
.badge-amber  { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-red    { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-gray   { background: rgba(148,163,184,.15); color: #94a3b8; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.3);  color: var(--success); }
.alert-danger  { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: var(--danger); }
.alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: var(--warning); }
.alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: var(--accent); }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 800px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 1.2rem; }

/* ── Tabs ────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: .85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Misc ────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.text-muted { color: var(--text2); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent  { color: var(--accent); }
.font-bold    { font-weight: 700; }
.font-mono    { font-family: monospace; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Login Page ──────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .logo-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
  display: block;
}
.login-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
}
.login-logo p {
  color: var(--text2);
  font-size: .82rem;
  margin-top: 4px;
}

/* ── Wizard Steps ────────────────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  gap: 0;
}
.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.wizard-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
  position: absolute;
  right: -50%;
  top: 16px;
  width: 100%;
  z-index: 0;
}
.wizard-step.done::after  { background: var(--success); }
.wizard-step.active::after { background: var(--border); }
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  background: var(--surface);
  z-index: 1;
  flex-shrink: 0;
}
.wizard-step.active .step-circle  { border-color: var(--accent); color: var(--accent); }
.wizard-step.done   .step-circle  { border-color: var(--success); background: var(--success); color: #fff; }
.step-label { font-size: .78rem; color: var(--text2); }
.wizard-step.active .step-label   { color: var(--accent); font-weight: 600; }
.wizard-step.done   .step-label   { color: var(--success); }

/* ── Image Preview ───────────────────────────────────────────────── */
.img-preview { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }

/* ── Option Card (Wizard) ────────────────────────────────────────── */
.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.option-card:hover     { border-color: var(--accent); }
.option-card.selected  { border-color: var(--accent); background: rgba(59,130,246,.07); }
.option-card.conflict  { opacity: .4; pointer-events: none; }

/* ── Search Box ──────────────────────────────────────────────────── */
.search-box {
  position: relative;
  flex: 1;
}
.search-box input { padding-left: 36px; }
.search-box .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text2);
  font-size: .9rem;
  pointer-events: none;
}

/* ── Mobile ──────────────────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .main-wrap { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
  .modal { padding: 20px; }
  table { font-size: .78rem; }
  td, th { padding: 9px 10px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
}

/* ── Misc utils ──────────────────────────────────────────────────── */
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; display: block; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.balance-positive { color: var(--danger); }
.balance-negative { color: var(--success); }
.balance-zero     { color: var(--text2); }

/* ── CSS Variable Aliases ─────────────────────────────────────────── */
/* Templates use --surface-2, --text-muted; CSS defines --surface2, --text2 */
[data-theme="dark"] {
  --surface-2: #273549;
  --text-muted: #94a3b8;
}
[data-theme="light"] {
  --surface-2: #f8fafc;
  --text-muted: #64748b;
}

/* ── Class Aliases (template vs CSS name mismatches) ─────────────── */
/* nav-link = nav-item */
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active {
  background: rgba(59,130,246,.15);
  color: #fff;
  border-left-color: var(--accent);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-label { font-size: .85rem; }

/* sidebar-logo = sidebar-brand */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo-text {
  font-size: 1.1rem; font-weight: 700; color: #fff; display: block;
}
.sidebar-logo-img { max-height: 48px; object-fit: contain; }

/* Sidebar user section overrides */
.sidebar-user { margin-top: auto; }
.sidebar-user-link {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; text-decoration: none;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.sidebar-user-name { font-size: .82rem; font-weight: 600; color: #fff; }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-role { font-size: .72rem; }

/* modal-box = modal inner container */
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Modal visibility: hidden by default, shown with .active */
.modal-overlay { display: none; }
.modal-overlay.active { display: flex; }

/* card-body and card-footer */
.card-body { padding: 20px; }
.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* step-item = wizard-step, step-connector = the line */
.step-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; position: relative;
}
.step-connector {
  flex: 1; height: 2px; background: var(--border); margin: 0 4px; margin-bottom: 20px;
  transition: background var(--transition);
}
.step-item.done .step-connector { background: var(--success); }
.step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  background: var(--surface); color: var(--text2);
  transition: all var(--transition);
}
.step-item.active .step-circle { border-color: var(--accent); color: var(--accent); }
.step-item.done .step-circle { border-color: var(--success); background: var(--success); color: #fff; }
.step-label { font-size: .78rem; color: var(--text2); white-space: nowrap; }
.step-item.active .step-label { color: var(--accent); font-weight: 600; }
.step-item.done .step-label { color: var(--success); }

/* search-box as input directly (not wrapper) */
input.search-box {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .85rem;
  width: 100%;
}
input.search-box:focus { outline: none; border-color: var(--accent); }

/* Sidebar open on mobile */
.sidebar.sidebar-open { transform: translateX(0); }
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 99;
}
.overlay.overlay-active { display: block; }

/* Main content layout (no .app-layout wrapper in templates) */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: 24px;
}
.container { max-width: 1400px; margin: 0 auto; }

/* Topbar */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 90;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.page-title { font-size: 1rem; font-weight: 600; }

@media (max-width: 768px) {
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
}


/* ── Mobile: collapse all inline grid layouts ───────────────────── */
@media (max-width: 640px) {
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-column:1/-1"] {
    grid-column: 1 / -1 !important;
  }
  .wizard-steps {
    flex-wrap: wrap;
    gap: 8px;
  }
  .step-connector { display: none; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 0; }
}

/* ── Responsive column helpers ──────────────────────────────────── */
.col-show-sm { display: none; }
@media (max-width: 640px) {
  .col-hide-sm { display: none; }
  .col-show-sm { display: block; }
}

/* ── Mobile optimizations ────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Topbar: compact */
  .topbar { padding: 0 10px; }
  .topbar-right { gap: 2px; }
  .topbar-profile { display: none; }   /* accessible via sidebar */
  .page-title { font-size: .88rem; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Language flags: smaller */
  .lang-btn { font-size: 12px !important; padding: 3px 5px !important; }

  /* btn-icon: tighter */
  .btn-icon { padding: 5px; }

  /* Main content: less wasted space */
  .main-content { padding: 10px; }

  /* Table: compact rows */
  td, th { padding: 6px 6px; }
  table  { font-size: .78rem; min-width: 0; }

  /* Action button groups in tables: icon-only on mobile */
  .btn-sm { padding: 4px 7px; font-size: .72rem; }
  td .btn-text { display: none; }
  td:first-child { word-break: break-word; }
  .badge { white-space: nowrap; }

  /* Cards */
  .card { padding: 14px; }

  /* Stats grid 1 col on very small */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Search + action row: stack on mobile */
  .page-toolbar { flex-direction: column; align-items: stretch !important; }
  .page-toolbar .search-box { max-width: 100% !important; }
}
