/*
  PNP MR.SUSHI — Финдир — premium тёмная тема
  Брендовая палитра: чёрный + красный E92229 + золото F5E385 + белый
*/
:root {
    /* Бренд */
    --brand-red: #E92229;
    --brand-red-hover: #FF3D44;
    --brand-red-soft: rgba(233, 34, 41, 0.15);
    --brand-gold: #F5E385;
    --brand-gold-soft: rgba(245, 227, 133, 0.12);
    --brand-black: #0F0F0F;
    --brand-white: #FFFFFF;

    /* UI surface */
    --bg: #0F0F0F;
    --bg-2: #1A1A1A;
    --bg-3: #262626;
    --line: #3A3A3A;
    --line-2: #5A5A5A;

    /* Text */
    --text: #FFFFFF;
    --text-dim: #A8A8A8;
    --text-muted: #6B6B6B;

    /* Status */
    --success: #7DD389;
    --success-soft: rgba(125, 211, 137, 0.12);
    --warning: #F5E385;
    --danger: #E92229;
    --danger-soft: rgba(233, 34, 41, 0.15);
    --info: #7DA8D3;

    /* Effects */
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03), 0 4px 24px rgba(0, 0, 0, 0.4);
    --glow-gold: 0 0 0 1px rgba(245, 227, 133, 0.15), 0 0 24px rgba(245, 227, 133, 0.08);
    --glow-red: 0 0 0 1px rgba(233, 34, 41, 0.2), 0 0 16px rgba(233, 34, 41, 0.15);

    /* Legacy alias (не ломаем старые классы) */
    --crimson: var(--brand-red);
    --crimson-2: #B81A20;
    --gold: var(--brand-gold);
    --gold-2: #D4C575;
    --green: var(--success);
    --red: var(--danger);
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-image:
        radial-gradient(ellipse at top right, rgba(245, 227, 133, 0.04), transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(233, 34, 41, 0.035), transparent 50%);
    min-height: 100vh;
}

a { color: var(--brand-gold); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand-red); }

::selection { background: var(--brand-gold); color: var(--brand-black); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }

h1, h2, h3, h4, h5 {
    font-family: 'Unbounded', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: linear-gradient(180deg, #1A1A1A 0%, #0F0F0F 100%);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    position: sticky; top: 0; z-index: 100;
}

.brand {
    display: flex; align-items: center; gap: 12px;
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-weight: 700; font-size: 16px;
    letter-spacing: 0.05em;
}
.logo {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    line-height: 1;
}
.logo-line {
    height: 1px;
    background: var(--brand-gold);
}
.logo-text {
    color: var(--brand-red);
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 3px 4px;
    font-size: 14px;
    font-family: 'Unbounded', sans-serif;
}
.brand-text {
    color: var(--text);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.18em;
}
.brand-text em {
    color: var(--brand-gold);
    font-style: normal;
    font-weight: 500;
    font-size: 11px;
    margin-left: 4px;
    letter-spacing: 0.16em;
}

.nav { display: flex; gap: 4px; }
.nav a {
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.15s;
    font-size: 13px;
}
.nav a:hover { background: var(--bg-3); color: var(--text); }
.nav a.active {
    background: var(--bg-3);
    color: var(--brand-gold);
    box-shadow: inset 0 -2px 0 var(--brand-red);
}

.user-block { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.user-role {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.role-owner {
    background: var(--brand-gold-soft);
    color: var(--brand-gold);
    border: 1px solid rgba(245, 227, 133, 0.3);
}
.role-manager {
    background: var(--brand-red-soft);
    color: var(--brand-red);
    border: 1px solid rgba(233, 34, 41, 0.3);
}
.user-name { color: var(--text-dim); }
.logout {
    color: var(--text-muted); font-size: 12px;
    padding: 4px 10px; border-radius: 6px;
    border: 1px solid var(--line);
    transition: all 0.15s;
}
.logout:hover { color: var(--danger); border-color: var(--danger); }

/* ── Main ───────────────────────────────────────────────────────────────── */
.main { max-width: 1400px; margin: 0 auto; padding: 28px; }

.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    background: linear-gradient(90deg, var(--text) 0%, var(--brand-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.filters { display: flex; gap: 8px; }
.filters input, .filters select {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.filters input:focus, .filters select:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.12);
}

/* ── KPI cards ──────────────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.kpi-card {
    background:
        linear-gradient(180deg, rgba(245, 227, 133, 0.03) 0%, rgba(15, 15, 15, 0) 100%),
        var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 20px;
    transition: all 0.2s;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow-card);
}
.kpi-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--brand-red), var(--brand-gold));
    opacity: 0.4;
}
.kpi-card:hover {
    border-color: var(--line-2);
    transform: translateY(-2px);
    box-shadow: var(--glow-gold), 0 8px 24px rgba(0, 0, 0, 0.5);
}
.kpi-card.kpi-revenue::before { opacity: 1; }
.kpi-card.kpi-ebitda::before { background: var(--brand-gold); opacity: 1; }
.kpi-card.kpi-net::before { background: var(--success); opacity: 1; }
.kpi-card.kpi-net.negative::before { background: var(--danger); opacity: 1; }

.kpi-label {
    color: var(--text-muted);
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.1em; font-weight: 600;
    margin-bottom: 8px;
}
.kpi-value {
    font-size: 28px; font-weight: 700;
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.kpi-card.kpi-net.negative .kpi-value { color: var(--danger); }
.kpi-card.kpi-ebitda .kpi-value { color: var(--brand-gold); }
.kpi-card.kpi-net .kpi-value { color: var(--success); }
.kpi-card.kpi-net.negative .kpi-value { color: var(--danger); }
.kpi-sub {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 11px; color: var(--text-dim);
}

/* ── Section ────────────────────────────────────────────────────────────── */
.section {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-card);
}
.section h2 {
    margin: 0 0 16px;
    font-size: 16px; font-weight: 600;
    color: var(--brand-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chart-wrap { height: 320px; position: relative; }
.chart-wrap.chart-small { height: 280px; max-width: 720px; margin: 0 auto; }

/* ── Branch cards ───────────────────────────────────────────────────────── */
.branch-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.branch-card {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
    transition: all 0.15s;
}
.branch-card:hover { border-color: var(--line-2); }
.branch-name {
    font-size: 16px; font-weight: 700;
    color: var(--brand-gold);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    font-family: 'Unbounded', sans-serif;
    letter-spacing: -0.01em;
}
.branch-stat {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 13px;
    border-bottom: 1px dashed var(--line);
}
.branch-stat:last-child { border-bottom: none; }
.branch-stat span { color: var(--text-dim); }
.branch-stat b {
    color: var(--text);
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* ── PNL table ──────────────────────────────────────────────────────────── */
.pnl-wrap {
    overflow-x: auto;
    background: var(--bg-2);
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}
.pnl-table {
    width: 100%; border-collapse: collapse;
    font-size: 13px;
}
.pnl-table th, .pnl-table td {
    padding: 10px 14px; text-align: left;
    border-bottom: 1px solid var(--line);
}
.pnl-table thead th {
    background: var(--bg-3);
    color: var(--brand-gold);
    font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.08em;
    position: sticky; top: 0;
    font-family: 'Unbounded', sans-serif;
}
.pnl-table th:first-child, .pnl-table td:first-child {
    text-align: left; min-width: 280px;
    color: var(--text);
}
.pnl-table td:not(:first-child) {
    text-align: right;
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.pnl-table tbody tr:hover { background: rgba(245, 227, 133, 0.025); }
.pnl-table .pct {
    display: inline-block; margin-left: 6px;
    color: var(--brand-gold);
    font-size: 11px;
    font-weight: 500;
}
.pnl-table .indent { padding-left: 32px; color: var(--text-dim); font-size: 12px; }
.section-row td {
    background: linear-gradient(90deg, rgba(233, 34, 41, 0.18) 0%, transparent 70%);
    color: var(--brand-gold) !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
    padding: 12px 14px !important;
    font-family: 'Unbounded', sans-serif;
}
.total-row td {
    background: var(--bg-3);
    font-weight: 700;
}
.ebitda-row td {
    background: rgba(245, 227, 133, 0.06);
    border-top: 1px solid rgba(245, 227, 133, 0.2);
}
.ebitda-row td:not(:first-child) {
    color: var(--brand-gold);
}
.net-row td {
    background: rgba(125, 211, 137, 0.06);
    border-top: 1px solid rgba(125, 211, 137, 0.2);
}
.net-row td:not(:first-child) {
    color: var(--success);
}
.net-row.negative td, .negative { color: var(--danger) !important; }
.net-row.negative td:not(:first-child) { color: var(--danger); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.input-form {
    background: var(--bg-2);
    border: 1px solid var(--line);
    padding: 22px 24px;
    border-radius: 12px;
    display: flex; flex-direction: column; gap: 12px;
    box-shadow: var(--shadow-card);
}
.input-form h2 {
    margin: 0 0 12px;
    color: var(--brand-gold);
    font-size: 17px;
}
.input-form h3 {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 8px 0 4px;
    font-family: 'Inter', sans-serif;
}
.input-form-inline { flex-direction: row; flex-wrap: wrap; align-items: end; }
.form-section {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px 0; border-top: 1px solid var(--line);
}
.form-section:first-of-type { border-top: none; padding-top: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.input-form label {
    display: flex; flex-direction: column; gap: 4px;
    flex: 1;
}
.input-form label span {
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.input-form input, .input-form select {
    background: var(--bg-3);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-form input:focus, .input-form select:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.12);
}

.btn-primary {
    background: linear-gradient(180deg, var(--brand-red) 0%, #B81A20 100%);
    color: white;
    border: none;
    padding: 11px 24px;
    border-radius: 8px;
    font-weight: 600; font-size: 13px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s;
    align-self: flex-start;
    font-family: inherit;
}
.btn-primary:hover {
    background: linear-gradient(180deg, var(--brand-red-hover) 0%, var(--brand-red) 100%);
    transform: translateY(-1px);
    box-shadow: var(--glow-red), 0 4px 12px rgba(233, 34, 41, 0.3);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary-sm {
    background: var(--brand-gold);
    color: var(--brand-black);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-primary-sm:hover { background: #FFF1A8; }
.btn-danger-sm {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--line);
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-danger-sm:hover { background: var(--danger-soft); border-color: var(--danger); }

.alert.ok {
    background: var(--success-soft);
    border: 1px solid rgba(125, 211, 137, 0.3);
    color: var(--success);
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 500;
}

/* ── Data table ────────────────────────────────────────────────────────── */
.data-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-3);
    border-radius: 10px; overflow: hidden;
    font-size: 13px;
}
.data-table th, .data-table td {
    padding: 10px 14px; text-align: left;
    border-bottom: 1px solid var(--line);
}
.data-table thead th {
    background: var(--bg-2);
    color: var(--brand-gold);
    font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.08em;
    font-family: 'Unbounded', sans-serif;
}
.data-table tbody tr:hover { background: var(--bg-2); }
.data-table .empty {
    text-align: center; color: var(--text-muted);
    padding: 28px; font-style: italic;
}
.data-table b {
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
}
.plan-fact-table .over { background: rgba(233, 34, 41, 0.06); }
.plan-fact-table .under { background: rgba(125, 211, 137, 0.06); }
.inline { display: inline-flex; gap: 6px; }
.inline input { padding: 6px 10px; }

/* ── Branch input grid ──────────────────────────────────────────────────── */
.branch-input-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(ellipse at top, rgba(245, 227, 133, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at bottom, rgba(233, 34, 41, 0.05) 0%, transparent 60%),
        var(--bg);
    padding: 20px;
}
.login-card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--glow-gold);
    text-align: center;
}
.login-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 16px;
    line-height: 1;
}
.login-logo .logo-line { height: 2px; background: var(--brand-gold); }
.login-logo .logo-text {
    color: var(--brand-red);
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 32px;
    letter-spacing: 0.12em;
    padding: 6px 8px;
}
.login-card h1 {
    margin: 0 0 4px;
    font-size: 22px; font-weight: 700;
    font-family: 'Unbounded', sans-serif;
    color: var(--text);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.login-sub {
    color: var(--brand-gold);
    margin-bottom: 32px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
}
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-form label { display: flex; flex-direction: column; gap: 4px; }
.login-form label span {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.login-form input {
    background: var(--bg-3);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.login-form input:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.15);
}
.login-form .btn-primary {
    align-self: stretch;
    padding: 13px;
    font-size: 14px;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.login-form .error {
    background: var(--danger-soft);
    border: 1px solid rgba(233, 34, 41, 0.3);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
}

/* ── Avg-check cards ──────────────────────────────────────────────────── */
.avg-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.avg-card {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}
.avg-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--text-muted);
}
.avg-card.trend-up::before { background: var(--success); }
.avg-card.trend-down::before { background: var(--danger); }
.avg-card.trend-flat::before { background: var(--brand-gold); }
.avg-card .ac-branch {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 6px;
}
.avg-card .ac-value {
    font-family: 'Unbounded', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.avg-card.trend-up .ac-value { color: var(--success); }
.avg-card.trend-down .ac-value { color: var(--danger); }
.avg-card .ac-meta {
    display: flex; gap: 12px;
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 10px;
}
.avg-card .ac-delta {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-2);
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}
.avg-card.trend-up .ac-delta {
    background: var(--success-soft);
    border: 1px solid rgba(125, 211, 137, 0.25);
    color: var(--success);
}
.avg-card.trend-down .ac-delta {
    background: var(--danger-soft);
    border: 1px solid rgba(233, 34, 41, 0.25);
    color: var(--danger);
}
.avg-card .delta-arrow { font-size: 14px; font-weight: 700; }
.avg-card .delta-pct { font-weight: 700; }
.avg-card .delta-vs { color: var(--text-muted); margin-left: auto; font-size: 11px; }
.avg-card .delta-none { color: var(--text-muted); font-style: italic; }

/* ── History table ──────────────────────────────────────────────────────── */
.history-table { font-size: 12px; }
.history-table .muted { color: var(--text-muted); }
.kind-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.kind-revenue {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(125, 211, 137, 0.3);
}
.kind-expense {
    background: rgba(125, 168, 211, 0.12);
    color: var(--info);
    border: 1px solid rgba(125, 168, 211, 0.3);
}
.kind-extra {
    background: var(--brand-gold-soft);
    color: var(--brand-gold);
    border: 1px solid rgba(245, 227, 133, 0.3);
}
.kind-monthly {
    background: var(--brand-red-soft);
    color: var(--brand-red);
    border: 1px solid rgba(233, 34, 41, 0.3);
}
.kind-salary {
    background: rgba(177, 156, 217, 0.12);
    color: #B19CD9;
    border: 1px solid rgba(177, 156, 217, 0.3);
}

.hint { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }
.muted { color: var(--text-muted); }

/* ── Quick-fill (быстрый ввод месяца) ─────────────────────────────────── */
.quickfill-intro {
    margin-bottom: 18px;
}

.quickfill-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.qf-section {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 26px;
    box-shadow: var(--shadow-card);
}

.qf-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.qf-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--brand-gold-soft);
    color: var(--brand-gold);
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid rgba(245, 227, 133, 0.3);
}

.qf-header h2 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.01em;
    flex: 1;
    text-transform: none;
}

.qf-hint {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.qf-optional {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.qf-sub {
    color: var(--brand-gold);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 18px 0 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}
.qf-sub:first-child { margin-top: 0; }

.qf-branches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
}

.qf-branch {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
}

.qf-branch h3 {
    margin: 0 0 12px;
    color: var(--brand-gold);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: 'Unbounded', sans-serif;
}

.qf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.qf-grid label,
.qf-cat-grid label,
.qf-cat-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qf-grid label span,
.qf-cat-grid label span,
.qf-cat-row label span {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.qf-grid input,
.qf-cat-grid input,
.qf-cat-row input {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 8px;
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.qf-grid input:focus,
.qf-cat-grid input:focus,
.qf-cat-row input:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.12);
}

.qf-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.qf-cat {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
}

.qf-cat-label {
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
}

.qf-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.qf-cat-row {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
}

.qf-emp-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.qf-emp-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 1fr 36px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.qf-emp-row input,
.qf-emp-row select {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}
.qf-emp-row input:focus,
.qf-emp-row select:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.12);
}
.qf-emp-row input[type="number"] {
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.qf-submit {
    background: var(--bg-2);
    border: 1px solid var(--brand-gold);
    border-radius: 12px;
    padding: 22px 26px;
    box-shadow: var(--glow-gold);
    text-align: center;
}

.qf-submit .btn-primary {
    align-self: center;
    padding: 14px 38px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 auto 12px;
}

.qf-submit .hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .qf-section { padding: 16px; }
    .qf-grid { grid-template-columns: 1fr; }
    .qf-emp-row { grid-template-columns: 1fr; gap: 6px; }
    .qf-cat-grid { grid-template-columns: 1fr; }
    .qf-cat-table { font-size: 12px; }
    .qf-cat-table th, .qf-cat-table td { padding: 6px 6px; }
    .qf-cat-input { width: 100%; min-width: 80px; }
}

/* ── Per-branch category table (quick-fill section C) ──────────────────── */
.qf-cat-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-3);
}
.qf-cat-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}
.qf-cat-table th,
.qf-cat-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.qf-cat-table thead th {
    background: var(--bg-2);
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.qf-cat-table .qf-cat-th {
    text-align: right;
    width: 160px;
}
.qf-cat-table .qf-cat-name {
    font-weight: 500;
    color: var(--text);
}
.qf-cat-input {
    width: 140px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 6px;
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    text-align: right;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.qf-cat-input:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.12);
}
.qf-cat-table tbody tr:hover {
    background: rgba(245, 227, 133, 0.03);
}
.qf-cat-table .qf-cat-sum {
    text-align: right;
    color: var(--text-dim);
    font-weight: 600;
}
.qf-cat-table tfoot .qf-cat-totals {
    background: var(--bg-2);
    color: var(--brand-gold);
}
.qf-cat-table tfoot .qf-cat-total,
.qf-cat-table tfoot .qf-cat-grand {
    text-align: right;
}
.qf-cat-table tfoot .qf-cat-grand {
    color: var(--brand-gold);
    background: rgba(245, 227, 133, 0.08);
}

/* ── FOT live totals (quick-fill section D) ────────────────────────────── */
.qf-fot-totals {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 12px 0 14px;
    padding: 10px 12px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.qf-fot-totals-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.qf-fot-chip {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.qf-fot-chip b { color: var(--brand-gold); margin-left: 4px; }
.qf-fot-chip.qf-fot-grand {
    background: rgba(245, 227, 133, 0.08);
    border-color: var(--brand-gold);
}
.qf-fot-chip.qf-fot-grand b { color: var(--brand-gold); }
.qf-fot-chip.qf-fot-common b { color: var(--text); }

/* ── /input/monthly per-branch blocks ──────────────────────────────────── */
.im-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.im-summary-card {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
}
.im-summary-card:first-child {
    border-color: var(--brand-gold);
    background: rgba(245, 227, 133, 0.06);
}
.im-summary-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.im-summary-value {
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
    font-family: 'Unbounded', sans-serif;
    font-variant-numeric: tabular-nums;
}
.im-summary-card:first-child .im-summary-value { color: var(--brand-gold); }

.im-branch-block { margin-bottom: 24px; }
.im-branch-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}
.im-branch-header h2 { margin: 0; }
.im-branch-total {
    color: var(--brand-gold);
    font-weight: 600;
    font-family: 'Unbounded', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 16px;
}
.im-common-block .im-branch-header { border-bottom-style: dashed; }
.data-table-total td {
    border-top: 2px solid var(--brand-gold);
    background: rgba(245, 227, 133, 0.04);
    color: var(--brand-gold);
}

/* ── Empty-state wizard ───────────────────────────────────────────────────── */
.wizard-card {
    background: linear-gradient(135deg, rgba(245, 227, 133, 0.06), rgba(200, 16, 46, 0.04));
    border: 1px solid var(--brand-gold);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    text-align: center;
}
.wizard-icon { font-size: 40px; margin-bottom: 8px; }
.wizard-card h2 {
    color: var(--brand-gold);
    margin: 0 0 8px;
    font-size: 22px;
}
.wizard-card p { color: var(--text-dim); margin-bottom: 18px; }
.wizard-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 20px;
    text-align: left;
}
.wizard-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}
.wizard-step:hover {
    border-color: var(--brand-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 227, 133, 0.12);
}
.wizard-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-gold);
    color: var(--bg-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Unbounded', sans-serif;
}
.wizard-step-title { font-weight: 600; margin-bottom: 2px; }
.wizard-step-sub { font-size: 12px; color: var(--text-dim); }

