
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

:root {
    --bg:           #08090d;
    --bg-1:         #0e0f15;
    --bg-2:         #14151d;
    --bg-3:         #1b1c25;

    --border:       #1f2030;
    --border-hi:    #2a2c3c;
    --border-soft:  rgba(255, 255, 255, 0.04);

    --text:         #ecedf3;
    --text-dim:     #9295a4;
    --text-muted:   #5a5c6c;

    --accent:       #c4d0e8;
    --accent-2:     #8a96b0;
    --accent-glow:  rgba(196, 208, 232, 0.12);

    --danger:       #ff6b7a;
    --danger-bg:    rgba(255, 107, 122, 0.08);
    --ok:           #5dd4b4;
    --ok-bg:        rgba(93, 212, 180, 0.08);

    --sidebar-w:    240px;
    --radius:       10px;
    --radius-sm:    8px;
    --radius-lg:    14px;

    --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:       0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg:    0 24px 60px rgba(0, 0, 0, 0.55);
    --shadow-glow:  0 0 0 4px var(--accent-glow);

    --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --t:      180ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-glow); color: var(--text); }

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: #fff; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

body.auth {
    display: flex; flex-direction: column;
    min-height: 100vh; padding: 24px;
    background: radial-gradient(ellipse at top, rgba(196,208,232,0.04), transparent 50%), var(--bg);
}
body.auth .auth-card { margin: auto; }

.auth-card {
    width: 100%; max-width: 400px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
}
.auth-card::before {
    content: ''; position: absolute; inset: -1px;
    border-radius: inherit; padding: 1px;
    background: linear-gradient(180deg, rgba(196,208,232,0.18), transparent 45%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}

/* ------------------------------------------------------------------ *
 * Modal de senha do Nyx
 * Cole no fim de /assets/style.css. Não pode virar style inline:
 * a CSP do .htaccess usa style-src 'self', sem 'unsafe-inline'.
 * As cores herdam as variáveis do tema quando elas existem.
 * ------------------------------------------------------------------ */

.nyx-pin-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 8, 12, .78);
    overflow-y: auto;
}

