/* ❖ GazSpace | Corporate System © 2026 | Dev: GazmanovDev */
/* Design System v2 — Neon Purple */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg:           #0F0C1A;
    --surface:      #1A1430;
    --surface2:     #221A3A;
    --surface3:     #160F28;
    --border:       rgba(127,119,221,0.14);
    --border-glow:  rgba(127,119,221,0.38);
    --purple-light: #B8B2F0;
    --purple-main:  #7F77DD;
    --purple-deep:  #534AB7;
    --purple-dark:  #2A2468;
    --void:         #08060F;
    --text:         #F0EEF8;
    --text-muted:   rgba(184,178,240,0.55);
    --text-dim:     rgba(184,178,240,0.3);
    --success:      #3DFFA0;
    --warning:      #FFD166;
    --danger:       #FF4D6D;
    --info:         #47C8FF;
    --sidebar-w:    270px;
    --radius:       12px;
    --radius-sm:    8px;
    --radius-xs:    5px;
    --glow-sm:   0 0 14px rgba(127,119,221,0.22);
    --glow-md:   0 0 28px rgba(127,119,221,0.32);
    --glow-lg:   0 0 56px rgba(127,119,221,0.4);
    --transition: all .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(127,119,221,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127,119,221,0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none; z-index: 0;
}

body::after {
    content: '';
    position: fixed; top: -150px; right: -150px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(83,74,183,0.1) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

/* ══════════════════ LAYOUT ══════════════════ */

.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ══════════════════ SIDEBAR ══════════════════ */

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #160F2A 0%, #0E0A1C 100%);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100; overflow-y: auto; overflow-x: hidden;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.sidebar::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple-main), transparent);
}

/* Brand */
.sidebar__brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.brand-logo {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-main));
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; box-shadow: 0 0 14px rgba(127,119,221,0.45);
}

.brand-title {
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 18px;
    color: var(--purple-light); letter-spacing: 0.06em;
    text-shadow: 0 0 12px rgba(184,178,240,0.4);
}
.brand-sub {
    font-size: 10px; color: var(--text-dim);
    letter-spacing: 0.14em; text-transform: uppercase;
}

/* User card */
.sidebar__user {
    display: flex; align-items: center; gap: 11px;
    padding: 14px 16px; margin: 10px 10px 6px;
    background: rgba(127,119,221,0.06);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.sidebar__avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--purple-deep); box-shadow: 0 0 8px rgba(83,74,183,0.5);
}
.sidebar__avatar--placeholder {
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-main));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Rajdhani', sans-serif; font-weight: 700;
    font-size: 15px; color: #fff;
}

.sidebar__username { font-weight: 600; font-size: 13px; line-height: 1.3; }
.sidebar__level-badge {
    display: inline-block; font-size: 9px; font-weight: 700;
    font-family: 'Rajdhani', sans-serif; letter-spacing: 0.1em;
    text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
    background: rgba(127,119,221,0.2); border: 1px solid rgba(127,119,221,0.3);
    color: var(--purple-light); margin-top: 2px;
}

/* Nav */
.sidebar__nav { padding: 8px 10px; flex: 1; }

.nav-section {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.14em; color: var(--text-dim);
    font-family: 'Rajdhani', sans-serif;
    padding: 16px 6px 7px; display: flex; align-items: center; gap: 8px;
}
.nav-section::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); text-decoration: none;
    font-size: 13px; font-weight: 500;
    transition: var(--transition); margin-bottom: 2px;
    position: relative; letter-spacing: 0.01em;
}
.nav-item svg { flex-shrink: 0; opacity: .7; transition: opacity .2s; }
.nav-item:hover {
    background: rgba(127,119,221,0.09);
    color: var(--purple-light);
    box-shadow: inset 0 0 0 1px rgba(127,119,221,0.14);
}
.nav-item:hover svg { opacity: 1; }

.nav-item--active {
    background: linear-gradient(135deg, rgba(83,74,183,0.28), rgba(127,119,221,0.12));
    color: var(--purple-light);
    box-shadow: inset 0 0 0 1px rgba(127,119,221,0.28), var(--glow-sm);
}
.nav-item--active::before {
    content: ''; position: absolute; left: 0; top: 22%; bottom: 22%;
    width: 3px; background: linear-gradient(180deg, var(--purple-main), var(--purple-light));
    border-radius: 0 2px 2px 0; box-shadow: 0 0 6px var(--purple-main);
}
.nav-item--active svg { opacity: 1; }
.nav-item__count {
    margin-left: auto; background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
    font-family: 'Rajdhani', sans-serif; animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,77,109,.4); }
    50% { box-shadow: 0 0 0 4px rgba(255,77,109,0); }
}

/* Sidebar footer */
.sidebar__footer {
    padding: 14px 10px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.btn-logout {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    background: rgba(255,77,109,0.07); color: var(--danger); text-decoration: none;
    font-size: 13px; font-weight: 600; border: 1px solid rgba(255,77,109,0.18);
    transition: var(--transition); font-family: 'Rajdhani', sans-serif; letter-spacing: 0.04em;
}
.btn-logout:hover { background: rgba(255,77,109,0.14); box-shadow: 0 0 12px rgba(255,77,109,0.18); }
.sidebar__brand-footer {
    font-size: 9px; color: var(--text-dim); margin-top: 10px;
    padding: 0 2px; line-height: 1.5;
}

/* Mobile toggle */
.hamburger {
    display: none; position: fixed; top: 14px; left: 14px; z-index: 200;
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border);
    cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.hamburger span {
    display: block; width: 18px; height: 2px;
    background: var(--purple-light); border-radius: 1px; transition: var(--transition);
}

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(8,6,15,0.75); z-index: 99; backdrop-filter: blur(4px);
}

/* ══════════════════ MAIN CONTENT ══════════════════ */