/* ── KPI delta pill ───────────────────────────────────────────────────────── */
.kpi-delta {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-left: 6px;
    vertical-align: middle;
}
.kpi-delta-up {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
}
.kpi-delta-down {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}
.kpi-delta-flat {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
}

/* ── Bottom nav (mobile only) ─────────────────────────────────────────────── */
.bottom-nav { display: none; }

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-2);
        border-top: 1px solid var(--line);
        padding: 6px 4px;
        z-index: 100;
        gap: 2px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 4px;
        text-decoration: none;
        color: var(--text-dim);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-radius: 8px;
        position: relative;
    }
    .bottom-nav-item.active {
        color: var(--brand-gold);
        background: rgba(245, 227, 133, 0.08);
    }
    .bn-icon {
        font-size: 20px;
        line-height: 1;
    }
    .bn-label {
        font-weight: 600;
    }
    .bn-badge {
        position: absolute;
        top: 2px;
        right: 14px;
        background: #ef4444;
        color: white;
        font-size: 9px;
        font-weight: 700;
        padding: 1px 5px;
        border-radius: 8px;
        line-height: 1;
    }
    body { padding-bottom: 70px; }
}

/* ── Nav alert badge ──────────────────────────────────────────────────────── */
.nav-alert-badge {
    display: inline-block;
    margin-left: 4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
    vertical-align: middle;
    min-width: 16px;
    text-align: center;
    animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* ── Inline sanity hints (под полями ввода) ──────────────────────────────── */
.sanity-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.3;
    padding: 3px 8px;
    border-radius: 4px;
}
.sanity-hint-ok {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.08);
}
.sanity-hint-warn {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.08);
}
.sanity-hint-danger {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

/* ── P&L: alerts + KPI strip + sparklines + collapsible groups ───────────── */
.pnl-alerts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.pnl-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid;
}
.pnl-alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}
.pnl-alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}
.pnl-alert-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.pnl-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.pnl-kpi {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}
.pnl-kpi.negative {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.06);
}
.pnl-kpi-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.pnl-kpi-pct {
    color: var(--brand-gold);
    font-size: 11px;
    font-weight: 600;
}
.pnl-kpi.negative .pnl-kpi-pct { color: #f87171; }
.pnl-kpi-value {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    font-family: 'Unbounded', sans-serif;
    font-variant-numeric: tabular-nums;
}
.pnl-spark {
    height: 32px !important;
    width: 100% !important;
    margin-top: 4px;
}

.pnl-table .th-plan, .pnl-table .th-delta {
    width: 100px;
    text-align: right;
    color: var(--text-dim);
    font-weight: 500;
}
.pnl-table .th-plan { width: 110px; }
.pnl-delta {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.pnl-delta.pos {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}
.pnl-delta.neg {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.pnl-table .section-row[data-collapsible="true"]:hover {
    background: rgba(245, 227, 133, 0.06);
}
.pnl-table .group-toggle {
    display: inline-block;
    width: 14px;
    color: var(--brand-gold);
    transition: transform 0.15s;
}
.pnl-table .group-row.collapsed {
    display: none;
}
.pnl-table .group-row-detail td:first-child {
    padding-left: 28px;
    color: var(--text-dim);
    font-size: 13px;
}
.pnl-table td.muted, .pnl-table .muted {
    color: var(--text-muted);
    font-size: 12px;
}

@media print {
    .topbar, .filters, .entry-nav-wrap, .pnl-alerts { display: none !important; }
    body { background: white !important; color: black !important; }
    .pnl-kpi, .pnl-table {
        background: white !important;
        color: black !important;
        border-color: #ccc !important;
    }
    .pnl-table th, .pnl-table td {
        border-bottom-color: #ddd !important;
        color: black !important;
    }
    .pnl-table .group-row.collapsed { display: table-row !important; }
    .pnl-spark { display: none !important; }
    .pnl-kpi-strip { grid-template-columns: repeat(4, 1fr) !important; }
    .pnl-table .group-toggle { display: none; }
    .pnl-delta { color: black !important; background: #eee !important; }
}

/* ── Entry tabs (across all entry pages) ──────────────────────────────────── */
.entry-nav-wrap {
    margin: -8px -4px 18px;
    padding: 4px;
    overflow-x: auto;
}
.entry-nav {
    display: flex;
    gap: 8px;
    min-width: max-content;
}
.entry-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    background: var(--bg-3);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dim);
    transition: all 0.15s;
    min-width: 160px;
}
.entry-tab:hover {
    border-color: var(--brand-gold);
    color: var(--text);
    transform: translateY(-1px);
}
.entry-tab.active {
    border-color: var(--brand-gold);
    background: rgba(245, 227, 133, 0.08);
    color: var(--brand-gold);
    box-shadow: 0 0 0 1px var(--brand-gold) inset, var(--glow-gold);
}
.entry-tab-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.entry-tab-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.entry-tab-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.entry-tab-sub {
    font-size: 11px;
    color: var(--text-dim);
}
.entry-tab.active .entry-tab-sub { color: rgba(245, 227, 133, 0.7); }
.entry-tab-quick {
    background: rgba(245, 227, 133, 0.04);
    border-color: rgba(245, 227, 133, 0.3);
}
.entry-tab-quick:not(.active):hover {
    background: rgba(245, 227, 133, 0.08);
}

@media (max-width: 768px) {
    .entry-tab { min-width: 140px; padding: 8px 10px; }
    .entry-tab-title { font-size: 12px; }
    .entry-tab-sub { display: none; }
    .entry-tab-icon { font-size: 18px; }
}

/* ── CSV import on /roster ────────────────────────────────────────────────── */
.roster-import-details summary {
    cursor: pointer;
    color: var(--brand-gold);
    font-size: 14px;
    list-style: none;
    padding: 8px 0;
}
.roster-import-details summary::-webkit-details-marker { display: none; }
.roster-import-details summary::before { content: "▸ "; }
.roster-import-details[open] summary::before { content: "▾ "; }
.roster-import-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.roster-import-form textarea {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
}
.roster-import-form textarea:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.1);
}
.row-error {
    background: rgba(239, 68, 68, 0.04);
    color: var(--text-dim);
}
.row-error b { color: #f87171; }

/* ── Roster (/roster) ─────────────────────────────────────────────────────── */
.roster-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-3);
}
.roster-table {
    width: 100%;
}
.roster-table th, .roster-table td {
    padding: 8px 10px;
    vertical-align: middle;
}
.roster-row.roster-inactive {
    opacity: 0.5;
}
.roster-row.roster-courier {
    background: rgba(124, 158, 255, 0.04);
}
.roster-table input[type="text"],
.roster-table input[type="number"],
.roster-table select {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}
.roster-table input.rate-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Unbounded', 'Inter', sans-serif;
    max-width: 120px;
}
.roster-table input:focus, .roster-table select:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.1);
}
.roster-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}
.btn-ghost-sm {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.15s;
    display: inline-block;
}
.btn-ghost-sm:hover, .btn-ghost-sm.active {
    border-color: var(--brand-gold);
    color: var(--brand-gold);
}

