/* Quizest Super Admin — shared layout styles (every page) */

/* =========================================================
       THEME TOKENS
       ========================================================= */
:root,
[data-theme="dark"] {
    --bg: #0a0d14;
    --surface: #11151f;
    --surface-2: #161b27;
    --surface-3: #1c2232;
    --border: #222a3b;
    --border-strong: #2d3650;
    --text: #e8ecf4;
    --text-2: #a3adc2;
    --muted: #6b7690;
    --primary: #7c6cff;
    --primary-2: #5b4ff0;
    --primary-soft: rgba(124, 108, 255, .14);
    --green: #22c55e;
    --green-soft: rgba(34, 197, 94, .13);
    --amber: #f5a524;
    --amber-soft: rgba(245, 165, 36, .13);
    --rose: #f43f5e;
    --rose-soft: rgba(244, 63, 94, .13);
    --sky: #38bdf8;
    --sky-soft: rgba(56, 189, 248, .13);
    --violet: #c084fc;
    --violet-soft: rgba(192, 132, 252, .13);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .28);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
    --glow: radial-gradient(600px 300px at 0% 0%, rgba(124, 108, 255, .12), transparent 60%),
        radial-gradient(500px 260px at 100% 0%, rgba(56, 189, 248, .07), transparent 60%);
    --shadow-3d: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 -1px 0 rgba(0, 0, 0, .35) inset,
        0 2px 4px rgba(0, 0, 0, .25), 0 12px 28px rgba(0, 0, 0, .35);
    --shadow-3d-hover: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 -1px 0 rgba(0, 0, 0, .35) inset,
        0 6px 10px rgba(0, 0, 0, .25), 0 26px 50px rgba(0, 0, 0, .5);
}

/* sidebar tokens — deep gradient in BOTH themes */
:root {
    --sb-bg: radial-gradient(420px 260px at 0% 0%, rgba(124, 108, 255, .35), transparent 65%),
        radial-gradient(360px 300px at 100% 100%, rgba(56, 189, 248, .18), transparent 65%),
        linear-gradient(175deg, #241a6b 0%, #18124a 38%, #0e0b2e 72%, #080718 100%);
    --sb-text: #c9cbe8;
    --sb-muted: #8a8fbf;
    --sb-hover: rgba(255, 255, 255, .07);
    --sb-border: rgba(255, 255, 255, .09);
}

[data-theme="light"] {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --surface-3: #eef1f7;
    --border: #e5e8f0;
    --border-strong: #d6dbe7;
    --text: #0f1729;
    --text-2: #48536b;
    --muted: #7a8499;
    --primary: #5b4ff0;
    --primary-2: #4338ca;
    --primary-soft: rgba(91, 79, 240, .1);
    --green: #16a34a;
    --green-soft: rgba(22, 163, 74, .1);
    --amber: #d97706;
    --amber-soft: rgba(217, 119, 6, .1);
    --rose: #e11d48;
    --rose-soft: rgba(225, 29, 72, .09);
    --sky: #0284c7;
    --sky-soft: rgba(2, 132, 199, .09);
    --violet: #9333ea;
    --violet-soft: rgba(147, 51, 234, .09);
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
    --shadow-lg: 0 24px 64px rgba(16, 24, 40, .18);
    --glow: radial-gradient(600px 300px at 0% 0%, rgba(91, 79, 240, .07), transparent 60%);
    --shadow-3d: 0 1px 0 #fff inset, 0 -2px 0 rgba(16, 24, 40, .05) inset,
        0 2px 4px rgba(16, 24, 40, .05), 0 12px 28px rgba(16, 24, 40, .09);
    --shadow-3d-hover: 0 1px 0 #fff inset, 0 -2px 0 rgba(16, 24, 40, .05) inset,
        0 6px 10px rgba(16, 24, 40, .07), 0 26px 50px rgba(16, 24, 40, .16);
}

/* =========================================================
       BASE
       ========================================================= */
* {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

html,
body {
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
    background-image: var(--glow);
    background-attachment: fixed;
    transition: background-color .3s, color .3s;
}

a {
    color: var(--primary);
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: .78em;
    letter-spacing: .2px;
}

.text-2 {
    color: var(--text-2) !important;
}

.text-muted-x {
    color: var(--muted) !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* =========================================================
       LAYOUT
       ========================================================= */
.app {
    display: flex;
    align-items: flex-start; /* keeps .main at its content height; sidebar keeps its own 100vh */
    min-height: 100vh;
}

.sidebar {
    width: 264px;
    flex-shrink: 0;
    background: var(--sb-bg);
    color: var(--sb-text);
    border-right: 1px solid var(--sb-border);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: transform .3s ease;
    box-shadow: 1px 0 0 rgba(255, 255, 255, .04) inset, 10px 0 40px rgba(8, 7, 24, .35);
    overflow: hidden;
}

/* soft light streak across the top of the sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167, 155, 255, .7), transparent);
    pointer-events: none;
}

/* faint dotted texture for depth */
.sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .35;
    background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
}

.sidebar>* {
    position: relative;
    z-index: 1;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 22px 28px 40px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--sb-border);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.05rem;
    background: linear-gradient(145deg, #a89bff 0%, #7c6cff 40%, #4f3fe0 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 -3px 0 rgba(0, 0, 0, .25) inset, 0 10px 22px rgba(91, 79, 240, .55);
    transform: perspective(240px) rotateY(-14deg) rotateX(6deg);
    transition: transform .35s;
}

.brand:hover .brand-mark {
    transform: perspective(240px) rotateY(0) rotateX(0) scale(1.06);
}

.brand-name {
    font-weight: 800;
    font-size: 1.12rem;
    letter-spacing: -.4px;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 10px rgba(124, 108, 255, .45);
}

.brand-name span {
    background: linear-gradient(90deg, #a89bff, #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-sub {
    font-size: .68rem;
    color: var(--sb-muted);
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 12px;
}

.nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12);
}

.nav-label {
    font-size: .66rem;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--sb-muted);
    font-weight: 700;
    padding: 16px 10px 6px;
    opacity: .85;
}

