/* ═══════════════════════════════════════════════════════════
   АИС «Оперативник» — Military / Government Dark Interface
   Gold + Navy + Deep Red — with CRT scanline texture
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;800&family=Source+Sans+3:wght@300;400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    --bg:          #060a10;
    --bg-surface:  #0c1219;
    --bg-card:     #111a25;
    --bg-card-h:   #162030;
    --border:      #1c2a3b;
    --border-h:    #2a3d55;
    --gold:        #d4a843;
    --gold-light:  #f0d06e;
    --gold-dark:   #a07e2f;
    --red:         #c0392b;
    --red-light:   #e74c3c;
    --red-dark:    #7a1f1f;
    --blue:        #2980b9;
    --green:       #27ae60;
    --text:        #b0c1d4;
    --text-dim:    #5a6f84;
    --text-bright: #e4ecf5;
    --mono:        'JetBrains Mono', 'Consolas', monospace;
    --display:     'Playfair Display', Georgia, serif;
    --body:        'Source Sans 3', 'Segoe UI', sans-serif;
    --radius:      3px;
}

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

body {
    font-family: var(--body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* ── CRT scanline overlay ── */
.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
}

/* ── Top Bar ── */
.top-bar {
    background: linear-gradient(180deg, #101824 0%, #0a1018 100%);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-bar__left { display: flex; align-items: center; gap: 1rem; }
.top-bar__emblem { height: 44px; width: auto; }
.top-bar__text { display: flex; flex-direction: column; }
.top-bar__title {
    font-family: var(--display);
    font-weight: 800;
    color: var(--gold);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1.2;
}
.top-bar__subtitle {
    font-family: var(--mono);
    color: var(--text-dim);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
}
.top-bar__right { display: flex; align-items: center; gap: 0.75rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.5rem 1.4rem; border: none; border-radius: var(--radius);
    font-family: var(--body); font-size: 0.82rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all 0.25s; white-space: nowrap;
}
.btn--accent {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff; border: 1px solid var(--red);
}
.btn--accent:hover { background: var(--red-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(192,57,43,0.3); }
.btn--gold {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
    color: #0a0e14; border: 1px solid var(--gold);
}
.btn--gold:hover { background: var(--gold-light); }
.btn--outline {
    background: transparent; border: 1px solid var(--border-h); color: var(--text);
}
.btn--outline:hover { border-color: var(--gold); color: var(--gold); }
.btn--sm { padding: 0.3rem 0.8rem; font-size: 0.75rem; }
.btn--lg { padding: 0.8rem 2.4rem; font-size: 1rem; }
.btn--full { width: 100%; }

/* ── Main ── */
.main {
    flex: 1; padding: 2rem;
    max-width: 1300px; margin: 0 auto; width: 100%;
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 3rem 1rem 4rem;
    position: relative;
}
.hero__emblem { width: 180px; height: auto; margin-bottom: 2rem; filter: drop-shadow(0 0 30px rgba(212,168,67,0.15)); }
.hero__title {
    font-family: var(--display);
    font-size: 1.8rem;
    color: var(--text-bright);
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}
.hero__sub {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 2rem;
    font-weight: 300;
}
.hero__actions { margin-bottom: 2.5rem; }
.hero__warning {
    max-width: 620px; margin: 0 auto;
    background: rgba(192,57,43,0.08);
    border: 1px solid rgba(192,57,43,0.25);
    border-left: 3px solid var(--red);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    font-size: 0.82rem;
    color: var(--red-light);
    text-align: left;
}

/* ── Features ── */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}
.feat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s;
}
.feat::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0; transition: opacity 0.3s;
}
.feat:hover { border-color: var(--gold-dark); transform: translateY(-3px); }
.feat:hover::before { opacity: 1; }
.feat__icon { font-size: 1.8rem; margin-bottom: 1rem; }
.feat h3 { font-family: var(--display); color: var(--gold); margin-bottom: 0.5rem; font-size: 1rem; }
.feat p { color: var(--text-dim); font-size: 0.82rem; }

/* ── Auth ── */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    position: relative;
}
.auth-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}
.auth-card__hdr { text-align: center; margin-bottom: 2rem; }
.auth-card__hdr img { width: 80px; margin-bottom: 1rem; }
.auth-card__hdr h2 {
    font-family: var(--display); color: var(--text-bright);
    font-size: 1.4rem; margin-bottom: 0.25rem;
}
.auth-card__hdr p { color: var(--text-dim); font-size: 0.8rem; }
.auth-card__footer {
    margin-top: 1.5rem; text-align: center;
    color: var(--text-dim); font-size: 0.75rem; line-height: 1.6;
}

/* ── Forms ── */
.fg { margin-bottom: 1.2rem; }
.fg label {
    display: block; margin-bottom: 0.35rem;
    font-size: 0.78rem; font-weight: 600;
    color: var(--text); text-transform: uppercase;
    letter-spacing: 0.06em;
}
.fg input, .fg textarea, .code-input {
    width: 100%; padding: 0.7rem 0.9rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-bright);
    font-family: var(--mono); font-size: 0.84rem;
    outline: none; transition: border-color 0.2s;
}
.fg input:focus, .fg textarea:focus, .code-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212,168,67,0.1);
}