/* ── Payroll (/payroll) ───────────────────────────────────────────────────── */
.payroll-tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0 18px;
}
.payroll-tab {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    background: var(--bg-3);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dim);
    transition: all 0.15s;
}
.payroll-tab:hover { border-color: var(--brand-gold); color: var(--text); }
.payroll-tab.active {
    border-color: var(--brand-gold);
    background: rgba(245, 227, 133, 0.06);
    color: var(--brand-gold);
    box-shadow: var(--glow-gold);
}
.payroll-tab-num {
    font-family: 'Unbounded', sans-serif;
    font-size: 22px;
    font-weight: 700;
    width: 32px;
    text-align: center;
    color: var(--brand-gold);
}
.payroll-tab-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.payroll-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.payroll-summary-card {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
}
.payroll-summary-grand {
    border-color: var(--brand-gold);
    background: rgba(245, 227, 133, 0.06);
}
.payroll-summary-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.payroll-summary-value {
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
    font-family: 'Unbounded', sans-serif;
    font-variant-numeric: tabular-nums;
}
.payroll-summary-grand .payroll-summary-value { color: var(--brand-gold); }

.payroll-section { margin-bottom: 24px; }
.payroll-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.payroll-section-header h2 { margin: 0; }
.payroll-section-total {
    color: var(--brand-gold);
    font-weight: 600;
    font-family: 'Unbounded', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 16px;
}

