/* Department Panel — UI */

:root {
    --bg:          #0b0e14;
    --bg-2:        #12161f;
    --bg-3:        #1a202b;
    --line:        #222a37;
    --line-soft:   #1a2029;
    --text:        #e8edf4;
    --text-dim:    #8f9cae;
    --text-faint:  #616e80;
    --accent:      #3e86ff;
    --accent-soft: rgba(62, 134, 255, .14);
    --green:       #2fd07a;
    --green-soft:  rgba(47, 208, 122, .14);
    --red:         #ff5468;
    --red-soft:    rgba(255, 84, 104, .14);
    --amber:       #ffb020;
    --amber-soft:  rgba(255, 176, 32, .14);
    --purple:      #a67cff;
    --purple-soft: rgba(166, 124, 255, .14);
    --radius:      12px;
    --radius-sm:   8px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Inter, system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }

/* ── login ───────────────────────────────────────────────── */

.login-page {
    display: grid; place-items: center; min-height: 100vh;
    background: radial-gradient(circle at 50% 30%, #16203a, var(--bg) 60%);
    padding: 20px;
}
.login-card {
    width: 420px; max-width: 100%;
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: 18px; padding: 40px 34px; text-align: center;
}
.login-mark {
    width: 56px; height: 56px; margin: 0 auto 20px;
    border-radius: 15px; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--accent), #2a5fd6);
    font-weight: 700; font-size: 19px;
}
.login-card h1 { font-size: 23px; font-weight: 650; }
.login-sub { color: var(--text-dim); font-size: 13.5px; margin: 12px 0 26px; }
.login-note { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 14px; }
.login-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--text-faint); }
.btn-discord { background: #5865f2; color: #fff; padding: 12px; font-size: 14px; }

/* ── shell ───────────────────────────────────────────────── */

.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
    background: var(--bg-2); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 20px 16px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

.brand { display: flex; gap: 11px; align-items: center; margin-bottom: 20px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--accent), #2a5fd6); font-weight: 700; font-size: 13px;
}
.brand-title { font-size: 14.5px; font-weight: 620; }
.brand-sub { font-size: 11px; color: var(--text-faint); }

.dept-switch { margin-bottom: 18px; }
.dept-switch select {
    width: 100%; padding: 9px 11px; background: var(--bg-3);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--text); font-family: inherit; font-size: 13px;
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
             color: var(--text-faint); margin: 16px 10px 6px; }
.nav-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-dim); font-size: 13.5px; cursor: pointer;
    border: none; background: none; font-family: inherit; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: #b9d2ff; font-weight: 600; }
.nav-count {
    font-size: 11px; padding: 1px 7px; border-radius: 999px;
    background: var(--amber-soft); color: var(--amber);
}

.user-card {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border-radius: var(--radius-sm); background: var(--bg-3); margin-top: 16px;
}
.user-card img { width: 32px; height: 32px; border-radius: 50%; }
.user-card .u-name { font-size: 13px; font-weight: 560; }
.user-card .u-role { font-size: 11px; color: var(--text-faint); }
.user-card a { margin-left: auto; color: var(--text-faint); font-size: 12px; }

/* ── main ────────────────────────────────────────────────── */

.main { min-width: 0; padding: 26px 32px 60px; }

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; font-weight: 650; }
.page-head p { color: var(--text-faint); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ── components ──────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 15px; border: 1px solid transparent; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
    transition: filter .12s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-green { background: var(--green); color: #062313; }
.btn-red { background: var(--red); color: #2b0209; }
.btn-soft { background: var(--bg-3); color: var(--text); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--line); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; }

.input, select.input, textarea.input {
    width: 100%; padding: 9px 12px; background: var(--bg-2);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--text); font-family: inherit; font-size: 13px; outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 90px; resize: vertical; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.card {
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center;
             gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 620; }
.card-head p { font-size: 12px; color: var(--text-faint); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
             gap: 14px; margin-bottom: 20px; }
.stat { background: var(--bg-2); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 5px; }
.stat .value.green { color: var(--green); }
.stat .value.amber { color: var(--amber); }
.stat .value.red { color: var(--red); }
.stat .sub { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-faint); font-weight: 600; padding: 0 12px 10px;
    border-bottom: 1px solid var(--line);
}
td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: middle; }
tbody tr:hover { background: #151b25; }
tbody tr:last-child td { border-bottom: none; }
td .muted { color: var(--text-faint); font-size: 12px; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

.pill {
    display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px;
    padding: 3px 8px; border-radius: 999px; background: var(--bg-3); color: var(--text-dim);
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.blue { background: var(--accent-soft); color: #8fb8ff; }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.purple { background: var(--purple-soft); color: var(--purple); }

.mono { font-family: 'Consolas', 'SF Mono', monospace; font-size: 12.5px; }

.empty { text-align: center; padding: 48px 20px; color: var(--text-faint); font-size: 13.5px; }
.empty strong { display: block; color: var(--text-dim); font-size: 15px; margin-bottom: 6px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { max-width: 300px; }

.tabs-row { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
            flex-wrap: wrap; }
.tab-btn {
    padding: 10px 14px; background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-dim); font-family: inherit; font-size: 13.5px; cursor: pointer;
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* Member profile */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-avatar {
    width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
    background: var(--accent-soft); color: #a9c8ff; font-size: 19px; font-weight: 650;
}
.profile-name { font-size: 20px; font-weight: 650; }
.profile-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; }
.profile-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 130px 1fr; gap: 12px;
                 padding: 10px 2px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.timeline-item:last-child { border-bottom: none; }
.timeline-time { color: var(--text-faint); font-size: 11.5px; }

/* ── modal ───────────────────────────────────────────────── */

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(3, 5, 9, .72);
    display: grid; place-items: center; z-index: 50; padding: 20px;
}
.modal {
    width: 540px; max-width: 100%; max-height: 86vh;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
    display: flex; flex-direction: column;
}
.modal.wide { width: 780px; }
.modal-head { display: flex; justify-content: space-between; align-items: center;
              padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { font-size: 16px; font-weight: 620; }
.modal-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px;
              padding: 16px 22px; border-top: 1px solid var(--line-soft); }
.modal-note { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.icon-btn { background: none; border: none; color: var(--text-dim); font-size: 22px; cursor: pointer; }

/* ── toasts ──────────────────────────────────────────────── */

.toasts { position: fixed; top: 20px; right: 20px; display: flex;
          flex-direction: column; gap: 10px; z-index: 80; }
.toast {
    min-width: 250px; max-width: 380px; background: var(--bg-2);
    border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm); padding: 12px 15px; font-size: 13px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }

/* ── public roster ───────────────────────────────────────── */

.public-wrap { max-width: 1000px; margin: 0 auto; padding: 40px 20px 80px; }
.public-head { text-align: center; margin-bottom: 32px; }
.public-head h1 { font-size: 28px; font-weight: 680; }
.public-head p { color: var(--text-faint); margin-top: 6px; }
.public-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .profile-cols { grid-template-columns: 1fr; }
    .main { padding: 20px 16px 50px; }
}