.main {
    margin-left: var(--sidebar-w); flex: 1; padding: 32px 36px;
    max-width: calc(100vw - var(--sidebar-w)); position: relative; z-index: 1;
    min-height: 100vh;
}

.main__header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border); position: relative;
}
.main__header::after {
    content: ''; position: absolute; bottom: -1px; left: 0; width: 100px; height: 1px;
    background: linear-gradient(90deg, var(--purple-main), transparent);
    box-shadow: 0 0 8px var(--purple-main);
}

.main__title {
    font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 700;
    letter-spacing: 0.04em; display: flex; align-items: center; gap: 10px;
}
.main__title svg { color: var(--purple-main); }

.main__header-right {
    display: flex; align-items: center; gap: 16px;
}

.main__time {
    font-size: 11px; color: var(--text-dim);
    font-family: 'Rajdhani', sans-serif; letter-spacing: 0.08em;
    display: flex; align-items: center; gap: 6px;
}

/* ══════════════════ FLASH MESSAGES ══════════════════ */

.flash-messages { margin-bottom: 20px; }
.flash {
    padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px;
    font-size: 13px; border: 1px solid; backdrop-filter: blur(10px);
    display: flex; align-items: center; gap: 10px;
}
.flash--error   { background: rgba(255,77,109,.08);  border-color: rgba(255,77,109,.28);  color: #FF7B90; }
.flash--success { background: rgba(61,255,160,.07);  border-color: rgba(61,255,160,.22);  color: var(--success); }
.flash--info    { background: rgba(127,119,221,.08); border-color: rgba(127,119,221,.22); color: var(--purple-light); }
.flash--warning { background: rgba(255,209,102,.07); border-color: rgba(255,209,102,.25); color: var(--warning); }

/* ══════════════════ CARDS ══════════════════ */

.card {
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface3) 100%);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; margin-bottom: 20px; position: relative;
    transition: border-color .2s, box-shadow .2s;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(127,119,221,0.28), transparent);
}
.card:hover { border-color: rgba(127,119,221,0.24); }

.card__title {
    font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700;
    letter-spacing: 0.08em; margin-bottom: 18px; color: var(--purple-light);
    display: flex; align-items: center; gap: 8px; text-transform: uppercase;
}
.card__subtitle {
    font-size: 12px; color: var(--text-muted); margin-top: 4px; margin-bottom: 18px;
    line-height: 1.6; font-weight: 400; text-transform: none; letter-spacing: 0;
}

.card--highlight {
    border-color: rgba(127,119,221,.3);
    box-shadow: var(--glow-sm);
}

/* ══════════════════ STAT CARDS ══════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 28px;
}
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat-card {
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface3) 100%);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 20px; position: relative; overflow: hidden;
    transition: var(--transition); cursor: default;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--purple-dark), var(--purple-main), var(--purple-light));
}
.stat-card--success::before { background: linear-gradient(90deg, #1A5C3A, var(--success)); }
.stat-card--warning::before { background: linear-gradient(90deg, #7A5A00, var(--warning)); }
.stat-card--danger::before  { background: linear-gradient(90deg, #8B1A2E, var(--danger)); }
.stat-card--info::before    { background: linear-gradient(90deg, #0A4F6E, var(--info)); }

.stat-card:hover {
    border-color: rgba(127,119,221,.28);
    box-shadow: var(--glow-sm); transform: translateY(-2px);
}
.stat-card--danger:hover  { border-color: rgba(255,77,109,.28); box-shadow: 0 0 14px rgba(255,77,109,.18); }
.stat-card--success:hover { border-color: rgba(61,255,160,.28); box-shadow: 0 0 14px rgba(61,255,160,.12); }
.stat-card--warning:hover { border-color: rgba(255,209,102,.28); box-shadow: 0 0 14px rgba(255,209,102,.12); }

.stat-card__icon {
    width: 36px; height: 36px; border-radius: 9px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(127,119,221,.12); border: 1px solid rgba(127,119,221,.18);
    color: var(--purple-main);
}
.stat-card--success .stat-card__icon { background: rgba(61,255,160,.08); border-color: rgba(61,255,160,.2); color: var(--success); }
.stat-card--warning .stat-card__icon { background: rgba(255,209,102,.08); border-color: rgba(255,209,102,.2); color: var(--warning); }
.stat-card--danger  .stat-card__icon { background: rgba(255,77,109,.08);  border-color: rgba(255,77,109,.2);  color: var(--danger); }
.stat-card--info    .stat-card__icon { background: rgba(71,200,255,.08);  border-color: rgba(71,200,255,.2);  color: var(--info); }

.stat-card__value {
    font-family: 'Rajdhani', sans-serif; font-size: 38px; font-weight: 700;
    color: var(--purple-light); line-height: 1; margin-bottom: 4px;
    text-shadow: 0 0 20px rgba(184,178,240,.4);
}
.stat-card--success .stat-card__value { color: var(--success); text-shadow: 0 0 20px rgba(61,255,160,.3); }
.stat-card--warning .stat-card__value { color: var(--warning); text-shadow: 0 0 20px rgba(255,209,102,.3); }
.stat-card--danger  .stat-card__value { color: var(--danger);  text-shadow: 0 0 20px rgba(255,77,109,.3); }
.stat-card--info    .stat-card__value { color: var(--info);    text-shadow: 0 0 20px rgba(71,200,255,.3); }

.stat-card__label {
    font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em;
    text-transform: uppercase; font-family: 'Rajdhani', sans-serif;
}
.stat-card__delta {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 600; margin-top: 6px; padding: 2px 7px;
    border-radius: 999px; font-family: 'Rajdhani', sans-serif;
}
.stat-card__delta--up   { background: rgba(61,255,160,.1); color: var(--success); }
.stat-card__delta--down { background: rgba(255,77,109,.1); color: var(--danger); }

/* ══════════════════ TABLES ══════════════════ */

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
    text-align: left; padding: 11px 16px;
    background: rgba(127,119,221,.05);
    color: var(--purple-main); font-weight: 700; font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.12em;
    border-bottom: 1px solid var(--border);
    font-family: 'Rajdhani', sans-serif; white-space: nowrap;
}

td {
    padding: 12px 16px; border-bottom: 1px solid rgba(127,119,221,.06);
    vertical-align: middle; color: rgba(240,238,248,.85);
    transition: background .15s;
}

tr:hover td { background: rgba(127,119,221,.04); }
tr:last-child td { border-bottom: none; }

td.mono { font-family: 'Courier New', monospace; font-size: 12px; }

code {
    background: rgba(127,119,221,.1); border: 1px solid rgba(127,119,221,.18);
    border-radius: 4px; padding: 2px 7px; font-size: 11px; color: var(--purple-light);
    font-family: 'Courier New', monospace;
}

/* ══════════════════ BUTTONS ══════════════════ */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer; border: none;
    text-decoration: none; transition: var(--transition); letter-spacing: 0.03em;
    font-family: 'Rajdhani', sans-serif; white-space: nowrap; line-height: 1;
}
.btn svg { flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-main));
    color: #fff; border: 1px solid rgba(127,119,221,.3);
    box-shadow: 0 0 14px rgba(83,74,183,.35);
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(127,119,221,.6); transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, #8B1A2E, var(--danger)); color: #fff;
    border: 1px solid rgba(255,77,109,.3); box-shadow: 0 0 14px rgba(255,77,109,.25);
}
.btn-danger:hover { box-shadow: 0 0 22px rgba(255,77,109,.5); transform: translateY(-1px); }

.btn-success {
    background: linear-gradient(135deg, #1A5C3A, #2BC97A); color: #fff;
    border: 1px solid rgba(61,255,160,.25); box-shadow: 0 0 14px rgba(61,255,160,.18);
}
.btn-success:hover { box-shadow: 0 0 22px rgba(61,255,160,.4); transform: translateY(-1px); }

.btn-warning {
    background: linear-gradient(135deg, #7A5A00, var(--warning)); color: #000;
    border: 1px solid rgba(255,209,102,.3);
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-ghost {
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: rgba(127,119,221,.08); color: var(--purple-light);
    border-color: var(--border-glow); box-shadow: var(--glow-sm);
}

.btn-info {
    background: linear-gradient(135deg, #0A4F6E, var(--info)); color: #fff;
    border: 1px solid rgba(71,200,255,.3);
}
.btn-info:hover { box-shadow: 0 0 22px rgba(71,200,255,.4); transform: translateY(-1px); }

.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-icon {
    padding: 8px; width: 34px; height: 34px; justify-content: center;
}

/* ══════════════════ FORMS ══════════════════ */

.form-group { margin-bottom: 16px; }

.form-label {
    display: block; margin-bottom: 7px; font-size: 10px; font-weight: 700;
    color: var(--purple-main); text-transform: uppercase; letter-spacing: 0.12em;
    font-family: 'Rajdhani', sans-serif;
}

.form-hint {
    font-size: 11px; color: var(--text-muted); margin-top: 5px; line-height: 1.5;
}

.form-control {
    width: 100%; padding: 9px 13px;
    background: rgba(8,6,15,.55); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
    outline: none; transition: var(--transition); font-family: 'Inter', sans-serif;
}
.form-control:focus {
    border-color: var(--purple-main);
    box-shadow: 0 0 0 3px rgba(127,119,221,.14), var(--glow-sm);
    background: rgba(8,6,15,.7);
}
.form-control::placeholder { color: var(--text-dim); }

select.form-control {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237F77DD' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
select.form-control option { background: var(--surface); color: var(--text); }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.form-row.single { grid-template-columns: 1fr; }

/* Search box */
.search-wrap {
    position: relative; display: flex; align-items: center;
}
.search-wrap svg {
    position: absolute; left: 11px; color: var(--text-dim);
    pointer-events: none;
}
.search-wrap .form-control { padding-left: 36px; }

/* ══════════════════ BADGES ══════════════════ */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; font-family: 'Rajdhani', sans-serif;
    white-space: nowrap;
}

.badge-warn    { background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.3); color: var(--warning); }
.badge-ban     { background: rgba(255,77,109,.12);  border: 1px solid rgba(255,77,109,.3);  color: var(--danger); }
.badge-mute    { background: rgba(255,140,0,.12);   border: 1px solid rgba(255,140,0,.3);   color: #FF9A3C; }
.badge-kick    { background: rgba(255,140,0,.12);   border: 1px solid rgba(255,140,0,.3);   color: #FF9A3C; }
.badge-success { background: rgba(61,255,160,.1);   border: 1px solid rgba(61,255,160,.25); color: var(--success); }
.badge-muted   { background: rgba(127,119,221,.1);  border: 1px solid rgba(127,119,221,.2); color: var(--text-muted); }
.badge-info    { background: rgba(71,200,255,.1);   border: 1px solid rgba(71,200,255,.25); color: var(--info); }
.badge-danger  { background: rgba(255,77,109,.12);  border: 1px solid rgba(255,77,109,.3);  color: var(--danger); }
.badge-primary { background: rgba(127,119,221,.15); border: 1px solid rgba(127,119,221,.3); color: var(--purple-light); }

/* Level badges */
.badge-level {
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 11px;
    padding: 3px 10px; border-radius: 999px; display: inline-block; letter-spacing: .04em;
}
.badge-lvl-1 { background: rgba(100,100,100,.12); border: 1px solid rgba(150,150,150,.2);  color: rgba(184,178,240,.4); }
.badge-lvl-2 { background: rgba(100,150,200,.1);  border: 1px solid rgba(100,150,200,.2);  color: rgba(184,178,240,.65); }
.badge-lvl-3 { background: rgba(100,200,100,.1); border: 1px solid rgba(100,200,100,.25); color: #78E878; }
.badge-lvl-4 { background: rgba(71,200,255,.1);  border: 1px solid rgba(71,200,255,.25);  color: var(--info); }
.badge-lvl-5 { background: rgba(127,119,221,.15); border: 1px solid rgba(127,119,221,.3); color: var(--purple-light); }
.badge-lvl-6 { background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.3); color: var(--warning); }
.badge-lvl-7 { background: rgba(255,140,0,.12);   border: 1px solid rgba(255,140,0,.3);   color: #FF9A3C; }
.badge-lvl-8 { background: rgba(255,77,109,.1);   border: 1px solid rgba(255,77,109,.25); color: var(--danger); }
.badge-lvl-9 { background: rgba(200,50,200,.12);  border: 1px solid rgba(200,50,200,.3);  color: #E870E8; }
.badge-lvl-10{ background: linear-gradient(135deg,rgba(83,74,183,.2),rgba(255,209,102,.15)); border: 1px solid rgba(255,209,102,.4); color: var(--warning); }

/* ══════════════════ PAGINATION ══════════════════ */

.pagination {
    display: flex; gap: 6px; align-items: center;
    margin-top: 24px; justify-content: center;
}
.page-btn {
    padding: 7px 14px; border-radius: var(--radius-sm); background: var(--surface);
    border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
    font-size: 13px; text-decoration: none; transition: var(--transition);
    font-family: 'Rajdhani', sans-serif; font-weight: 600;
}
.page-btn:hover { background: rgba(127,119,221,.1); border-color: var(--border-glow); color: var(--purple-light); }
.page-btn--active {
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-main));
    border-color: var(--purple-main); color: #fff; box-shadow: 0 0 12px rgba(127,119,221,.4);
}
.page-btn--disabled { opacity: .3; pointer-events: none; }

/* ══════════════════ FILTERS ══════════════════ */

.filters {
    display: flex; gap: 10px; flex-wrap: wrap;
    align-items: center; margin-bottom: 20px;
}

.filter-info {
    color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: 5px;
}

/* Tab group */
.tab-group {
    display: flex; gap: 4px; background: rgba(127,119,221,.06);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 7px 16px; border-radius: 6px; font-size: 12px; font-weight: 600;
    color: var(--text-muted); cursor: pointer; border: none; background: transparent;
    font-family: 'Rajdhani', sans-serif; letter-spacing: .04em; transition: var(--transition);
    display: flex; align-items: center; gap: 6px; text-decoration: none;
}
.tab-btn:hover { color: var(--purple-light); background: rgba(127,119,221,.1); }
.tab-btn--active {
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-main));
    color: #fff; box-shadow: 0 0 10px rgba(127,119,221,.35);
}
.tab-btn .tab-count {
    background: rgba(255,255,255,.15); border-radius: 999px;
    padding: 0 6px; font-size: 10px; line-height: 1.5; min-width: 18px; text-align: center;
}
.tab-btn--active .tab-count { background: rgba(255,255,255,.2); }

/* ══════════════════ TOGGLES ══════════════════ */

.toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid rgba(127,119,221,.06);
    color: rgba(240,238,248,.8);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row__label { flex: 1; }
.toggle-row__title { font-size: 13px; font-weight: 500; }
.toggle-row__desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }

.toggle { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: rgba(127,119,221,.08); border: 1px solid var(--border);
    border-radius: 999px; transition: all .25s;
}
.toggle-slider::before {
    content: ''; position: absolute; width: 16px; height: 16px;
    border-radius: 50%; background: var(--text-dim); top: 3px; left: 3px; transition: all .25s;
}
.toggle input:checked + .toggle-slider {
    background: rgba(127,119,221,.2); border-color: var(--purple-main);
    box-shadow: 0 0 8px rgba(127,119,221,.3);
}
.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px); background: var(--purple-light);
    box-shadow: 0 0 8px rgba(184,178,240,.5);
}

/* ══════════════════ ACTIVITY FEED ══════════════════ */

.activity-feed {
    display: flex; flex-direction: column; gap: 0;
}

.activity-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 12px 0; border-bottom: 1px solid rgba(127,119,221,.06);
    position: relative; transition: background .15s;
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; margin-top: 1px;
}
.activity-dot--punishments { background: rgba(255,77,109,.1); border: 1px solid rgba(255,77,109,.2); color: var(--danger); }
.activity-dot--automod     { background: rgba(127,119,221,.1); border: 1px solid rgba(127,119,221,.2); color: var(--purple-main); }
.activity-dot--messages    { background: rgba(71,200,255,.08); border: 1px solid rgba(71,200,255,.2); color: var(--info); }
.activity-dot--members     { background: rgba(61,255,160,.08); border: 1px solid rgba(61,255,160,.2); color: var(--success); }
.activity-dot--voice       { background: rgba(255,140,0,.08);  border: 1px solid rgba(255,140,0,.2);  color: #FF9A3C; }
.activity-dot--security    { background: rgba(255,77,109,.1); border: 1px solid rgba(255,77,109,.2); color: var(--danger); }
.activity-dot--staff       { background: rgba(184,178,240,.08); border: 1px solid rgba(184,178,240,.2); color: var(--purple-light); }
.activity-dot--appeals     { background: rgba(255,209,102,.08); border: 1px solid rgba(255,209,102,.2); color: var(--warning); }
.activity-dot--dashboard   { background: rgba(127,119,221,.1); border: 1px solid rgba(127,119,221,.2); color: var(--purple-main); }
.activity-dot--default     { background: rgba(127,119,221,.08); border: 1px solid rgba(127,119,221,.15); color: var(--text-muted); }

.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: rgba(240,238,248,.85); line-height: 1.4; }
.activity-text strong { color: var(--text); font-weight: 600; }
.activity-meta {
    display: flex; align-items: center; gap: 10px;
    margin-top: 4px; font-size: 11px; color: var(--text-dim);
}

