/* ==========================================================================
   SelfSig Admin — design system
   Sections: 1 Tokens · 2 Base · 3 Brand · 4 Shell/Sidebar · 5 Topbar
             6 Page head · 7 Alerts · 8 Stats · 9 Panels & tables
             10 Badges & media · 11 Buttons · 12 Forms · 13 Pagination
             14 Auth · 15 Utilities · 16 Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    /* Brand (pulled straight from the SelfSig logo) */
    --navy-900: #0A1830;
    --navy-800: #0F2444;
    --navy-700: #16325C;
    --navy-600: #1E4478;
    --blue-600: #2166B8;
    --blue-500: #2D7DD2;
    --blue-100: #E4EFFB;
    --green-600: #349A3E;
    --green-500: #3FAE49;
    --green-100: #E4F5E6;
    --teal-500: #17A2B8;
    --amber-500: #F7B32B;
    --amber-100: #FDF1D7;
    --orange-500: #F0722F;
    --red-500: #E24B3B;
    --red-100: #FCE7E4;
    --purple-500: #8E5EC1;
    --rainbow: linear-gradient(90deg, #E24B3B, #F0722F, #F7B32B, #3FAE49, #17A2B8, #2D7DD2, #8E5EC1);

    /* Surfaces & text */
    --bg: #F2F5FA;
    --surface: #FFFFFF;
    --surface-2: #F8FAFD;
    --text: #12294D;
    --text-soft: #4A5B75;
    --muted: #7C8AA0;
    --line: #E4EAF2;
    --line-strong: #D3DCE8;

    /* Shape & motion */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(16, 36, 68, .06);
    --shadow: 0 6px 20px rgba(16, 36, 68, .07);
    --shadow-lg: 0 18px 45px rgba(16, 36, 68, .14);
    --ease: 180ms cubic-bezier(.4, 0, .2, 1);

    --sidebar-w: 268px;
    --sidebar-w-collapsed: 78px;
    --topbar-h: 68px;

    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--navy-700); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; }
img { max-width: 100%; }
svg.icon { flex: 0 0 auto; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124, 138, 160, .35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 138, 160, .6); }

:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; border-radius: 6px; }

/* 3. Brand ----------------------------------------------------------------- */
.brand { align-items: center; display: inline-flex; gap: 10px; min-width: 0; }
.brand__lockup { display: block; height: 52px; width: auto; }
.brand__mark { display: none; height: 40px; width: auto; }
.brand--sm .brand__lockup { height: 94px; }
.brand--lg .brand__lockup { height: 104px; }

/* Collapsed sidebar: swap the wide lockup for the square mark. */
.is-collapsed .sidebar .brand__lockup { display: none; }
.is-collapsed .sidebar .brand__mark { display: block; }

/* 4. Shell & sidebar ------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 55%, #12294D 100%);
    color: #E6ECF6;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: width var(--ease);
    width: var(--sidebar-w);
    z-index: 40;
}
.sidebar::after {
    background: var(--rainbow);
    content: "";
    opacity: .9;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 3px;
}

.sidebar__head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: var(--topbar-h);
    padding: 16px;
}
.sidebar__toggle {
    align-items: center;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: #E6ECF6;
    cursor: pointer;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    transition: background var(--ease), color var(--ease);
    width: 34px;
}
.sidebar__toggle:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.sidebar__nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 6px 12px 18px;
}
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); }
.sidebar__nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .32); }

.nav-group { margin-bottom: 18px; }
.nav-group__label {
    color: rgba(230, 236, 246, .45);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    margin: 0 0 8px 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-link {
    align-items: center;
    border-radius: var(--radius);
    color: rgba(230, 236, 246, .78);
    display: flex;
    font-size: 13.5px;
    font-weight: 600;
    gap: 12px;
    margin-bottom: 3px;
    padding: 10px 12px;
    position: relative;
    transition: background var(--ease), color var(--ease);
    white-space: nowrap;
}
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.is-active { background: linear-gradient(90deg, rgba(45, 125, 210, .32), rgba(63, 174, 73, .18)); color: #fff; }
.nav-link.is-active::before {
    background: var(--green-500);
    border-radius: 0 4px 4px 0;
    content: "";
    height: 20px;
    left: -12px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
}
.nav-link__label { overflow: hidden; text-overflow: ellipsis; }
.nav-link__badge {
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
    padding: 1px 8px;
}

.sidebar__foot { border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 16px; }
.sidebar__user {
    align-items: center;
    border-radius: var(--radius);
    display: flex;
    gap: 11px;
    margin-bottom: 10px;
    min-width: 0;
    padding: 6px;
    position: relative;
    transition: background var(--ease);
}
a.sidebar__user:hover { background: rgba(255, 255, 255, .08); }
.sidebar__user-meta { display: grid; min-width: 0; }
.sidebar__user-name { color: #fff; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-mail { color: rgba(230, 236, 246, .55); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logout-btn {
    align-items: center;
    background: rgba(226, 75, 59, .14);
    border: 1px solid rgba(226, 75, 59, .3);
    border-radius: var(--radius);
    color: #FFC7C0;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    gap: 10px;
    padding: 10px 12px;
    position: relative;
    transition: background var(--ease), color var(--ease);
    width: 100%;
}
.logout-btn:hover { background: rgba(226, 75, 59, .28); color: #fff; }

/* Collapsed state */
.is-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.is-collapsed .sidebar .brand__text,
.is-collapsed .nav-link__label,
.is-collapsed .nav-link__badge,
.is-collapsed .sidebar__user-meta,
.is-collapsed .logout-btn span { display: none; }
.is-collapsed .nav-group__label { display: none; }
.is-collapsed .nav-group { border-top: 1px solid rgba(255, 255, 255, .08); margin-bottom: 10px; padding-top: 10px; }
.is-collapsed .nav-group:first-child { border-top: 0; padding-top: 0; }
.is-collapsed .sidebar__head { justify-content: center; padding: 14px 8px; }
.is-collapsed .sidebar__head { flex-direction: column; gap: 12px; padding: 14px 8px 10px; }
.is-collapsed .nav-link,
.is-collapsed .logout-btn { justify-content: center; padding-left: 10px; padding-right: 10px; }
.is-collapsed .sidebar__user { justify-content: center; }
.is-collapsed .sidebar__nav { padding-left: 10px; padding-right: 10px; }