.nyx-pin-card {
    width: 100%;
    max-width: 380px;
    padding: 26px 24px 22px;
    border: 1px solid var(--border, #2a2f3a);
    border-radius: var(--radius, 10px);
    background: var(--surface, #161a22);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    animation: nyx-pin-in .18s ease-out;
}

.nyx-pin-card h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    line-height: 1.3;
    color: var(--text, #e8ebf0);
}

.nyx-pin-card .muted {
    margin: 0 0 16px;
    line-height: 1.5;
}

.nyx-pin-card .flash {
    margin-bottom: 14px;
}

.nyx-pin-form label {
    display: block;
    margin-bottom: 6px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--muted, #9aa3b2);
}

.nyx-pin-form input[type="password"] {
    width: 100%;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border, #2a2f3a);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg, #0f1218);
    color: var(--text, #e8ebf0);
    font: inherit;
}

.nyx-pin-form input[type="password"]:focus-visible {
    outline: 2px solid var(--accent, #4d7cff);
    outline-offset: 1px;
    border-color: transparent;
}

/* ------------------------------------------------------------------ *
 * PARTE 2: página /senha.php
 * Cole no fim de /assets/style.css, depois do bloco do modal.
 * Se você ainda não colou a parte 1 (.nyx-pin-*), cole as duas.
 * Nada aqui pode virar style inline: a CSP usa style-src 'self'.
 * ------------------------------------------------------------------ */

.nyx-card {
    max-width: 460px;
    margin: 28px auto;
    padding: 26px 24px 22px;
    border: 1px solid var(--border, #2a2f3a);
    border-radius: var(--radius, 10px);
    background: var(--surface, #161a22);
}

.nyx-card-titulo {
    margin: 0 0 8px;
    font-size: 1.2rem;
    line-height: 1.3;
    color: var(--text, #e8ebf0);
}

.nyx-card .muted {
    margin: 0 0 18px;
    line-height: 1.5;
}

.nyx-card .flash {
    margin-bottom: 16px;
}

.nyx-form label {
    display: block;
    margin-bottom: 6px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--muted, #9aa3b2);
}

.nyx-form input[type="password"] {
    width: 100%;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border, #2a2f3a);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg, #0f1218);
    color: var(--text, #e8ebf0);
    font: inherit;
}

.nyx-form input[type="password"]:focus-visible {
    outline: 2px solid var(--accent, #4d7cff);
    outline-offset: 1px;
    border-color: transparent;
}

.nyx-form .muted.small {
    margin: -4px 0 18px;
}

.nyx-form-acoes {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Caso o tema ainda não tenha um estado de sucesso para .flash */
.flash-ok {
    border: 1px solid rgba(70, 170, 110, .4);
    background: rgba(70, 170, 110, .12);
    color: #8fd6ac;
}

.nyx-pin-form .muted.small {
    margin: -4px 0 16px;
}

@keyframes nyx-pin-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .nyx-pin-card { animation: none; }
}

.auth-note { margin-top: 14px; text-align: center; }

.auth-logo {
    display: block; width: 200px; margin: 0 auto 24px;
    filter: drop-shadow(0 0 12px rgba(196,208,232,0.15));
}
.auth-heading {
    text-align: center; color: var(--text);
    font-weight: 500; font-size: 13px;
    margin: 0 0 20px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.auth-secondary {
    margin-top: 20px; padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.field { display: block; margin-bottom: 16px; }
.field > span {
    display: block; font-size: 11px; color: var(--text-dim);
    margin-bottom: 7px; letter-spacing: 0.6px;
    text-transform: uppercase; font-weight: 500;
}

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="email"],
select, textarea {
    width: 100%; background: #050609; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 11px 13px; font-size: 14px; font-family: inherit; outline: none;
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
input:hover, select:hover, textarea:hover { border-color: var(--border-hi); }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent-2);
    background: #0a0b11;
    box-shadow: var(--shadow-glow);
}
input::placeholder { color: var(--text-muted); }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%239295a4' stroke-width='1.5'%3E%3Cpolyline points='3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
    padding-right: 36px;
}

.row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.row .field { flex: 1; min-width: 160px; margin-bottom: 0; }

.check {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none;
}
.check input {
    appearance: none; width: 16px; height: 16px;
    border: 1px solid var(--border-hi); border-radius: 4px;
    background: var(--bg-1); cursor: pointer; position: relative;
    transition: all var(--t-fast);
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
    content: ''; position: absolute; inset: 2px;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpolyline points='2.5 6.5 5 9 9.5 3.5' stroke='black' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpolyline points='2.5 6.5 5 9 9.5 3.5' stroke='black' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    background: var(--bg);
}

.link { font-size: 13px; color: var(--text-dim); transition: color var(--t-fast); }
.link:hover { color: var(--accent); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--bg-2); color: var(--text);
    border: 1px solid var(--border-hi); border-radius: var(--radius-sm);
    padding: 9px 16px; font-size: 13px; font-weight: 500; letter-spacing: 0.3px;
    cursor: pointer; transition: all var(--t-fast); text-decoration: none;
    line-height: 1; white-space: nowrap;
}
.btn:hover { border-color: var(--accent-2); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-glow); }
.btn svg { width: 16px; height: 16px; }

.btn.primary {
    background: linear-gradient(180deg, #d5dff2, #b1bdd6);
    color: #1a1d28; border-color: transparent;
    font-weight: 600; width: 100%; padding: 12px 20px; margin-top: 4px;
    text-transform: uppercase; letter-spacing: 0.8px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, var(--shadow-sm);
}
.btn.primary:hover { background: linear-gradient(180deg, #e2ecff, #c2cee7); color: #000; }

.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-2); }

.btn.danger { color: var(--danger); border-color: rgba(255,107,122,0.3); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

.btn.small { padding: 6px 11px; font-size: 12px; }
.btn.icon-only { padding: 9px; }

.flash {
    padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
    font-size: 13px; border: 1px solid; display: flex; align-items: center; gap: 10px;
    animation: flashIn 240ms ease-out;
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.flash-error   { background: var(--danger-bg); border-color: rgba(255,107,122,0.3); color: #ffb8c0; }
.flash-success { background: var(--ok-bg);     border-color: rgba(93,212,180,0.3);  color: #b6e9d6; }
.flash-info    { background: rgba(196,208,232,0.06); border-color: rgba(196,208,232,0.2); color: var(--text); }

.code-box {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 20px; font-weight: 600; letter-spacing: 3px; text-align: center;
    background: #050609; color: var(--accent);
    border: 1px dashed var(--accent-2); border-radius: var(--radius);
    padding: 18px 14px; margin: 14px 0 20px;
    user-select: all; cursor: copy; transition: all var(--t-fast);
}
.code-box:hover { background: #0a0b10; border-color: var(--accent); }

.help { color: var(--text-dim); font-size: 13px; text-align: center; margin: 0 0 12px; }
.help.small { font-size: 12px; color: var(--text-muted); }

body.app {
    display: grid; grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #06070a, var(--bg-1));
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; z-index: 50;
}
.sidebar-brand { text-align: center; margin-bottom: 28px; padding: 4px 8px; position: relative; }
.sidebar-brand::after {
    content: ''; position: absolute; bottom: -16px; left: 8px; right: 8px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.sidebar-brand img {
    max-width: 160px; height: auto;
    filter: drop-shadow(0 0 16px rgba(196,208,232,0.1));
    transition: filter var(--t);
}
.sidebar-brand img:hover { filter: drop-shadow(0 0 20px rgba(196,208,232,0.22)); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    color: var(--text-dim); font-size: 13.5px; font-weight: 500;
    letter-spacing: 0.2px; transition: all var(--t-fast);
    position: relative; overflow: hidden;
}
.nav-item:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.nav-item.active { color: var(--text); background: var(--bg-2); }
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--accent); box-shadow: 0 0 12px var(--accent-glow);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; transition: opacity var(--t-fast); }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 1; }

.sidebar-toggle {
    display: none;
    background: transparent; border: 1px solid var(--border-hi);
    color: var(--text); padding: 6px; border-radius: var(--radius-sm);
    cursor: pointer;
}
.sidebar-toggle svg { width: 20px; height: 20px; display: block; }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); z-index: 49;
}

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 28px;
    background: rgba(8,9,13,0.85);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
    backdrop-filter: saturate(180%) blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.page-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }

.user-pill {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px 8px 4px 16px;
    transition: border-color var(--t-fast);
}
.user-pill:hover { border-color: var(--border-hi); }
.user-nick { font-size: 13.5px; font-weight: 500; color: var(--text); }
.user-avatar {
    width: 38px; height: 50px; object-fit: cover; object-position: center top;
    border-radius: 50%; background: var(--bg-2);
}
.user-avatar.tiny { width: 22px; height: 28px; }
.user-avatar.small { width: 28px; height: 36px; }

.content { padding: 26px 28px 48px; max-width: 1400px; width: 100%; margin: 0 auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-1); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
    text-align: left; padding: 12px 16px;
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px;
    font-size: 11px; white-space: nowrap;
}
table.data tbody td { padding: 12px 16px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
table.data tbody tr { transition: background var(--t-fast); }
table.data tbody tr:hover { background: rgba(255,255,255,0.018); }

.user-cell { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.user-cell .user-avatar { flex-shrink: 0; }
.empty { text-align: center; color: var(--text-muted); padding: 32px 16px; font-style: italic; }

.pill {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    border: 1px solid var(--border-hi); font-weight: 500;
}
.pill.ok    { color: var(--ok); border-color: rgba(93,212,180,0.4); background: var(--ok-bg); }
.pill.off   { color: var(--text-muted); border-color: var(--border-hi); }
.pill.admin { color: var(--accent); border-color: var(--accent-2); background: var(--accent-glow); }

.count-cell { display: inline-flex; align-items: baseline; gap: 4px; }
.count-cell strong { font-size: 14px; color: var(--text); font-weight: 600; }
.count-cell .unit { font-size: 11px; color: var(--text-muted); }

.searchbar { display: flex; gap: 8px; margin-bottom: 18px; position: relative; flex-wrap: wrap; align-items: center; }
.searchbar > input {
    flex: 1; min-width: 200px; padding-left: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239295a4' stroke-width='1.8'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 12px center; background-size: 16px;
}
.searchbar > input[type="date"] { padding-left: 38px; }

.filter-tabs {
    display: inline-flex;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.filter-tab {
    background: transparent;
    color: var(--text-dim);
    border: 0;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    letter-spacing: 0.3px;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active {
    background: var(--accent);
    color: #1a1d28;
    font-weight: 600;
}

.result-area { position: relative; min-height: 100px; }
.result-area.loading { opacity: 0.5; pointer-events: none; transition: opacity var(--t-fast); }
.result-area.loading::after {
    content: '';
    position: absolute; top: 30px; left: 50%; transform: translateX(-50%);
    width: 24px; height: 24px;
    border: 2px solid var(--border-hi);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: translateX(-50%) rotate(360deg); } }

.paginator { display: flex; gap: 4px; justify-content: center; padding: 18px 0 8px; flex-wrap: wrap; }
.paginator a {
    padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    color: var(--text-dim); font-size: 12px; min-width: 32px; text-align: center;
    transition: all var(--t-fast);
}
.paginator a:hover { color: var(--text); border-color: var(--border-hi); background: var(--bg-2); text-decoration: none; }
.paginator a.active { color: #1a1d28; background: var(--accent); border-color: var(--accent); font-weight: 600; }

.cross-form, .cross-summary, .snap {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.cross-summary p { margin: 6px 0; color: var(--text-dim); }
.cross-summary strong { color: var(--text); }

.snap-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 12px; gap: 12px; flex-wrap: wrap;
}
.snap-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.snap-meta { color: var(--text-dim); font-size: 12.5px; margin: 0 0 12px; }
.snap-meta strong { color: var(--text); font-weight: 600; }

.snap-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center;
    padding: 4px 11px; border-radius: 999px;
    background: var(--bg-2); border: 1px solid var(--border);
    font-size: 12px; color: var(--text); font-weight: 500;
    transition: all var(--t-fast);
}
.chip:hover { border-color: var(--border-hi); }
.chip-right { border-color: var(--accent-2); color: var(--accent); background: var(--accent-glow); }
.chip-in    { border-color: rgba(93,212,180,0.4); color: var(--ok); background: var(--ok-bg); }
.chip-out   { border-color: rgba(255,107,122,0.3); color: var(--danger); background: var(--danger-bg); }

.cross-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cross-grid h4 {
    margin: 0 0 8px; font-size: 11px; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
}

.subtabs {
    display: flex; gap: 2px; border-bottom: 1px solid var(--border);
    margin-bottom: 22px; overflow-x: auto;
}
.subtabs a {
    padding: 10px 16px; color: var(--text-dim);
    font-size: 13.5px; font-weight: 500;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: all var(--t-fast); white-space: nowrap;
}
.subtabs a:hover { color: var(--text); text-decoration: none; }
.subtabs a.active { color: var(--text); border-bottom-color: var(--accent); }

.adm-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px;
    transition: border-color var(--t-fast);
}
.adm-card:hover { border-color: var(--border-hi); }
.adm-card summary {
    cursor: pointer; color: var(--accent); font-size: 13.5px; font-weight: 500;
    user-select: none; list-style: none;
    display: flex; align-items: center; gap: 6px;
}
.adm-card summary::-webkit-details-marker { display: none; }
.adm-card summary::before {
    content: '+'; font-size: 16px; font-weight: 400;
    transition: transform var(--t-fast); display: inline-block;
}
.adm-card[open] summary::before { transform: rotate(45deg); }
.adm-card[open] summary { margin-bottom: 14px; }
.adm-form .field { max-width: 360px; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form.inline, .actions form.inline-edit { display: contents; }
form.inline-edit input { display: inline-block; width: auto; min-width: 120px; }

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    z-index: 100; padding: 20px; animation: overlayIn var(--t-slow);
}
.modal-overlay.open { display: flex; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-1); border: 1px solid var(--border-hi);
    border-radius: var(--radius-lg);
    max-width: 740px; width: 100%; max-height: 88vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn var(--t-slow);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 12px;
}
.modal-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.modal-close {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-dim); width: 32px; height: 32px;
    border-radius: var(--radius-sm); cursor: pointer;
    display: grid; place-items: center; transition: all var(--t-fast);
}
.modal-close:hover { color: var(--text); border-color: var(--border-hi); background: var(--bg-2); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 18px 22px 22px; overflow-y: auto; }
.modal-section { margin-bottom: 22px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; gap: 8px;
}
.modal-section-header h4 {
    margin: 0; font-size: 11.5px; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600;
}
.modal-section-header .count { font-size: 11.5px; color: var(--text-muted); }

.copy-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent; color: var(--text-dim);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 5px 10px; font-size: 11.5px; font-weight: 500;
    cursor: pointer; transition: all var(--t-fast);
    text-transform: uppercase; letter-spacing: 0.4px;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-hi); background: var(--bg-2); }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn.copied {
    color: var(--ok); border-color: rgba(93,212,180,0.4); background: var(--ok-bg);
}

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li {
    padding: 6px 0; border-bottom: 1px solid var(--border-soft);
    font-size: 13px; color: var(--text);
}
ul.plain li:last-child { border: 0; }
ul.plain li.empty { color: var(--text-muted); border: 0; font-style: italic; }

.site-footer {
    margin-top: 48px;
    padding: 24px 16px 18px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.3px;
}
.site-footer p { margin: 4px 0; }
.site-footer .footer-brand {
    color: var(--text-dim);
    font-weight: 500;
}
.site-footer .footer-brand strong {
    color: var(--text);
    font-weight: 600;
}
.site-footer .footer-author {
    color: var(--accent);
    font-weight: 500;
}
.site-footer .footer-sep {
    color: var(--text-muted);
    margin: 0 8px;
    opacity: 0.6;
}

body.auth .site-footer {
    margin-top: 32px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border-top: 0;
    padding-top: 16px;
}

@media (max-width: 960px) {
    body.app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: var(--sidebar-w); height: 100vh;
        transform: translateX(-100%);
        transition: transform var(--t);
    }
    body.app.sidebar-open .sidebar { transform: translateX(0); }
    body.app.sidebar-open .sidebar-overlay { display: block; }
    .sidebar-toggle { display: inline-flex; align-items: center; }
    .topbar { padding: 14px 18px; gap: 12px; }
    .page-title { font-size: 15px; }
    .content { padding: 18px 18px 40px; }
    .user-nick { display: none; }
    .cross-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .auth-card { padding: 28px 22px 24px; }
    .auth-logo { width: 160px; margin-bottom: 18px; }
    .topbar { padding: 12px 14px; }
    .content { padding: 14px; }
    .row { flex-direction: column; align-items: stretch; }
    .row .field { min-width: 0; }
    .btn { padding: 9px 14px; font-size: 12.5px; }
    .table-wrap { font-size: 12px; }
    table.data thead th, table.data tbody td { padding: 10px 12px; }
}