/* ══════════════════ STAFF CARDS ══════════════════ */

.staff-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.staff-card {
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface3) 100%);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
    transition: var(--transition); position: relative;
}
.staff-card::before {
    content: ''; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(127,119,221,.25), transparent);
}
.staff-card:hover { border-color: var(--border-glow); box-shadow: var(--glow-sm); transform: translateY(-2px); }

.staff-card__header {
    display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px;
}
.staff-avatar-circle {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-main));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 18px; color: #fff;
    border: 2px solid var(--purple-deep); box-shadow: 0 0 10px rgba(83,74,183,.4);
}
.staff-card__info { flex: 1; min-width: 0; }
.staff-card__id {
    font-family: 'Courier New', monospace; font-size: 11px; color: var(--text-dim);
    margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-card__position {
    font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.3;
}

.staff-card__meta { display: flex; flex-direction: column; gap: 7px; }
.staff-card__meta-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-muted);
}
.staff-card__meta-row svg { flex-shrink: 0; color: var(--purple-main); }
.staff-card__meta-row strong { color: var(--text); font-weight: 500; }

.staff-card__actions {
    display: flex; gap: 8px; margin-top: 14px; padding-top: 14px;
    border-top: 1px solid rgba(127,119,221,.08);
}

/* ══════════════════ PROGRESS BARS ══════════════════ */

.progress-wrap { margin-top: 8px; }
.progress-label {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-muted); margin-bottom: 5px;
}
.progress-bar {
    height: 6px; background: rgba(127,119,221,.1); border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 999px; transition: width .6s ease;
    background: linear-gradient(90deg, var(--purple-deep), var(--purple-main));
}
.progress-fill--success { background: linear-gradient(90deg, #1A5C3A, var(--success)); }
.progress-fill--warning { background: linear-gradient(90deg, #7A5A00, var(--warning)); }
.progress-fill--danger  { background: linear-gradient(90deg, #8B1A2E, var(--danger)); }

/* ══════════════════ STATUS INDICATORS ══════════════════ */

.status-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0;
}
.status-dot--online  { background: var(--success); box-shadow: 0 0 6px rgba(61,255,160,.6); animation: pulse-green 2s infinite; }
.status-dot--offline { background: var(--text-dim); }
.status-dot--warning { background: var(--warning); box-shadow: 0 0 6px rgba(255,209,102,.6); }
.status-dot--danger  { background: var(--danger);  box-shadow: 0 0 6px rgba(255,77,109,.6); animation: pulse-red 2s infinite; }

@keyframes pulse-green {
    0%,100% { box-shadow: 0 0 0 0 rgba(61,255,160,.4); }
    50%      { box-shadow: 0 0 0 5px rgba(61,255,160,0); }
}
@keyframes pulse-red {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,77,109,.4); }
    50%      { box-shadow: 0 0 0 5px rgba(255,77,109,0); }
}

/* System status panel */
.system-status-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.system-module {
    background: rgba(127,119,221,.05); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    display: flex; align-items: center; gap: 10px; transition: var(--transition);
}
.system-module--on  { border-color: rgba(61,255,160,.22); background: rgba(61,255,160,.04); }
.system-module--off { opacity: .55; }
.system-module__name {
    font-size: 12px; font-weight: 600; color: var(--text);
    font-family: 'Rajdhani', sans-serif; letter-spacing: .03em;
}

/* ══════════════════ QUICK ACTIONS ══════════════════ */

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.quick-action {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 18px 16px; border-radius: var(--radius); cursor: pointer;
    border: 1px solid var(--border); background: rgba(127,119,221,.04);
    text-decoration: none; transition: var(--transition); min-width: 100px; flex: 1;
}
.quick-action:hover {
    background: rgba(127,119,221,.1); border-color: var(--border-glow);
    transform: translateY(-2px); box-shadow: var(--glow-sm);
}
.quick-action__icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(127,119,221,.12); border: 1px solid rgba(127,119,221,.2);
    color: var(--purple-main);
}
.quick-action__label {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif; letter-spacing: .04em;
    text-align: center;
}

/* ══════════════════ INFO BOXES ══════════════════ */

.info-box {
    border-radius: var(--radius-sm); padding: 14px 16px;
    margin: 8px 0; font-size: 12px; line-height: 1.6;
}
.info-box.warn   { background: rgba(255,77,109,.06); border: 1px solid rgba(255,77,109,.2); color: #FF8FA0; }
.info-box.ok     { background: rgba(61,255,160,.05); border: 1px solid rgba(61,255,160,.15); color: var(--text-muted); }
.info-box.info   { background: rgba(71,200,255,.06); border: 1px solid rgba(71,200,255,.2); color: var(--info); }
.info-box.purple { background: rgba(127,119,221,.07); border: 1px solid rgba(127,119,221,.2); color: var(--purple-light); }

/* ══════════════════ AUTOMOD MODULES ══════════════════ */

.automod-grid { display: flex; flex-direction: column; gap: 12px; }

.module-card {
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface3) 100%);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: border-color .2s, box-shadow .2s; position: relative;
}
.module-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(127,119,221,.25), transparent);
}
.module-card:hover { border-color: rgba(127,119,221,.24); }
.module-card.enabled { border-color: rgba(61,255,160,.2); }
.module-card.enabled.open { box-shadow: 0 0 20px rgba(61,255,160,.08); }