/* ── Alerts ── */
.alert {
    padding: 0.8rem 1.1rem; border-radius: var(--radius);
    font-size: 0.82rem; margin-bottom: 1.5rem;
    border-left: 3px solid;
}
.alert--error { background: rgba(192,57,43,0.1); border-color: var(--red); color: var(--red-light); }
.alert--info  { background: rgba(41,128,185,0.08); border-color: var(--blue); color: #5dade2; }
.alert--info a { color: #85c1e9; }
.alert--warn  { background: rgba(243,156,18,0.08); border-color: #f39c12; color: #f5b041; }
.alert--warn a { color: #f9e79f; }

/* ── Dashboard ── */
.dash__hdr { margin-bottom: 2rem; }
.dash__hdr h1 {
    font-family: var(--display); color: var(--gold);
    font-size: 1.5rem; margin-bottom: 0.3rem;
}
.dash__hdr p { color: var(--text-dim); font-size: 0.88rem; }

/* ── Panel ── */
.panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 1.5rem; overflow: hidden;
}
.panel__hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
}
.panel__hdr h2 { font-family: var(--display); font-size: 1rem; color: var(--gold); }

/* ── Tables ── */
.tw { overflow-x: auto; }
.dt {
    width: 100%; border-collapse: collapse; font-size: 0.8rem;
}
.dt th {
    background: rgba(0,0,0,0.25); padding: 0.6rem 1rem;
    text-align: left; font-weight: 700; color: var(--text-dim);
    text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
}
.dt td {
    padding: 0.6rem 1rem; border-bottom: 1px solid var(--border);
    color: var(--text);
}
.dt tr:hover td { background: var(--bg-card-h); }

/* ── Badges ── */
.badge {
    background: var(--red-dark); color: #fff;
    padding: 0.15rem 0.6rem; border-radius: 10px;
    font-size: 0.7rem; font-weight: 600;
}
.ubadge { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.ubadge__role {
    padding: 0.12rem 0.5rem; border-radius: 3px;
    font-size: 0.66rem; text-transform: uppercase;
    font-weight: 700; font-family: var(--mono);
}
.ubadge__role--op    { background: var(--border-h); color: var(--text-dim); }
.ubadge__role--admin { background: var(--blue); color: #fff; }
.ubadge__role--gen   { background: var(--gold-dark); color: #fff; }

/* ── Classification ── */
.cls {
    padding: 0.15rem 0.55rem; border-radius: 3px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; font-family: var(--mono);
}
.cls--dsp { background: rgba(39,174,96,0.15); color: #2ecc71; }
.cls--s   { background: rgba(243,156,18,0.15); color: #f39c12; }
.cls--ss  { background: rgba(192,57,43,0.15); color: #e74c3c; }
.st { font-size: 0.78rem; }
.st--active { color: var(--green); }
.st--closed { color: var(--text-dim); }

/* ── Modal ── */
.modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
}
.modal__bg { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.modal__box {
    position: relative; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 6px;
    width: 90%; max-width: 620px; box-shadow: 0 12px 60px rgba(0,0,0,0.6);
}
.modal__top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal__top h3 { font-family: var(--display); color: var(--gold); font-size: 1rem; }
.modal__x { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.3rem; }
.modal__body { padding: 1.25rem; max-height: 55vh; overflow-y: auto; }
.cd__row {
    display: flex; gap: 1rem; padding: 0.45rem 0;
    border-bottom: 1px solid var(--border); font-size: 0.82rem;
}
.cd__row .lbl { color: var(--text-dim); min-width: 110px; font-weight: 600; }
.cd__desc { margin-top: 1rem; }
.cd__desc .lbl { color: var(--text-dim); font-weight: 600; font-size: 0.82rem; }
.cd__desc p { margin-top: 0.5rem; font-size: 0.82rem; line-height: 1.7; }

/* ── Grid ── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .g2 { grid-template-columns: 1fr; } }

/* ── Report ── */
.report-out {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
    font-family: var(--mono); font-size: 0.8rem;
    color: var(--text); white-space: pre-wrap;
    min-height: 200px; max-height: 500px; overflow-y: auto;
    margin: 1rem;
}
.hint-box {
    background: rgba(212,168,67,0.05); border: 1px solid rgba(212,168,67,0.15);
    border-left: 3px solid var(--gold-dark); border-radius: var(--radius);
    padding: 1rem; font-size: 0.8rem; color: var(--text-dim); line-height: 1.9;
}
.hint-box code {
    background: var(--bg); padding: 0.1rem 0.4rem;
    border-radius: 3px; color: var(--gold-light);
    font-family: var(--mono); font-size: 0.78rem;
}

/* ── Error page ── */
.err-page { text-align: center; padding: 5rem 1rem; }
.err-page__code {
    font-family: var(--display); font-size: 6rem; font-weight: 800;
    color: var(--red); line-height: 1; margin-bottom: 1rem;
    text-shadow: 0 0 40px rgba(192,57,43,0.3);
}
.err-page__msg { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 2rem; }

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border); padding: 1rem 2rem; margin-top: auto;
}
.footer__inner {
    max-width: 1300px; margin: 0 auto; display: flex;
    justify-content: space-between; font-size: 0.72rem; color: var(--text-dim);
}
.footer__ver { font-family: var(--mono); }

/* ── Misc ── */
code {
    font-family: var(--mono); font-size: 0.84em;
    background: var(--bg); padding: 0.1rem 0.35rem;
    border-radius: 3px; color: var(--gold);
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); text-decoration: underline; }

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.anim { animation: fadeUp 0.6s ease-out both; }
.anim-d1 { animation-delay: 0.1s; }
.anim-d2 { animation-delay: 0.2s; }
.anim-d3 { animation-delay: 0.3s; }
.anim-d4 { animation-delay: 0.4s; }
