/* =========================================================================
   Asterisk Panel — design system
   A clean, modern admin theme. Tokens first, then components.
   ========================================================================= */

:root {
    /* Brand + accent */
    --brand-50:  #eef4ff;
    --brand-100: #dbe6ff;
    --brand-200: #bfd3ff;
    --brand-300: #93b4ff;
    --brand-400: #608dff;
    --brand-500: #3b66f5;
    --brand-600: #274ee0;
    --brand-700: #1f3dc0;
    --brand-800: #1e349b;
    --brand-900: #1d2f7a;

    --accent-500: #7c5cff;
    --success-500: #16a34a;
    --success-100: #dcfce7;
    --warning-500: #d97706;
    --warning-100: #fef3c7;
    --danger-500: #dc2626;
    --danger-100: #fee2e2;
    --info-500: #0284c7;
    --info-100: #e0f2fe;

    /* Neutrals */
    --gray-25:  #fcfcfd;
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Semantic surfaces */
    --bg:            var(--gray-50);
    --surface:       #ffffff;
    --surface-alt:   var(--gray-50);
    --border:        var(--gray-200);
    --border-strong: var(--gray-300);
    --text:          var(--gray-800);
    --text-muted:    var(--gray-500);
    --text-faint:    var(--gray-400);

    /* Layout */
    --sidebar-w: 250px;
    --topbar-h: 60px;
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
    --shadow-focus: 0 0 0 3px rgba(59, 102, 245, .25);

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

/* Dark theme */
[data-theme="dark"] {
    --bg:            #0b1120;
    --surface:       #111a2e;
    --surface-alt:   #16203a;
    --border:        #22304d;
    --border-strong: #31405f;
    --text:          #e6edf7;
    --text-muted:    #93a3bd;
    --text-faint:    #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 14px rgba(0,0,0,.45);
    --shadow-lg: 0 16px 40px rgba(0,0,0,.55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; color: var(--gray-900); }
[data-theme="dark"] h1,[data-theme="dark"] h2,[data-theme="dark"] h3,[data-theme="dark"] h4 { color: var(--text); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0 0 12px; }
a  { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
button { font-family: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.code-block {
    margin: 12px 0 0;
    padding: 14px 16px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    color: var(--text);
    font: 12px/1.6 var(--mono);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-w);
    transition: margin-left .22s ease;
}
.app-shell.sidebar-collapsed .main { margin-left: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #101a33 0%, #0c1428 100%);
    color: #c7d2e6;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform .22s ease;
    border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 11px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
    display: grid; place-items: center;
    font-weight: 800; color: #fff; font-size: 16px;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    box-shadow: 0 4px 12px rgba(59,102,245,.35);
}
.brand-mark.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; margin: 0 auto 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.brand-text strong { color: #fff; font-size: 14.5px; font-weight: 650; white-space: nowrap; }
.brand-text span { font-size: 11px; color: #7d8db0; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; margin: 1px 0;
    border-radius: var(--radius-sm);
    color: #b6c3dc; font-size: 13.5px; font-weight: 500;
    transition: background .14s ease, color .14s ease;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.is-active {
    background: linear-gradient(90deg, rgba(59,102,245,.28), rgba(59,102,245,.08));
    color: #fff;
    box-shadow: inset 2px 0 0 var(--brand-400);
}
.nav-icon { display: inline-flex; width: 18px; height: 18px; flex: 0 0 18px; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { white-space: nowrap; overflow: hidden; }

.nav-children { margin: 2px 0 6px 30px; display: flex; flex-direction: column; }
.nav-child {
    padding: 6px 10px; font-size: 12.5px; color: #93a3bd;
    border-left: 1px solid rgba(255,255,255,.1); margin: 1px 0;
}
.nav-child:hover { color: #fff; text-decoration: none; }
.nav-child.is-active { color: #fff; border-left-color: var(--brand-400); }

.sidebar-footer { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-meta { font-size: 11px; color: #64748b; }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 14px;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
}
.topbar-search { flex: 1; max-width: 420px; position: relative; }
.topbar-search input {
    width: 100%; padding: 8px 12px 8px 34px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-alt); font-size: 13px; color: var(--text);
    transition: border-color .14s, box-shadow .14s;
}
.topbar-search input:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--shadow-focus); background: var(--surface); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
    width: 36px; height: 36px; display: grid; place-items: center;
    border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm);
    color: var(--text-muted); cursor: pointer; transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text); }
#sidebarToggle { display: none; }

.tenant-switch select {
    padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-alt); color: var(--text); font-size: 13px; font-weight: 500;
    cursor: pointer;
}
.tenant-badge {
    padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
    background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100);
}

.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 8px; border: 1px solid transparent; background: transparent;
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
}
.user-btn:hover { background: var(--surface-alt); }
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta strong { font-size: 13px; font-weight: 600; }
.user-meta small { font-size: 11px; color: var(--text-muted); }
.chev svg { width: 14px; height: 14px; }

.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 190px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    z-index: 50;
}
.dropdown-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 8px 10px; border: 0; background: transparent; border-radius: var(--radius-sm);
    color: var(--text); font-size: 13px; cursor: pointer; text-align: left;
}
.dropdown-item svg { width: 16px; height: 16px; }
.dropdown-item:hover { background: var(--surface-alt); text-decoration: none; }
.dropdown-item.danger { color: var(--danger-500); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }

/* ---------- Content ---------- */
.content { flex: 1; padding: 22px; max-width: 1440px; width: 100%; margin: 0 auto; }

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head .subtitle { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot {
    padding: 12px 18px; border-top: 1px solid var(--border);
    background: var(--surface-alt); display: flex; justify-content: space-between; align-items: center;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

/* ---------- Stat tiles ---------- */
.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow-xs); transition: box-shadow .16s, transform .16s;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
    width: 42px; height: 42px; border-radius: 11px; flex: 0 0 42px;
    display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand-600);
}
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.green { background: var(--success-100); color: var(--success-500); }
.stat-icon.amber { background: var(--warning-100); color: var(--warning-500); }
.stat-icon.red   { background: var(--danger-100);  color: var(--danger-500); }
.stat-icon.violet{ background: #ede9fe; color: var(--accent-500); }
.stat-body { min-width: 0; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--gray-900); }
[data-theme="dark"] .stat-value { color: var(--text); }
.stat-label { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text); font-size: 13px; font-weight: 550; cursor: pointer;
    transition: background .14s, border-color .14s, box-shadow .14s, color .14s;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn-primary {
    background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
    border-color: var(--brand-600); color: #fff;
    box-shadow: 0 1px 2px rgba(39,78,224,.3);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--brand-600), var(--brand-700)); color:#fff; }