.module-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; cursor: pointer; user-select: none; transition: background .2s;
}
.module-header:hover { background: rgba(127,119,221,.03); }
.module-header-left { display: flex; align-items: center; gap: 14px; }

.module-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; background: rgba(127,119,221,.1);
    border: 1px solid rgba(127,119,221,.18); flex-shrink: 0;
}
.module-card.enabled .module-icon { background: rgba(61,255,160,.08); border-color: rgba(61,255,160,.2); }

.module-name {
    font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700;
    letter-spacing: .04em; color: var(--text);
}
.module-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

.module-header-right { display: flex; align-items: center; gap: 14px; }

.module-status {
    font-size: 10px; font-family: 'Rajdhani', sans-serif; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    padding: 3px 10px; border-radius: 999px;
}
.module-status.on  { background: rgba(61,255,160,.1); border: 1px solid rgba(61,255,160,.25); color: var(--success); }
.module-status.off { background: rgba(127,119,221,.07); border: 1px solid rgba(127,119,221,.14); color: var(--text-dim); }

.module-chevron {
    width: 24px; height: 24px; color: var(--text-dim);
    display: flex; align-items: center; justify-content: center;
    transition: transform .25s;
}
.module-card.open .module-chevron { transform: rotate(180deg); }

.module-body {
    display: none; padding: 0 22px 22px;
    border-top: 1px solid rgba(127,119,221,.07);
}
.module-card.open .module-body { display: block; }

.settings-section { margin-top: 20px; }
.settings-section-title {
    font-family: 'Rajdhani', sans-serif; font-size: 11px; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase; color: var(--purple-main);
    margin-bottom: 14px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(127,119,221,.1);
    display: flex; align-items: center; gap: 8px;
}
.settings-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.settings-row.single { grid-template-columns: 1fr; }
.settings-row.triple { grid-template-columns: 1fr 1fr 1fr; }

.setting-field { display: flex; flex-direction: column; gap: 6px; }
.setting-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); }
.setting-hint { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.tip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: rgba(127,119,221,.14); border: 1px solid rgba(127,119,221,.24);
    color: var(--purple-light); font-size: 10px; cursor: help; position: relative;
    font-weight: 700; flex-shrink: 0;
}
.tip::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: #160F2A; border: 1px solid var(--border-glow); border-radius: 8px;
    padding: 8px 12px; font-size: 11px; color: var(--text); width: max-content; max-width: 240px;
    white-space: normal; line-height: 1.5; text-align: left; font-weight: 400;
    box-shadow: 0 4px 20px rgba(8,6,15,.8), var(--glow-sm);
    opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 50;
}
.tip:hover::after { opacity: 1; }

.chain-container { display: flex; flex-direction: column; gap: 10px; }
.chain-step {
    display: flex; align-items: center; gap: 12px;
    background: rgba(8,6,15,.35); border: 1px solid rgba(127,119,221,.1);
    border-radius: 10px; padding: 12px 16px; transition: border-color .2s;
}
.chain-step:hover { border-color: rgba(127,119,221,.22); }
.step-num {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-main));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700; color: #fff;
    box-shadow: 0 0 8px rgba(127,119,221,.4);
}
.step-info { flex: 1; }
.step-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.step-desc { font-size: 11px; color: var(--text-muted); }
.chain-arrow { text-align: center; color: var(--text-dim); font-size: 16px; line-height: 1; margin: -4px 0; }

.chain-editor { display: flex; flex-direction: column; gap: 8px; }
.chain-item {
    display: flex; align-items: center; gap: 10px;
    background: rgba(8,6,15,.35); border: 1px solid rgba(127,119,221,.1);
    border-radius: 10px; padding: 10px 14px; transition: border-color .2s;
}
.chain-item:hover { border-color: rgba(127,119,221,.22); }
.chain-item-num {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-main));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 700; color: #fff;
    box-shadow: 0 0 8px rgba(127,119,221,.4);
}

.module-save-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(127,119,221,.08);
    flex-wrap: wrap; gap: 10px;
}
.save-hint { font-size: 11px; color: var(--text-dim); }

.mode-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.mode-card { flex: 1; min-width: 150px; cursor: pointer; }

/* Automod overview */
.automod-overview {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px; margin-bottom: 28px;
}
.automod-stat {
    background: rgba(127,119,221,.05); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 16px; text-align: center;
}
.automod-stat__val {
    font-family: 'Rajdhani', sans-serif; font-size: 28px; font-weight: 700;
    color: var(--purple-light); line-height: 1;
}
.automod-stat__val--on  { color: var(--success); }
.automod-stat__val--off { color: var(--text-muted); }
.automod-stat__lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════ EMBEDS ══════════════════ */

.embed-preview {
    border-left: 4px solid var(--purple-main);
    background: rgba(8,6,15,.45); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 16px; margin-top: 16px;
}
.embed-preview__title { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 6px; color: var(--purple-light); }
.embed-preview__desc { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; white-space: pre-wrap; }
.embed-preview__field { margin-bottom: 10px; }
.embed-preview__fname { font-size: 11px; font-weight: 700; color: var(--purple-main); text-transform: uppercase; letter-spacing: .06em; font-family: 'Rajdhani', sans-serif; }
.embed-preview__fvalue { font-size: 13px; color: rgba(240,238,248,.8); }
.embed-preview__footer { font-size: 10px; color: var(--text-dim); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }

.eb-field-row {
    display: grid; grid-template-columns: 1fr 1fr auto auto;
    gap: 8px; align-items: center; margin-bottom: 8px;
}

/* ══════════════════ MODALS ══════════════════ */