.nav-item-x {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 11px;
    color: var(--sb-text);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
    transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}

.nav-item-x i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: var(--sb-muted);
    font-size: .85rem;
    background: rgba(255, 255, 255, .04);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 4px rgba(0, 0, 0, .25);
    transition: color .2s, background .2s, transform .25s;
}

.nav-item-x:hover {
    background: var(--sb-hover);
    color: #fff;
    border-color: rgba(255, 255, 255, .06);
    transform: translateX(3px);
}

.nav-item-x:hover i {
    color: #fff;
    transform: perspective(120px) rotateY(-18deg) scale(1.08);
}

.nav-item-x.active {
    color: #fff;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(124, 108, 255, .95) 0%, rgba(91, 79, 240, .95) 55%, rgba(67, 56, 202, .95) 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .28) inset, 0 -2px 0 rgba(0, 0, 0, .25) inset, 0 10px 24px rgba(79, 63, 224, .55);
    transform: translateY(-1px);
}

.nav-item-x.active i {
    color: #fff;
    background: rgba(255, 255, 255, .18);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 3px 8px rgba(0, 0, 0, .25);
}

.nav-count {
    margin-left: auto;
    font-size: .68rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .09);
    color: var(--sb-text);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset;
}

.nav-item-x.active .nav-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.nav-count.live {
    background: rgba(34, 197, 94, .18);
    color: #4ade80;
}

/* Quizest logo (sidebar is always dark, so the white-text logo is used in both themes) */
.qz-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 14px 20px 14px 14px;
}

.qz-logo {
    display: block;
    width: 178px;
    height: auto;
    transition: transform .35s;
}

.qz-brand:hover .qz-logo {
    transform: scale(1.03);
}

.qz-brand .brand-sub {
    padding-left: 54px;
    margin-top: -8px;
}

.qz-powered {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 16px 6px;
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--sb-muted);
}

.qz-powered img {
    width: 84px;
    height: auto;
    opacity: .9;
}

.sidebar-foot {
    padding: 12px;
    border-top: 1px solid var(--sb-border);
}

.me {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 12px;
    color: #fff;
    transition: background .2s;
}

.me:hover {
    background: var(--sb-hover);
}

.me .text-muted-x {
    color: var(--sb-muted) !important;
}

.me .icon-btn {
    background: rgba(255, 255, 255, .06);
    border-color: var(--sb-border);
    color: var(--sb-text);
}

.me .icon-btn:hover {
    background: rgba(244, 63, 94, .2);
    color: #fff;
}

.me .avatar {
    box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 14px rgba(0, 0, 0, .35);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .8rem;
    color: #fff;
    flex-shrink: 0;
}

/* =========================================================
       TOPBAR
       ========================================================= */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.6px;
    margin: 0;
}

.crumb {
    font-size: .8rem;
    color: var(--muted);
}

.tb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    transition: all .15s;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.icon-btn .ping {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rose);
    box-shadow: 0 0 0 2px var(--surface);
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 10px;
    height: 40px;
    min-width: 240px;
}

.search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search input {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: .85rem;
    flex: 1;
}

.search input::placeholder {
    color: var(--muted);
}

.search kbd {
    background: var(--surface-3);
    color: var(--muted);
    font-size: .66rem;
    border-radius: 5px;
    padding: 2px 6px;
}

.theme-btn .fa-sun {
    display: none;
}

[data-theme="light"] .theme-btn .fa-sun {
    display: inline;
}