/* Tooltip for collapsed items */
.is-collapsed .nav-link[data-tip]:hover::after,
.is-collapsed .logout-btn[data-tip]:hover::after {
    background: var(--navy-900);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: #fff;
    content: attr(data-tip);
    font-size: 12px;
    font-weight: 600;
    left: calc(100% + 12px);
    padding: 6px 10px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    z-index: 60;
}

.sidebar__scrim { display: none; }

/* 5. Topbar ---------------------------------------------------------------- */
.app { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 14px;
    height: var(--topbar-h);
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar__burger {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    display: none;
    height: 38px;
    justify-content: center;
    width: 38px;
}
.breadcrumb { align-items: center; color: var(--muted); display: flex; font-size: 12.5px; font-weight: 600; gap: 7px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue-600); }
.breadcrumb__current { color: var(--text); }

.topbar__spacer { flex: 1 1 auto; }
.topbar__actions { align-items: center; display: flex; gap: 10px; }

.icon-btn {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text-soft);
    cursor: pointer;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    position: relative;
    transition: background var(--ease), color var(--ease), border-color var(--ease);
    width: 38px;
}
.icon-btn:hover { background: var(--blue-100); border-color: #C9DEF6; color: var(--blue-600); }
.icon-btn__dot { background: var(--red-500); border: 2px solid #fff; border-radius: 50%; height: 9px; position: absolute; right: 8px; top: 7px; width: 9px; }

.avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--blue-500), var(--green-500));
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    letter-spacing: .02em;
    width: 38px;
}
.avatar--sm { font-size: 11px; height: 30px; width: 30px; }
.avatar--lg { font-size: 24px; height: 72px; width: 72px; }
.profile-card { display: grid; gap: 4px; justify-items: center; padding: 8px 0 18px; text-align: center; }
.profile-card h3 { margin-top: 8px; }
.profile-card .badge { margin-top: 8px; }

.userbox { position: relative; }
.userbox__trigger {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    gap: 9px;
    padding: 4px 12px 4px 4px;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.userbox__trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.userbox__name { color: var(--text); font-size: 13px; font-weight: 700; }
.userbox__menu {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    min-width: 230px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 50;
}
.userbox.is-open .userbox__menu { display: block; }
.userbox__head { border-bottom: 1px solid var(--line); margin-bottom: 6px; padding: 8px 10px 12px; }
.userbox__head strong { display: block; font-size: 13.5px; }
.userbox__head span { color: var(--muted); font-size: 12px; word-break: break-all; }
.userbox__item {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-weight: 600;
    gap: 10px;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}
.userbox__item:hover { background: var(--surface-2); }
.userbox__item--danger { color: var(--red-500); }
.userbox__item--danger:hover { background: var(--red-100); }

/* 6. Page head ------------------------------------------------------------- */
.content { flex: 1 1 auto; padding: 26px; }

.page-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 22px;
}
.page-head__title { align-items: center; display: flex; gap: 14px; min-width: 0; }
.page-head__icon {
    align-items: center;
    background: linear-gradient(135deg, var(--navy-800), var(--blue-600));
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(33, 102, 184, .28);
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    height: 46px;
    justify-content: center;
    width: 46px;
}
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; max-width: 70ch; }
.page-head__actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }

.footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; justify-content: space-between; padding: 16px 26px; }

/* 7. Alerts ---------------------------------------------------------------- */
.alert {
    align-items: flex-start;
    border: 1px solid transparent;
    border-radius: var(--radius);
    display: flex;
    font-weight: 600;
    gap: 11px;
    margin-bottom: 18px;
    padding: 13px 15px;
}
.alert__body { flex: 1 1 auto; }
.alert__list { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }
.alert--success { background: var(--green-100); border-color: #BFE5C4; color: #1E6B2A; }
.alert--danger { background: var(--red-100); border-color: #F5C4BE; color: #9E2B1D; }
.alert--info { background: var(--blue-100); border-color: #C6DDF7; color: var(--navy-700); }
.alert__close { background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; padding: 0; }
.alert__close:hover { opacity: 1; }

/* 8. Stats ----------------------------------------------------------------- */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 22px; }

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: 18px;
    position: relative;
    transition: box-shadow var(--ease), transform var(--ease);
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
a.stat { color: inherit; display: block; }
a.stat:hover { border-color: #C9DEF6; color: inherit; }
a.stat .stat__hint { display: inline-flex; align-items: center; gap: 5px; }
.stat::before { content: ""; height: 3px; left: 0; position: absolute; right: 0; top: 0; background: var(--blue-500); }
.stat--green::before { background: var(--green-500); }
.stat--amber::before { background: var(--amber-500); }
.stat--purple::before { background: var(--purple-500); }
.stat--teal::before { background: var(--teal-500); }
.stat--orange::before { background: var(--orange-500); }
.stat--red::before { background: var(--red-500); }
.stat--navy::before { background: var(--navy-700); }

.stat__top { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.stat__label { color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.stat__icon {
    align-items: center;
    background: var(--blue-100);
    border-radius: 12px;
    color: var(--blue-600);
    display: inline-flex;
    flex: 0 0 auto;
    height: 40px;
    justify-content: center;
    width: 40px;
}
.stat--green .stat__icon { background: var(--green-100); color: var(--green-600); }
.stat--amber .stat__icon { background: var(--amber-100); color: #B0790B; }
.stat--purple .stat__icon { background: #F0E9F9; color: var(--purple-500); }
.stat--teal .stat__icon { background: #DDF3F6; color: #0E7C8D; }
.stat--orange .stat__icon { background: #FDEADF; color: #C4551D; }
.stat--red .stat__icon { background: var(--red-100); color: #B93425; }
.stat--navy .stat__icon { background: #E7EDF6; color: var(--navy-700); }
.stat__value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 12px; }
.stat__hint { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* 9. Panels & tables ------------------------------------------------------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}
.panel__head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 16px 18px;
}
.panel__title { align-items: center; display: flex; font-size: 15px; font-weight: 700; gap: 9px; line-height: 1.3; }
.panel__head > div { min-width: 0; }
.panel__title .icon { color: var(--blue-500); }
.panel__subtitle { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 2px; }
.panel__body { padding: 18px; }
.panel__foot { border-top: 1px solid var(--line); padding: 14px 18px; }

.panel__tools { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }

.segmented {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: inline-flex;
    gap: 2px;
    padding: 3px;
}
.segmented__item {
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 12px;
    transition: background var(--ease), color var(--ease), box-shadow var(--ease);
    white-space: nowrap;
}
.segmented__item:hover { background: rgba(255, 255, 255, .7); color: var(--blue-600); }
.segmented__item.is-active {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--blue-600);
}

/* A row leaving the current filter fades out before the list reloads. */
.table tbody tr.is-leaving {
    opacity: 0;
    transform: translateX(14px);
    transition: opacity 300ms ease, transform 300ms ease;
}

/* A row that just changed group flashes so the jump is easy to follow. */
.table tbody tr.is-moved { animation: row-flash 1.1s ease-out; }
@keyframes row-flash {
    0% { background: rgba(45, 125, 210, .16); }
    100% { background: transparent; }
}

/* Rows whose record is switched off read quieter than the live ones. */
.table tbody tr.is-off { background: rgba(124, 138, 160, .04); }
.table tbody tr.is-off .table__primary { color: var(--text-soft); }
.table tbody tr.is-off .thumb, .table tbody tr.is-off .badge { opacity: .8; }

/* Listing search. A GET form, so the query runs in the database and searches
   every record — not just the rows rendered on the current page. */
.table-search { margin: 0; position: relative; }
.table-search > .icon { color: var(--muted); left: 12px; position: absolute; top: 50%; transform: translateY(-50%); }
.table-search input[type="search"] { padding-left: 38px; padding-right: 34px; width: 260px; }
.table-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.table-search__clear {
    align-items: center;
    border-radius: 50%;
    color: var(--muted);
    display: flex;
    height: 20px;
    justify-content: center;
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    transition: background var(--ease), color var(--ease);
    width: 20px;
}
.table-search__clear:hover { background: var(--surface-2); color: var(--text); }

.table-wrap { overflow-x: auto; }

.table { border-collapse: collapse; min-width: 100%; width: 100%; }
.table th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    padding: 12px 18px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.table td { border-bottom: 1px solid var(--line); padding: 13px 18px; text-align: left; vertical-align: middle; }
.table th.text-right, .table td:has(> .table__actions) { text-align: right; width: 1%; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table__primary { color: var(--text); font-weight: 700; }
.table__sub { color: var(--muted); font-size: 12.5px; }
.table__muted { color: var(--muted); }
.table__id { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; width: 56px; }
.table__clip { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table__actions { align-items: center; display: flex; flex-wrap: nowrap; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.table__actions .btn:hover { transform: none; }

.table td form { display: inline; }

.table td.empty__cell { padding: 46px 18px; text-align: center; }
.empty__icon {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    display: inline-flex;
    height: 56px;
    justify-content: center;
    margin-bottom: 12px;
    width: 56px;
}
.empty__title { font-size: 15px; font-weight: 700; }
.empty__text { color: var(--muted); font-size: 13px; margin-top: 4px; }
.empty__cell .btn { margin-top: 14px; }

/* 10. Badges & media ------------------------------------------------------- */
.badge {
    align-items: center;
    background: #EEF2F8;
    border-radius: 999px;
    color: var(--text-soft);
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 700;
    gap: 5px;
    line-height: 1.6;
    padding: 3px 10px;
    white-space: nowrap;
}
.badge::before { background: currentColor; border-radius: 50%; content: ""; height: 6px; opacity: .75; width: 6px; }
.badge--plain::before { display: none; }
.badge--green { background: var(--green-100); color: #22752E; }
.badge--red { background: var(--red-100); color: #A93123; }
.badge--amber { background: var(--amber-100); color: #A97709; }
.badge--blue { background: var(--blue-100); color: var(--blue-600); }
.badge--purple { background: #F0E9F9; color: #6F44A0; }
.badge--teal { background: #DDF3F6; color: #0E7C8D; }

.thumb {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    height: 48px;
    object-fit: contain;
    padding: 4px;
    width: 48px;
}
.thumb--lg { height: 76px; width: 76px; }
.thumb--empty { align-items: center; color: var(--muted); display: inline-flex; justify-content: center; }

.user-cell { align-items: center; display: flex; gap: 10px; min-width: 0; }

/* Label / value table used on detail screens. */
.table--kv th, .table--kv td { text-align: left; }
.table--kv th { color: var(--muted); font-size: 12px; letter-spacing: .04em; }

/* 10b. Mini cards (connections, compact records) ---------------------------- */
.mini-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }

.mini-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    padding: 14px 15px;
    transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.mini-card:hover { border-color: #C9DEF6; box-shadow: var(--shadow); transform: translateY(-2px); }

.mini-card__top { align-items: center; display: flex; gap: 11px; min-width: 0; }
.mini-card__meta { display: grid; flex: 1 1 auto; min-width: 0; }
.mini-card__name {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
a.mini-card__name:hover { color: var(--blue-600); }
.mini-card__sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status is a single quiet dot — the sentence below carries the detail. */
.dot { border-radius: 50%; flex: 0 0 auto; height: 9px; width: 9px; }
.dot--green { background: var(--green-500); box-shadow: 0 0 0 3px rgba(63, 174, 73, .16); }
.dot--amber { background: var(--amber-500); box-shadow: 0 0 0 3px rgba(247, 179, 43, .18); }
.dot--red { background: var(--red-500); box-shadow: 0 0 0 3px rgba(226, 75, 59, .16); }

.mini-card__story {
    align-items: flex-start;
    border-radius: 10px;
    display: flex;
    font-size: 12.5px;
    font-weight: 600;
    gap: 7px;
    line-height: 1.45;
    margin-top: 12px;
    padding: 9px 10px;
}
.mini-card__story .icon { flex: 0 0 auto; margin-top: 1px; }
.mini-card__sep { opacity: .5; padding: 0 6px; }
.mini-card__story--green { background: var(--green-100); color: #22752E; }
.mini-card__story--amber { background: var(--amber-100); color: #A97709; }
.mini-card__story--red { background: var(--red-100); color: #A93123; }

.mini-card__foot {
    align-items: center;
    color: var(--muted);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 12px;
}
.mini-card__date { align-items: center; display: inline-flex; font-size: 11.5px; font-weight: 600; gap: 5px; white-space: nowrap; }
.mini-card__link {
    align-items: center;
    color: var(--blue-600);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 3px;
    opacity: 0;
    transition: opacity var(--ease);
    white-space: nowrap;
}
.mini-card:hover .mini-card__link, .mini-card__link:focus-visible { opacity: 1; }

@media (hover: none) {
    .mini-card__link { opacity: 1; }
}

/* 11. Buttons -------------------------------------------------------------- */
.btn {
    align-items: center;
    background: var(--navy-800);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    line-height: 1.2;
    padding: 10px 16px;
    transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease);
    white-space: nowrap;
}
.btn:hover { background: var(--navy-700); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); box-shadow: 0 6px 16px rgba(33, 102, 184, .26); }
.btn--primary:hover { background: linear-gradient(135deg, #1B5AA6, #2670C3); }
.btn--success { background: linear-gradient(135deg, var(--green-600), var(--green-500)); box-shadow: 0 6px 16px rgba(52, 154, 62, .24); }
.btn--success:hover { background: linear-gradient(135deg, #2C8535, #37A041); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--blue-500); color: var(--blue-600); }
.btn--danger { background: var(--surface); border-color: #F1C6C0; color: #B93425; }
.btn--danger:hover { background: var(--red-500); border-color: var(--red-500); color: #fff; }
.btn--sm { border-radius: 10px; font-size: 12.5px; padding: 7px 12px; }
.btn--icon { padding: 8px; width: 34px; }
.btn--block { width: 100%; }
.btn[disabled] { cursor: not-allowed; opacity: .55; transform: none; }

/* 12. Forms ---------------------------------------------------------------- */
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: block; margin-bottom: 18px; }
.form-grid .field { margin-bottom: 0; }
.field--full { grid-column: 1 / -1; }
.form-grid + :is(.field, .form-grid, .toggle-row, .editor) { margin-top: 18px; }
.form-grid + .switch { display: flex; margin-top: 18px; width: fit-content; }
.form-section > .field:last-child { margin-bottom: 0; }

.field > label, .label { color: var(--text); display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.field__hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.required { color: var(--red-500); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="search"], input[type="tel"], input[type="date"],
input[type="datetime-local"], input[type="time"], select, textarea {
    background: var(--surface);
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    padding: 10px 13px;
    transition: border-color var(--ease), box-shadow var(--ease);
    width: 100%;
}
input:hover, select:hover, textarea:hover { border-color: #BFCBDC; }
input:focus, select:focus, textarea:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(45, 125, 210, .15);
    outline: 0;
}
input::placeholder, textarea::placeholder { color: #A6B1C2; }
textarea { min-height: 150px; resize: vertical; }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237C8AA0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    padding-right: 36px;
}

/* Searchable select.
   admin.js upgrades every <select data-searchable> into this combobox and keeps
   the real <select> behind the trigger (invisible but focusable, so the browser
   can still point its own validation bubble at it). Without JS the native
   select is what you get, and the form works exactly the same. */
.ss-select { position: relative; }
.ss-select__native {
    height: 100%;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 100%;
}
.ss-select__trigger {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 13.5px;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 13px;
    position: relative;
    text-align: left;
    transition: border-color var(--ease), box-shadow var(--ease);
    width: 100%;
}
.ss-select__trigger:hover { border-color: #BFCBDC; }
.ss-select.is-open .ss-select__trigger,
.ss-select__trigger:focus-visible {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(45, 125, 210, .15);
    outline: 0;
}
.ss-select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-select__value.is-placeholder { color: #A6B1C2; }
.ss-select__caret { color: var(--muted); flex: 0 0 auto; transition: transform var(--ease); }
.ss-select.is-open .ss-select__caret { transform: rotate(180deg); }

.ss-select__panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    left: 0;
    margin-top: 8px;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 60;
}
.ss-select--drop-up .ss-select__panel { bottom: 100%; margin: 0 0 8px; top: auto; }

/* The search field sits outside the scrolling list, so it never scrolls away. */
.ss-select__search {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
    padding: 12px;
    position: relative;
}
.ss-select__search .icon { color: var(--muted); left: 25px; position: absolute; top: 50%; transform: translateY(-50%); }
.ss-select__search input { padding-left: 38px; }

/* position:relative makes the list the offsetParent of its options, so the
   keyboard scrolling in admin.js measures against the list and not the field. */
.ss-select__list { flex: 1 1 auto; list-style: none; margin: 0; overflow-y: auto; padding: 8px; position: relative; }
.ss-select__option {
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13.5px;
    overflow: hidden;
    padding: 11px 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ss-select__option:hover, .ss-select__option.is-active { background: var(--surface-2); }
.ss-select__option.is-selected { background: var(--blue-100); color: var(--navy-700); font-weight: 700; }
.ss-select__empty { color: var(--muted); font-size: 13px; padding: 16px 12px; text-align: center; }

input[type="file"] {
    background: var(--surface-2);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    font-size: 13px;
    padding: 10px 13px;
    width: 100%;
}
input[type="file"]::file-selector-button {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    margin-right: 12px;
    padding: 6px 12px;
}
input[type="file"]::file-selector-button:hover { border-color: var(--blue-500); color: var(--blue-600); }

.input-group { position: relative; }
.input-group > .icon { color: var(--muted); left: 13px; position: absolute; top: 50%; transform: translateY(-50%); }
.input-group input { padding-left: 40px; }
.input-group__btn {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}
.input-group__btn:hover { color: var(--text); }

.switch { align-items: center; cursor: pointer; display: inline-flex; font-size: 13.5px; font-weight: 600; gap: 10px; }
.switch input { appearance: none; height: 0; margin: 0; opacity: 0; position: absolute; width: 0; }
.switch__track {
    background: #CBD5E3;
    border-radius: 999px;
    flex: 0 0 auto;
    height: 22px;
    position: relative;
    transition: background var(--ease);
    width: 40px;
}
.switch__track::after {
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    content: "";
    height: 17px;
    left: 3px;
    position: absolute;
    top: 2.5px;
    transition: transform var(--ease);
    width: 17px;
}
.switch input:checked + .switch__track { background: var(--green-500); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px rgba(63, 174, 73, .25); }

.status-toggle { align-items: center; display: inline-flex; gap: 8px; }
.status-toggle .switch { gap: 8px; }
.status-toggle__label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    min-width: 62px;
    text-align: left;
    white-space: nowrap;
}
.status-toggle__label.is-on { color: var(--green-600); }
.status-toggle.is-busy { opacity: .55; pointer-events: none; }

.checkbox { align-items: center; cursor: pointer; display: inline-flex; font-size: 13.5px; font-weight: 600; gap: 9px; }
.checkbox input { accent-color: var(--blue-500); height: 17px; width: 17px; }

.form-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.form-section__title { align-items: center; display: flex; font-size: 14px; font-weight: 700; gap: 8px; margin-bottom: 4px; }
.form-section__title .icon { color: var(--blue-500); }
.form-section__text { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }

.form-actions {
    align-items: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--surface-2);
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px -18px -18px;
    padding: 16px 18px;
}
.toggle-row { align-items: center; display: flex; flex-wrap: wrap; gap: 14px 26px; }

/* 12b. Rich text editor ---------------------------------------------------- */
.editor {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.editor.is-focused { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(45, 125, 210, .15); }

.editor__toolbar {
    align-items: center;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 7px 8px;
}
.editor__sep { background: var(--line-strong); height: 20px; margin: 0 5px; width: 1px; }

.editor__btn {
    align-items: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-soft);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    height: 30px;
    justify-content: center;
    min-width: 30px;
    padding: 0 7px;
    transition: background var(--ease), color var(--ease);
}
.editor__btn:hover { background: var(--blue-100); color: var(--blue-600); }
.editor__btn.is-active { background: var(--blue-100); border-color: #C9DEF6; color: var(--blue-600); }

.editor__area {
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    min-height: 280px;
    outline: 0;
    overflow-y: auto;
    padding: 16px 18px;
}
.editor__area:empty::before { color: #A6B1C2; content: attr(data-placeholder); }
.editor__area > *:first-child { margin-top: 0; }
.editor__area > *:last-child { margin-bottom: 0; }
.editor__area h2 { font-size: 20px; margin: 20px 0 8px; }
.editor__area h3 { font-size: 16px; margin: 18px 0 6px; }
.editor__area p { margin: 0 0 12px; }
.editor__area ul, .editor__area ol { margin: 0 0 12px; padding-left: 22px; }
.editor__area li { margin-bottom: 4px; }
.editor__area a { text-decoration: underline; }
.editor__area blockquote {
    border-left: 3px solid var(--blue-500);
    color: var(--text-soft);
    margin: 0 0 12px;
    padding: 4px 0 4px 14px;
}
.editor__area pre {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13px;
    overflow-x: auto;
    padding: 12px 14px;
}

/* 13. Pagination ----------------------------------------------------------- */
.pagination-bar {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 18px;
}
.pagination-bar__info { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pagination-bar__info strong { color: var(--text); }
.pagination { align-items: center; display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pagination li { display: flex; }
.page-link {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    color: var(--text-soft);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    height: 34px;
    justify-content: center;
    min-width: 34px;
    padding: 0 10px;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.page-link:hover { background: var(--blue-100); border-color: #C2D9F4; color: var(--blue-600); }
.page-link.is-active {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(33, 102, 184, .28);
    color: #fff;
}
.page-link.is-disabled { background: var(--surface-2); color: #B6C0CF; cursor: not-allowed; pointer-events: none; }
.page-link--dots { background: none; border-color: transparent; cursor: default; pointer-events: none; }

/* 14. Auth ----------------------------------------------------------------- */
.auth {
    align-items: center;
    background:
        radial-gradient(circle at 12% 12%, rgba(45, 125, 210, .18), transparent 34%),
        radial-gradient(circle at 88% 84%, rgba(63, 174, 73, .16), transparent 32%),
        var(--bg);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 940px;
    overflow: hidden;
    width: 100%;
}
.auth-aside {
    background: linear-gradient(160deg, var(--navy-900), var(--navy-700) 60%, #17457C);
    color: #E6ECF6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 38px;
    position: relative;
}
.auth-aside::after { background: var(--rainbow); bottom: 0; content: ""; height: 4px; left: 0; position: absolute; right: 0; }
.auth-aside__title { color: #fff; font-size: 27px; letter-spacing: -.03em; margin-top: 42px; }
.auth-aside__text { color: rgba(230, 236, 246, .68); font-size: 13.5px; margin-top: 12px; }
.auth-points { display: grid; gap: 14px; margin-top: 30px; }
.auth-point { align-items: center; color: rgba(230, 236, 246, .85); display: flex; font-size: 13px; font-weight: 600; gap: 11px; }
.auth-point__icon {
    align-items: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    height: 34px;
    justify-content: center;
    width: 34px;
}
.auth-aside__foot { color: rgba(230, 236, 246, .45); font-size: 11.5px; margin-top: 40px; }

.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 44px 42px; }
.auth-form__eyebrow { color: var(--blue-600); font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-form h1 { font-size: 26px; margin: 8px 0 6px; }
.auth-form__lead { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.auth-form__row { align-items: center; display: flex; justify-content: space-between; margin-bottom: 20px; }
.auth-form__hint { color: var(--muted); font-size: 12.5px; margin-top: 18px; text-align: center; }
.auth-form__brand { display: none; margin-bottom: 24px; }

/* 14b. Confirm dialog ------------------------------------------------------ */
.swal { display: none; }
.swal.is-open { display: block; }
.swal__backdrop {
    animation: swal-fade 160ms ease-out;
    background: rgba(10, 24, 48, .55);
    inset: 0;
    position: fixed;
    z-index: 100;
}
.swal__box {
    animation: swal-pop 180ms cubic-bezier(.34, 1.3, .64, 1);
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    left: 50%;
    max-width: 420px;
    padding: 30px 28px 24px;
    position: fixed;
    text-align: center;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    z-index: 101;
}
.swal__icon {
    align-items: center;
    animation: swal-ring 1.4s ease-in-out infinite;
    background: var(--red-100);
    border: 3px solid rgba(226, 75, 59, .28);
    border-radius: 50%;
    color: var(--red-500);
    display: inline-flex;
    height: 74px;
    justify-content: center;
    margin-bottom: 18px;
    width: 74px;
}
.swal__title { font-size: 21px; letter-spacing: -.02em; }
.swal__text { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 10px auto 0; max-width: 34ch; }
.swal__actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }
.swal__actions .btn { min-width: 130px; }
.swal__confirm { background: var(--red-500); border-color: var(--red-500); color: #fff; }
.swal__confirm:hover { background: #C93F31; border-color: #C93F31; color: #fff; }

@keyframes swal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes swal-pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes swal-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 75, 59, .18); } 50% { box-shadow: 0 0 0 10px rgba(226, 75, 59, 0); } }

@media (max-width: 480px) {
    .swal__actions { flex-direction: column-reverse; }
    .swal__actions .btn { width: 100%; }
}

/* 15. Utilities ------------------------------------------------------------ */
.stack { display: grid; gap: 20px; }
.split { align-items: start; display: grid; gap: 20px; grid-template-columns: 1.6fr 1fr; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }

.meter { background: #EDF1F7; border-radius: 999px; height: 7px; overflow: hidden; }
.meter__fill { background: linear-gradient(90deg, var(--blue-500), var(--green-500)); border-radius: inherit; height: 100%; }

.list-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; padding: 12px 0; }
.list-row:first-child { padding-top: 0; }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row__meta { flex: 1 1 auto; min-width: 0; }
.list-row__title { font-size: 13.5px; font-weight: 700; }
.list-row__text { color: var(--muted); font-size: 12.5px; }

/* 16. Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
    .split { grid-template-columns: 1fr; }
    .form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar {
        left: 0;
        position: fixed;
        transform: translateX(-100%);
        transition: transform var(--ease);
        width: var(--sidebar-w);
    }
    .is-collapsed .sidebar { width: var(--sidebar-w); }
    .is-collapsed .sidebar .brand__text,
    .is-collapsed .nav-link__label,
    .is-collapsed .sidebar__user-meta,
    .is-collapsed .logout-btn span { display: initial; }
    .is-collapsed .nav-group__label { display: block; }
    .is-collapsed .nav-group { border-top: 0; padding-top: 0; }
    .is-collapsed .nav-link, .is-collapsed .logout-btn { justify-content: flex-start; }
    .is-collapsed .sidebar__head { justify-content: space-between; padding: 14px 16px; }
    .is-collapsed .sidebar__head .brand { display: inline-flex; }
    .is-drawer-open .sidebar { box-shadow: var(--shadow-lg); transform: translateX(0); }
    .is-drawer-open .sidebar__scrim {
        background: rgba(10, 24, 48, .45);
        display: block;
        inset: 0;
        position: fixed;
        z-index: 35;
    }
    .topbar__burger { display: inline-flex; }
    .topbar { padding: 0 16px; }
    .content { padding: 18px 16px; }
    .footer { padding: 16px; }
    .table-search input[type="search"] { width: 180px; }
}

@media (max-width: 720px) {
    .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
    .auth-card { grid-template-columns: 1fr; max-width: 460px; }
    .auth-aside { display: none; }
    .auth-form { padding: 32px 24px; }
    .auth-form__brand { display: flex; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .page-head__actions { width: 100%; }
    .userbox__name, .breadcrumb__parent { display: none; }
    .pagination-bar { justify-content: center; }
    .table-search input[type="search"] { width: 100%; }
    .panel__head, .panel__tools { align-items: stretch; flex-direction: column; }
    .table-search, .panel__tools > * { width: 100%; }
    .form-actions .btn { flex: 1 1 auto; }
    .page-head__actions .btn { flex: 1 1 auto; }
}

@media print {
    .sidebar, .topbar, .page-head__actions, .pagination-bar, .footer { display: none !important; }
    .content { padding: 0; }
    .panel { border: 1px solid #ccc; box-shadow: none; }
}

/* Compact switch + item rows used by the landing page editor. */
.switch--sm { font-size: 12px; gap: 7px; }
.switch--sm .switch__track { height: 18px; width: 32px; }
.switch--sm .switch__track::after { height: 14px; top: 2px; width: 14px; }
.switch--sm input:checked + .switch__track::after { transform: translateX(14px); }

#landing-items td { vertical-align: top; }
#landing-items input[type="text"],
#landing-items input[type="number"],
#landing-items select,
#landing-items textarea { font-size: 13px; padding: 7px 9px; width: 100%; }
#landing-items input[type="file"] { font-size: 11.5px; max-width: 140px; }
#landing-items .table__sub { display: inline-block; margin-top: 4px; }

.avatar { overflow: hidden; }
.avatar img { border-radius: inherit; height: 100%; object-fit: cover; width: 100%; }
.thumb--xl { height: 180px; width: 140px; object-fit: cover; padding: 0; }
.thumb--slide { height: 96px; width: 72px; object-fit: cover; padding: 0; }

/* Landing section list rows: every label shows in full. */
.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-row { align-items: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 12px; padding: 12px; }
.item-row__field { flex: 1 1 220px; margin: 0; min-width: 0; }
.item-row__field--sm { flex: 0 1 170px; }
.item-row__field input, .item-row__field select { width: 100%; }
.item-row__actions { display: flex; gap: 6px; }