.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(8,6,15,.85); z-index: 300;
    align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: linear-gradient(145deg, var(--surface) 0%, #160F2A 100%);
    border: 1px solid var(--border); border-radius: 16px; padding: 32px;
    width: 100%; max-width: 500px;
    box-shadow: 0 0 60px rgba(8,6,15,.95), var(--glow-md);
    animation: modalIn .2s ease; position: relative;
}
.modal::before {
    content: ''; position: absolute; top: 0; left: 36px; right: 36px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(127,119,221,.35), transparent);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal__title {
    font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700;
    letter-spacing: .06em; margin-bottom: 20px; color: var(--purple-light);
    text-transform: uppercase;
}
.modal__body { color: var(--text-muted); font-size: 13px; line-height: 1.7; margin-bottom: 6px; }
.modal__actions { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; }
.modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
    background: rgba(127,119,221,.08); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer; transition: var(--transition);
}
.modal-close:hover { background: rgba(255,77,109,.1); color: var(--danger); border-color: rgba(255,77,109,.3); }

/* ══════════════════ LOGIN ══════════════════ */

.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--bg); position: relative; overflow: hidden;
}
.login-body::before {
    content: ''; position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(127,119,221,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127,119,221,.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
.login-body::after {
    content: ''; position: fixed; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(83,74,183,.12) 0%, transparent 65%);
    pointer-events: none;
}

.login-card {
    background: linear-gradient(145deg, var(--surface) 0%, #160F2A 100%);
    border: 1px solid var(--border); border-radius: 20px; padding: 48px 44px;
    width: 100%; max-width: 420px; text-align: center; position: relative; z-index: 1;
    box-shadow: 0 0 0 1px rgba(127,119,221,.08), 0 24px 80px rgba(8,6,15,.8), var(--glow-md);
    animation: cardIn .5s ease;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card::before {
    content: ''; position: absolute; top: 0; left: 40px; right: 40px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple-main), transparent);
    box-shadow: 0 0 10px var(--purple-main);
}

.login-brand { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 32px; }
.login-brand__logo {
    width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-main));
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; box-shadow: 0 0 20px rgba(127,119,221,.5);
    animation: glow-pulse 3s ease-in-out infinite;
}
@keyframes glow-pulse {
    0%,100% { box-shadow: 0 0 20px rgba(127,119,221,.5); }
    50%      { box-shadow: 0 0 36px rgba(184,178,240,.6); }
}
.login-brand__title {
    font-family: 'Rajdhani', sans-serif; font-size: 28px; font-weight: 700;
    color: var(--purple-light); letter-spacing: .08em;
    text-shadow: 0 0 20px rgba(184,178,240,.5);
}
.login-brand__sub { font-size: 11px; color: var(--text-dim); letter-spacing: .14em; text-transform: uppercase; }

.login-desc { color: var(--text-muted); margin-bottom: 32px; font-size: 14px; line-height: 1.7; }

.btn-discord {
    display: inline-flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-main)); color: #fff;
    padding: 14px 32px; border-radius: 12px; text-decoration: none;
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 15px;
    letter-spacing: .06em; transition: all .25s ease;
    border: 1px solid rgba(184,178,240,.2);
    box-shadow: 0 0 24px rgba(83,74,183,.5), inset 0 1px 0 rgba(255,255,255,.08);
    text-transform: uppercase;
}
.btn-discord:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(127,119,221,.7), inset 0 1px 0 rgba(255,255,255,.14);
}
.login-footer { margin-top: 32px; font-size: 10px; color: var(--text-dim); line-height: 1.7; }

/* ══════════════════ ERROR PAGES ══════════════════ */

.error-page { text-align: center; padding: 100px 20px; }
.error-page__code {
    font-family: 'Rajdhani', sans-serif; font-size: 100px; font-weight: 700;
    color: var(--purple-main); text-shadow: 0 0 40px rgba(127,119,221,.6);
    line-height: 1; margin-bottom: 16px;
}
.error-page__title { font-family: 'Rajdhani', sans-serif; font-size: 26px; font-weight: 600; letter-spacing: .06em; margin-bottom: 12px; }
.error-page__desc  { color: var(--text-muted); margin-bottom: 32px; line-height: 1.7; }

/* ══════════════════ NORM STATUS ══════════════════ */

.norm-ok   { color: var(--success); text-shadow: 0 0 8px rgba(61,255,160,.4); }
.norm-fail { color: var(--danger);  text-shadow: 0 0 8px rgba(255,77,109,.4); }
.norm-warn { color: var(--warning); text-shadow: 0 0 8px rgba(255,209,102,.4); }

/* ══════════════════ PAGE SECTIONS ══════════════════ */

.page-intro {
    color: var(--text-muted); font-size: 13px; line-height: 1.7;
    margin-bottom: 24px; padding: 14px 18px;
    background: rgba(127,119,221,.05); border: 1px solid rgba(127,119,221,.12);
    border-radius: var(--radius-sm); border-left: 3px solid var(--purple-main);
}

.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700;
    letter-spacing: .06em; color: var(--text); display: flex; align-items: center; gap: 8px;
}
.section-title svg { color: var(--purple-main); }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