.btn-danger { background: var(--danger-500); border-color: var(--danger-500); color: #fff; }
.btn-danger:hover { background: #b91c1c; color:#fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
[data-theme="dark"] .field > label { color: var(--text-muted); }
.field .hint { font-size: 11.5px; color: var(--text-faint); }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=url], input[type=tel], select, textarea {
    width: 100%; padding: 8px 11px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-size: 13.5px; font-family: inherit;
    transition: border-color .14s, box-shadow .14s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand-400); box-shadow: var(--shadow-focus);
}
/* Browsers paint saved credentials with their own pale autofill background.
   Match the active theme instead, including while the field is focused. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    -webkit-box-shadow: inset 0 0 0 1000px var(--surface);
    box-shadow: inset 0 0 0 1000px var(--surface);
    transition: background-color 5000s ease-in-out 0s;
}
input:-webkit-autofill:focus {
    -webkit-box-shadow: inset 0 0 0 1000px var(--surface), var(--shadow-focus);
    box-shadow: inset 0 0 0 1000px var(--surface), var(--shadow-focus);
}
input:autofill {
    color: var(--text);
    caret-color: var(--text);
    box-shadow: inset 0 0 0 1000px var(--surface);
}
input:autofill:focus {
    box-shadow: inset 0 0 0 1000px var(--surface), var(--shadow-focus);
}
textarea { min-height: 90px; resize: vertical; }
input[readonly] { background: var(--surface-alt); color: var(--text-muted); }

.check {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-alt); cursor: pointer;
}
.check input { margin: 2px 0 0; accent-color: var(--brand-600); width: 15px; height: 15px; }
.check .check-body strong { display: block; font-size: 13px; font-weight: 600; }
.check .check-body span { font-size: 11.5px; color: var(--text-muted); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    text-align: left; padding: 10px 14px; font-size: 11.5px; font-weight: 650;
    text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
    background: var(--surface-alt); border-bottom: 1px solid var(--border);
    white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-alt); }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.nowrap { white-space: nowrap; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; line-height: 1.5;
    background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--border);
}
[data-theme="dark"] .badge { background: var(--surface-alt); color: var(--text-muted); }
.badge.green  { background: var(--success-100); color: #15803d; border-color: transparent; }
.badge.amber  { background: var(--warning-100); color: #b45309; border-color: transparent; }
.badge.red    { background: var(--danger-100);  color: #b91c1c; border-color: transparent; }
.badge.blue   { background: var(--brand-100);   color: var(--brand-700); border-color: transparent; }
.badge.violet { background: #ede9fe; color: #6d28d9; border-color: transparent; }
.badge.gray   { background: var(--gray-100); color: var(--gray-600); border-color: transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Flash messages ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px;
    border: 1px solid transparent; animation: slideDown .22s ease;
}
.flash-icon { display: inline-flex; width: 17px; height: 17px; flex: 0 0 17px; }
.flash-icon svg { width: 17px; height: 17px; }
.flash-msg { flex: 1; }
.flash-close { border: 0; background: transparent; cursor: pointer; color: inherit; opacity: .55; padding: 2px; }
.flash-close:hover { opacity: 1; }
.flash-close svg { width: 15px; height: 15px; }
.flash-success { background: var(--success-100); color: #166534; border-color: #bbf7d0; }
.flash-error   { background: var(--danger-100);  color: #991b1b; border-color: #fecaca; }
.flash-warning { background: var(--warning-100); color: #92400e; border-color: #fde68a; }
.flash-info    { background: var(--info-100);    color: #075985; border-color: #bae6fd; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 32px; height: 32px; padding: 0 9px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12.5px; color: var(--text); background: var(--surface);
}
.pagination a:hover { background: var(--surface-alt); text-decoration: none; }
.pagination .current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination .disabled { opacity: .45; pointer-events: none; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-icon {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
    display: grid; place-items: center; background: var(--surface-alt); color: var(--text-faint);
}
.empty-icon svg { width: 26px; height: 26px; }
.empty h3 { color: var(--text); margin-bottom: 5px; }

/* ---------- Toolbar ---------- */
.toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.toolbar .spacer { flex: 1; }
.toolbar input[type=search], .toolbar select { max-width: 240px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tab {
    padding: 11px 14px; font-size: 13px; font-weight: 550; color: var(--text-muted);
    border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--brand-600); border-bottom-color: var(--brand-600); }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    display: grid; place-items: center; z-index: 60; padding: 20px;
    backdrop-filter: blur(2px);
}
.modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
    animation: popIn .18s ease;
}
.modal.lg { max-width: 760px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-alt); display: flex; justify-content: flex-end; gap: 9px; }
@keyframes popIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Auth screens ---------- */
.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(1100px 500px at 15% -10%, rgba(59,102,245,.18), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(124,92,255,.16), transparent 55%),
        var(--bg);
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand h1 { font-size: 21px; margin-bottom: 4px; }
.auth-brand p { color: var(--text-muted); font-size: 13px; margin: 0; }
.auth-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 26px;
    box-shadow: var(--shadow-lg);
}
.auth-footer { text-align: center; margin-top: 18px; color: var(--text-faint); font-size: 12px; }

/* ---------- Misc utilities ---------- */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.text-right { text-align: right; } .text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.copy-field { display: flex; gap: 6px; align-items: center; }
.copy-field input { font-family: var(--mono); font-size: 12px; background: var(--surface-alt); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); }
    .app-shell.sidebar-open .sidebar { transform: none; }
    .main { margin-left: 0; }
    #sidebarToggle { display: grid; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .topbar-search { display: none; }
    .user-meta { display: none; }
    .content { padding: 16px; }
}
@media (max-width: 560px) {
    .page-head { flex-direction: column; align-items: stretch; }
    .page-actions .btn { flex: 1; justify-content: center; }
}

@media print {
    .sidebar, .topbar, .page-actions, .toolbar { display: none !important; }
    .main { margin-left: 0; }
    .card { box-shadow: none; border-color: #ddd; }
}
