/* ==========================================================================
   Bank Reader — визуална система за счетоводна кантора
   Класически финансов вид: светъл лист, мастилен навигационен блок,
   един сдържан акцент, тънки линии, плътни таблици с табулярни цифри.
   ========================================================================== */

:root {
    --canvas:        #f4f7fa;
    --surface:       #ffffff;
    --surface-alt:   #f7f9fb;
    --surface-sunk:  #eef2f6;

    --line:          #dfe5ec;
    --line-strong:   #c7d0dc;

    --ink:           #17212b;
    --ink-2:         #425164;
    --muted:         #69788b;
    --faint:         #94a0ae;

    --nav-bg:        #101b29;
    --nav-bg-2:      #0b1420;
    --nav-text:      #aebdce;
    --nav-hover:     #19283a;
    --nav-active:    #ffffff;
    --nav-rule:      rgba(255,255,255,.07);

    --accent:        #285f9e;
    --accent-dark:   #1d497c;
    --accent-soft:   #edf4fb;
    --accent-line:   #c4d8eb;

    --debit:         #a3212a;
    --credit:        #14663d;
    --warn:          #8a5a00;
    --warn-soft:     #fdf5e4;
    --warn-line:     #ecd9a8;
    --ok-soft:       #eaf5ef;
    --ok-line:       #bcdcca;
    --bad-soft:      #fbeceb;
    --bad-line:      #eec7c4;

    --r:  5px;
    --r-lg: 7px;

    --nav-w: 236px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "IBM Plex Sans", "Noto Sans", "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 1.5;
    font-feature-settings: "tnum" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #6da0d2; outline-offset: 2px; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: 0; color: var(--ink); }

.icon {
    width: 1.25em; height: 1.25em; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.num, .money, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted) !important; }
.faint { color: var(--faint) !important; }
.nowrap { white-space: nowrap; }
.tr { text-align: right; }
.tc { text-align: center; }
.debit  { color: var(--debit);  font-variant-numeric: tabular-nums; font-weight: 600; }
.credit { color: var(--credit); font-variant-numeric: tabular-nums; font-weight: 600; }
.zero   { color: var(--faint);  font-variant-numeric: tabular-nums; }

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

.app { display: flex; min-height: 100vh; }