[data-theme="light"] .theme-btn .fa-moon {
    display: none;
}

.act-as {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 4px 0 12px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
}

.act-as i {
    color: var(--violet);
    font-size: .85rem;
}

.act-as select {
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    outline: 0;
    max-width: 210px;
    cursor: pointer;
}

.act-as select option {
    background: var(--surface);
}

.btn-primary-x {
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    border: 0;
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 6px 18px rgba(124, 108, 255, .3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform .15s, box-shadow .15s;
}

.btn-primary-x:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(124, 108, 255, .38);
}

.btn-ghost {
    height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    font-weight: 600;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 250px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 9px 10px;
    font-size: .85rem;
    color: var(--text-2);
    display: flex;
    gap: 10px;
    align-items: center;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--surface-3);
    color: var(--text);
}

.dropdown-item .di-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: .8rem;
    flex-shrink: 0;
}

.dropdown-item small {
    display: block;
    color: var(--muted);
    font-size: .72rem;
}

.dropdown-divider {
    border-color: var(--border);
}

/* act-as banner */
.act-banner {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    background: linear-gradient(90deg, var(--violet-soft), transparent);
    border: 1px solid var(--violet-soft);
    font-size: .85rem;
}

.act-banner.show {
    display: flex;
}

.act-banner i.lead-i {
    color: var(--violet);
}

/* =========================================================
       CARDS
       ========================================================= */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    height: 100%;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px 0;
    flex-wrap: wrap;
}

.panel-title {
    font-weight: 700;
    font-size: .98rem;
    letter-spacing: -.2px;
    margin: 0;
}

.panel-sub {
    font-size: .76rem;
    color: var(--muted);
}

.panel-body {
    padding: 16px 18px 18px;
}

.stat-ic {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 1rem;
}

.chip {
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chip.up {
    background: var(--green-soft);
    color: var(--green);
}

.chip.down {
    background: var(--rose-soft);
    color: var(--rose);
}

.chip.live {
    background: var(--green-soft);
    color: var(--green);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.soft-blue {
    background: var(--primary-soft);
    color: var(--primary);
}

.soft-green {
    background: var(--green-soft);
    color: var(--green);
}

.soft-amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.soft-rose {
    background: var(--rose-soft);
    color: var(--rose);
}

.soft-sky {
    background: var(--sky-soft);
    color: var(--sky);
}

.soft-violet {
    background: var(--violet-soft);
    color: var(--violet);
}

/* =========================================================
       TABLE
       ========================================================= */
.tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tbl th {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--muted);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface-2);
}

.tbl th:first-child {
    border-top-left-radius: 10px;
}

.tbl th:last-child {
    border-top-right-radius: 10px;
}

.tbl td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: .84rem;
    vertical-align: middle;
    color: var(--text);
}

.tbl tbody tr {
    transition: background .12s;
}

.tbl tbody tr:hover {
    background: var(--surface-2);
}

.tbl tbody tr:last-child td {
    border-bottom: 0;
}

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

.org-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .72rem;
    flex-shrink: 0;
}

.org-name {
    font-weight: 600;
    line-height: 1.2;
}

.org-meta {
    font-size: .72rem;
    color: var(--muted);
}

.usage {
    min-width: 120px;
}

.usage-bar {
    height: 6px;
    border-radius: 6px;
    background: var(--surface-3);
    overflow: hidden;
    margin-top: 5px;
}

.usage-bar span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--primary);
    transition: width .8s ease;
}

.usage-bar span.warn {
    background: var(--amber);
}

.usage-bar span.full {
    background: var(--rose);
}

.status {
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.st-active,
.st-live {
    background: var(--green-soft);
    color: var(--green);
}

.st-suspended,
.st-completed {
    background: var(--rose-soft);
    color: var(--rose);
}

.st-pending,
.st-upcoming {
    background: var(--amber-soft);
    color: var(--amber);
}

.st-draft {
    background: var(--violet-soft);
    color: var(--violet);
}

.st-completed {
    background: var(--surface-3);
    color: var(--muted);
}

.type-tag {
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--text-2);
}

.row-acts {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.row-acts button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: .8rem;
}

.row-acts button:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border);
}

.row-acts button.act-btn:hover {
    color: var(--violet);
}

/* =========================================================
       MODALS / FORMS
       ========================================================= */
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
    padding: 16px 22px;
}

.modal-body {
    padding: 20px 22px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-backdrop.show {
    opacity: .65;
}

.form-section {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--muted);
    margin: 4px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.form-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 5px;
}

.form-control,
.form-select {
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    font-size: .86rem;
    padding: 9px 12px;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--surface-2);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-control::placeholder {
    color: var(--muted);
}

.form-check-input {
    background-color: var(--surface-3);
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    font-size: .84rem;
    color: var(--text-2);
}