.payroll-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-3);
}
.payroll-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}
.payroll-table th, .payroll-table td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
.payroll-table thead th {
    background: var(--bg-2);
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.payroll-table tbody tr:hover {
    background: rgba(245, 227, 133, 0.03);
}
.payroll-emp-name { font-weight: 500; color: var(--text); }
.payroll-emp-cat { color: var(--text-dim); font-size: 12px; }
.payroll-input {
    width: 80px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 13px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Unbounded', 'Inter', sans-serif;
}
.payroll-input:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 227, 133, 0.1);
}
.pr-rate, .pr-total { text-align: right; }
.pr-hours, .pr-ot, .pr-courier { width: 90px; text-align: right; }
.pr-total {
    color: var(--brand-gold);
    font-weight: 600;
    font-family: 'Unbounded', sans-serif;
}
.payroll-line-currency { color: var(--text-dim); font-size: 11px; margin-left: 2px; }
.payroll-row-courier { background: rgba(124, 158, 255, 0.03); }

.payroll-submit {
    background: var(--bg-2);
    border: 1px solid var(--brand-gold);
    border-radius: 12px;
    padding: 22px 26px;
    margin-top: 18px;
    box-shadow: var(--glow-gold);
    text-align: center;
}
.payroll-submit .btn-primary {
    padding: 14px 38px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.empty-state {
    padding: 40px;
    text-align: center;
    background: var(--bg-3);
    border: 1px dashed var(--line);
    border-radius: 12px;
}

@media (max-width: 768px) {
    .payroll-table th, .payroll-table td { padding: 6px 6px; font-size: 12px; }
    .payroll-input { width: 60px; padding: 5px 6px; font-size: 12px; }
    .payroll-tab { padding: 10px 12px; }
    .payroll-tab-num { font-size: 18px; width: 24px; }
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
    .nav { width: 100%; overflow-x: auto; }
    .nav a { white-space: nowrap; padding: 6px 10px; font-size: 12px; }
    .main { padding: 16px; }
    .page-header h1 { font-size: 24px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .branch-input-grid { grid-template-columns: 1fr; }
    .input-form-inline { flex-direction: column; align-items: stretch; }
    .pnl-table { font-size: 12px; }
    .pnl-table th, .pnl-table td { padding: 8px 8px; }
    .login-card { padding: 32px 24px; }
}
