/* Admin theme — aligned with central-de-jogos-pc dark glass design */

:root {
    --bg-base: #080b10;
    --bg-elevated: rgba(18, 22, 30, 0.82);
    --card-surface: rgba(18, 22, 30, var(--card-bg-alpha, 0.82));
    --bg-input: rgba(255, 255, 255, 0.04);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 200, 150, 0.55);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #00c896;
    --accent-hover: #00e0a8;
    --accent-muted: rgba(0, 200, 150, 0.14);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --success-bg: rgba(0, 200, 150, 0.12);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.1);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-card: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-subtle);
    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sidebar-width: 260px;
}

/* MongoDB Compass ------------------------------------------------------- */
.mongo-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.mongo-compass {
    display: grid;
    grid-template-columns: minmax(210px, .75fr) minmax(220px, .8fr) minmax(420px, 2fr);
    min-height: 620px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    background: rgba(8, 13, 25, .76);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.mongo-pane {
    min-width: 0;
    border-right: 1px solid rgba(148, 163, 184, .14);
    background: linear-gradient(180deg, rgba(21, 31, 50, .84), rgba(12, 19, 34, .7));
}

.mongo-pane__header,
.mongo-documents__header {
    min-height: 78px;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid rgba(148, 163, 184, .13);
}

.mongo-pane__header h3,
.mongo-documents__header h3 { margin: .18rem 0 0; font-size: 1rem; }

.mongo-pane__header > div,
.mongo-documents__header > div { min-width: 0; }

.mongo-pane--databases .mongo-pane__header,
.mongo-pane--collections .mongo-pane__header {
    align-items: stretch;
    flex-direction: column;
}

.mongo-documents__header--stacked {
    align-items: stretch;
    flex-direction: column;
    min-height: auto;
}

.mongo-documents__title-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.mongo-document-search-trigger {
    height: 32px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .38rem;
    padding: 0 .62rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(148, 163, 184, .07);
    color: #8fa3bd;
    cursor: pointer;
    font-size: .68rem;
    font-weight: 700;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.mongo-document-search-trigger:hover:not(:disabled) {
    border-color: rgba(148, 163, 184, .22);
    background: rgba(148, 163, 184, .11);
    color: #d8e4f1;
}

.mongo-document-search-trigger.is-active {
    border-color: rgba(0, 200, 150, .26);
    background: rgba(0, 200, 150, .09);
    color: #6ee7c7;
}

.mongo-document-search-trigger__dot { width: 5px; height: 5px; border-radius: 50%; background: #34d399; opacity: 0; box-shadow: 0 0 8px rgba(52, 211, 153, .8); }
.mongo-document-search-trigger.is-active .mongo-document-search-trigger__dot { opacity: 1; }
.mongo-document-search-trigger:disabled { cursor: not-allowed; opacity: .34; }

.mongo-document-search {
    padding: .85rem 1rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    background: rgba(8, 14, 24, .72);
}

.mongo-document-search[hidden] { display: none !important; }

.mongo-document-search__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .65rem;
}

.mongo-document-search__top > div { min-width: 0; display: grid; gap: .08rem; }
.mongo-document-search__top strong { color: #dce7f3; font-size: .78rem; font-weight: 700; }
.mongo-document-search__top span { color: #64748b; font-size: .65rem; }
.mongo-document-search__close { width: 28px; height: 28px; display: inline-grid; flex: 0 0 28px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #64748b; cursor: pointer; font-size: .7rem; }
.mongo-document-search__close:hover { background: rgba(148, 163, 184, .09); color: #cbd5e1; }

.mongo-search-composer {
    display: grid;
    grid-template-columns: minmax(120px, .8fr) 30px minmax(150px, 1.2fr) auto;
    align-items: stretch;
    padding: .35rem;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 12px;
    background: rgba(3, 8, 15, .64);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}

.mongo-search-composer:focus-within { border-color: rgba(0, 200, 150, .32); box-shadow: 0 0 0 3px rgba(0, 200, 150, .055); }
.mongo-search-composer__field { min-width: 0; display: grid; align-content: center; gap: .1rem; padding: .22rem .55rem; }
.mongo-search-composer__field > span { color: #5f7087; font-size: .58rem; font-weight: 800; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.mongo-search-composer__field input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: #dbe7f4; font: 500 .73rem/1.35 var(--font); }
.mongo-search-composer__field input::placeholder { color: #46566b; }
.mongo-search-composer__operator { display: grid; place-items: center; border-left: 1px solid rgba(148, 163, 184, .09); border-right: 1px solid rgba(148, 163, 184, .09); color: #52637a; font: 700 .75rem/1 ui-monospace, Consolas, monospace; }
.mongo-search-composer__submit { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .38rem; padding: 0 .8rem; border: 0; border-radius: 9px; background: linear-gradient(135deg, #00c896, #00a978); color: #03140f; cursor: pointer; font-size: .7rem; font-weight: 800; box-shadow: 0 6px 18px rgba(0, 200, 150, .12); }
.mongo-search-composer__submit:hover { background: linear-gradient(135deg, #00dda6, #00bd88); }

.mongo-document-search__footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .5rem; color: #52637a; font-size: .62rem; }
.mongo-document-search__footer code { color: #8fbfaa; }
.mongo-document-search__footer button { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem 0; border: 0; background: transparent; color: #718096; cursor: pointer; font-size: .64rem; font-weight: 700; }
.mongo-document-search__footer button:hover:not(:disabled) { color: #d2deeb; }
.mongo-document-search__footer button:disabled { cursor: default; opacity: .34; }

.mongo-pane--databases .mongo-pane__header--stacked {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: max-content max-content;
    align-content: start;
    align-items: stretch;
    justify-content: stretch;
    min-height: 0;
    height: auto;
    gap: .75rem;
}

.mongo-pane__heading-row {
    position: static;
    min-width: 0;
}

.mongo-create-button {
    width: auto;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    flex: 0 0 auto;
    padding: .5rem .7rem;
    border: 1px solid rgba(0, 200, 150, .28);
    border-radius: 9px;
    background: rgba(0, 200, 150, .09);
    color: #a7f3d0;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.mongo-create-button--full { width: 100%; }
.mongo-create-button:hover:not(:disabled) { border-color: rgba(0, 200, 150, .5); background: rgba(0, 200, 150, .15); }
.mongo-create-button:disabled { cursor: not-allowed; opacity: .42; }

.mongo-pane__eyebrow {
    display: block;
    max-width: 360px;
    overflow: hidden;
    color: #5eead4;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.mongo-count {
    display: inline-grid;
    min-width: 28px;
    height: 24px;
    padding: 0 .45rem;
    place-items: center;
    border: 1px solid rgba(0, 200, 150, .25);
    border-radius: 999px;
    background: rgba(0, 200, 150, .1);
    color: #a7f3d0;
    font-size: .72rem;
    font-weight: 700;
}

.mongo-pane__list { padding: .55rem; }

.mongo-list-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .72rem .7rem;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.mongo-list-item:hover { background: rgba(0, 200, 150, .07); transform: translateX(2px); }
.mongo-list-item.is-active { border-color: rgba(0, 200, 150, .25); background: rgba(0, 200, 150, .13); }
.mongo-list-item__icon { width: 28px; color: var(--accent); text-align: center; }
.mongo-list-item__body { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.mongo-list-item__body strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.mongo-list-item__body small { margin-top: .12rem; color: #7f91aa; font-size: .68rem; }
.mongo-list-item__chevron { color: #52627a; font-size: .72rem; }

.mongo-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 9px;
    background: rgba(15, 23, 42, .66);
    color: #a5c9e8;
}

.mongo-icon-btn:hover:not(:disabled) { border-color: rgba(0, 200, 150, .45); color: #5eead4; }
.mongo-icon-btn:disabled { cursor: not-allowed; opacity: .4; }
.mongo-pane__empty { padding: 2rem 1rem; color: #71829b; font-size: .78rem; text-align: center; }

.mongo-documents { min-width: 0; position: relative; }
.mongo-documents__table { max-height: 510px; overflow: auto; padding: .85rem; }
.mongo-document-list { display: grid; gap: .55rem; }

.mongo-document-item {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    align-items: center;
    gap: .75rem;
    padding: .78rem .8rem;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(30, 41, 59, .55), rgba(15, 23, 42, .5));
    color: var(--text-primary);
    text-align: left;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .09);
    transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.mongo-document-item:hover,
.mongo-document-item:focus-visible {
    border-color: rgba(0, 200, 150, .34);
    background: linear-gradient(135deg, rgba(0, 200, 150, .09), rgba(15, 23, 42, .62));
    box-shadow: 0 12px 26px rgba(0, 0, 0, .16);
    outline: none;
    transform: translateY(-1px);
}

.mongo-document-item__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 200, 150, .2);
    border-radius: 11px;
    background: rgba(0, 200, 150, .09);
    color: var(--accent);
    font-size: 1rem;
}

.mongo-document-item__content { display: flex; min-width: 0; flex-direction: column; gap: .28rem; }
.mongo-document-item__topline { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .75rem; }
.mongo-document-item__topline strong { font-size: .78rem; }
.mongo-document-item__count { color: var(--text-muted); font-size: .64rem; font-weight: 600; white-space: nowrap; }
.mongo-document-item__id { overflow: hidden; color: #7f91aa; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.mongo-document-item__fields { display: flex; min-width: 0; gap: .28rem; overflow: hidden; }
.mongo-document-field-chip {
    max-width: 110px;
    overflow: hidden;
    padding: .16rem .38rem;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 999px;
    background: rgba(148, 163, 184, .07);
    color: #9bacbf;
    font-size: .58rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mongo-document-field-chip.is-more { flex: 0 0 auto; color: #5eead4; }
.mongo-document-item__chevron { color: #52627a; font-size: .72rem; transition: color var(--transition), transform var(--transition); }
.mongo-document-item:hover .mongo-document-item__chevron { color: var(--accent); transform: translateX(2px); }

.mongo-documents__empty { min-height: 420px; display: grid; place-content: center; }
.mongo-documents__empty[hidden] { display: none; }
.mongo-loading { position: relative; z-index: 2; padding: .7rem 1rem; background: rgba(8, 13, 25, .92); color: #9eb2ca; font-size: .75rem; }
.mongo-loading .spinner { width: 14px; height: 14px; display: inline-block; margin-right: .4rem; }
.mongo-pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .85rem; border-top: 1px solid rgba(148, 163, 184, .13); color: #8fa3bd; font-size: .75rem; }
@media (max-width: 1180px) {
    .mongo-compass { grid-template-columns: minmax(190px, .7fr) minmax(200px, .75fr) minmax(340px, 1.6fr); }
}

@media (max-width: 900px) {
    .mongo-compass { grid-template-columns: 1fr 1fr; }
    .mongo-documents { grid-column: 1 / -1; border-top: 1px solid rgba(148, 163, 184, .14); }
    .mongo-pane--collections { border-right: 0; }
}

@media (max-width: 600px) {
    .mongo-intro { align-items: stretch; flex-direction: column; }
    .mongo-compass { display: block; border-radius: 13px; }
    .mongo-pane { min-height: 180px; border-right: 0; border-bottom: 1px solid rgba(148, 163, 184, .14); }
    .mongo-pane__list { max-height: 230px; overflow: auto; }
    .mongo-documents__header { align-items: flex-start; flex-direction: column; }
    .mongo-documents__header .btn,
    .mongo-documents__header .mongo-create-button { width: 100%; }
    .mongo-documents__table { max-height: none; padding: .6rem; }
    .mongo-document-item { grid-template-columns: 38px minmax(0, 1fr) 18px; gap: .6rem; padding: .68rem; }
    .mongo-document-item__icon { width: 38px; height: 38px; }
    .mongo-document-field-chip:nth-child(n+4) { display: none; }
    .mongo-documents__title-row { width: 100%; }
    .mongo-document-search { padding: .75rem; }
    .mongo-search-composer { grid-template-columns: 1fr; gap: .15rem; }
    .mongo-search-composer__field { min-height: 48px; padding: .32rem .55rem; }
    .mongo-search-composer__operator + .mongo-search-composer__field { border-top: 1px solid rgba(148, 163, 184, .09); }
    .mongo-search-composer__operator { display: none; }
    .mongo-search-composer__submit { width: 100%; margin-top: .2rem; }
    .mongo-document-search__footer { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .mongo-json-editor { min-height: 300px; }
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color-scheme: dark;
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100dvh;
    line-height: 1.5;
}

::selection {
    background: rgba(0, 200, 150, 0.3);
}

/* ── Ambient background ── */
.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient__image {
    position: absolute;
    inset: 0;
    background-image: url('https://geradormarketing.com/static/staticlintree/hawk.png');
    background-size: cover;
    background-position: center;
    opacity: 0.18;
    filter: saturate(0.6) blur(1px);
}

.ambient__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 200, 150, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(56, 189, 248, 0.08), transparent 50%),
        linear-gradient(180deg, rgba(8, 11, 16, 0.4) 0%, var(--bg-base) 85%);
}

.ambient__grid-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent);
}

/* ── Glass surface mixin ── */
.glass-surface {
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
}

@supports not (backdrop-filter: blur(20px)) {
    .glass-surface,
    .login-container,
    .dashboard-header,
    .dashboard-sidebar,
    .metric-card,
    .chart-container,
    .table-container {
        background: #12161e;
    }
}

/* ══════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════ */
.login-page {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 420px;
    animation: fade-up 0.5s ease-out both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

body.login-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    padding: clamp(1rem, 4vw, 2rem);
}

.login-container {
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: clamp(1.75rem, 5vw, 2.5rem);
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-header__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.login-header h1 {
    color: var(--text-primary);
    font-size: clamp(1.5rem, 4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.login-alert {
    display: none;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.45;
    animation: alert-in 0.25s ease-out;
}

.login-alert.is-visible { display: flex; }

@keyframes alert-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-alert--error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.login-alert--success {
    background: var(--success-bg);
    color: var(--accent);
    border: 1px solid rgba(0, 200, 150, 0.25);
}

.form-group {
    margin-bottom: 1.125rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap__icon {
    position: absolute;
    left: 0.875rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--transition);
}

.input-wrap input {
    width: 100%;
    padding: 0.8rem 0.875rem 0.8rem 2.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-wrap--password input {
    padding-right: 2.75rem;
}

.input-wrap input::placeholder {
    color: var(--text-muted);
}

.input-wrap input:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.input-wrap:focus-within .input-wrap__icon {
    color: var(--accent);
}

.toggle-password {
    position: absolute;
    right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
}

.toggle-password:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.login-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, var(--accent) 0%, #00a676 100%);
    color: #041510;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 200, 150, 0.3);
    filter: brightness(1.05);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.login-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.login-oauth {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-oauth__hint {
    margin: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.login-btn--telegram,
.telegram-oauth-btn {
    text-decoration: none;
    background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
    color: #fff;
}

.login-btn--telegram:hover:not(:disabled):not(.is-loading),
.telegram-oauth-btn:hover:not(:disabled):not(.is-loading) {
    box-shadow: 0 8px 24px rgba(42, 171, 238, 0.35);
    filter: brightness(1.06);
}

.login-btn--telegram:focus-visible,
.telegram-oauth-btn:focus-visible {
    outline-color: #2aabee;
}

.login-btn--telegram.is-loading,
.telegram-oauth-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

.login-btn--telegram.is-loading::after,
.telegram-oauth-btn.is-loading::after {
    content: '';
    width: 1.125rem;
    height: 1.125rem;
    margin-left: 0.25rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.login-footer i {
    color: var(--accent);
}

.login-spinner {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid rgba(4, 21, 16, 0.25);
    border-top-color: #041510;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ══════════════════════════════════════
   DASHBOARD SHELL
   ══════════════════════════════════════ */
.dashboard-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100dvh;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
}

.dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: var(--sidebar-width);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: rgba(12, 15, 22, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-subtle);
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.dashboard-sidebar.is-open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(0);
        position: sticky;
        flex-shrink: 0;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

.sidebar-brand {
    padding: 1.25rem 1.125rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.625rem;
}

.sidebar-brand h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0;
    min-width: 0;
}

.sidebar-brand__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-brand p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.sidebar-brand__online-wrap {
    position: relative;
    flex-shrink: 0;
}

.sidebar-brand__online {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: rgba(0, 200, 150, 0.08);
    border: 1px solid rgba(0, 200, 150, 0.18);
    color: var(--accent);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.sidebar-brand__online:hover,
.sidebar-brand__online:focus-visible,
.sidebar-brand__online-wrap.is-open .sidebar-brand__online {
    background: rgba(0, 200, 150, 0.14);
    border-color: rgba(0, 200, 150, 0.35);
    outline: none;
}

.sidebar-brand__online i {
    font-size: 0.625rem;
    opacity: 0.85;
}

.sidebar-online-popover {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 200;
    min-width: 10.5rem;
    max-width: min(16rem, 70vw);
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(14, 18, 26, 0.98);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    animation: viewIn 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-online-popover[hidden] {
    display: none !important;
}

.sidebar-online-popover__title {
    margin: 0 0 0.35rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-online-popover__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-online-popover__list li {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.sidebar-online-popover__count {
    min-width: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.sidebar-online-popover__name {
    text-transform: lowercase;
    word-break: break-word;
}

.sidebar-online-popover__empty {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.875rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.sidebar-nav__item i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    color: var(--text-muted);
    transition: color var(--transition);
}

.sidebar-nav__item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.sidebar-nav__item:hover i {
    color: var(--accent);
}

.sidebar-nav__item.is-active {
    background: var(--accent-muted);
    border-color: rgba(0, 200, 150, 0.25);
    color: var(--accent);
}

.sidebar-nav__item.is-active i {
    color: var(--accent);
}

.sidebar-nav__item--danger.is-active {
    background: var(--danger-bg);
    border-color: rgba(248, 113, 113, 0.25);
    color: var(--danger);
}

.sidebar-nav__item--danger.is-active i {
    color: var(--danger);
}

.sidebar-nav__divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.5rem 0.25rem;
}

.dashboard-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(0.75rem, 2vw, 1.25rem);
    padding-bottom: clamp(1.5rem, 3vw, 2rem);
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    margin-bottom: 1rem;
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

@media (min-width: 1024px) {
    .sidebar-toggle {
        display: none;
    }
}

.header-title {
    flex: 1;
    min-width: 0;
}

.header-title h1 {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-title h1 i {
    color: var(--accent);
    margin-right: 0.375rem;
}

.header-title p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.header-actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.header-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.header-actions__label {
    line-height: 1;
}

@media (max-width: 767px) {
    .dashboard-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "toggle title"
            "actions actions";
        align-items: start;
        column-gap: 0.75rem;
        row-gap: 0.625rem;
    }

    .sidebar-toggle {
        grid-area: toggle;
        margin-top: 0.125rem;
    }

    .header-title {
        grid-area: title;
        min-width: 0;
    }

    .header-title h1 {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 1.05rem;
        line-height: 1.25;
    }

    .header-title p {
        font-size: 0.72rem;
        line-height: 1.4;
        margin-top: 0.2rem;
    }

    .header-actions {
        grid-area: actions;
        width: 100%;
        justify-content: stretch;
    }

    .header-actions .btn {
        flex: 1 1 0;
        min-width: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 420px) {
    .header-actions__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .header-actions .btn {
        position: relative;
        flex: 1 1 0;
        padding: 0.5rem 0.35rem;
        font-size: 1rem;
    }

    .header-title p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.dashboard-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.dashboard-toolbar .form-select {
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .dashboard-toolbar {
        grid-template-columns: 1fr 1fr;
    }
}

.dashboard-content {
    flex: 1;
}

/* ── Cards & metrics ── */
.metric-card,
.chart-container,
.table-container {
    background: var(--card-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: clamp(1rem, 2.5vw, 1.25rem);
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
    transition: transform var(--transition), border-color var(--transition);
}

.metric-card {
    border-left: 3px solid var(--accent);
    height: 100%;
}

.metric-card:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 200, 150, 0.2);
}

.metric-value {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    word-break: break-word;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.375rem;
}

.chart-container h4,
.table-container h4,
.panel-title {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container h4 i,
.table-container h4 i {
    color: var(--accent);
}

/* ── Loading ── */
.loading {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.loading--error:not([hidden]) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.loading--error .bi-exclamation-triangle {
    font-size: 1.75rem;
    color: var(--danger, #e5484d);
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Status indicators ── */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-online { background: var(--accent); box-shadow: 0 0 8px rgba(0, 200, 150, 0.5); }
.status-offline { background: var(--danger); }
.status-warning { background: var(--warning); }

/* ── Location map ── */
.map-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.map-toolbar--end {
    justify-content: flex-end;
}

.map-popup__system {
    color: var(--accent, #00c896);
    font-size: 0.8125rem;
    font-weight: 500;
}

.map-tab-panel[hidden] {
    display: none !important;
}

.map-top-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 0.65rem;
}

.map-top-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.25rem;
    flex: 1 1 auto;
    min-width: 0;
}

.map-top-toolbar__refresh {
    flex-shrink: 0;
    align-self: flex-end;
}

.map-filter-group {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.map-filter-group__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0;
}

.map-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    max-width: 100%;
}

.map-segmented__btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.5rem 0.85rem;
    border-radius: calc(var(--radius-md) - 3px);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.map-segmented__btn i {
    font-size: 0.9rem;
    opacity: 0.85;
}

.map-segmented__btn:hover:not(.is-active):not(:disabled) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.map-segmented__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 200, 150, 0.35);
}

.map-segmented__btn.is-active {
    color: var(--text-primary);
    background: rgba(0, 200, 150, 0.14);
    box-shadow: inset 0 0 0 1px rgba(0, 200, 150, 0.28);
}

.map-segmented--period .map-segmented__btn {
    min-width: 2.75rem;
    padding-inline: 0.65rem;
    font-variant-numeric: tabular-nums;
}

.map-filter-group.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.map-filter-group.is-disabled .map-segmented__btn {
    cursor: not-allowed;
}

.map-top-hint {
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid rgba(0, 200, 150, 0.45);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

@media (max-width: 640px) {
    .map-top-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .map-top-toolbar__filters {
        flex-direction: column;
        align-items: stretch;
    }

    .map-segmented {
        display: flex;
        width: 100%;
    }

    .map-segmented__btn {
        flex: 1 1 auto;
    }

    .map-segmented--period .map-segmented__btn {
        min-width: 0;
    }

    .map-top-toolbar__refresh {
        width: 100%;
    }
}

.map-top-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 960px) {
    .map-top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.map-top-table td strong {
    color: var(--accent, #00c896);
}

.map-subtabs {
    margin-top: 0.25rem;
}

.map-stats {
    margin: 0;
}

.map-stats.metrics-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .map-stats.metrics-panel {
        grid-template-columns: 1fr;
    }
}

.map-loading {
    min-height: 120px;
}

.map-canvas,
#locationMap {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

/* Map tab — mobile: mapa quadrado cabe no viewport (dvh) */
@media (max-width: 768px) {
    #viewMap {
        --map-mobile-chrome: calc(16.5rem + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
    }

    #viewMap .section-intro {
        margin-bottom: 0;
    }

    #viewMap .section-intro p {
        display: none;
    }

    #viewMap .section-intro h2 {
        font-size: 1rem;
        margin-bottom: 0;
    }

    #viewMap .map-panel {
        gap: 0.625rem;
    }

    #viewMap .map-stats.metrics-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
    }

    #viewMap .map-stats .stat-cell {
        padding: 0.5rem 0.55rem;
    }

    #viewMap .map-stats .stat-cell__icon {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 0.75rem;
    }

    #viewMap .map-stats .stat-cell__label {
        font-size: 0.625rem;
    }

    #viewMap .map-stats .stat-cell__value {
        font-size: 1.0625rem;
    }

    #viewMap .map-subtabs.client-subtabs {
        width: 100%;
        margin-top: 0;
        margin-bottom: 0;
    }

    #viewMap .map-subtabs .client-subtabs__btn {
        flex: 1 1 50%;
        text-align: center;
        justify-content: center;
    }

    #viewMap #mapTabLive {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    #viewMap #mapTabLive .map-toolbar {
        margin: 0;
    }

    #viewMap .map-canvas,
    #viewMap #locationMap {
        width: min(100%, calc(100dvh - var(--map-mobile-chrome)), calc(100vw - 1.5rem));
        max-height: min(calc(100dvh - var(--map-mobile-chrome)), calc(100vw - 1.5rem));
        margin-inline: auto;
        align-self: center;
    }

    #viewMap #mapTabTop {
        max-height: calc(100dvh - var(--map-mobile-chrome));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.map-empty.is-hidden,
.map-error.is-hidden {
    display: none;
}

.map-error.is-error {
    color: var(--danger);
}

.map-popup {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-primary, #e8eaed);
}

.map-popup small {
    color: var(--text-muted, #9aa0a6);
}

.leaflet-container {
    font-family: inherit;
    background: rgba(255, 255, 255, 0.03);
}

.leaflet-popup-content-wrapper {
    background: var(--bg-elevated, #1e2228);
    color: var(--text-primary, #e8eaed);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.leaflet-popup-tip {
    background: var(--bg-elevated, #1e2228);
}

.leaflet-popup-content {
    margin: 0.65rem 0.85rem;
}

.leaflet-control-zoom a {
    background: var(--bg-elevated, #1e2228) !important;
    color: var(--text-primary, #e8eaed) !important;
    border-color: var(--border-subtle, rgba(255, 255, 255, 0.12)) !important;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.45) !important;
    color: var(--text-muted, #9aa0a6) !important;
    font-size: 0.65rem;
}

.leaflet-control-attribution a {
    color: var(--accent, #00c896) !important;
}

/* ── Bootstrap overrides (dark glass) ── */
.form-control,
textarea.form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 42px;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2394a3b8'%3e%3cpath d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 14px;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.form-select:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background-color: rgba(255, 255, 255, 0.06);
}

.form-control:focus,
textarea.form-control:focus {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
    color: var(--text-primary);
}

.form-select:focus {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
    color: var(--text-primary);
    outline: none;
}

.form-select option {
    background-color: #12161e;
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #00a676 100%);
    border: none;
    color: #041510;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    color: #041510;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 200, 150, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent) 0%, #00a676 100%);
    border: none;
    color: #041510;
}

.btn-success:hover {
    filter: brightness(1.08);
    color: #041510;
}

.btn-danger {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.25);
    color: #fca5a5;
}

.btn-warning {
    background: var(--warning-bg);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--warning);
}

.btn-info {
    background: var(--info-bg);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: var(--info);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.btn-outline-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(0, 200, 150, 0.06);
    --bs-table-border-color: var(--border-subtle);
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom-color: var(--border-subtle);
    white-space: nowrap;
}

.table tbody tr {
    transition: background var(--transition);
}

.table tbody tr:hover {
    transform: none;
    box-shadow: none;
}

.badge {
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge:hover {
    white-space: normal;
    word-wrap: break-word;
    max-width: none;
}

.badge.bg-primary {
    background: var(--accent-muted) !important;
    color: var(--accent) !important;
}

.badge.bg-success {
    background: var(--success-bg) !important;
    color: var(--accent) !important;
}

.badge.bg-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
}

.badge.bg-warning {
    background: var(--warning-bg) !important;
    color: var(--warning) !important;
}

.badge.bg-info {
    background: var(--info-bg) !important;
    color: var(--info) !important;
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: var(--info);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: var(--warning);
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(0, 200, 150, 0.25);
    color: var(--accent);
}

.card {
    background: var(--card-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.card.bg-warning,
.card.bg-primary,
.card.bg-success,
.card.bg-info {
    background: var(--card-surface) !important;
    border-left: 3px solid var(--warning);
}

.card.bg-primary { border-left-color: var(--info); }
.card.bg-success { border-left-color: var(--accent); }
.card.bg-info { border-left-color: var(--info); }

.card.bg-warning .card-title,
.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-info .card-title {
    color: var(--text-secondary) !important;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card.bg-warning h3,
.card.bg-primary h3,
.card.bg-success h3,
.card.bg-info h3 {
    color: var(--accent) !important;
    font-weight: 700;
}

.card.bg-warning.text-white,
.card.bg-primary.text-white,
.card.bg-success.text-white,
.card.bg-info.text-white {
    color: var(--text-primary) !important;
}

.list-group-item {
    background: var(--bg-input);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.list-group-item-action:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.input-group-text {
    background: var(--bg-input);
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

.modal-content {
    background: rgba(18, 22, 30, 0.96);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.modal-header {
    border-bottom-color: var(--border-subtle);
}

.modal-footer {
    border-top-color: var(--border-subtle);
}

.modal-header.bg-primary,
.modal-header.bg-danger {
    background: var(--bg-elevated) !important;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header.bg-primary .modal-title {
    color: var(--accent);
}

.modal-header.bg-danger .modal-title {
    color: var(--danger);
}

.btn-close {
    filter: invert(1) grayscale(1) brightness(1.5);
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-secondary { color: var(--text-secondary) !important; }

pre code {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.modal-body .text-break {
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-subtle);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .metric-value {
        font-size: 1.375rem;
    }

    .mobile-hide {
        display: none;
    }

    .chart-container canvas {
        max-height: 280px;
    }

    .table-responsive {
        font-size: 0.8125rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ══════════════════════════════════════
   ADMIN V2 — views, system picker, IPs
   ══════════════════════════════════════ */
.view-panel {
    display: none;
    animation: viewIn 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.view-panel.is-active {
    display: block;
}

@keyframes viewIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-footer {
    padding: 0.75rem 0.625rem 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
}

.sidebar-user__avatar-wrap {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-user__avatar-wrap > .sidebar-user__avatar,
.sidebar-user__avatar-wrap > .sidebar-user__avatar--placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.sidebar-user__avatar-wrap > .sidebar-user__avatar.is-visible {
    display: block;
}

.sidebar-user__avatar-wrap > .sidebar-user__avatar--placeholder.is-visible {
    display: flex;
}

.sidebar-user__avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-user__avatar--placeholder {
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(0, 200, 150, 0.12);
}

.sidebar-user__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sidebar-user__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user__username {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.access-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid var(--border-subtle);
}

.access-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(0, 200, 150, 0.12);
}

.access-col-avatar {
    width: 2.75rem;
}

.sidebar-footer .sidebar-nav__item {
    text-decoration: none;
}

.nav-badge {
    margin-left: auto;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sidebar-nav__item.is-active .nav-badge {
    background: rgba(0, 200, 150, 0.2);
    color: var(--accent);
}

.section-intro {
    margin-bottom: 1.25rem;
}

.section-intro h2 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.section-intro p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    max-width: 52ch;
}

.client-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    width: fit-content;
    max-width: 100%;
}

.client-subtabs__btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.client-subtabs__btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.client-subtabs__btn.is-active {
    color: var(--text-primary);
    background: rgba(0, 200, 150, 0.12);
    box-shadow: inset 0 0 0 1px rgba(0, 200, 150, 0.25);
}

.client-tab-panel[hidden] {
    display: none !important;
}

.client-release-panel {
    display: grid;
    gap: 1.25rem;
}

.client-release-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.client-release-form .release-dropzone {
    width: 100%;
    max-width: 40rem;
}

.client-release-form .client-release-actions {
    width: 100%;
    max-width: 40rem;
}

.client-release-form .client-release-feedback {
    width: 100%;
    max-width: 40rem;
}

.client-release-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.client-release-status__main {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    flex: 1;
    min-width: 0;
}

.client-release-status__downloads {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding-left: 0.75rem;
    padding-right: 0.25rem;
    border-left: 1px solid var(--border-subtle);
    min-width: 5rem;
    text-align: center;
}

.client-release-status__downloads[hidden] {
    display: none !important;
}

.client-release-status__downloads-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.client-release-status__downloads-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.client-release-status.is-empty .client-release-status__downloads {
    display: none !important;
}

.client-release-status.is-empty {
    border-style: dashed;
}

.client-release-status.is-warning {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.06);
}

.client-release-status__icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 1.05rem;
}

.client-release-status.is-empty .client-release-status__icon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.client-release-status.is-warning .client-release-status__icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.client-release-status__label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.25rem;
}

.client-release-status__value {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    line-height: 1.45;
}

.client-release-status__value strong {
    color: var(--text-primary);
}

.client-release-status__version {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 200, 150, 0.14);
    border: 1px solid rgba(0, 200, 150, 0.28);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.75rem;
}

.client-release-status__detail {
    color: var(--text-muted);
}

.client-release-status__detail code {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.client-release-status__detail.is-ok {
    color: var(--accent);
}

.client-release-status__detail.is-bad {
    color: var(--danger);
}

.release-dropzone {
    position: relative;
    display: grid;
    gap: 0.75rem;
    padding: 1.35rem 1.25rem;
    min-height: 11rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 200, 150, 0.08), transparent 60%),
        var(--bg-elevated);
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
    outline: none;
}

.release-dropzone:hover,
.release-dropzone:focus-visible {
    border-color: rgba(0, 200, 150, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.1);
}

.release-dropzone.is-dragover {
    border-color: var(--accent);
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 200, 150, 0.16), transparent 60%),
        rgba(0, 200, 150, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.16);
    transform: scale(1.005);
}

.release-dropzone.has-file {
    cursor: default;
    border-style: solid;
    border-color: rgba(0, 200, 150, 0.28);
    min-height: auto;
}

.release-dropzone.has-file:hover {
    transform: none;
}

.release-dropzone.is-invalid.has-file {
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.08);
}

.release-dropzone__idle {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.5rem 0;
}

.release-dropzone__idle[hidden],
.release-dropzone__selected[hidden] {
    display: none !important;
}

.release-dropzone__icon-wrap {
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    margin-bottom: 0.35rem;
    border-radius: 999px;
    background: rgba(0, 200, 150, 0.1);
    border: 1px solid rgba(0, 200, 150, 0.22);
    color: var(--accent);
    font-size: 1.45rem;
    transition: transform var(--transition), background var(--transition);
}

.release-dropzone:hover .release-dropzone__icon-wrap,
.release-dropzone.is-dragover .release-dropzone__icon-wrap {
    transform: translateY(-2px);
    background: rgba(0, 200, 150, 0.16);
}

.release-dropzone__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.release-dropzone__subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

.release-dropzone__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.release-dropzone__chip code {
    color: var(--accent);
    font-size: 0.75rem;
}

.release-dropzone__selected {
    display: grid;
    gap: 0.75rem;
}

.release-file-preview {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
}

.release-file-preview__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: var(--info);
    font-size: 1.15rem;
}

.release-dropzone.is-invalid .release-file-preview__icon {
    background: var(--danger-bg);
    border-color: rgba(248, 113, 113, 0.25);
    color: var(--danger);
}

.release-file-preview__info {
    flex: 1;
    min-width: 0;
}

.release-file-preview__name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.release-file-preview__meta {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.release-dropzone.is-invalid .release-file-preview__meta {
    color: var(--danger);
}

.release-file-preview__badge {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.release-file-preview__badge.is-valid {
    background: var(--success-bg);
    border: 1px solid rgba(0, 200, 150, 0.28);
    color: var(--accent);
}

.release-file-preview__badge.is-invalid {
    background: var(--danger-bg);
    border: 1px solid rgba(248, 113, 113, 0.28);
    color: var(--danger);
}

.release-dropzone__change {
    justify-self: start;
    appearance: none;
    border: none;
    background: transparent;
    color: var(--accent);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition);
}

.release-dropzone__change:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.client-release-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 42ch;
    line-height: 1.5;
}

.client-release-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.client-release-feedback {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.client-release-feedback[hidden] {
    display: none !important;
}

.client-release-feedback__text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.45;
}

.client-release-feedback__text[hidden] {
    display: none !important;
}

.client-release-feedback.is-progress {
    border-color: rgba(0, 200, 150, 0.22);
    background:
        radial-gradient(ellipse 90% 80% at 50% 0%, rgba(0, 200, 150, 0.08), transparent 65%),
        rgba(255, 255, 255, 0.03);
}

.client-release-feedback.is-progress.is-processing .client-release-progress__bar {
    animation: release-progress-indeterminate 1.35s ease-in-out infinite;
}

.client-release-progress {
    display: grid;
    gap: 0.55rem;
    width: 100%;
}

.client-release-progress[hidden] {
    display: none !important;
}

.client-release-progress__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.client-release-progress__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.client-release-progress__pct {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.client-release-progress__track {
    position: relative;
    overflow: hidden;
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.client-release-progress__bar {
    position: relative;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        rgba(0, 200, 150, 0.85) 0%,
        rgba(0, 230, 170, 1) 50%,
        rgba(0, 200, 150, 0.85) 100%
    );
    box-shadow:
        0 0 12px rgba(0, 200, 150, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: width 0.18s ease-out;
}

.client-release-progress__bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.28) 45%,
        transparent 90%
    );
    transform: translateX(-120%);
    animation: release-progress-shimmer 1.6s ease-in-out infinite;
}

.client-release-progress__detail {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

@keyframes release-progress-shimmer {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

@keyframes release-progress-indeterminate {
    0%, 100% { opacity: 0.72; }
    50% { opacity: 1; }
}

.client-release-feedback.is-success {
    border-color: rgba(0, 200, 150, 0.28);
    background: var(--success-bg);
    color: var(--accent);
}

.client-release-feedback.is-success .client-release-feedback__text::before {
    content: '\f26b';
    font-family: 'bootstrap-icons';
    font-size: 0.95rem;
    line-height: 1;
}

.client-release-feedback.is-error {
    border-color: rgba(248, 113, 113, 0.28);
    background: var(--danger-bg);
    color: var(--danger);
}

.client-release-feedback.is-error .client-release-feedback__text::before {
    content: '\f623';
    font-family: 'bootstrap-icons';
    font-size: 0.95rem;
    line-height: 1;
}

@media (max-width: 640px) {
    .client-release-status {
        flex-direction: column;
        align-items: stretch;
    }

    .client-release-status__downloads {
        flex-direction: row;
        align-items: baseline;
        justify-content: center;
        gap: 0.35rem;
        padding-left: 0;
        padding-top: 0.65rem;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        min-width: 0;
    }

    .release-dropzone {
        min-height: 10rem;
        padding: 1.1rem 1rem;
    }

    .release-file-preview {
        flex-wrap: wrap;
    }

    .release-file-preview__badge {
        margin-left: 3.375rem;
    }
}

.systems-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.875rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.system-switcher {
    position: relative;
    flex: 1 1 220px;
    min-width: 0;
}

.system-switcher__trigger {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.system-switcher__trigger:hover {
    border-color: rgba(0, 200, 150, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.system-switcher.is-open .system-switcher__trigger,
.system-switcher__trigger:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.system-switcher__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.system-switcher__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.system-switcher__name {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.system-switcher__meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.system-switcher__chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.system-switcher.is-open .system-switcher__chevron {
    transform: rotate(180deg);
}

.system-switcher__menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 60;
    padding: 0.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: rgba(14, 18, 26, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    animation: viewIn 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.system-switcher__search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.625rem;
    margin-bottom: 0.35rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-muted);
}

.system-switcher__search-wrap i {
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.system-switcher__search {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    outline: none;
}

.system-switcher__search::placeholder {
    color: var(--text-muted);
}

.system-switcher__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(240px, 40dvh);
    overflow-y: auto;
}

.system-switcher__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.system-switcher__option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.system-switcher__option.is-selected {
    background: var(--accent-muted);
    color: var(--accent);
}

.system-switcher__option-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.system-switcher__option-count {
    flex-shrink: 0;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}

.system-switcher__option.is-selected .system-switcher__option-count {
    background: rgba(0, 200, 150, 0.18);
    color: var(--accent);
}

.system-switcher__empty {
    margin: 0.35rem 0 0;
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

/* Seletor de sistema — modal criar usuário */
.system-switcher--create {
    flex: none;
    width: 100%;
}

.system-switcher--create .system-switcher__trigger {
    min-height: 3rem;
    padding: 0.625rem 0.875rem;
}

.system-switcher--create .system-switcher__menu {
    z-index: 1300;
}

.system-switcher--create.is-placeholder .system-switcher__name {
    color: var(--text-muted);
    font-weight: 500;
}

.system-switcher--create.is-invalid .system-switcher__trigger {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.18);
}

.user-create-system-field {
    margin-bottom: 0.125rem;
}

.user-create-system-field .system-switcher__option-count::after {
    content: ' usuários';
    font-weight: 400;
    opacity: 0.75;
}

@media (max-width: 576px) {
    .system-switcher--create .system-switcher__menu {
        position: static;
        margin-top: 0.35rem;
        box-shadow: none;
    }
}

/* Migração de usuário entre sistemas (modal de detalhe) */
.user-migrate {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-migrate__route {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.user-migrate__node {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.user-migrate__node--target {
    align-items: flex-end;
    text-align: right;
}

.user-migrate__node-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.user-migrate__node-system {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.user-migrate__node-system i {
    color: var(--accent);
    flex-shrink: 0;
}

.user-migrate__node-system.is-placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.user-migrate__node-system.is-placeholder i {
    color: var(--text-muted);
}

.user-migrate__arrow {
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent-muted);
    color: var(--accent);
}

.user-migrate__note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0;
    padding: 0.75rem 0.875rem;
    background: var(--warning-bg);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.user-migrate__note i {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.user-migrate__note strong {
    color: var(--text-primary);
}

.user-migrate-target-field {
    margin-bottom: 0;
}

.user-migrate-target-field .system-switcher__option-count::after {
    content: ' usuários';
    font-weight: 400;
    opacity: 0.75;
}

@media (max-width: 576px) {
    .user-migrate__route {
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-migrate__node--target {
        align-items: flex-start;
        text-align: left;
    }

    .user-migrate__arrow {
        align-self: flex-start;
        transform: rotate(90deg);
    }
}

.systems-toolbar__period {
    flex: 0 0 auto;
}

.systems-toolbar__period .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.6875rem;
}

.period-control {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.period-control input[type="number"] {
    width: 3.25rem;
    padding: 0.5rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    text-align: center;
}

.period-control input[type="number"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.period-control__suffix {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.period-control .btn {
    padding: 0.45rem 0.55rem;
}

.metrics-panel {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 0.875rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--border-subtle);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

@media (max-width: 960px) {
    .metrics-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .metrics-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.stat-cell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: rgba(14, 18, 26, 0.88);
    backdrop-filter: blur(12px);
    min-height: 5.5rem;
    transition: background var(--transition);
}

.stat-cell:hover {
    background: rgba(18, 24, 34, 0.95);
}

.stat-cell__head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.stat-cell__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 7px;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.stat-cell__icon--blue {
    background: rgba(96, 165, 250, 0.14);
    color: #60a5fa;
}

.stat-cell__icon--violet {
    background: rgba(167, 139, 250, 0.14);
    color: #a78bfa;
}

.stat-cell__icon--amber {
    background: rgba(251, 191, 36, 0.14);
    color: #fbbf24;
}

.stat-cell__icon--green {
    background: rgba(0, 200, 150, 0.14);
    color: var(--accent);
}

.stat-cell__icon--teal {
    background: rgba(45, 212, 191, 0.12);
    color: #2dd4bf;
}

.stat-cell__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-cell__pulse {
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.5);
    animation: statPulse 2.4s ease-out infinite;
    flex-shrink: 0;
}

@keyframes statPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.45); }
    70% { box-shadow: 0 0 0 6px rgba(0, 200, 150, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0); }
}

.stat-cell__value {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1.15;
}

.stat-cell__value--accent {
    color: var(--accent);
}

.stat-cell__hint {
    margin: -0.15rem 0 0;
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.presence-panel {
    background: var(--card-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem 0.5rem;
    box-shadow: var(--shadow-card);
}

.presence-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border-subtle);
}

.presence-panel__title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.presence-panel__title i {
    color: var(--accent);
    font-size: 0.9375rem;
}

.presence-panel__badge {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.presence-empty[hidden],
.presence-empty.is-hidden {
    display: none !important;
}

.presence-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.presence-empty i {
    font-size: 1rem;
    opacity: 0.5;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toolbar-row .form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.toolbar-row input[type="number"] {
    width: 5.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
}

.toolbar-row input[type="number"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.status-banner {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    min-height: 1.25rem;
}

.status-banner.is-error { color: var(--danger); }
.status-banner.is-success { color: var(--accent); }

.online-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.online-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
}

.online-list li:last-child { border-bottom: none; }

.online-user { font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.online-sep { color: var(--text-muted); font-weight: 400; }
.online-game {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(167, 139, 250, 0.12);
    color: #c4b5fd;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.online-meta { color: var(--text-muted); font-size: 0.75rem; text-align: right; }

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2rem;
    opacity: 0.45;
    margin-bottom: 0.75rem;
    display: block;
}

.block-form {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .block-form {
        grid-template-columns: 1fr;
    }
}

.block-form input {
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
}

.block-form input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

.table-wrap .table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap .table th,
.table-wrap .table td {
    padding: 0.75rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.table-wrap .table tbody tr:last-child td {
    border-bottom: none;
}

.reason-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

@media (max-width: 576px) {
    .reason-cell {
        max-width: 120px;
    }
}

.aviso-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aviso-textarea {
    width: 100%;
    min-height: 8rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
}

.aviso-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.aviso-form__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.aviso-duration {
    width: 5rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.aviso-form__actions {
    display: flex;
    gap: 0.5rem;
}

.aviso-meta {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.users-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.users-search {
    flex: 1;
    min-width: 12rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
}

.users-search:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.hwid-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.hwid-input {
    flex: 1;
    min-width: 14rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
}

.hwid-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.hwid-result {
    margin-top: 0.5rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.hwid-result[hidden] {
    display: none;
}

.hwid-result__summary {
    margin: 0 0 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hwid-result__summary.is-success {
    color: var(--accent-green, #00c896);
}

.hwid-result__summary.is-error {
    color: #ff6b6b;
}

.hwid-result__list {
    margin: 0 0 0.625rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hwid-result__list li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.hwid-result__list li i {
    color: var(--accent-green, #00c896);
    margin-right: 0.35rem;
}

.hwid-result__meta {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* HWID — cobrança Pix (painel admin) */
.hwid-pricing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hwid-pricing-title {
    margin-bottom: 0.35rem;
}

.hwid-pricing-lead,
.hwid-reset-lead {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.hwid-pricing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    background: var(--bg-input);
}

.hwid-pricing-badge.is-active {
    border-color: var(--border-subtle);
    color: var(--text-primary);
    background: var(--bg-input);
}

.hwid-pricing-badge.is-warning {
    border-color: rgba(248, 113, 113, 0.35);
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
}

.hwid-pricing-badge.is-muted {
    color: var(--text-secondary);
}

.hwid-pricing-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
}

.hwid-pricing-preview__label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.hwid-pricing-preview__value {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.hwid-pricing-preview__hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hwid-pricing-form__grid {
    display: grid;
    gap: 1rem;
}

.hwid-pricing-field__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.hwid-currency-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hwid-currency-input:focus-within {
    border-color: var(--border-focus);
}

.hwid-currency-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border-right: 1px solid var(--border-subtle);
}

.hwid-currency-control {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 0.65rem 0.75rem;
    font-family: inherit;
}

.hwid-currency-control:focus {
    outline: none;
}

.hwid-pricing-field__help {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.hwid-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    cursor: pointer;
    user-select: none;
}

.hwid-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hwid-toggle__track {
    flex-shrink: 0;
    width: 2.5rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border-subtle);
    position: relative;
    transition: background var(--transition), border-color var(--transition);
}

.hwid-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform var(--transition), background var(--transition);
}

.hwid-toggle input:checked + .hwid-toggle__track {
    background: rgba(0, 200, 150, 0.35);
    border-color: rgba(0, 200, 150, 0.5);
}

.hwid-toggle input:checked + .hwid-toggle__track::after {
    transform: translateX(1.1rem);
    background: var(--accent);
}

.hwid-toggle__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.hwid-toggle__text small {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.hwid-pricing-meta {
    margin: 0.75rem 0 0;
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.hwid-pricing-actions {
    margin-top: 0.85rem;
}

.hwid-reset-card {
    margin-top: 0;
}

.pagination-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem 0.625rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.pagination-controls__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.pagination-controls__info {
    margin: 0;
    text-align: center;
    min-width: 0;
    line-height: 1.35;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pagination-controls__page,
.pagination-controls__total {
    display: block;
}

.pagination-controls__total {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

@media (max-width: 576px) {
    .users-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .users-search {
        min-width: 0;
        width: 100%;
    }

    .users-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .users-toolbar .users-search {
        order: -1;
    }

    .hwid-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .hwid-input {
        min-width: 0;
        width: 100%;
    }

    .hwid-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .pagination-controls {
        gap: 0.375rem 0.5rem;
    }

    .pagination-controls__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .pagination-controls__btn {
        min-width: 2.5rem;
        padding: 0.45rem 0.6rem;
    }

    .pagination-controls__info {
        font-size: 0.75rem;
    }

    .pagination-controls__total {
        font-size: 0.6875rem;
    }

    #viewUsers .table-wrap .table th,
    #viewUsers .table-wrap .table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }

    #viewUsers .table-wrap .table td:first-child {
        max-width: 7rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.user-status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-active {
    background: rgba(0, 200, 150, 0.15);
    color: var(--accent-green, #00c896);
}

.badge-expired {
    background: rgba(255, 90, 90, 0.15);
    color: #ff6b6b;
}

/* ── Modal detalhe usuário ── */
body.admin-modal-open {
    overflow: hidden;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.admin-modal[hidden] {
    display: none;
}

.admin-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(100%, 32rem);
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    background: rgba(18, 22, 30, 0.98);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

.admin-modal__backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.admin-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-modal__heading {
    min-width: 0;
}

.admin-modal__header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    word-break: break-word;
}

.admin-modal__subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-modal__header--logs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "heading actions"
        "meta meta";
    align-items: start;
    gap: 0.375rem 0.75rem;
}

.admin-modal__header--logs .admin-modal__heading {
    grid-area: heading;
}

.admin-modal__header--logs .admin-modal__header-actions {
    grid-area: actions;
}

.admin-modal__header--logs .server-logs-meta {
    grid-area: meta;
    margin: 0;
}

.server-logs-meta {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.server-logs-meta__path {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-muted);
    opacity: 0.9;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.server-logs-viewer {
    max-height: 60vh;
    overflow: auto;
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: #0d1117;
    color: #c9d1d9;
    font: 12px/1.45 ui-monospace, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 576px) {
    #serverLogsModal .admin-modal__header-actions .header-actions__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    #serverLogsModal .admin-modal__header-actions .btn {
        position: relative;
    }

    .server-logs-viewer {
        max-height: 55vh;
        font-size: 11px;
        padding: 10px;
    }
}

.admin-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.admin-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.admin-modal__close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.admin-modal__body {
    padding: 1rem 1.125rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.admin-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.875rem 1.125rem;
    border-top: 1px solid var(--border-subtle);
}

.meet-admin-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.meet-admin-metrics .metric-card {
    margin-bottom: 0;
}

.meet-primary-subtabs {
    width: min(100%, 30rem);
}

.meet-primary-subtabs .client-subtabs__btn {
    flex: 1 1 0;
    justify-content: center;
    text-align: center;
}

.meet-section-panel {
    min-width: 0;
}

.meet-platform-subtabs {
    margin-top: .25rem;
}

.meet-admin-metrics--online {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meet-online-panel { padding: 1rem; }

.meet-online-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.meet-online-panel__header strong,
.meet-online-panel__header small { display: block; }

.meet-online-panel__header small {
    margin-top: .25rem;
    color: var(--text-secondary);
}

.meet-online-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .875rem;
}

.meet-online-product {
    min-width: 0;
    padding: .875rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: .75rem;
    background: var(--bg-input);
}

.meet-online-product > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: .8125rem;
    font-weight: 650;
}

.meet-online-badge {
    flex: 0 0 auto;
    padding: .16rem .5rem;
    border-radius: 999px;
    background: rgba(0, 200, 150, .12);
    color: var(--accent);
    font-size: .6875rem;
    font-weight: 650;
}

.meet-online-list {
    max-height: 15rem;
    overflow-y: auto;
}

.meet-online-list li { padding: .65rem 0; }

.meet-online-empty {
    padding: 1.4rem .5rem .75rem;
    color: var(--text-muted);
    font-size: .75rem;
    text-align: center;
}

@media (max-width: 900px) {
    .meet-admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .meet-admin-metrics { grid-template-columns: 1fr; }
    .meet-online-panel__header { align-items: flex-start; flex-direction: column; }
    .meet-online-grid { grid-template-columns: 1fr; }
}

/* MongoDB Compass — modais de criação --------------------------------- */
.mongo-modal__dialog,
.mongo-document-modal__dialog {
    width: min(calc(100vw - 2rem), 35rem);
    max-width: none;
    max-height: min(92dvh, 800px);
    overflow: hidden;
    border-color: rgba(94, 234, 212, 0.16);
    border-radius: 20px;
    background: linear-gradient(155deg, rgba(21, 30, 43, 0.99), rgba(12, 17, 27, 0.99));
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(0, 200, 150, 0.04);
}

.mongo-document-modal__dialog { width: min(calc(100vw - 2rem), 54rem); }

.mongo-modal__header {
    align-items: center;
    padding: 1.15rem 1.25rem;
    background: linear-gradient(90deg, rgba(0, 200, 150, 0.075), transparent 62%);
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

.mongo-modal__title-group {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.mongo-modal__icon {
    width: 44px;
    height: 44px;
    display: inline-grid;
    flex: 0 0 44px;
    place-items: center;
    border: 1px solid rgba(0, 200, 150, 0.24);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(0, 200, 150, 0.17), rgba(0, 200, 150, 0.06));
    color: #6ee7c7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    font-size: 1.1rem;
}

.mongo-modal__eyebrow {
    display: block;
    margin-bottom: 0.18rem;
    color: #5eead4;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1;
    text-transform: uppercase;
}

.mongo-modal__header .admin-modal__heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
}

.mongo-modal__header .admin-modal__subtitle { margin-top: 0.2rem; color: #8190a6; }
.mongo-modal__header .admin-modal__close { flex: 0 0 34px; width: 34px; height: 34px; background: rgba(255, 255, 255, 0.035); }
.mongo-modal__header .admin-modal__close:hover { background: rgba(255, 255, 255, 0.075); color: var(--text-primary); }

.mongo-form {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.mongo-form[hidden] {
    display: none !important;
}

.mongo-resource-modal__body,
.mongo-document-form__body {
    padding: 1.25rem;
    background: rgba(5, 10, 18, 0.16);
}

.mongo-modal__context {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding: 0.72rem 0.8rem;
    border: 1px solid rgba(96, 165, 250, 0.13);
    border-radius: 12px;
    background: rgba(30, 64, 175, 0.06);
}

.mongo-modal__context-icon {
    width: 32px;
    height: 32px;
    display: inline-grid;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 9px;
    background: rgba(96, 165, 250, 0.1);
    color: #93c5fd;
}

.mongo-modal__context div { min-width: 0; display: grid; gap: 0.12rem; }
.mongo-modal__context span:not(.mongo-modal__context-icon) { color: #718096; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.mongo-modal__context strong { overflow: hidden; color: #dbeafe; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.mongo-form-section {
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.52);
}

.mongo-form-section__heading {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.mongo-form-section__step {
    width: 27px;
    height: 27px;
    display: inline-grid;
    flex: 0 0 27px;
    place-items: center;
    border-radius: 8px;
    background: rgba(0, 200, 150, 0.1);
    color: #6ee7c7;
    font: 800 0.65rem/1 var(--font);
}

.mongo-form-section__heading h3 { margin: 0; color: #e5edf7; font-size: 0.86rem; font-weight: 700; }
.mongo-form-section__heading p { margin: 0.2rem 0 0; color: #718096; font-size: 0.72rem; }
.mongo-form-field + .mongo-form-field { margin-top: 0.9rem; }
.mongo-form-field .form-label { display: block; margin: 0 0 0.38rem; color: #aebdd0; font-size: 0.72rem; font-weight: 700; }
.mongo-form-field .form-label span { color: #5eead4; }

.mongo-input-shell { position: relative; }
.mongo-input-shell > i { position: absolute; z-index: 1; top: 50%; left: 0.78rem; translate: 0 -50%; color: #607089; font-size: 0.86rem; pointer-events: none; }
.mongo-input-shell .mongo-form-input { min-height: 44px; padding-left: 2.35rem; border-color: rgba(148, 163, 184, 0.16); border-radius: 10px; background: rgba(3, 8, 15, 0.58); color: #e5edf7; font-size: 0.82rem; }
.mongo-input-shell:focus-within > i { color: #5eead4; }
.mongo-input-shell:focus-within .mongo-form-input { border-color: rgba(0, 200, 150, 0.45); box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.08); }
.mongo-form-field .form-hint { display: flex; align-items: flex-start; gap: 0.4rem; margin: 0.48rem 0 0; color: #718096; font-size: 0.68rem; line-height: 1.45; }
.mongo-form-field .form-hint i { margin-top: 0.09rem; color: #60a5fa; }
.mongo-form__message:empty { display: none; }
.mongo-form__message:not(:empty) { margin: 0.85rem 0 0; }

.mongo-form__footer,
.mongo-document-form__footer {
    align-items: center;
    justify-content: flex-end;
    padding: 0.9rem 1.25rem;
    background: rgba(6, 11, 19, 0.58);
}

.mongo-form__footer .btn,
.mongo-document-form__footer .btn { min-height: 40px; padding-inline: 1rem; }
.mongo-modal__primary { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-width: 150px; }

.mongo-json-workspace {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    background: rgba(3, 7, 13, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.mongo-json-toolbar {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.72);
}

.mongo-json-toolbar label { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; color: #cbd5e1; font-size: 0.75rem; font-weight: 700; }
.mongo-json-toolbar label i { color: #5eead4; }
.mongo-format-badge { padding: 0.28rem 0.5rem; border: 1px solid rgba(0, 200, 150, 0.2); border-radius: 999px; background: rgba(0, 200, 150, 0.07); color: #6ee7c7; font: 700 0.62rem/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase; }
.mongo-json-editor { min-height: 360px; resize: vertical; padding: 1rem; border: 0; border-radius: 0; background: transparent; color: #d8e5f3; box-shadow: none; font: 500 0.8rem/1.62 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.mongo-json-editor:focus { border: 0; background: rgba(0, 200, 150, 0.018); box-shadow: inset 3px 0 0 rgba(0, 200, 150, 0.5); }
.mongo-json-hint { display: flex; align-items: flex-start; gap: 0.55rem; margin: 0; padding: 0.72rem 0.85rem; border-top: 1px solid rgba(148, 163, 184, 0.1); background: rgba(15, 23, 42, 0.42); color: #718096; font-size: 0.68rem; line-height: 1.5; }
.mongo-json-hint i { margin-top: 0.1rem; color: #fbbf24; }
.mongo-json-hint code { color: #a7f3d0; }
.mongo-document-view { padding: 1.25rem; }

@media (max-width: 600px) {
    .mongo-modal__dialog,
    .mongo-document-modal__dialog { width: min(100%, 34rem); max-height: calc(100dvh - 1rem); border-radius: 16px; }
    .mongo-modal__header { padding: 0.9rem; }
    .mongo-modal__icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
    .mongo-modal__header .admin-modal__subtitle { max-width: 235px; }
    .mongo-resource-modal__body,
    .mongo-document-form__body { padding: 0.85rem; }
    .mongo-form-section { padding: 0.85rem; }
    .mongo-json-toolbar { align-items: flex-start; flex-direction: column; gap: 0.45rem; }
    .mongo-json-editor { min-height: 280px; padding: 0.85rem; font-size: 0.75rem; }
    .mongo-form__footer,
    .mongo-document-form__footer { display: grid; grid-template-columns: 1fr 1fr; padding: 0.75rem 0.85rem; }
    .mongo-form__footer .btn,
    .mongo-document-form__footer .btn { width: 100%; min-width: 0; }
}

.admin-modal__dialog--wide {
    width: min(100%, 42rem);
    max-height: min(92vh, 820px);
}

/* ── Modal Erros/Soluções ── */
.error-solution-modal__dialog {
    width: min(100%, 56rem);
    max-height: min(92vh, 880px);
    overflow: hidden;
}

#errorSolutionModal .error-solution-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#errorSolutionModal .admin-modal__body {
    flex: 1;
    min-height: 0;
    padding: 1rem 1.25rem 1.25rem;
}

.error-solution-form__stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.error-solution-form__section {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.error-solution-form__section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.error-solution-form__section-title i {
    color: var(--accent-teal, #00c896);
    font-size: 0.9375rem;
}

.error-solution-form__optional {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
}

.error-solution-form__required {
    color: var(--accent-teal, #00c896);
    font-weight: 700;
}

.error-solution-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.error-solution-form__field .form-label {
    display: block;
    margin-bottom: 0;
}

.error-solution-form__input,
.error-solution-form__textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.error-solution-form__textarea {
    min-height: 10.5rem;
    resize: vertical;
    line-height: 1.55;
}

.error-solution-form__field .form-text {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.error-solution-form__meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem 1rem;
}

.error-solution-form__content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.error-solution-form__section--content .error-solution-form__field {
    height: 100%;
}

.error-solution-form__section--content .error-solution-form__textarea {
    flex: 1;
    min-height: 11rem;
}

.error-solution-form__footer {
    flex-shrink: 0;
    background: rgba(18, 22, 30, 0.98);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}

/* ── Preview modal Erros/Soluções ── */
.error-solution-preview-modal__dialog {
    width: min(100%, 52rem);
    max-height: min(92vh, 860px);
    overflow: hidden;
}

.error-solution-preview__title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.error-solution-preview__title-row h2 {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.35;
}

.error-solution-preview__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.error-solution-preview__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
}

.error-solution-preview__section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.error-solution-preview__section-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ff8a8a;
}

.error-solution-preview__section-title--solution {
    color: var(--accent-teal, #00c896);
}

.error-solution-preview__block {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
    font-size: 0.875rem;
    color: var(--text-primary);
    max-height: 16rem;
    overflow-y: auto;
}

.error-solution-preview__block--solution {
    border-color: rgba(0, 200, 150, 0.18);
    background: rgba(0, 200, 150, 0.04);
}

.error-solution-preview__meta {
    margin: 0;
    padding-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.error-solution-preview__footer {
    flex-shrink: 0;
    justify-content: space-between;
    background: rgba(18, 22, 30, 0.98);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}

@media (max-width: 720px) {
    .error-solution-modal__dialog {
        width: min(100%, 100%);
        max-height: 100vh;
        border-radius: 0;
    }

    .error-solution-form__meta-grid,
    .error-solution-form__content-grid {
        grid-template-columns: 1fr;
    }

    .error-solution-form__textarea {
        min-height: 8.5rem;
    }
}

.admin-modal__footer-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

#errorSolutionModal .admin-modal__footer {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.error-solutions-toolbar {
    flex-wrap: wrap;
}

.error-solutions-category {
    width: auto;
    min-width: 10rem;
    max-width: 100%;
}

.error-solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
}

.error-solution-card {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 1rem;
    background: var(--card-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    min-height: 100%;
}

.error-solution-card--clickable {
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.error-solution-card--clickable:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 200, 150, 0.22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.error-solution-card--clickable:focus-visible {
    outline: 2px solid var(--accent-teal, #00c896);
    outline-offset: 2px;
}

.error-solution-card__edit-btn {
    flex-shrink: 0;
}

.error-solution-card__head {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.error-solution-card__head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.error-solution-card__download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.error-solution-card__download-btn:hover {
    color: var(--accent-teal, #00c896);
    background: rgba(0, 200, 150, 0.1);
    border-color: rgba(0, 200, 150, 0.22);
}

.error-solution-card__download-btn:focus-visible {
    outline: 2px solid var(--accent-teal, #00c896);
    outline-offset: 2px;
}

.error-solution-card__download-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.error-solution-card__download-btn i {
    font-size: 0.875rem;
    line-height: 1;
}

.error-solution-card__category {
    align-self: flex-start;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-teal, #00c896);
    background: rgba(0, 200, 150, 0.1);
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
}

.error-solution-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--text-primary);
}

.error-solution-card__preview {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
    flex: 1;
}

.error-solution-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.error-solution-tag {
    font-size: 0.6875rem;
    padding: 0.125rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.error-solution-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

.error-solution-card__meta {
    font-size: 0.75rem;
    color: var(--text-muted, var(--text-secondary));
}

.user-detail-form__actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.user-detail-modal-msg {
    margin: 0;
    padding: 0.625rem 1.125rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.user-detail-modal-msg[hidden] {
    display: none;
}

.user-detail-modal-msg.is-success {
    color: var(--accent-green, #00c896);
}

.user-detail-modal-msg.is-error {
    color: #ff6b6b;
}

.user-detail-password {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.user-detail-password--edit .user-detail-password__input {
    flex: 1;
    min-width: 0;
}

.user-detail-password__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.user-detail-password__generate,
.user-detail-password__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
}

.user-detail-password__generate:hover,
.user-detail-password__toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.user-create-success__lead {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.user-create-success__summary {
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-create-success__row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.5rem 0.75rem;
    align-items: start;
}

.user-create-success__row dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.user-create-success__row dd {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-word;
}

.user-create-success__row code {
    font-size: 0.875rem;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.25);
}

.user-create-success__copy-src {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.user-detail-password__value {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
    word-break: break-all;
}

.user-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.user-detail-field {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.625rem 0.75rem;
    align-items: start;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border-subtle);
}

.user-detail-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.user-detail-field--edit {
    grid-template-columns: 1fr;
    gap: 0.375rem;
}

.user-detail-field--readonly .user-detail-field__value {
    opacity: 0.85;
}

.user-detail-field__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.user-detail-field--edit .user-detail-field__label {
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.user-detail-field__value {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-word;
}

.user-detail-field__value--muted {
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.user-detail-json {
    margin: 0;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    line-height: 1.45;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.user-detail-json-fold {
    width: 100%;
}

.user-detail-json-fold__trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.user-detail-json-fold__trigger:hover {
    border-color: rgba(0, 200, 150, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.user-detail-json-fold.is-open .user-detail-json-fold__trigger,
.user-detail-json-fold__trigger:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.user-detail-json-fold__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 6px;
    background: rgba(0, 200, 150, 0.12);
    color: var(--accent-green, #00c896);
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.user-detail-json-fold__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.user-detail-json-fold__title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.user-detail-json-fold__summary {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-detail-json-fold__chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.user-detail-json-fold.is-open .user-detail-json-fold__chevron {
    transform: rotate(180deg);
}

.user-detail-json-fold__body {
    margin-top: 0.375rem;
}

.user-detail-json-fold__body .user-detail-json {
    max-height: min(240px, 35vh);
}

.user-detail-json-fold__body .user-detail-input--json {
    min-height: 6rem;
}

.field-type-picker {
    position: relative;
    width: 100%;
}

.field-type-picker__trigger {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.45rem 0.625rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.field-type-picker__trigger:hover {
    border-color: rgba(0, 200, 150, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.field-type-picker.is-open .field-type-picker__trigger,
.field-type-picker__trigger:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.field-type-picker__icon {
    font-size: 0.875rem;
    color: var(--accent-green, #00c896);
    flex-shrink: 0;
}

.field-type-picker__label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.field-type-picker__chevron {
    font-size: 0.6875rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.field-type-picker.is-open .field-type-picker__chevron {
    transform: rotate(180deg);
}

.field-type-picker__menu {
    position: absolute;
    top: auto;
    bottom: calc(100% + 0.3rem);
    left: 0;
    right: 0;
    z-index: 1250;
    padding: 0.35rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(14, 18, 26, 0.98);
    backdrop-filter: blur(16px);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.4);
}

.field-type-picker__option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.5rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.field-type-picker__option i {
    width: 1rem;
    text-align: center;
    color: var(--accent-green, #00c896);
}

.field-type-picker__option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.field-type-picker__option.is-selected {
    background: rgba(0, 200, 150, 0.12);
    color: var(--accent-green, #00c896);
}

.bool-picker {
    width: 100%;
}

.bool-picker__group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem;
    padding: 0.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
}

.bool-picker__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.375rem;
    padding: 0.45rem 0.625rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.bool-picker__option i {
    font-size: 0.875rem;
}

.bool-picker__option:hover:not(.is-selected) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.bool-picker__option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.bool-picker__option--yes.is-selected {
    background: rgba(0, 200, 150, 0.16);
    border-color: rgba(0, 200, 150, 0.35);
    color: var(--accent-green, #00c896);
}

.bool-picker__option--no.is-selected {
    background: rgba(255, 107, 107, 0.12);
    border-color: rgba(255, 107, 107, 0.35);
    color: #ff8a8a;
}

.user-detail-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
}

.user-detail-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.user-detail-input--json {
    min-height: 5rem;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
}

.user-detail-new-fields {
    margin-top: 0.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-subtle);
}

.user-detail-new-fields__title {
    margin: 0 0 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.user-detail-new-fields__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.user-detail-new-fields__list:empty {
    display: none;
}

.user-detail-new-fields__add {
    width: 100%;
    justify-content: center;
}

.user-detail-new-field {
    display: grid;
    grid-template-columns: minmax(5.5rem, 1fr) minmax(7rem, auto) minmax(7rem, 2fr) auto;
    gap: 0.375rem;
    align-items: start;
}

.user-detail-new-field__type-wrap {
    position: relative;
    min-width: 0;
}

.user-detail-new-field__value-wrap .user-detail-json-fold,
.user-detail-field--edit .user-detail-json-fold {
    grid-column: 1 / -1;
}

.user-detail-new-field__remove {
    align-self: center;
    padding: 0.35rem 0.5rem;
}

.user-detail-error {
    margin: 0;
    color: #ff6b6b;
    font-size: 0.875rem;
}

.users-table__row {
    cursor: pointer;
}

.users-table__system {
    font-size: 0.8125rem;
    color: var(--accent-green, #00c896);
}

.users-loading {
    margin-bottom: 0.75rem;
}

.users-table__row--enter {
    animation: users-row-enter 0.22s ease-out;
}

@keyframes users-row-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.users-table__row:hover,
.users-table__row:focus-visible {
    background: rgba(0, 200, 150, 0.06);
    outline: none;
}

@media (max-width: 576px) {
    .admin-modal {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .admin-modal__dialog {
        width: 100%;
        max-height: 92vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    #clientScriptModal .admin-modal__dialog {
        max-height: min(94dvh, 720px);
    }

    #clientScriptModal .admin-modal__body {
        padding: 0.875rem 1rem 1.125rem;
    }

    #clientScriptModal .admin-modal__footer {
        padding: 0.875rem 1rem calc(0.875rem + env(safe-area-inset-bottom, 0px));
    }

    #clientScriptModal .admin-modal__footer .btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        min-height: 2.75rem;
        justify-content: center;
    }

    .client-script-combobox-field .system-switcher__menu:not([hidden]) .system-switcher__list {
        max-height: min(120px, 22dvh);
    }

    .user-detail-field:not(.user-detail-field--edit) {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .user-detail-new-field {
        grid-template-columns: 1fr auto;
    }

    .user-detail-new-field__key,
    .user-detail-new-field__type-wrap,
    .user-detail-new-field__value-wrap {
        grid-column: 1 / -1;
    }

    .user-detail-new-field__remove {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
    }

    .field-type-picker__menu {
        position: absolute;
        top: auto;
        bottom: calc(100% + 0.3rem);
        margin-top: 0;
        box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.4);
    }
}

/* ── Client catalog (aba Client) ── */
.client-catalog-panel {
    overflow: visible;
}

.client-catalog-toolbar {
    align-items: center;
    margin-bottom: 1rem;
}

.client-catalog-toolbar__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.client-catalog-toolbar__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.client-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.client-stat-chip i {
    color: var(--accent);
    font-size: 0.8125rem;
}

.client-stat-chip--toggle {
    cursor: pointer;
    font-family: inherit;
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        box-shadow var(--transition);
}

.client-stat-chip--toggle:hover {
    border-color: rgba(0, 200, 150, 0.28);
    background: rgba(0, 200, 150, 0.06);
    color: var(--text-primary);
}

.client-stat-chip--toggle.is-active {
    border-color: rgba(0, 200, 150, 0.42);
    background: var(--accent-muted);
    color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 200, 150, 0.12);
}

.client-stat-chip--toggle:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.client-catalog-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

@media (min-width: 1100px) {
    .client-catalog-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-catalog-body.is-category-panel-open {
        grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    }

    .client-category-order:not([hidden]) {
        display: flex;
        flex-direction: column;
        align-self: stretch;
        min-height: 100%;
    }

    .client-category-order:not([hidden]) .client-category-order__card {
        flex: 1;
        min-height: 100%;
    }
}

.client-catalog-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.client-category-order {
    min-width: 0;
}

.client-category-order__card {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    height: 100%;
    min-height: 0;
    padding: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background:
        linear-gradient(145deg, rgba(0, 200, 150, 0.06) 0%, transparent 42%),
        rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.client-category-order.is-dirty .client-category-order__card {
    border-color: rgba(0, 200, 150, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(0, 200, 150, 0.08);
}

.client-category-order__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-shrink: 0;
}

.client-category-order__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: var(--accent-muted);
    color: var(--accent);
    flex-shrink: 0;
}

.client-category-order__intro {
    min-width: 0;
}

.client-category-order__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.client-category-order__hint {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.client-category-order__preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.client-category-order__preview-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.client-category-order__preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.55rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.18);
}

.client-category-order__tab {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-category-order__tab.is-active {
    border-color: rgba(0, 200, 150, 0.35);
    background: var(--accent-muted);
    color: var(--accent);
}

.client-category-order__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
    min-height: 0;
}

.client-category-order__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.55rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    cursor: grab;
    user-select: none;
    transition:
        border-color var(--transition),
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition),
        opacity var(--transition);
}

.client-category-order__item:hover {
    border-color: rgba(0, 200, 150, 0.22);
    background: rgba(255, 255, 255, 0.05);
}

.client-category-order__item.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.client-category-order__item.is-drop-target {
    border-color: var(--accent);
    background: rgba(0, 200, 150, 0.08);
    box-shadow: 0 0 0 1px rgba(0, 200, 150, 0.18);
    transform: translateY(-1px);
}

.client-category-order__grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
    pointer-events: none;
}

.client-category-order__content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.client-category-order__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-category-order__count {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.client-category-order__nudge {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-shrink: 0;
}

.client-category-order__move {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.375rem;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.client-category-order__move:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: rgba(0, 200, 150, 0.28);
    background: rgba(0, 200, 150, 0.08);
}

.client-category-order__move:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.client-category-order__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: var(--radius-sm);
    background: rgba(251, 191, 36, 0.08);
    flex-shrink: 0;
    margin-top: auto;
}

.client-category-order__footer[hidden] {
    display: none;
}

.client-category-order__dirty {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fcd34d;
}

.client-category-order__dirty-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.client-category-order__footer-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .client-catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .client-catalog-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .client-category-order__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .client-category-order__footer-actions {
        width: 100%;
    }

    .client-category-order__footer-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .client-category-order__nudge {
        flex-direction: row;
    }
}

.client-meta {
    flex: 1;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.client-script-form__grid {
    display: grid;
    gap: 1rem;
}

.client-script-form__row--meta {
    display: grid;
    gap: 1rem;
}

@media (min-width: 520px) {
    .client-script-form__row--meta {
        grid-template-columns: 1fr 1fr;
    }
}

.client-script-form__field .form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.client-script-form__field .form-select {
    width: 100%;
    margin-top: 0;
}

.client-script-form__field .form-text {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.client-script-form__field .form-label {
    display: block;
}

#clientScriptModal .client-script-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#clientScriptModal .admin-modal__dialog {
    overflow: hidden;
}

#clientScriptModal .admin-modal__body {
    flex: 1;
    min-height: 0;
}

#clientScriptModal .admin-modal__footer {
    flex-shrink: 0;
    background: rgba(18, 22, 30, 0.98);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}

.form-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.table-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
    white-space: nowrap;
}

#clientScriptsTableWrap .table td,
#clientScriptsTableWrap .table th {
    vertical-align: middle;
}

#clientScriptsTableWrap .table-actions-cell {
    width: 1%;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge--success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.badge--warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.client-script-tutorial-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: color 160ms ease;
}

.client-script-tutorial-badge:hover,
.client-script-tutorial-badge:focus-visible {
    color: #6ee7b7;
    outline: none;
}

.client-script-combobox-field {
    margin-bottom: 0.125rem;
}

.client-script-combobox-field .system-switcher.is-open {
    z-index: 2;
}

.client-script-combobox-field .system-switcher__menu:not([hidden]) {
    z-index: 1400;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.client-script-combobox-field .system-switcher__menu[hidden] {
    display: none !important;
}

.client-script-combobox-field .system-switcher__menu:not([hidden]) .system-switcher__search-wrap {
    order: 3;
    flex-shrink: 0;
    margin-bottom: 0;
    margin-top: 0.35rem;
}

.client-script-combobox-field .system-switcher__menu:not([hidden]) .system-switcher__list {
    order: 1;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(100px, 16dvh);
    overflow-y: auto;
}

.client-script-combobox-field .system-switcher__menu:not([hidden]) .system-switcher__empty {
    order: 2;
    flex-shrink: 0;
    margin: 0.35rem 0 0;
}

.client-script-combobox-field .system-switcher__option-count::after {
    content: ' usuários';
    font-weight: 400;
    opacity: 0.75;
}

.client-script-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.client-script-upload__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.client-script-upload__btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.client-script-upload__status {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.client-script-upload__status.is-error {
    color: #f87171;
}

.client-script-upload__status.is-success {
    color: #6ee7b7;
}

.client-script-upload__status.is-loading {
    color: var(--accent-primary, #38bdf8);
}

@media (max-width: 575.98px) {
    .client-script-upload__btn {
        width: 100%;
        justify-content: center;
    }
}

.system-switcher__option-hint {
    font-size: 0.6875rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .users-toolbar .client-meta {
        flex-basis: 100%;
    }
}

/* ── Game reports (aba Reports) ── */
.reports-toolbar {
    margin-bottom: 1rem;
}

.reports-game-filter {
    min-width: 10rem;
}

.reports-loading {
    margin: 1.5rem 0;
}

.game-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
    gap: 1rem;
}

.game-report-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), border-color var(--transition);
    height: 100%;
}

.game-report-card:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 200, 150, 0.2);
}

.game-report-card__link-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(10, 14, 22, 0.82);
    color: var(--text-secondary);
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.game-report-card__link-btn:hover {
    color: var(--accent-teal, #00c896);
    background: rgba(0, 200, 150, 0.15);
    border-color: rgba(0, 200, 150, 0.35);
}

.game-report-card__link-btn.is-linked {
    color: var(--accent-teal, #00c896);
    border-color: rgba(0, 200, 150, 0.4);
    background: rgba(0, 200, 150, 0.18);
}

.game-report-card__link-btn:focus-visible {
    outline: 2px solid var(--accent-teal, #00c896);
    outline-offset: 2px;
}

.game-report-card__link-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.game-report-card__link-btn i {
    font-size: 0.875rem;
    line-height: 1;
}

.game-report-card__thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
}

.game-report-card__thumb img,
.game-report-card__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-report-card__thumb--empty,
.game-report-card__thumb--doc {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.game-report-card__thumb--video .game-report-card__thumb-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 2rem;
    pointer-events: none;
}

.game-report-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem 1rem 1rem;
    flex: 1;
}

.game-report-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.game-report-card__user {
    font-size: 0.9375rem;
    line-height: 1.3;
    word-break: break-word;
}

.game-report-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.game-report-card__badge--ok {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.game-report-card__badge--fail {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.game-report-card__game {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.game-report-card__key {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.game-report-card__message {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-primary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.game-report-card__meta {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.game-report-card--resolved {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08), var(--shadow-card);
}

.game-report-card--unresolved {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1), var(--shadow-card);
}

.game-report-card--busy {
    opacity: 0.72;
    pointer-events: none;
}

.game-report-card--saved {
    animation: game-report-card-saved 0.55s ease;
}

@keyframes game-report-card-saved {
    0% { transform: scale(1); }
    35% { transform: scale(1.012); }
    100% { transform: scale(1); }
}

.game-report-card__resolution {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.game-report-card__status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.game-report-card__status--pending {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.game-report-card__status--resolved {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.game-report-card__status--unresolved {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.game-report-resolution-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
}

.game-report-resolution-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
}

.game-report-resolution-btn i {
    font-size: 1rem;
    line-height: 1;
}

.game-report-resolution-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    color: var(--text-primary);
}

.game-report-resolution-btn:focus-visible {
    outline: 2px solid rgba(0, 200, 150, 0.55);
    outline-offset: 2px;
}

.game-report-resolution-btn--resolved.is-active,
.game-report-resolution-btn--resolved:hover:not(:disabled) {
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.16);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12);
}

.game-report-resolution-btn--resolved.is-active {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.28), rgba(16, 185, 129, 0.14));
}

.game-report-resolution-btn--unresolved.is-active,
.game-report-resolution-btn--unresolved:hover:not(:disabled) {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.14);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.12);
}

.game-report-resolution-btn--unresolved.is-active {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.28), rgba(245, 158, 11, 0.12));
}

.game-report-resolution-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 576px) {
    .reports-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .reports-toolbar .users-search,
    .reports-toolbar .btn {
        width: 100%;
        min-width: 0;
    }

    .game-reports-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Tarefas / Kanban ── */
.tasks-toolbar {
    margin-bottom: 1rem;
}

.tasks-kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.875rem;
    align-items: start;
}

.tasks-kanban__column {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 0;
    min-height: 12rem;
    padding: 0.625rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.tasks-kanban__column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.125rem 0.25rem 0.375rem;
    border-bottom: 1px solid var(--border-subtle);
}

.tasks-kanban__column-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.tasks-kanban__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.tasks-kanban__dropzone {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex: 1;
    min-height: 8rem;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), box-shadow var(--transition);
}

.tasks-kanban__dropzone.is-drop-target {
    background: rgba(0, 200, 150, 0.08);
    box-shadow: inset 0 0 0 1px rgba(0, 200, 150, 0.35);
}

.tasks-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--card-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    cursor: grab;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.tasks-card:hover {
    border-color: rgba(0, 200, 150, 0.18);
}

.tasks-card.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
    transform: scale(0.98);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    border-color: rgba(0, 200, 150, 0.35);
}

.tasks-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.tasks-card__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.tasks-card__copy,
.tasks-card__edit {
    flex-shrink: 0;
    padding: 0.2rem 0.45rem;
}

.tasks-card--importance-low {
    border-left: 3px solid #6b7280;
}

.tasks-card--importance-medium {
    border-left: 3px solid #3b82f6;
}

.tasks-card--importance-high {
    border-left: 3px solid #f59e0b;
}

.tasks-card--importance-critical {
    border-left: 3px solid #ef4444;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.tasks-card__drop-indicator {
    height: 2px;
    margin: 0.125rem 0;
    border-radius: 999px;
    background: var(--accent-teal, #00c896);
    box-shadow: 0 0 8px rgba(0, 200, 150, 0.45);
    pointer-events: none;
}

.tasks-card__title {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.35;
    font-weight: 600;
    color: var(--text-primary);
}

.task-importance {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.task-importance__option {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    line-height: 1;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.task-importance__option:hover {
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
}

.task-importance__option.is-selected {
    border-color: var(--importance-color, var(--accent-teal));
    background: color-mix(in srgb, var(--importance-color, var(--accent-teal)) 12%, transparent);
    color: var(--text-primary);
}

.task-importance__swatch {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 999px;
    background: var(--importance-color, var(--text-muted));
    flex-shrink: 0;
}

.task-importance__label {
    white-space: nowrap;
}

.task-form__field--importance {
    grid-column: 1 / -1;
}

.tasks-card__desc {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.tasks-card__meta {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.tasks-card__checklist {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tasks-card__checklist-item {
    margin: 0;
}

.tasks-card__checklist-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text-secondary);
    cursor: pointer;
}

.tasks-card__checklist-label span.is-done {
    text-decoration: line-through;
    color: var(--text-muted);
}

.tasks-card__checklist-check {
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--accent-teal, #00c896);
    cursor: pointer;
}

/* ── Modal Tarefas ── */
.task-modal__dialog {
    width: min(100%, 40rem);
    max-height: min(92vh, 820px);
    overflow: hidden;
}

#taskModal .task-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#taskModal .admin-modal__body {
    flex: 1;
    min-height: 0;
    padding: 1rem 1.25rem 1.25rem;
}

.task-form__stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.task-form__section {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.task-form__required {
    color: var(--accent-teal, #00c896);
    font-weight: 700;
}

.task-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.task-form__field .form-label {
    display: block;
    margin-bottom: 0;
}

.task-form__input,
.task-form__textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.task-form__textarea {
    min-height: 6.5rem;
    resize: vertical;
    line-height: 1.55;
}

.task-form__meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.875rem 1rem;
}

.task-form__footer {
    flex-shrink: 0;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(18, 22, 30, 0.98);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}

@media (max-width: 992px) {
    .tasks-kanban {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .task-modal__dialog {
        width: min(100%, 100%);
        max-height: 100vh;
        border-radius: 0;
    }

    .task-form__meta-grid {
        grid-template-columns: 1fr;
    }

    .tasks-kanban {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Overlay de tela (aba Cliente -> Overlay)
   ============================================================ */
.overlay-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.25rem;
    margin-top: 1.25rem;
    align-items: start;
}

@media (max-width: 900px) {
    .overlay-layout { grid-template-columns: 1fr; }
}

.overlay-card,
.overlay-side {
    padding: 1.25rem;
    background: var(--card-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.overlay-card { display: grid; gap: 1.1rem; }
/* Garante que o atributo [hidden] vença as regras de display abaixo
   (preview de imagem, botao "Remover imagem" e aviso do modo Travar). */
.overlay-card [hidden] { display: none !important; }
.overlay-field { display: grid; gap: 0.45rem; }
.overlay-field .form-label { margin-bottom: 0; }

.overlay-req,
.overlay-opt {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    margin-left: 0.35rem;
    vertical-align: middle;
}
.overlay-req { color: var(--accent); background: var(--accent-muted); }
.overlay-opt { color: var(--text-muted); background: rgba(255, 255, 255, 0.05); }

/* Segmented control (tipo de alvo) */
.overlay-segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    padding: 0.3rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}
.overlay-segment__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius-sm) - 4px);
    background: transparent;
    color: var(--text-secondary);
    font: 600 0.8125rem var(--font);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.overlay-segment__btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.overlay-segment__btn.is-active {
    color: var(--accent);
    background: var(--accent-muted);
    border-color: rgba(0, 200, 150, 0.35);
}

/* Input com icone */
.overlay-input-wrap { position: relative; }
.overlay-input-wrap > i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}
.overlay-input.form-control {
    width: 100%;
    min-height: 42px;
    padding: 0.625rem 0.875rem 0.625rem 2.3rem;
}
.overlay-hint { color: var(--text-muted); font-size: 0.74rem; }

/* Dropzone de imagem */
.overlay-drop {
    position: relative;
    display: block;
    cursor: pointer;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow: hidden;
    transition: border-color var(--transition), background var(--transition);
}
.overlay-drop:hover { border-color: rgba(0, 200, 150, 0.45); background: rgba(255, 255, 255, 0.04); }
.overlay-drop__placeholder {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    text-align: center;
    padding: 1.6rem 1rem;
    color: var(--text-muted);
}
.overlay-drop__placeholder i { font-size: 1.7rem; color: var(--text-secondary); }
.overlay-drop__placeholder span { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }
.overlay-drop__placeholder small { font-size: 0.72rem; }
.overlay-drop__preview { display: block; background: #05070b; }
.overlay-drop__preview img { display: block; width: 100%; max-height: 220px; object-fit: contain; }

.overlay-clear {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}
.overlay-clear:hover { text-decoration: underline; }

/* Arquivo de audio */
.overlay-file {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    transition: border-color var(--transition), background var(--transition);
}
.overlay-file:hover { border-color: rgba(0, 200, 150, 0.3); background: rgba(255, 255, 255, 0.04); }
.overlay-file > i { color: var(--accent); font-size: 1rem; flex-shrink: 0; }
.overlay-file > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlay-file.has-file { color: var(--text-primary); border-color: rgba(0, 200, 150, 0.35); }

/* Modos */
.overlay-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.overlay-modes--single { grid-template-columns: minmax(0, 1fr); }
.overlay-modes--single .overlay-mode:disabled { cursor: default; opacity: 1; }
.overlay-modes--single .overlay-mode:disabled:hover {
    border-color: rgba(0, 200, 150, 0.45);
    background: var(--accent-muted);
}
@media (max-width: 480px) { .overlay-modes { grid-template-columns: 1fr; } }
.overlay-mode {
    display: grid;
    gap: 0.15rem;
    text-align: left;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.overlay-mode:hover { border-color: rgba(0, 200, 150, 0.3); background: rgba(255, 255, 255, 0.04); }
.overlay-mode > i { font-size: 1.1rem; color: var(--text-secondary); }
.overlay-mode__title { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.overlay-mode__desc { font-size: 0.72rem; color: var(--text-muted); }
.overlay-mode.is-active { border-color: rgba(0, 200, 150, 0.45); background: var(--accent-muted); }
.overlay-mode.is-active > i,
.overlay-mode.is-active .overlay-mode__title { color: var(--accent); }

/* Aviso do modo Travar */
.overlay-warn {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--warning-bg);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: var(--warning);
    font-size: 0.78rem;
    line-height: 1.4;
}
.overlay-warn > i { margin-top: 0.1rem; flex-shrink: 0; }
.overlay-warn strong { color: var(--warning); font-weight: 700; }

.overlay-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.overlay-actions .btn { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Lado direito - ativos */
.overlay-side { display: grid; gap: 0.85rem; align-content: start; }
.overlay-side__head { display: flex; align-items: center; justify-content: space-between; }
.overlay-side__head h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.overlay-count {
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
}
.overlay-refresh {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.overlay-refresh:hover { color: var(--accent); border-color: rgba(0, 200, 150, 0.4); }

.overlay-active-list { display: grid; gap: 0.55rem; }

.overlay-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}
.overlay-item__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 1rem;
}
.overlay-item__body { flex: 1; min-width: 0; display: grid; gap: 0.25rem; }
.overlay-item__target {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.overlay-item__meta { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.overlay-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}
.overlay-tag--lock { background: var(--warning-bg); color: var(--warning); }
.overlay-tag--audio { background: var(--info-bg); color: var(--info); }
.overlay-item__off {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.overlay-item__off:hover { background: var(--danger-bg); }

.overlay-empty {
    display: grid;
    justify-items: center;
    gap: 0.4rem;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}
.overlay-empty i { font-size: 1.8rem; opacity: 0.4; }
.overlay-empty span { font-size: 0.82rem; }
.overlay-empty.is-error { color: var(--danger); }
.overlay-empty.is-error i { opacity: 0.6; }

/* Segurança e histórico de login --------------------------------------- */
#viewLoginSecurity [hidden] { display: none !important; }
.login-security-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
    padding: .4rem;
    margin: 1.25rem 0 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: rgba(3, 8, 15, .38);
}
.login-security-tab {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}
.login-security-tab > i { flex-shrink: 0; font-size: 1.25rem; }
.login-security-tab > span:first-of-type { flex: 1; min-width: 0; }
.login-security-tab strong { display: block; font-size: .86rem; line-height: 1.4; font-weight: 700; }
.login-security-tab small { display: block; margin-top: .25rem; color: var(--text-muted); font-size: .72rem; }
.login-security-tab:hover { background: rgba(255, 255, 255, .035); }
.login-security-tab[aria-selected="true"] {
    border-color: rgba(0, 200, 150, .35);
    background: linear-gradient(120deg, rgba(0, 200, 150, .12), rgba(0, 200, 150, .035));
    color: var(--accent);
    box-shadow: inset 0 -2px 0 rgba(0, 200, 150, .5);
}
.login-security-tab[aria-selected="true"] strong { color: var(--text-primary); }
.login-security-tab-count {
    flex-shrink: 0;
    min-width: 1.9rem;
    padding: .25rem .5rem;
    border-radius: 8px;
    background: rgba(148, 163, 184, .1);
    font-size: .75rem;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.login-security-tab:focus-visible,
#viewLoginSecurity [role="tabpanel"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.login-security-filter-hint { display: flex; align-items: center; gap: .45rem; color: var(--text-muted); font-size: .75rem; }
.login-security-refresh-label { display: none; }
.login-security-panel-head p { margin: .45rem 0 0; color: var(--text-secondary); font-size: .75rem; line-height: 1.5; }
.login-security-panel-head > span { flex-shrink: 0; }
.login-security-alert > header strong,
.login-security-account { overflow-wrap: anywhere; }
.login-security-alert__facts > span { min-width: 0; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
    .login-security-tab { transition: none; }
}
.login-security-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.login-security-intro > div { min-width: 0; }

.login-security-observe-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .4rem;
    padding: .4rem .7rem;
    border: 1px solid rgba(96, 165, 250, .25);
    border-radius: 999px;
    background: rgba(96, 165, 250, .08);
    color: #93c5fd;
    font-size: .7rem;
    font-weight: 700;
}

.nav-badge--danger.is-alerting {
    background: rgba(248, 113, 113, .2);
    color: #fecaca;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, .24);
}

.login-security-filters {
    display: grid;
    grid-template-columns: minmax(190px, 1.5fr) minmax(160px, 1fr) minmax(145px, .8fr) minmax(150px, .9fr) auto auto;
    align-items: end;
    gap: .75rem;
    padding: 1rem;
}

.login-security-filters label {
    min-width: 0;
    display: grid;
    gap: .4rem;
}

.login-security-filters label > span {
    color: var(--text-secondary);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.login-security-filters .form-control {
    width: 100%;
    min-width: 0;
    min-height: 39px;
    border-color: var(--border-subtle);
    background: rgba(3, 8, 15, .62);
    color: var(--text-primary);
}

.login-security-filters select option { background: #111827; color: var(--text-primary); }
.login-security-filter-btn,
.login-security-refresh-btn { min-height: 39px; }
.login-security-refresh-btn { width: 40px; padding-inline: 0; }

.login-security-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin: 1rem 0;
}

.login-security-stat {
    position: relative;
    overflow: hidden;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, rgba(18, 28, 42, .86), rgba(9, 15, 26, .78));
}

.login-security-stat::after {
    content: '';
    position: absolute;
    inset: auto -18px -28px auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0, 200, 150, .08);
    filter: blur(2px);
}

.login-security-stat--warning::after { background: rgba(251, 191, 36, .12); }
.login-security-stat--danger::after { background: rgba(248, 113, 113, .14); }
.login-security-stat span { display: block; color: var(--text-secondary); font-size: .72rem; }
.login-security-stat strong { display: block; margin-top: .35rem; color: var(--text-primary); font-size: 1.65rem; line-height: 1; }
.login-security-stat--warning strong { color: #fcd34d; }
.login-security-stat--danger strong { color: #fca5a5; }

.login-security-loading { margin: 1rem 0; }
.login-security-alerts,
.login-security-history { margin-top: 1rem; overflow: hidden; }

.login-security-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.login-security-panel-head h3 { margin: .15rem 0 0; color: var(--text-primary); font-size: 1rem; }
.login-security-panel-head > span { color: var(--text-muted); font-size: .72rem; }
.login-security-eyebrow { color: var(--accent); font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.login-security-alert-list { display: grid; gap: .7rem; padding: .85rem; }
.login-security-alert-empty { margin: 0; }

.login-security-alert {
    padding: .85rem .95rem;
    border: 1px solid rgba(251, 191, 36, .18);
    border-left: 3px solid var(--warning);
    border-radius: 12px;
    background: rgba(251, 191, 36, .045);
}

.login-security-alert--high {
    border-color: rgba(248, 113, 113, .22);
    border-left-color: var(--danger);
    background: rgba(248, 113, 113, .05);
}

.login-security-alert--medium { border-left-color: #fb923c; }
.login-security-alert > header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.login-security-alert > header > div { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: .5rem; }
.login-security-alert > header strong { color: var(--text-primary); font-size: .9rem; }
.login-security-alert > header code { color: #93c5fd; font-size: .68rem; }

.login-security-alert__facts {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .85rem;
    margin-top: .65rem;
    color: var(--text-secondary);
    font-size: .7rem;
}
.login-security-alert__facts i { margin-right: .25rem; color: var(--text-muted); }
.login-device-fact--authorized { color: #6ee7c7; }
.login-device-fact--authorized i { color: #34d399; }
.login-device-fact--blocked { color: #fca5a5; }
.login-device-fact--blocked i { color: var(--danger); }

.login-security-reasons { display: grid; gap: .35rem; margin: .65rem 0 0; padding: 0; list-style: none; }
.login-security-reasons li { display: flex; align-items: flex-start; gap: .45rem; color: var(--text-secondary); font-size: .72rem; line-height: 1.45; }
.login-security-reasons li > i { flex: 0 0 auto; margin-top: .1rem; color: var(--warning); }
.login-security-alert--high .login-security-reasons li > i { color: var(--danger); }
.login-security-reasons strong { display: block; color: var(--text-primary); font-size: .72rem; }

.login-risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: .25rem .5rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, .09);
    color: var(--text-secondary);
    font-size: .64rem;
    font-weight: 800;
    white-space: nowrap;
}
.login-risk-badge--attention { background: rgba(251, 191, 36, .1); color: #fcd34d; }
.login-risk-badge--medium { background: rgba(251, 146, 60, .12); color: #fdba74; }
.login-risk-badge--high { background: rgba(248, 113, 113, .13); color: #fca5a5; }
.login-risk-badge--normal { background: rgba(0, 200, 150, .09); color: #6ee7c7; }

.login-security-table { min-width: 930px; }
.login-security-table td { vertical-align: middle; }
.login-security-table time { color: var(--text-secondary); font-size: .72rem; white-space: nowrap; }
.login-security-account { display: block; color: var(--text-primary); font-size: .78rem; }
.login-security-table td > code { color: #93c5fd; font-size: .67rem; }
.login-security-location { display: block; max-width: 260px; color: var(--text-primary); font-size: .74rem; }
.login-security-table td small { display: block; max-width: 240px; margin-top: .2rem; overflow: hidden; color: var(--text-muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.login-security-ip { color: #c4b5fd !important; white-space: nowrap; }
.login-security-table .login-device-status { font-weight: 800; letter-spacing: .02em; }
.login-security-table .login-device-status--authorized { color: #6ee7c7; }
.login-security-table .login-device-status--blocked { color: #fca5a5; }
.login-security-table .login-device-status--historical { color: #fcd34d; }

.login-security-history .pagination-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; padding: .85rem 1rem; border-top: 1px solid var(--border-subtle); }
.login-security-history .pagination-btn {
    flex: 0 0 auto;
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: .72rem;
    font-weight: 700;
}
.login-security-history .pagination-btn:hover:not(:disabled),
.login-security-history .pagination-btn.is-active { border-color: rgba(0, 200, 150, .4); background: var(--accent-muted); color: var(--accent); }
.login-security-history .pagination-btn:disabled { cursor: default; opacity: .35; }

@media (max-width: 1180px) {
    .login-security-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto; }
}

@media (max-width: 760px) {
    .login-security-intro { display: grid; }
    .login-security-tab { gap: .5rem; padding: .75rem; flex-wrap: wrap; align-content: start; }
    .login-security-tab > i { font-size: 1rem; }
    .login-security-tab > span:first-of-type { flex-basis: calc(100% - 2rem); }
    .login-security-tab strong { font-size: .78rem; }
    .login-security-tab small { display: none; }
    .login-security-tab-count { margin-left: 1.5rem; }
    .login-security-panel-head { align-items: flex-start; flex-direction: column; gap: .5rem; }
    .login-security-alert > header { flex-wrap: wrap; }
    .login-security-table { min-width: 0; width: 100%; }
    .login-security-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .login-security-table tbody { display: grid; gap: .75rem; padding: .75rem; }
    .login-security-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; padding: 1rem; border: 1px solid var(--border-subtle); border-radius: 12px; background: rgba(148, 163, 184, .025); }
    .login-security-table td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
    .login-security-table td::before { content: attr(data-label); display: block; margin-bottom: .35rem; color: var(--text-muted); font-size: .64rem; font-weight: 700; }
    .login-security-table .login-security-account-cell { grid-column: 1 / -1; grid-row: 1; }
    .login-security-table time, .login-security-ip { white-space: normal; }
    .login-security-table td small { max-width: 100%; white-space: normal; }
    .login-security-filters .form-control, .login-security-filter-btn, .login-security-refresh-btn { min-height: 44px; }
    .login-security-refresh-label { display: inline; margin-left: .4rem; }
    .login-security-refresh-btn { width: auto; padding-inline: .6rem; }
    .login-security-history .pagination-btn { min-width: 40px; height: 44px; }
    .login-security-observe-badge { justify-self: start; }
    .login-security-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .login-security-filters label:first-child { grid-column: 1 / -1; }
    .login-security-filter-btn { grid-column: 1; }
    .login-security-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-security-alert > header { align-items: flex-start; }
}

@media (max-width: 460px) {
    .login-security-filters { grid-template-columns: 1fr; }
    .login-security-filters label:first-child,
    .login-security-filter-btn { grid-column: auto; }
    .login-security-refresh-btn { width: 100%; }
}