/* Empty state */
.empty-state {
    text-align: center; padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state__icon {
    font-size: 42px; margin-bottom: 16px; opacity: .5;
    display: block;
}
.empty-state__title {
    font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 600;
    color: var(--text); margin-bottom: 8px; letter-spacing: .04em;
}
.empty-state__desc { font-size: 13px; line-height: 1.7; }

/* ══════════════════ SCROLLBAR ══════════════════ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--purple-dark); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-main); }

/* ══════════════════ RESPONSIVE ══════════════════ */

@media (max-width: 1200px) {
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .main { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .settings-row { grid-template-columns: 1fr; }
    .settings-row.triple { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .stats-grid-4 { grid-template-columns: 1fr 1fr; }
    .eb-field-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--glow-lg); }
    .sidebar-overlay.open { display: block; }
    .hamburger { display: flex; }
    .main { margin-left: 0; padding: 16px; padding-top: 60px; max-width: 100vw; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid-4 { grid-template-columns: 1fr 1fr; }
    .staff-grid { grid-template-columns: 1fr; }
    .tab-group { overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid-4 { grid-template-columns: 1fr; }
    .login-card { padding: 32px 24px; }
    .module-header { padding: 14px 16px; }
    .module-body { padding: 0 16px 16px; }
}

/* ══════════════════ LOG ENTRIES (accordion) ══════════════════ */

.log-entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
    overflow: hidden;
}
.log-entry:hover { border-color: var(--border-glow); box-shadow: var(--glow-sm); }

.log-entry__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    flex-wrap: wrap;
}

.log-entry__ids {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.log-id-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: .04em;
}
.log-id-tag--obj { color: var(--purple-light); border-color: rgba(127,119,221,.22); }

.log-chevron {
    transition: transform .2s;
    color: var(--text-dim);
    flex-shrink: 0;
}
.log-entry--open .log-chevron { transform: rotate(180deg); }

.log-entry__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s cubic-bezier(.4,0,.2,1), padding .2s;
    padding: 0 14px;
    border-top: 0px solid var(--border);
}
.log-entry--open .log-entry__body {
    max-height: 600px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

.log-details-grid {
    display: grid;
    grid-template-columns: minmax(120px, max-content) 1fr;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
    font-size: 12px;
}

.log-detail-row {
    display: contents;
}
.log-detail-row:hover .log-detail-key,
.log-detail-row:hover .log-detail-val {
    background: var(--surface3);
}

.log-detail-key {
    background: var(--surface2);
    padding: 6px 10px;
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: 10px;
    border-right: 1px solid var(--border);
    word-break: break-word;
}
.log-detail-val {
    background: var(--surface);
    padding: 6px 10px;
    color: var(--text);
    word-break: break-all;
    font-family: 'Inter', sans-serif;
}

/* ══════════════════ MEMO CARDS (forum) ══════════════════ */

.memo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.memo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s;
    display: flex;
    flex-direction: column;
}
.memo-card:hover { border-color: var(--border-glow); box-shadow: var(--glow-sm); }
.memo-card--pinned {
    border-color: rgba(127,119,221,.36);
    box-shadow: 0 0 0 1px rgba(127,119,221,.12), var(--glow-sm);
}

.memo-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 0;
    flex-wrap: wrap;
}

.memo-card__title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    padding: 6px 14px 4px;
    letter-spacing: .02em;
    cursor: pointer;
}
.memo-card__title:hover { color: var(--purple-light); }

.memo-card__preview {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 14px 10px;
    line-height: 1.55;
    flex: 1;
}

.memo-content {
    display: none;
    padding: 0 14px 10px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.memo-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.memo-card__actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.memo-expand-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--purple-light);
    border-radius: var(--radius-xs);
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}
.memo-expand-btn:hover {
    background: rgba(127,119,221,.1);
    border-color: var(--border-glow);
}

/* ══════════════════ BRANCH CARDS ══════════════════ */

.branch-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color .18s, box-shadow .18s;
}
.branch-card:hover { border-color: var(--border-glow); box-shadow: var(--glow-sm); }

.branch-card__header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 4px;
}

.branch-card__icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--purple-light);
}

.branch-card__name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
    line-height: 1.2;
}

.branch-card__desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.branch-card__subs {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* ══════════════════ PERMISSION MATRIX ══════════════════ */

.perm-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.perm-matrix th,
.perm-matrix td {
    padding: 0;
    border: 1px solid var(--border);
    vertical-align: middle;
}

.perm-matrix thead th {
    background: var(--surface2);
    padding: 10px 8px;
    text-align: center;
    white-space: nowrap;
}

.perm-lvl-head {
    min-width: 80px;
}

.perm-lvl-badge {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 17px;
    font-weight: 700;
}

.perm-lvl-name {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: .04em;
}

.perm-group-row td {
    background: var(--surface3);
    padding: 6px 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-top: 2px solid var(--border-glow);
}

.perm-res-row { transition: background .15s; }
.perm-res-row:hover td { background: var(--surface2); }

.perm-res-row td:first-child {
    padding: 8px 12px;
    min-width: 190px;
}

.perm-res-label {
    font-weight: 600;
    color: var(--text);
    display: block;
}

.perm-res-sub {
    font-size: 10px;
    color: var(--text-dim);
    display: block;
    margin-top: 1px;
}

.perm-res-code {
    font-size: 9px;
    color: var(--purple-main);
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: .06em;
    display: block;
    margin-top: 2px;
}

.perm-cell {
    text-align: center;
    width: 70px;
    min-width: 70px;
    padding: 6px 0 !important;
}

/* The toggle label inside perm-cell is centered */
.perm-cell .toggle {
    margin: 0 auto;
}

/* ══════════════════ LEVEL CONFIG ══════════════════ */

.lvl-edit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.lvl-edit-row:last-child { border-bottom: none; }

.lvl-edit-badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.lvl-preview {
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}

/* ══════════════════ HISTORY DETAILS ══════════════════ */

.hist-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hist-kv {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
}

.hist-key {
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-size: 10px;
}

.hist-key::after { content: ':'; margin-right: 2px; }

.hist-val {
    color: var(--text);
    font-family: 'Inter', sans-serif;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ══════════════════ GRID AUTO (branch cards grid) ══════════════════ */

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

/* ══════════════════ RESPONSIVE (new components) ══════════════════ */

@media (max-width: 900px) {
    .memo-grid { grid-template-columns: 1fr; }
    .perm-matrix { font-size: 11px; display: block; overflow-x: auto; }
    .grid-auto { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .grid-auto { grid-template-columns: 1fr; }
    .lvl-edit-row { flex-wrap: wrap; }
    .lvl-preview { min-width: unset; }
}