.input-group-text {
    background: var(--surface-3);
    border-color: var(--border);
    color: var(--muted);
    font-size: .82rem;
}

.opt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.opt-key {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--surface-3);
    font-weight: 700;
    font-size: .78rem;
    color: var(--text-2);
    flex-shrink: 0;
}

.opt-row .form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.opt-row .rm {
    border: 0;
    background: transparent;
    color: var(--muted);
    width: 30px;
}

.opt-row .rm:hover {
    color: var(--rose);
}

.hint {
    font-size: .74rem;
    color: var(--muted);
}

.toggle-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    height: 100%;
}

.btn-close {
    filter: var(--close-filter, invert(1) grayscale(1) brightness(2));
}

[data-theme="light"] .btn-close {
    filter: none;
}

.offcanvas {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border) !important;
}

.kv {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    font-size: .84rem;
}

.kv span:first-child {
    color: var(--muted);
}

.toast-wrap {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-x {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 290px;
    max-width: 380px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: .84rem;
    animation: tin .3s ease;
}

@keyframes tin {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* =========================================================
       3D LAYER
       ========================================================= */
.panel {
    box-shadow: var(--shadow-3d);
    transition: box-shadow .3s, transform .3s, border-color .3s;
}

.panel:hover {
    box-shadow: var(--shadow-3d-hover);
    border-color: var(--border-strong);
}

/* buttons with a pressable bottom edge */
.btn-primary-x {
    box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 0px 0 #3b2fc4, 0 10px 22px rgba(91, 79, 240, .4);
    transform: translateY(0);
    transition: transform .12s, box-shadow .12s;
}

.btn-primary-x:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 6px 0 #3b2fc4, 0 16px 30px rgba(91, 79, 240, .45);
}

.btn-primary-x:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 2px 0 #3b2fc4, 0 16px 30px rgba(91, 79, 240, .45);
}

.icon-btn,
.btn-ghost,
.search,
.act-as {
    box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 0px 0 var(--border), 0 6px 14px rgba(0, 0, 0, .12);
    transition: transform .12s, box-shadow .12s, color .15s, background .15s;
}

.icon-btn:hover,
.btn-ghost:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 2px 0 var(--border-strong), 0 10px 20px rgba(0, 0, 0, .16);
}

.icon-btn:active,
.btn-ghost:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--border);
}

.me .icon-btn {
    box-shadow: none;
}

/* org logos, alerts, feed, rank chips */
.org-logo,
.alert-ic,
.feed-ic,
.rank-no {
    box-shadow: 0 1px 0 rgba(255, 255, 255, .1) inset, 0 -2px 0 rgba(0, 0, 0, .12) inset, 0 4px 10px rgba(0, 0, 0, .18);
}

.org-logo {
    transform: perspective(150px) rotateY(-10deg);
    transition: transform .25s;
}

.tbl tbody tr:hover .org-logo {
    transform: perspective(150px) rotateY(0) scale(1.06);
}

.usage-bar {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}

.usage-bar span {
    background: linear-gradient(90deg, #a89bff, var(--primary));
    box-shadow: 0 0 8px rgba(124, 108, 255, .45);
}

.usage-bar span.warn {
    background: linear-gradient(90deg, #fde68a, var(--amber));
    box-shadow: 0 0 8px rgba(245, 165, 36, .45);
}

.usage-bar span.full {
    background: linear-gradient(90deg, #fda4af, var(--rose));
    box-shadow: 0 0 8px rgba(244, 63, 94, .45);
}

/* modals pop in with depth */
.modal.fade .modal-dialog {
    transform: perspective(1200px) rotateX(10deg) translateY(30px) scale(.96);
    transition: transform .35s cubic-bezier(.34, 1.4, .64, 1);
}

.modal.show .modal-dialog {
    transform: perspective(1200px) rotateX(0) translateY(0) scale(1);
}

.modal-content {
    box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 30px 80px rgba(0, 0, 0, .55);
}

@media (prefers-reduced-motion: reduce) {

    .stat,
    .qa,
    .panel,
    .nav-item-x,
    .modal-dialog {
        transition: none !important;
        transform: none !important;
    }
}

/* =========================================================
       RESPONSIVE
       ========================================================= */
.backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 15, .55);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

.backdrop.show {
    display: block;
}

.menu-btn {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.show {
        transform: none;
    }

    .menu-btn {
        display: grid;
    }

    .main {
        padding: 16px;
    }

    .search {
        min-width: 0;
        flex: 1;
    }
}

@media (max-width: 575.98px) {
    .qa-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .act-as select {
        max-width: 140px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .btn-primary-x .lbl {
        display: none;
    }
}

.fade-up {
    animation: fu .45s ease both;
}

@keyframes fu {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
