/* Палитра Midnight Executive (~/00 Проекты/AA Mining/CLAUDE.md) */
:root {
    --navy: #1E2761;
    --navy-soft: #2C3878;
    --accent: #B85042;
    --gold: #C9A862;
    --ice: #CADCFC;
    --muted: #5F6A7D;
    --cream: #F5F5F0;
    --darktxt: #212121;
    --green: #2E7D32;
    --line: #E3E4E0;
    --sidebar: 232px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Calibri, Arial, sans-serif;
    background: var(--cream);
    color: var(--darktxt);
    font-size: 15px;
}

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

/* ------------------------------------------------------------- каркас */

.layout { display: flex; min-height: 100vh; align-items: stretch; }

aside {
    width: var(--sidebar);
    flex: 0 0 var(--sidebar);
    background: var(--navy);
    color: #fff;
    padding: 18px 0 28px;
}

aside .brand {
    display: block;
    padding: 0 18px 16px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.14);
    margin-bottom: 12px;
}
aside .brand b { display: block; font-size: 1.12em; letter-spacing: .2px; }
aside .brand span { color: var(--ice); font-size: .78em; }

aside .group { padding: 12px 18px 4px; color: var(--gold);
    font-size: .7em; letter-spacing: .12em; text-transform: uppercase; }

aside nav a {
    display: block;
    padding: 7px 18px;
    color: var(--ice);
    text-decoration: none;
    border-left: 3px solid transparent;
    font-size: .95em;
}
aside nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
aside nav a.active {
    background: rgba(255,255,255,.12);
    border-left-color: var(--gold);
    color: #fff;
    font-weight: bold;
}

.content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 1.25em; color: var(--navy); }
.topbar .user { color: var(--muted); font-size: .85em; }

main { padding: 20px 24px 40px; flex: 1 1 auto; }

footer { color: var(--muted); font-size: .78em; padding: 0 24px 22px; }

/* ------------------------------------------------------------ элементы */

h2 { color: var(--navy); font-size: 1.05em; margin: 26px 0 10px;
     text-transform: uppercase; letter-spacing: .05em; }
h2:first-child { margin-top: 0; }
h3 { color: var(--navy); font-size: 1em; margin: 18px 0 8px; }

.hint { color: var(--muted); font-size: .85em; margin: -4px 0 12px; max-width: 92ch; }

.toolbar {
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    padding: 10px 14px; margin-bottom: 18px;
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.toolbar label { font-size: .88em; color: var(--muted); }
.toolbar input, .toolbar select {
    padding: 5px 7px; border: 1px solid #ccc; border-radius: 4px;
    font-family: inherit; font-size: .95em; margin-left: 4px;
}
.toolbar .spacer { flex: 1 1 auto; }

.btn, button {
    background: var(--navy); color: #fff; border: none;
    padding: 7px 14px; border-radius: 4px; cursor: pointer;
    font-size: .9em; font-family: inherit; text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--navy-soft); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }

/* -------------------------------------------------------------- карточки */

.cards { display: grid; gap: 14px; margin-bottom: 22px;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }

.card {
    background: #fff; border: 1px solid var(--line);
    border-left: 3px solid var(--navy);
    border-radius: 6px; padding: 13px 16px;
}
.card .label { color: var(--muted); font-size: .74em; text-transform: uppercase;
    letter-spacing: .06em; margin-bottom: 4px; }
.card .value { font-size: 1.85em; font-weight: bold; color: var(--navy); line-height: 1.1; }
.card .sub { color: var(--muted); font-size: .8em; margin-top: 3px; }
.card.warn { border-left-color: var(--accent); }
.card.warn .value { color: var(--accent); }
.card.good { border-left-color: var(--green); }
.card.good .value { color: var(--green); }
.card.gold { border-left-color: var(--gold); }

/* --------------------------------------------------------------- таблицы */

.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line);
    border-radius: 6px; margin-bottom: 22px; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 7px 10px; border-bottom: 1px solid #EFEFEC; text-align: left;
    font-size: .9em; white-space: nowrap; }
th { background: var(--navy); color: #fff; font-weight: normal; position: sticky; top: 0;
    font-size: .82em; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #FAFAF7; }
tfoot td { font-weight: bold; background: #F4F5F1; border-top: 2px solid var(--navy); }
table.compact td, table.compact th { padding: 5px 8px; font-size: .85em; }

a.row-link { color: var(--navy); text-decoration: none; border-bottom: 1px dotted var(--ice); }
a.row-link:hover { border-bottom-color: var(--navy); }

.muted { color: var(--muted); font-size: .88em; }
.flag { color: var(--accent); font-weight: bold; }
.ok { color: var(--green); }

.pill { display: inline-block; padding: 1px 8px; border-radius: 10px;
    font-size: .78em; color: #fff; white-space: nowrap; }

/* Полоска выполнения плана прямо в ячейке таблицы. */
.bar { position: relative; display: block; height: 15px; min-width: 90px;
    background: #EFEFEC; border-radius: 2px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ice);
    border-radius: 2px; }
.bar i.over { background: #BFE3C0; }
.bar i.under { background: #F0C9C4; }
.bar span { position: relative; font-size: .78em; padding-left: 5px;
    line-height: 15px; color: var(--darktxt); font-variant-numeric: tabular-nums; }

.chart { width: 100%; height: 320px; background: #fff; border: 1px solid var(--line);
    border-radius: 6px; margin-bottom: 22px; }
.chart.short { height: 230px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }

/* Лента статусов борта по суткам. */
.strip { display: flex; gap: 1px; flex-wrap: wrap; background: #fff;
    border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 8px; }
.strip i { width: 7px; height: 26px; border-radius: 1px; display: block; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.legend span { font-size: .82em; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.legend em { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

.empty { color: var(--muted); padding: 14px; background: #fff;
    border: 1px dashed var(--line); border-radius: 6px; margin-bottom: 20px; }

/* ------------------------------------------------------------------ вход */

form.login-form {
    max-width: 340px; margin: 90px auto; background: #fff;
    padding: 30px; border-radius: 8px; box-shadow: 0 2px 14px rgba(30,39,97,.12);
}
form.login-form h1 { color: var(--navy); font-size: 1.2em; margin: 0 0 4px; }
form.login-form input { width: 100%; padding: 9px; margin-bottom: 11px;
    border: 1px solid #ccc; border-radius: 4px; font-family: inherit; }
form.login-form button { width: 100%; padding: 10px; font-size: 1em; }
.error { color: var(--accent); margin-bottom: 12px; }
.msg { background: var(--ice); padding: 9px 14px; border-radius: 4px; margin-bottom: 16px; }

@media (max-width: 900px) {
    .layout { flex-direction: column; }
    aside { width: 100%; flex: none; padding-bottom: 12px; }
    aside nav { display: flex; flex-wrap: wrap; }
    aside nav a { border-left: none; border-bottom: 3px solid transparent; }
    aside nav a.active { border-left: none; border-bottom-color: var(--gold); }
    aside .group { width: 100%; }
    .grid2 { grid-template-columns: 1fr; }
    main { padding: 16px; }
}

@media print {
    aside, .toolbar, .topbar .user { display: none; }
    body { background: #fff; font-size: 11px; }
    .chart { break-inside: avoid; }
    th { position: static; }
}
