/* Panel + sign-in design system. No external dependencies; works offline.
   Class names follow the familiar Bootstrap vocabulary so older pages keep rendering. */

:root {
    --bg: #f3f5fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e4e8f0;
    --text: #172033;
    --muted: #64708a;
    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-soft: #eef0ff;
    --success: #0f9d6c;
    --success-soft: #e3f7ef;
    --warning: #c97a06;
    --warning-soft: #fdf1dc;
    --danger: #d93a4a;
    --danger-soft: #fde8ea;
    --info: #0b84c6;
    --info-soft: #e2f3fc;
    --sidebar: #101729;
    --sidebar-text: #aab4cc;
    --sidebar-active: #ffffff;
    --shadow: 0 1px 2px rgba(16, 23, 41, .04), 0 8px 24px rgba(16, 23, 41, .06);
    --radius: 14px;
    --radius-sm: 9px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
    --bg: #0c111d;
    --surface: #141b2b;
    --surface-2: #19223a;
    --border: #26314b;
    --text: #e6eaf5;
    --muted: #93a0bd;
    --primary: #818cf8;
    --primary-600: #6d77f0;
    --primary-soft: #232a52;
    --success: #34d399;
    --success-soft: #11342b;
    --warning: #fbbf24;
    --warning-soft: #3a2c0d;
    --danger: #fb7185;
    --danger-soft: #401a22;
    --info: #38bdf8;
    --info-soft: #10314a;
    --sidebar: #0a0f1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 650; line-height: 1.25; color: var(--text); }
h1 { font-size: 1.55rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.12rem; } h4 { font-size: 1rem; } h5, h6 { font-size: .92rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
small, .small { font-size: .84em; }
code, pre, kbd { font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: .08em .38em; }
pre { background: #0f172a; color: #e2e8f0; border-radius: var(--radius-sm); padding: 14px 16px; overflow: auto; margin: 0 0 1rem; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
.icon { flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ------------------------------------------------------------------ shell */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    background: var(--sidebar); color: var(--sidebar-text); position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; overflow-y: auto; z-index: 40;
}
.sidebar::-webkit-scrollbar { width: 6px; } .sidebar::-webkit-scrollbar-thumb { background: #2a3552; border-radius: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand img { max-height: 30px; max-width: 120px; border-radius: 6px; background: #fff; padding: 2px; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #6366f1, #22d3ee); display: grid; place-items: center; color: #fff; font-weight: 800; }
.nav-section { padding: 16px 20px 6px; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: #6b7794; font-weight: 700; }
.nav-link {
    display: flex; align-items: center; gap: 11px; margin: 1px 10px; padding: 9px 11px; border-radius: 10px;
    color: var(--sidebar-text); font-weight: 500; font-size: .92rem;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.active { background: linear-gradient(90deg, rgba(99, 102, 241, .95), rgba(79, 70, 229, .8)); color: var(--sidebar-active); box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
.nav-link .pill { margin-left: auto; background: #ef4444; color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 7px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 14px 18px 18px; font-size: .76rem; color: #5d6988; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 26px;
    background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 650; font-size: 1.02rem; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    display: inline-grid; place-items: center; cursor: pointer; padding: 0;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); }
.user-chip:hover { text-decoration: none; border-color: var(--primary); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.user-chip small { display: block; color: var(--muted); line-height: 1.1; }
.user-chip strong { display: block; line-height: 1.2; font-size: .86rem; }
.menu-toggle { display: none; }
.content { padding: 24px 26px 48px; width: 100%; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backdrop { display: none; }

@media (max-width: 991px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: 0; width: 268px; transform: translateX(-100%); transition: transform .2s ease; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(8, 12, 22, .5); z-index: 35; }
    .menu-toggle { display: inline-grid; }
    .topbar { padding: 10px 14px; }
    .content { padding: 16px 14px 40px; }
    .user-chip span.meta { display: none; }
    .user-chip { padding: 4px; }
}

/* ------------------------------------------------------------------- grid */
.row { display: flex; flex-wrap: wrap; margin: 0 -9px; }
.row > * { padding: 0 9px; width: 100%; min-width: 0; }
.col { flex: 1 0 0; width: auto; }
.col-6 { width: 50%; } .col-12 { width: 100%; }
@media (min-width: 576px) { .col-sm-6 { width: 50%; } .col-sm-4 { width: 33.3333%; } .col-sm-12 { width: 100%; } }
@media (min-width: 768px) {
    .col-md-1 { width: 8.3333%; } .col-md-2 { width: 16.6667%; } .col-md-3 { width: 25%; } .col-md-4 { width: 33.3333%; }
    .col-md-5 { width: 41.6667%; } .col-md-6 { width: 50%; } .col-md-7 { width: 58.3333%; } .col-md-8 { width: 66.6667%; }
    .col-md-9 { width: 75%; } .col-md-10 { width: 83.3333%; } .col-md-11 { width: 91.6667%; } .col-md-12 { width: 100%; }
}
@media (min-width: 1100px) {
    .col-lg-2 { width: 16.6667%; } .col-lg-3 { width: 25%; } .col-lg-4 { width: 33.3333%; } .col-lg-5 { width: 41.6667%; }
    .col-lg-6 { width: 50%; } .col-lg-7 { width: 58.3333%; } .col-lg-8 { width: 66.6667%; } .col-lg-9 { width: 75%; } .col-lg-12 { width: 100%; }
}
.grid { display: grid; gap: 18px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-plans { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: stretch; }

/* ------------------------------------------------------------------ cards */
.card, .ibox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.grid > .card { margin-bottom: 0; }
.card-header, .ibox-head { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-header h2, .card-header h3, .card-title, .ibox-title { margin: 0; font-size: 1rem; font-weight: 650; }
.card-header p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.card-body, .ibox-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); }
.card-flush .table { margin: 0; }

.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin-top: 2px; word-break: break-word; }
.stat-sub { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.up { color: var(--success); } .down { color: var(--danger); }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px;
    padding: 8px 15px; font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.35; cursor: pointer; white-space: nowrap;
    background: var(--surface-2); color: var(--text); transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); filter: none; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: #f59e0b; color: #1f1300; }
.btn-info { background: var(--info); color: #fff; }
.btn-secondary, .btn-light, .btn-default { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline-primary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-success { background: transparent; border-color: var(--success); color: var(--success); }
.btn-outline-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-outline-secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn-link { background: none; color: var(--primary); padding-left: 4px; padding-right: 4px; }
.btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: 11px 20px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ forms */
.form-group, .mb-form { margin-bottom: 15px; }
label, .form-label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--text); }
.form-control, .form-select, select.form-control, textarea.form-control {
    display: block; width: 100%; padding: 9px 12px; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px; transition: border-color .12s, box-shadow .12s; min-height: 40px;
}
textarea.form-control { min-height: 96px; resize: vertical; }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.form-control[readonly], .form-control:disabled { background: var(--surface-2); color: var(--muted); }
.form-control-sm { padding: 6px 10px; min-height: 34px; font-size: .86rem; }
.form-text, .help { display: block; color: var(--muted); font-size: .8rem; margin-top: 5px; font-weight: 400; }
.input-group { display: flex; }
.input-group .form-control { border-radius: 10px 0 0 10px; }
.input-group .btn, .input-group-text { border-radius: 0 10px 10px 0; border: 1px solid var(--border); border-left: 0; }
.input-group-text { display: inline-flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); }
.input-group .input-group-text:first-child { border-radius: 10px 0 0 10px; border-left: 1px solid var(--border); border-right: 0; }
.input-group .input-group-text:first-child + .form-control { border-radius: 0 10px 10px 0; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; margin: 0; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 40px; height: 22px; border-radius: 999px; background: #cbd3e1; position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .form-group { margin: 0; min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.filters .grow { flex: 2 1 220px; max-width: none; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 12px; font-weight: 700; }

/* ----------------------------------------------------------------- tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; margin-bottom: 0; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover, .table tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.table-bordered { border: 1px solid var(--border); }
.table-sm th, .table-sm td { padding: 8px 12px; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.num, .text-right { text-align: right; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .86em; }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* -------------------------------------------------------- badges / alerts */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; border: 0; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-secondary { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.alert { padding: 12px 15px; border-radius: 11px; border: 1px solid transparent; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-danger, .alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }
.alert > div { color: var(--text); }
.alert strong { color: inherit; }

/* ---------------------------------------------------- tabs / pagination */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 14px 16px; }
.page-link { padding: 6px 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); font-size: .86rem; font-weight: 600; }
.page-link:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.disabled { opacity: .45; }
.page-gap { color: var(--muted); }
.table-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }
.table-meta .count { padding: 14px 16px; }

/* ------------------------------------------------------------------ misc */
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; margin-bottom: 10px; opacity: .6; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 9px 14px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field input { font-family: ui-monospace, Consolas, monospace; font-size: .86rem; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.progress.warn > span { background: #f59e0b; } .progress.bad > span { background: var(--danger); }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 230px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.check-list { list-style: none; padding: 0; margin: 0 0 16px; }
.check-list li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.check-list li small { margin-left: auto; color: var(--muted); text-align: right; }
.check-list li.ok .icon { color: var(--success); } .check-list li.bad .icon { color: var(--danger); } .check-list li.bad span { color: var(--danger); font-weight: 600; }
.check-list li.warn .icon { color: var(--warning); }

.plan-card { display: flex; flex-direction: column; padding: 22px; position: relative; }
.plan-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.plan-card.current { border-color: var(--success); box-shadow: 0 0 0 1px var(--success), var(--shadow); }
.plan-flag { position: absolute; top: 14px; right: 14px; }
.plan-name { font-size: 1.05rem; font-weight: 700; }
.plan-price { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 0; line-height: 1.1; }
.plan-price small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.plan-fee { color: var(--primary); font-weight: 650; margin-top: 4px; font-size: .92rem; }
.plan-desc { color: var(--muted); margin: 8px 0 0; font-size: .88rem; min-height: 1.2em; }
.plan-features { list-style: none; padding: 0; margin: 16px 0 20px; display: grid; gap: 8px; font-size: .9rem; }
.plan-features li { display: flex; gap: 9px; align-items: flex-start; }
.plan-features .icon { color: var(--success); margin-top: 2px; }
.plan-card .btn { margin-top: auto; }

.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 15px; border-radius: 11px; box-shadow: var(--shadow); font-weight: 500; font-size: .9rem; animation: rise .18s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-back { position: fixed; inset: 0; background: rgba(8, 12, 22, .55); z-index: 90; display: none; align-items: flex-start; justify-content: center; padding: 6vh 14px; overflow-y: auto; }
.modal-back.open { display: flex; }
.modal-box { background: var(--surface); border-radius: 16px; border: 1px solid var(--border); width: 100%; max-width: 520px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.modal-box.wide { max-width: 720px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.editor-toolbar button { border: 1px solid transparent; background: none; color: var(--text); border-radius: 7px; padding: 5px 9px; cursor: pointer; font: inherit; font-weight: 600; font-size: .85rem; }
.editor-toolbar button:hover { background: var(--surface); border-color: var(--border); }
.editor-area { min-height: 340px; border: 1px solid var(--border); border-radius: 0 0 10px 10px; padding: 16px 18px; background: var(--surface); overflow: auto; font-size: 1rem; line-height: 1.7; }
.editor-area:focus { outline: none; border-color: var(--primary); }
.editor-area img { border-radius: 10px; }
.editor-area blockquote { border-left: 3px solid var(--primary); margin: 1em 0; padding: .2em 1em; color: var(--muted); }

/* ------------------------------------------------------------- sign-in */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 28px 14px; background:
    radial-gradient(900px 500px at 10% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%),
    radial-gradient(700px 420px at 100% 110%, color-mix(in srgb, #22d3ee 18%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 30px 28px; box-shadow: 0 24px 60px rgba(16, 23, 41, .12); }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-weight: 750; font-size: 1.12rem; color: var(--text); }
.auth-logo img { max-height: 38px; max-width: 150px; }
.auth-title { font-size: 1.4rem; margin-bottom: 4px; }
.auth-sub { color: var(--muted); margin-bottom: 22px; }
.auth-foot { text-align: center; color: var(--muted); margin: 18px 0 0; font-size: .9rem; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.3rem; font-weight: 700; }

/* ------------------------------------------------------------ utilities */
.d-none { display: none !important; } .d-flex { display: flex !important; } .d-block { display: block !important; } .d-inline-flex { display: inline-flex !important; }
.flex-wrap { flex-wrap: wrap; } .flex-column { flex-direction: column; } .flex-1 { flex: 1 1 0; min-width: 0; }
.align-items-center { align-items: center; } .align-items-end { align-items: flex-end; } .align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; } .justify-content-end { justify-content: flex-end; } .justify-content-center { justify-content: center; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.w-100 { width: 100%; } .mx-auto { margin-left: auto; margin-right: auto; } .ml-auto, .ms-auto { margin-left: auto; }
.m-0 { margin: 0 !important; } .mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .mt-5 { margin-top: 36px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; } .mb-5 { margin-bottom: 36px; }
.mr-1, .me-1 { margin-right: 4px; } .mr-2, .me-2 { margin-right: 8px; } .ml-1, .ms-1 { margin-left: 4px; } .ml-2, .ms-2 { margin-left: 8px; }
.p-0 { padding: 0 !important; } .p-2 { padding: 8px; } .p-3 { padding: 16px; } .p-4 { padding: 24px; }
.text-center { text-align: center; } .text-left { text-align: left; }
.text-muted { color: var(--muted) !important; } .text-primary { color: var(--primary) !important; } .text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; } .text-warning { color: var(--warning) !important; } .text-info { color: var(--info) !important; }
.fw-bold, .font-strong, .font-weight-bold { font-weight: 700; } .fw-normal { font-weight: 400; }
.nowrap { white-space: nowrap; } .break { word-break: break-all; }
.float-end, .pull-right { float: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* -------------------------------------------- older theme class names */
.page-heading { margin-bottom: 18px; }
.page-title { font-size: 1.45rem; margin: 0; }
.breadcrumb { display: none; }
.page-content, .main-panel, .content .container-fluid { min-width: 0; }
.fade-in-up { animation: rise .2s ease; }
.color-white { color: #fff; } .color-white h2, .color-white .m-b-5 { color: #fff; }
.bg-success { background: var(--success) !important; } .bg-info { background: var(--info) !important; }
.bg-warning { background: #f59e0b !important; } .bg-danger { background: var(--danger) !important; } .bg-primary { background: var(--primary) !important; }
.widget-stat { position: relative; overflow: hidden; }
.widget-stat-icon { position: absolute; right: 16px; top: 16px; opacity: .5; }
.m-b-5 { margin-bottom: 5px; } .m-t-20 { margin-top: 20px; } .m-b-20 { margin-bottom: 20px; } .m-r-5 { margin-right: 5px; } .m-l-5 { margin-left: 5px; }
.font-20 { font-size: 20px; }

@media print {
    .sidebar, .topbar, .page-actions, .filters, .no-print, .toast-wrap { display: none !important; }
    .app { display: block; } .content { padding: 0; max-width: none; }
    body { background: #fff; } .card { box-shadow: none; border-color: #ccc; }
}