.side {
    width: var(--nav-w);
    flex: 0 0 var(--nav-w);
    background: var(--nav-bg);
    color: var(--nav-text);
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0; z-index: 60;
}
.side__brand {
    display: flex; align-items: center; gap: 11px;
    padding: 0 18px; height: 68px; flex: 0 0 68px;
    border-bottom: 1px solid var(--nav-rule);
    color: #fff;
}
.side__mark {
    width: 32px; height: 32px; flex: 0 0 32px; border-radius: 6px;
    background: #2f6aa5; color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 12px; letter-spacing: 0;
}
.side__name { font-weight: 700; font-size: 13.5px; letter-spacing: 0; color: #fff; }
.side__name small { display: block; font-weight: 500; font-size: 10px; color: #728198; letter-spacing: .06em; text-transform: uppercase; }

.side__nav { flex: 1; overflow-y: auto; padding: 14px 10px 20px; }
.side__group {
    font-size: 10px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
    color: #69788d; padding: 20px 10px 8px;
}
.side__item {
    display: flex; align-items: center; gap: 10px; min-height: 40px;
    padding: 8px 10px; margin-bottom: 3px;
    border-radius: var(--r);
    color: var(--nav-text); font-weight: 500; font-size: 13px;
    transition: background .12s, color .12s;
}
.side__item:hover { background: var(--nav-hover); color: #e6ebf1; text-decoration: none; }
.side__item.on { background: #214f7b; color: #fff; box-shadow: inset 3px 0 0 #72a9d7; }
.side__item.on .side__ico { opacity: 1; }
.side__ico { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; opacity: .82; }
.side__ico .icon { width: 18px; height: 18px; }
.side__label { min-width: 0; }
.side__count {
    margin-left: 1px; font-size: 10px; font-weight: 700; line-height: 18px;
    background: rgba(255,255,255,.11); color: #d9e2ee;
    height: 18px; padding: 0 5px; border-radius: 9px; min-width: 18px; text-align: center;
}
.side__count--alert { background: #c3263e; color: #fff; }
.side__foot {
    border-top: 1px solid var(--nav-rule);
    padding: 10px 18px; font-size: 10.5px; color: #4d5a6b;
    display: flex; justify-content: space-between; gap: 8px;
}

.main { flex: 1; min-width: 0; margin-left: var(--nav-w); display: flex; flex-direction: column; }

.top {
    height: 60px; flex: 0 0 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 50;
}
.top__crumbs { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; min-width: 0; }
.top__crumbs a { color: var(--muted); }
.top__crumbs a:hover { color: var(--accent); }
.top__crumbs .sep { color: var(--line-strong); }
.top__crumbs .cur { color: var(--ink); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__sp { flex: 1; }

.who { display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: var(--r); }
.who:hover { background: var(--surface-sunk); text-decoration: none; }
.who__av {
    width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
    border: 1px solid var(--accent-line);
}
.who__nm { font-size: 12.5px; font-weight: 550; color: var(--ink); line-height: 1.25; }
.who__rl { font-size: 10.5px; color: var(--muted); }

.wrap { padding: 28px 32px 48px; flex: 1; max-width: 1540px; width: 100%; margin: 0 auto; }

/* --------------------------------------------------- заглавие на страница */

.ph { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.ph__t { font-size: 22px; line-height: 1.2; }
.ph__s { color: var(--muted); font-size: 13px; margin-top: 4px; }
.ph__a { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------- контекст на клиентско досие */

.dossier {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    margin-bottom: 16px;
    overflow: hidden;
}
.dossier__hd { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px 14px; flex-wrap: wrap; }
.dossier__av {
    width: 42px; height: 42px; flex: 0 0 42px; border-radius: var(--r);
    background: var(--nav-bg); color: #fff;
    display: grid; place-items: center; font-weight: 650; font-size: 15px; letter-spacing: -.02em;
}
.dossier__id { min-width: 0; }
.dossier__nm { font-size: 17px; font-weight: 650; letter-spacing: -.012em; line-height: 1.25; }
.dossier__meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.dossier__meta b { color: var(--ink-2); font-weight: 600; }
.dossier__act { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }

.tabs { display: flex; gap: 2px; padding: 0 10px; border-top: 1px solid var(--line); background: var(--surface-alt); overflow-x: auto; }
.tabs a {
    padding: 9px 12px 8px; font-size: 12.5px; font-weight: 550; color: var(--muted);
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface); }
.tabs .n { font-size: 10.5px; color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ панели */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 1px 3px rgba(21, 36, 53, .04); overflow: hidden; }
.panel + .panel { margin-top: 14px; }
.panel__hd {
    display: flex; align-items: center; gap: 10px;
    min-height: 46px; padding: 11px 16px; border-bottom: 1px solid var(--line);
    font-size: 11px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; color: var(--ink-2);
}
.panel__hd .a { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; }
.panel__bd { padding: 16px; }
.panel__bd--flush { padding: 0; }
.panel__ft { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-alt); font-size: 12.5px; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 1260px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ KPI плочки */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(21, 36, 53, .04); }
.kpi { position: relative; min-height: 104px; padding: 17px 18px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: transparent; }
.kpi.is-bad::before { background: var(--debit); }
.kpi.is-warn::before { background: #c58a19; }
.kpi.is-ok::before { background: var(--credit); }
.kpi__k { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.kpi__v { font-size: 23px; font-weight: 700; letter-spacing: 0; margin-top: 5px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi__n { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi__v.sm { font-size: 15px; }
.kpi.is-bad .kpi__v { color: var(--debit); }
.kpi.is-warn .kpi__v { color: var(--warn); }
.kpi.is-ok .kpi__v { color: var(--credit); }

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

.tbl { width: 100%; border-collapse: collapse; background: var(--surface); }
.tbl thead th {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); text-align: left; white-space: nowrap;
}
.tbl thead th a { color: var(--muted); }
.tbl thead th a:hover { color: var(--accent); }
.tbl tbody td { height: 48px; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s ease; }
.tbl tbody tr:hover { background: #f4f8fc; }
.tbl tfoot td { padding: 10px 14px; border-top: 2px solid var(--line-strong); background: var(--surface-alt); font-weight: 650; }
.tbl th.tr, .tbl td.tr { text-align: right; }
.tbl .empty { padding: 34px 14px; text-align: center; color: var(--muted); }
.tbl--tight tbody td { height: 42px; padding: 7px 12px; }
.tbl--tight thead th { padding: 9px 12px; }
.scroll-x { overflow-x: auto; }
.scroll-x { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* GridView интеграция */
.grid-view table { width: 100%; border-collapse: collapse; }
.grid-view thead th {
    background: var(--surface-alt); border-bottom: 1px solid var(--line);
    padding: 8px 14px; font-size: 10.5px; font-weight: 650; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted); text-align: left; white-space: nowrap;
}
.grid-view thead th a { color: var(--muted); }
.grid-view thead th a:hover { color: var(--accent); }
.grid-view tbody td { height: 48px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.grid-view tbody tr:hover { background: var(--accent-soft); }
.grid-view tbody tr.empty td { padding: 34px; text-align: center; color: var(--muted); }
.grid-view tbody td:last-child { white-space: nowrap; }
.grid-view .filters td { height: auto; padding: 8px 10px; background: #fbfcfd; border-bottom: 1px solid var(--line); }
.grid-view .filters input, .grid-view .filters select {
    width: 100%; height: 34px; font-size: 12px; padding: 5px 9px;
    border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; color: var(--ink);
}
.grid-view .filters input:focus, .grid-view .filters select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.grid-view .summary { color: var(--muted); font-size: 12px; }
.gv-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--surface-alt); flex-wrap: wrap; }
.gv-foot .pagination { margin: 0; }

.pagination { display: flex; gap: 3px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pagination li a, .pagination li span {
    display: block; padding: 3px 9px; font-size: 12.5px; border: 1px solid var(--line);
    border-radius: 5px; color: var(--ink-2); background: #fff;
}
.pagination li a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination li.active span, .pagination li.active a { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination li.disabled span { color: var(--faint); background: var(--surface-alt); }

/* ------------------------------------------------------------- баджове */

.pill {
    display: inline-flex; align-items: center; gap: 4px;
    min-height: 22px; padding: 2px 7px; border-radius: 4px;
    font-size: 10.5px; font-weight: 650; line-height: 1.45;
    border: 1px solid transparent; white-space: nowrap;
}
.pill--ok    { background: var(--ok-soft);   border-color: var(--ok-line);   color: var(--credit); }
.pill--bad   { background: var(--bad-soft);  border-color: var(--bad-line);  color: var(--debit); }
.pill--warn  { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.pill--info  { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.pill--muted { background: var(--surface-sunk); border-color: var(--line-strong); color: var(--muted); }
.pill--dark  { background: #232f3d; border-color: #232f3d; color: #e2e8f0; }

.tag {
    display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border-radius: 4px;
    background: var(--surface-sunk); border: 1px solid var(--line);
    font-size: 10.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap;
}
.tag--bank { background: #fff; border-color: var(--accent-line); color: var(--accent); }

/* ------------------------------------------------------------- бутони */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 7px 12px; border-radius: var(--r);
    font-size: 12.5px; font-weight: 600; line-height: 1.35;
    border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
    cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-sunk); border-color: var(--muted); color: var(--ink); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn--danger { color: var(--debit); border-color: var(--bad-line); background: #fff; }
.btn--danger:hover { background: var(--bad-soft); border-color: var(--debit); color: var(--debit); }
.btn--sm { min-height: 30px; padding: 4px 9px; font-size: 11.5px; }
.btn--link { border-color: transparent; background: transparent; color: var(--accent); padding: 3px 6px; }
.btn--link:hover { background: var(--accent-soft); border-color: transparent; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 6px; }

/* ------------------------------------------------------------- формуляри */

.form-label, label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; display: block; }
.form-control, .form-select, input[type=text], input[type=password], input[type=email],
input[type=date], input[type=number], select, textarea {
    width: 100%; min-height: 38px; padding: 8px 10px; font-size: 13px; font-family: inherit;
    border: 1px solid var(--line-strong); border-radius: var(--r);
    background: #fff; color: var(--ink);
}
.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
    outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group, .field { margin-bottom: 14px; }
.hint, .help-block { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.help-block-error, .invalid-feedback, .text-danger { color: var(--debit); font-size: 11.5px; }
.has-error .form-control, .is-invalid { border-color: var(--debit); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 7px; }
.check input { width: auto; }
.check label { margin: 0; font-weight: 500; }

.filterbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; align-items: end; }
.filterbar .acts { display: flex; gap: 7px; }

.action-column { width: 112px; min-width: 112px; text-align: right; white-space: nowrap; }
.action-column .btn + .btn { margin-left: 4px; }

/* ------------------------------------------------------------- списъци */

.dl { display: grid; gap: 0; }
.dl__r { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.dl__r:last-child { border-bottom: 0; }
.dl__k { color: var(--muted); font-size: 12.5px; }
.dl__v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dl__v.wrap-any { word-break: break-all; text-align: left; font-weight: 500; }
.dl--2col { grid-template-columns: 1fr 1fr; column-gap: 26px; display: grid; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { position: relative; padding: 9px 0 9px 20px; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
.log li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.log li.lvl-info::before { background: var(--accent); }
.log li.lvl-warning::before { background: #d99a1e; }
.log li.lvl-error::before { background: var(--debit); }
.log .m { font-size: 12.8px; }
.log .t { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.log .c { font-size: 11px; color: var(--faint); word-break: break-all; }

/* ------------------------------------------------------------- известия */

.note { padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-alt); font-size: 12.8px; margin-bottom: 14px; }
.note--ok   { background: var(--ok-soft);   border-color: var(--ok-line);   color: #10502f; }
.note--bad  { background: var(--bad-soft);  border-color: var(--bad-line);  color: #7f1d1d; }
.note--warn { background: var(--warn-soft); border-color: var(--warn-line); color: #7a4d00; }
.note--info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }
.alert { padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); font-size: 12.8px; margin-bottom: 14px; }
.alert-success { background: var(--ok-soft);   border-color: var(--ok-line);   color: #10502f; }
.alert-danger  { background: var(--bad-soft);  border-color: var(--bad-line);  color: #7f1d1d; }
.alert-warning { background: var(--warn-soft); border-color: var(--warn-line); color: #7a4d00; }
.alert-info    { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }

/* ------------------------------------------------------------- сверка */

.checks { display: grid; gap: 0; }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row__i { flex: 0 0 16px; font-size: 12px; line-height: 1.5; font-weight: 700; }
.check-row.ok   .check-row__i { color: var(--credit); }
.check-row.bad  .check-row__i { color: var(--warn); }
.check-row.na   .check-row__i { color: var(--faint); }
.check-row__l { flex: 1; font-size: 12.5px; }
.check-row__v { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------- диаграма */

.bars { display: flex; align-items: flex-end; gap: 7px; height: 142px; padding: 8px 4px 0; border-bottom: 1px solid var(--line); }
.bars__c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bars__b { width: 100%; max-width: 24px; background: #3e78ad; border-radius: 3px 3px 0 0; min-height: 3px; opacity: .9; }
.bars__c:hover .bars__b { opacity: 1; }
.bars__n { font-size: 10px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; height: 12px; }
.bars__l { font-size: 9.5px; color: var(--faint); white-space: nowrap; }

.trend { display: flex; gap: 1px; align-items: flex-end; }

/* ------------------------------------------------------------ качване */

.drop {
    border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
    padding: 34px 20px; text-align: center; background: var(--surface-alt);
    cursor: pointer; transition: border-color .12s, background .12s;
}
.drop:hover { border-color: var(--accent); }
.drop.on { border-color: var(--accent); background: var(--accent-soft); }
.drop__i { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.drop__t { font-weight: 600; font-size: 13.5px; }
.drop__s { color: var(--muted); font-size: 12px; margin-top: 5px; }
.files { list-style: none; margin: 12px 0 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 9px; padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 5px; font-size: 12.5px; background: #fff; }
.files li .sz { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------- карта на клиент */

.ccard { display: flex; gap: 12px; align-items: center; min-height: 70px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background .1s ease; }
.ccard:last-child { border-bottom: 0; }
.ccard:hover { background: var(--accent-soft); }
.ccard__av { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-dark); display: grid; place-items: center; font-weight: 700; font-size: 11.5px; }
.ccard__av .icon { width: 17px; height: 17px; }
.ccard__b { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: center; }
.ccard__n { display: block; min-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: 13px; line-height: 1.45; color: var(--ink); }
.ccard__m { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 4px 10px; flex-wrap: wrap; }
.ccard__s { text-align: right; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ccard__s b { display: block; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }

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

.login {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: linear-gradient(160deg, var(--nav-bg-2) 0%, #16283d 55%, var(--accent-dark) 100%);
}
.login__box { width: 100%; max-width: 372px; background: #fff; border-radius: 10px; padding: 30px 30px 26px; box-shadow: 0 24px 48px -12px rgba(0,0,0,.45); }
.login__mark { width: 40px; height: 40px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 700; }
.login__t { font-size: 17px; margin: 14px 0 3px; }
.login__s { color: var(--muted); font-size: 12.5px; margin: 0 0 20px; }
.login__f { color: var(--faint); font-size: 11.5px; margin: 16px 0 0; text-align: center; }
.login .btn { width: 100%; justify-content: center; padding: 9px; font-size: 13.5px; }

/* ------------------------------------------------------------- дребни */

details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "▾"; margin-left: auto; color: var(--faint); }
details.panel[open] > summary::after { content: "▴"; }

.raw { white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.45; color: var(--ink-2); margin: 0; max-height: 460px; overflow: auto; }

.btn--icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
.btn--icon .icon { width: 18px; height: 18px; }
.side-toggle { display: none; }
.side-backdrop { display: none; position: fixed; inset: 0; z-index: 55; padding: 0; border: 0; background: rgba(8, 18, 30, .38); cursor: default; }
@media (max-width: 960px) {
    .side { transform: translateX(-100%); transition: transform .18s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .side.open { transform: translateX(0); }
    .side.open + .side-backdrop { display: block; }
    .main { margin-left: 0; }
    .side-toggle { display: inline-flex; }
    .wrap { padding: 22px 18px 36px; }
    .top { padding: 0 14px; }
}

@media (max-width: 560px) {
    .who__nm, .who__rl, .who__chevron { display: none; }
    .ph { margin-bottom: 18px; }
    .ph__t { font-size: 20px; }
    .ph__a { width: 100%; margin-left: 0; }
    .ph__a .btn { flex: 1; justify-content: center; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi { min-height: 96px; border-bottom: 1px solid var(--line); }
    .kpi:nth-child(even) { border-right: 0; }
    .kpi:last-child { grid-column: 1 / -1; }
    .bars { gap: 3px; height: 112px; }
    .bars__l { font-size: 8.5px; }
    .bars__c:nth-child(even) .bars__l { visibility: hidden; }
    .panel__hd { padding-inline: 13px; }
    .ccard { padding-inline: 13px; }
}

/* ------------------------------------------------------- падащо меню */
.menu { position: relative; }
.who__chevron { width: 14px; height: 14px; color: var(--faint); margin-left: 2px; }
.menu__pop {
    display: none; position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 210px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: 0 10px 30px -8px rgba(16,24,40,.22);
    padding: 6px; z-index: 100;
}
.menu.open .menu__pop { display: block; }
.menu__pop .hd { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu__pop .hd b { display: block; font-size: 12.5px; }
.menu__pop .hd span { font-size: 11.5px; color: var(--muted); }
.menu__pop a, .menu__pop button {
    display: block; width: 100%; text-align: left;
    padding: 7px 10px; border-radius: var(--r); font-size: 12.5px;
    border: 0; background: none; color: var(--ink); cursor: pointer;
}
.menu__pop a:hover, .menu__pop button:hover { background: var(--surface-sunk); text-decoration: none; }

/* по-широка лява колона, когато таблицата носи повечето информация */
.split--wide { grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); }
@media (max-width: 1240px) { .split--wide { grid-template-columns: 1fr; } }
.iban { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: nowrap; }
.sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
