:root {
    --accent: #1F3A5F;
    --accent-2: #2E6DB4;
    --bg: #F4F6F9;
    --sidebar-w: 236px;
}
body { background: var(--bg); color: #1d2433; font-size: .94rem; }
.material-icons-outlined { font-size: 20px; vertical-align: -4px; }

.app { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); background: var(--accent); color: #fff; display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1030; overflow-y: auto;
}
.sidebar .brand { padding: 18px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .brand-logo { max-width: 100%; max-height: 54px; background: #fff; border-radius: 6px; padding: 4px; margin-bottom: 8px; }
.sidebar .brand-name { font-weight: 600; line-height: 1.2; }
.sidebar .nav { padding: 10px 8px; flex: 1; }
.sidebar .nav-link { color: rgba(255,255,255,.85); border-radius: 6px; padding: 8px 10px; display: flex; gap: 10px; align-items: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.sidebar .nav-link.disabled { color: rgba(255,255,255,.38); }
.sidebar .nav-sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.45); padding: 14px 10px 4px; }
.sidebar-user { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user .btn-link { color: rgba(255,255,255,.7); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.content { padding: 24px 28px; max-width: 1280px; }
.content-plain { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.topbar { display: flex; gap: 12px; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e3e7ee; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: none; box-shadow: 0 0 30px rgba(0,0,0,.3); }
    .main { margin-left: 0; }
    .content { padding: 16px; }
}

.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { font-size: 1.45rem; margin: 0; font-weight: 600; }
.card { border: 1px solid #e3e7ee; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #5b6573; font-weight: 600; background: #f8f9fb; }
.table td { vertical-align: middle; }
.text-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat { padding: 16px 18px; }
.stat .label { font-size: .8rem; color: #5b6573; }
.stat .value { font-size: 1.4rem; font-weight: 600; }

.badge-status { font-weight: 600; }
.badge-draft { background: #E7EAF0; color: #3b4556; }
.badge-sent { background: #DCEBFF; color: #1b4f91; }
.badge-approved { background: #D9F2E3; color: #17663a; }
.badge-rejected { background: #FBE0E0; color: #9b1c1c; }
.badge-invoiced { background: #EFE3FF; color: #5b2a9a; }
.badge-expired { background: #FFF0CC; color: #8a5a00; }

.items-table input, .items-table select, .items-table textarea { font-size: .88rem; }
.items-table td { padding: 4px; vertical-align: top; }
.items-table .col-num { width: 92px; }
.items-table .col-price { width: 120px; }
.items-table .col-total { width: 130px; text-align: right; padding-top: 10px; }
.totals-box { min-width: 280px; }
.totals-box .row-total { font-size: 1.15rem; font-weight: 700; border-top: 2px solid var(--accent); padding-top: 6px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid #d8dee8; padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ""; width: 8px; height: 8px; background: var(--accent-2); border-radius: 50%; position: absolute; left: -5px; top: 6px; }
.form-label { font-weight: 500; font-size: .86rem; }
