/* =========================================================
   Fleet Console — dark theme
   ========================================================= */

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

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    background: #0f0f17;
    color: #e7e7f0;
    -webkit-font-smoothing: antialiased;
}

a { color: #5b9dff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout ---------------------------------------------- */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar nav ----------------------------------------- */
.nav {
    width: 180px;
    flex-shrink: 0;
    background: #15151f;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    border-right: 1px solid #262636;
}

.brand {
    padding: 16px 14px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #5b9dff;
    letter-spacing: .5px;
    border-bottom: 1px solid #262636;
}

.navlink {
    display: block;
    padding: 9px 14px;
    color: #8a90a6;
    font-size: 13px;
    cursor: pointer;
    border-radius: 0;
    transition: background .15s, color .15s;
    text-decoration: none;
}

.navlink:hover {
    color: #e7e7f0;
    background: #1d2740;
    text-decoration: none;
}

/* NavLink sets class="active" when route matches */
.navlink.active {
    color: #e7e7f0;
    background: #1d2740;
    border-left: 3px solid #5b9dff;
    padding-left: 11px;
}

.navlink.disabled {
    color: #454a5c;
    cursor: default;
    pointer-events: none;
}

.grp {
    padding: 12px 14px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #454a5c;
}

/* --- Main content area ----------------------------------- */
.main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* --- Panel (card) ---------------------------------------- */
.panel {
    background: #161620;
    border: 1px solid #262636;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #8a90a6;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

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

th {
    color: #8a90a6;
    font-weight: 600;
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #20202e;
    white-space: nowrap;
}

td {
    padding: 6px 10px;
    border-bottom: 1px solid #20202e;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

th.num, td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Color utilities ------------------------------------- */
.pos  { color: #5ad28a; }
.neg  { color: #ff8a8a; }
.muted { color: #8a90a6; }
.warn { color: #ffb38a; }

/* --- Badge (mode labels) --------------------------------- */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}

.badge.live   { background: #1d3a28; color: #5ad28a; }
.badge.dry    { background: #1d2740; color: #5b9dff; }
.badge.paper  { background: #2e2a1a; color: #ffb38a; }

/* --- Form fields ----------------------------------------- */
input:not([type=checkbox]):not([type=radio]),
textarea,
select {
    font: inherit;
    color: #e7e7f0;
    background: #12121c;
    border: 1px solid #2f3144;
    border-radius: 6px;
    padding: 7px 10px;
}

input:not([type=checkbox]):not([type=radio]):focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #5b9dff;
}

input::placeholder, textarea::placeholder { color: #5a607a; }

input:disabled, textarea:disabled, select:disabled { opacity: .55; cursor: not-allowed; }

select option { background: #12121c; color: #e7e7f0; }

label { color: #8a90a6; font-size: 12px; }

/* Per-field help text under a form label. */
.fhint { display: block; color: #6b7187; font-size: 11px; font-weight: 400; line-height: 1.4; margin: 1px 0 4px; max-width: 560px; }
.fhint code { background: #1b1b29; padding: 0 3px; border-radius: 3px; }

/* --- Range selector chips -------------------------------- */
.ranges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.range {
    padding: 3px 11px;
    border-radius: 20px;
    border: 1px solid #262636;
    background: transparent;
    color: #8a90a6;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: background .12s, color .12s, border-color .12s;
}

.range:hover {
    color: #e7e7f0;
    border-color: #5b9dff;
}

.range.active {
    background: #1d2740;
    color: #5b9dff;
    border-color: #5b9dff;
}

/* --- Buttons (action) ------------------------------------ */
/* Base style for every <button> except the .range filter chips (which keep their pill look). */
button:not(.range) {
    font: inherit;
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid #2f3144;
    background: #1b1b29;
    color: #e7e7f0;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s, opacity .12s;
}

button:not(.range):hover:not(:disabled) {
    border-color: #5b9dff;
    background: #1d2740;
    color: #ffffff;
}

button:not(.range):disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Primary call-to-action (Create / Next / Generate / I've funded it / Save). */
button.primary {
    background: #2a5bd7;
    border-color: #2a5bd7;
    color: #ffffff;
    font-weight: 600;
}

button.primary:hover:not(:disabled) {
    background: #3a6df0;
    border-color: #3a6df0;
}

/* Destructive (Stop / Delete). */
button.danger {
    background: transparent;
    border-color: #e05252;
    color: #ff8a8a;
}

button.danger:hover:not(:disabled) {
    background: #3a1d1d;
    border-color: #ff8a8a;
    color: #ffd2d2;
}

/* --- KPI card grid --------------------------------------- */
.kpis {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.kpi {
    background: #161620;
    border: 1px solid #262636;
    border-radius: 10px;
    padding: 12px 18px;
    min-width: 140px;
}

.kpi-label {
    font-size: 11px;
    color: #8a90a6;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #e7e7f0;
}

.kpi-value.pos { color: #5ad28a; }
.kpi-value.neg { color: #ff8a8a; }

/* --- Blazor framework ------------------------------------ */
h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 6px;
}

.blazor-error-boundary::after { content: "Произошла ошибка."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }
