:root {
    --bg: #0b0d0c;
    --bg-alt: #121513;
    --panel: #171a18;
    --panel-raised: #1e2320;
    --border: #262b27;
    --border-light: #363c37;
    --text: #e9ece9;
    --text-muted: #96a099;
    --text-faint: #626b65;
    --green: #2f8f5f;
    --green-bright: #3fae77;
    --green-soft: rgba(63, 174, 119, 0.14);
    --gold: #b8a86a;
    --danger: #a3503f;
    --danger-bright: #c26350;
    --radius: 2px;
    --radius-lg: 2px;
    --font-head: 'Oswald', 'Segoe UI', Arial, sans-serif;
    --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    --classified-h: 30px;
}

* { box-sizing: border-box; }
::selection { background: var(--green); color: #fff; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--green-bright); text-decoration: none; transition: color .15s ease; }
a:hover { color: #fff; text-decoration: none; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 600;
    letter-spacing: 0.2px;
    margin: 0 0 12px;
    color: #fff;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ================= Emblem (SVG hivatali pecsét) ================= */
.emblem { display: block; width: 100%; height: 100%; }
.emblem-ring-outer { fill: none; stroke: var(--green-bright); stroke-width: 1.5; }
.emblem-ring-inner { fill: none; stroke: var(--border-light); stroke-width: 1; }
.emblem-text {
    font-family: var(--font-head);
    font-size: 7.4px;
    font-weight: 600;
    letter-spacing: 1.6px;
    fill: var(--green-bright);
}
.emblem-shield { fill: var(--panel-raised); stroke: var(--border-light); stroke-width: 1.2; }
.emblem-star { fill: var(--green-bright); }

/* ================= Classification banner ================= */
.classified-bar {
    position: sticky;
    top: 0;
    z-index: 300;
    height: var(--classified-h);
    line-height: var(--classified-h);
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================= App shell / Sidebar / Topbar ================= */
.app-shell {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - var(--classified-h));
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px 20px 16px;
    border-bottom: 3px double var(--border-light);
    color: #fff;
}
.brand:hover { color: #fff; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.3px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-sub {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-top: 2px;
}

.brand-badge {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.sidebar {
    position: sticky;
    top: var(--classified-h);
    height: calc(100vh - var(--classified-h));
    width: 258px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
}

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

.side-nav details { margin-bottom: 6px; }
.side-nav summary {
    cursor: pointer;
    list-style: none;
    color: var(--text-faint);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.side-nav summary::-webkit-details-marker { display: none; }
.side-nav summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    transition: transform .15s ease;
}
.side-nav details[open] summary::after { transform: rotate(180deg); }

.side-group { display: flex; flex-direction: column; gap: 1px; padding-bottom: 10px; }

.side-group a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 0.87rem;
    font-weight: 500;
    border-left: 2px solid transparent;
}
.side-group a i { font-size: 0.85rem; width: 16px; text-align: center; opacity: 0.8; }
.side-group a:hover { color: #fff; background: rgba(255,255,255,0.03); }
.side-group a.active {
    color: #fff;
    background: var(--green-soft);
    border-left-color: var(--green-bright);
    font-weight: 600;
}

.side-group a.dept-gold.active, .side-group a.dept-gold:hover { color: var(--gold); border-left-color: var(--gold); }
.side-group a.dept-green.active, .side-group a.dept-green:hover { color: var(--green-bright); border-left-color: var(--green-bright); }
.side-group a.dept-red.active, .side-group a.dept-red:hover { color: var(--danger-bright); border-left-color: var(--danger); }
.side-group a.dept-blue.active, .side-group a.dept-blue:hover { color: #8fa8a0; border-left-color: #6b8880; }

.sidebar-user {
    padding: 14px;
    border-top: 1px solid var(--border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 12px;
    background: var(--panel-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.user-chip:hover { color: var(--text); border-color: var(--border-light); }

.main-area {
    flex: 1;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    height: 56px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--classified-h);
    z-index: 90;
}

.topbar-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.topbar-crumb i { font-size: 0.7rem; color: var(--text-faint); }

.topbar-toggle {
    display: none;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1rem;
    padding: 7px 11px;
    border-radius: var(--radius);
    cursor: pointer;
}

.topbar-avatar {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--panel-raised);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-weight: 700;
    font-size: 0.85rem;
    overflow: hidden;
    flex-shrink: 0;
}
.topbar-avatar:hover { border-color: var(--green-bright); color: #fff; }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
}

.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-weight: 700;
}
.badge-bad { background: rgba(163,80,63,0.18); color: #e0a396; border: 1px solid rgba(163,80,63,0.4); }
.badge-good { background: var(--green-soft); color: var(--green-bright); border: 1px solid rgba(63,174,119,0.35); }

/* ================= Buttons ================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    background: var(--panel-raised);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all .15s ease;
}
.btn:hover { border-color: var(--green-bright); color: #fff; text-decoration: none; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-bright); border-color: var(--green-bright); }
.btn-small { padding: 7px 13px; font-size: 0.78rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-bright); border-color: var(--danger-bright); }
.btn-good { background: var(--green); border-color: var(--green); color: #fff; }

/* ================= Layout / cards ================= */
main.container { padding-top: 28px; padding-bottom: 72px; min-height: 60vh; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}
.card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 3px double var(--border-light);
}
.card h3 { font-size: 0.92rem; font-weight: 600; color: var(--text); }

.page-header {
    background: linear-gradient(120deg, var(--panel-raised), var(--panel));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.page-header .page-header-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-lg);
    background: var(--green-soft);
    color: var(--green-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.page-header h1 { margin: 0; font-size: 1.5rem; }
.page-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }

.page-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 3px double var(--border-light);
}

.doc-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 3px 9px;
    letter-spacing: 0.5px;
}

.eyebrow {
    display: block;
    font-family: var(--font-head);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--green-bright);
    margin-bottom: 8px;
}

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

.stat-box {
    background: var(--panel-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
}
.stat-box .stat-icon { font-size: 1.1rem; color: var(--green-bright); margin-bottom: 8px; }
.stat-box .value { font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; color: #fff; line-height: 1; }
.stat-box .label { color: var(--text-muted); font-size: 0.78rem; margin-top: 8px; }

/* ================= Hero (index) ================= */
.hero {
    background: linear-gradient(120deg, #16201b, #0e1210);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.hero-text { flex: 1; min-width: 260px; }
.hero-emblem { width: 108px; height: 108px; flex-shrink: 0; opacity: 0.95; }
.hero h1 {
    font-size: clamp(1.6rem, 3.6vw, 2.3rem);
    margin-bottom: 10px;
}
.hero p { color: var(--text-muted); max-width: 560px; margin-bottom: 20px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ================= Forms ================= */
form.form-narrow { max-width: 440px; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
}

input[type=text], input[type=email], input[type=password], input[type=number],
select, textarea {
    width: 100%;
    padding: 11px 13px;
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.92rem;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green-bright);
    box-shadow: 0 0 0 3px var(--green-soft);
}
input[type=file] { padding: 8px; }

/* ================= Auth pages ================= */
.auth-shell {
    max-width: 940px;
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--panel);
}
.auth-side {
    background: linear-gradient(160deg, #131a16, #0d100e 65%);
    border-right: 1px solid var(--border);
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-side .brand-badge { width: 56px; height: 56px; margin-bottom: 22px; }
.auth-side h2 { font-size: 1.35rem; margin-bottom: 12px; }
.auth-side p { color: var(--text-muted); font-size: 0.9rem; }
.auth-form { padding: 44px 40px; }
.auth-form h1 { font-size: 1.25rem; margin-bottom: 22px; }

@media (max-width: 760px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

/* ================= Tables ================= */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
th {
    background: var(--bg-alt);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}
tbody tr:hover { background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ================= Alerts ================= */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 0.9rem;
    border-left: 3px solid;
    background: var(--panel);
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert::before { font-family: 'Font Awesome 6 Free'; font-weight: 900; }
.alert-error { border-color: var(--danger-bright); color: #e6b3a8; }
.alert-error::before { content: '\f071'; color: var(--danger-bright); }
.alert-success { border-color: var(--green-bright); color: #a9dcc0; }
.alert-success::before { content: '\f00c'; color: var(--green-bright); }
.alert-info { border-color: var(--border-light); color: var(--text-muted); }
.alert-info::before { content: '\f05a'; color: var(--text-muted); }

/* ================= Status pills ================= */
.pill {
    padding: 4px 11px;
    border-radius: var(--radius);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-active { background: var(--green-soft); color: var(--green-bright); border: 1px solid rgba(63,174,119,0.3); }
.pill-pending { background: rgba(184,168,106,0.15); color: var(--gold); border: 1px solid rgba(184,168,106,0.3); }
.pill-inactive { background: rgba(150,160,153,0.12); color: var(--text-muted); border: 1px solid var(--border-light); }
.pill-fired { background: rgba(163,80,63,0.15); color: #e0a396; border: 1px solid rgba(163,80,63,0.3); }
.pill-open { background: rgba(184,168,106,0.15); color: var(--gold); border: 1px solid rgba(184,168,106,0.3); }
.pill-reviewed { background: var(--green-soft); color: var(--green-bright); border: 1px solid rgba(63,174,119,0.3); }
.pill-closed { background: rgba(150,160,153,0.12); color: var(--text-muted); border: 1px solid var(--border-light); }

/* ================= Posts / content ================= */
.post { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 18px; }
.post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.post-meta { color: var(--text-faint); font-size: 0.78rem; margin-bottom: 8px; }
.post.pinned { border-left: 3px solid var(--green-bright); padding-left: 16px; }
.post h3 { font-size: 1.05rem; margin-bottom: 8px; }

.content-body { line-height: 1.75; color: #d7dbd7; }
.content-body h1, .content-body h2, .content-body h3 { color: var(--text); }

.footer-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.site-footer {
    border-top: 1px solid var(--border);
    padding: 26px 0;
    color: var(--text-faint);
    font-size: 0.85rem;
    text-align: center;
}

/* ================= Member cards / profile info ================= */
.rank-group { margin-bottom: 28px; }
.rank-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 3px double var(--border-light);
}
.rank-group-title i { color: var(--green-bright); }
.rank-group-title .count {
    background: var(--panel-raised);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 2px 9px;
    border-radius: 10px;
    font-family: var(--font-body);
}

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

.member-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
    transition: border-color .15s ease;
}
.member-card:hover { border-color: var(--green-bright); }

.member-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: var(--panel-raised);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-muted);
    overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }

.member-card .member-name { font-weight: 700; color: #fff; font-size: 0.95rem; margin-bottom: 8px; }
.member-tags { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-bottom: 8px; }
.member-card .member-meta { color: var(--text-faint); font-size: 0.75rem; }

.info-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.info-item {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 13px 16px;
}
.info-item .info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-faint);
    font-size: 0.72rem;
    margin-bottom: 6px;
}
.info-item .info-label i { color: var(--green-bright); width: 14px; }
.info-item .info-value { font-weight: 600; font-size: 0.95rem; color: #fff; }

.section-block { margin-top: 22px; }
.section-block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.empty-note {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 13px 16px;
    color: var(--text-faint);
    font-size: 0.85rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}
.profile-header .member-avatar { width: 72px; height: 72px; font-size: 1.5rem; margin: 0; flex-shrink: 0; }
.profile-header h1 { margin-bottom: 4px; }

/* ================= AFK szolgálat-ellenőrzés ================= */
.duty-check-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.duty-check-box {
    background: var(--panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 380px;
    text-align: center;
}
.duty-check-box h2 { font-size: 1.2rem; margin-bottom: 10px; }
.duty-check-box p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.duty-check-box #dutyCheckSeconds { color: var(--green-bright); font-weight: 700; font-family: var(--font-mono); }
.duty-check-actions { display: flex; gap: 12px; justify-content: center; }

@media (max-width: 860px) {
    .topbar-toggle { display: inline-block; }
    .sidebar {
        position: fixed;
        left: 0; top: var(--classified-h);
        height: calc(100vh - var(--classified-h));
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .topbar { padding: 0 14px; }
    main.container { padding-top: 20px; }
    .hero { flex-direction: column; text-align: center; }
}
