/* LikeMe 2C — стили. Матовая «фотобумага», янтарный акцент для главного действия, зелёный — проведено. */
:root {
  --bg: #F3F2EE; --surface: #FFFFFF; --surface-2: #F8F7F4; --line: #E2E0DA; --line-strong: #CFCCC4;
  --ink: #1C1F23; --ink-2: #4B5058; --muted: #7B8089;
  --accent: #B8731A; --accent-ink: #FFFFFF; --accent-soft: #FBF1E2;
  --ok: #1E6F58; --ok-soft: #E3F1EB; --warn: #9A6B00; --warn-soft: #FBF2D5; --err: #B3382C; --err-soft: #FBE7E3; --info: #2F5D8A; --info-soft: #E6EEF6;
  --sidebar: #1C1F23; --sidebar-ink: #D9D6CF; --sidebar-active: #2A2E34;
  --radius: 6px; --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--info); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 15px; font-weight: 650; margin: 0; } h3 { font-size: 14px; font-weight: 650; margin: 14px 0 6px; }
p { margin: 6px 0; }
#app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }

/* sidebar */
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 14px; color: #fff; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: #E8B86A; color: #1C1F23; font-weight: 800; display: grid; place-items: center; font-size: 15px; letter-spacing: -0.02em; }
.brand-text { display: flex; flex-direction: column; font-weight: 650; line-height: 1.15; } .brand-text small { font-weight: 400; color: var(--sidebar-ink); opacity: .75; font-size: 11.5px; }
.nav { display: flex; flex-direction: column; padding: 6px 8px; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--sidebar-ink); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: var(--sidebar-active); text-decoration: none; } .nav a.active { background: var(--sidebar-active); color: #fff; }
.nav .ic { width: 18px; height: 18px; opacity: .8; }
.sidebar-foot { margin-top: auto; padding: 14px 12px; }
.ic { width: 16px; height: 16px; flex: none; }

/* main */
.main { min-width: 0; }
.page { padding: 22px 28px 48px; max-width: 1600px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .strong { font-weight: 650; } .mono { font-family: var(--mono); font-size: 12px; }
.neg { color: var(--err); } .pos { color: var(--ok); } .warn-text { color: var(--warn); } .indent { padding-left: 18px; }
.al-right { text-align: right; } .al-center { text-align: center; } .al-left { text-align: left; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 0 0 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi-value { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.kpi-label { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; } .kpi-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* sections */
.sec { margin-top: 18px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; }
.sec-title { margin: 22px 0 8px; font-size: 15px; }
.chart-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 4px; }
.chart { width: 100%; height: 200px; color: var(--ink); display: block; }
.chart .bar { fill: #3B5B74; } .chart .bar-sub { fill: #D7DCE1; } .chart .grid { stroke: var(--line); } .chart .lbl { font-size: 10px; fill: var(--muted); }
.hbar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 3px; overflow: hidden; } .hbar-fill { height: 100%; background: #3B5B74; }
.with-bar { min-width: 90px; }

/* tables */
.tbl-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tbl-wrap.sticky { max-height: calc(100vh - 230px); } .tbl-wrap.sticky thead th { position: sticky; top: 0; z-index: 2; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 12px; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.tbl th.sortable { cursor: pointer; } .tbl th.sort-asc::after { content: ' ↑'; } .tbl th.sort-desc::after { content: ' ↓'; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl.dense td { padding: 5px 9px; } .tbl.dense th { padding: 6px 9px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: #FAF9F6; }
.tbl tr.empty td { color: var(--muted); text-align: center; padding: 22px; }
.tbl tfoot td { background: var(--surface-2); font-weight: 650; border-top: 1px solid var(--line-strong); }
.tbl tr.muted td { color: var(--muted); }
.tbl tr.origin-2c td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl .row-actions { white-space: nowrap; text-align: right; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; } .btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { background: #A2651A; }
.btn.ghost { background: transparent; } .btn.danger { color: var(--err); } .btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.icon-only { padding: 4px; border-color: transparent; color: var(--muted); } .btn.icon-only:hover { color: var(--ink); background: var(--surface-2); }
.btn.block { width: 100%; justify-content: center; }
.inp { font: inherit; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-width: 0; width: 100%; }
.inp:focus { outline: 2px solid #C9A46E; outline-offset: 0; border-color: var(--accent); }
.inp:disabled { background: var(--surface-2); color: var(--ink-2); }
.inp.num { text-align: right; width: 86px; } .inp.num.sm { width: 56px; padding: 4px 6px; } .inp.num.xs { width: 44px; padding: 4px 6px; }
.inp.grow { flex: 1; width: auto; }
select.inp { width: auto; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; } .field-label { font-size: 12px; color: var(--ink-2); font-weight: 550; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; } .field.inline .inp { width: 110px; }
.hint { font-size: 12px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13.5px; } .check input { width: 15px; height: 15px; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; } .filters .inp { width: auto; } .filters .lookup { width: 220px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .row-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .row-inline.tight { gap: 4px; flex-wrap: nowrap; justify-content: flex-end; }
.form-col { display: flex; flex-direction: column; gap: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 8px; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; } @media (max-width: 1200px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } }
.flags { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.err { background: var(--err-soft); color: var(--err); } .badge.info { background: var(--info-soft); color: var(--info); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; } .tabs a.active { color: var(--ink); border-color: var(--accent); } .tabs a:hover { text-decoration: none; color: var(--ink); }
.chips, .contacts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px; font-size: 13px; color: var(--ink); }
.note-text { background: var(--warn-soft); border-radius: var(--radius); padding: 8px 12px; }
.empty-state { padding: 22px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.error-box { background: var(--err-soft); color: var(--err); padding: 14px 16px; border-radius: var(--radius); }
.warn-box { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: var(--radius); font-size: 13px; }
.more { padding: 10px; text-align: center; }

/* lookup */
.lookup { position: relative; width: 100%; } .lookup.disabled .lookup-inp { pointer-events: none; background: var(--surface-2); }
.lookup-list { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 100%; width: max-content; max-width: 420px; max-height: 280px; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(28,31,35,.12); margin-top: 2px; }
.lookup-item { padding: 6px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; white-space: nowrap; } .lookup-item.active, .lookup-item:hover { background: var(--accent-soft); }
.lookup-sub { color: var(--muted); font-size: 12px; } .lookup-empty { padding: 8px 10px; color: var(--muted); }

/* toasts, modal */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 420px; transition: opacity .3s, transform .3s; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--err); } .toast.out { opacity: 0; transform: translateY(6px); }
.overlay { position: fixed; inset: 0; background: rgba(28,31,35,.42); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border-radius: 10px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); } .modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 14px 18px; overflow: auto; } .modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.explain { margin: 0; padding-left: 18px; } .explain li { margin: 3px 0; }
.code { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: var(--radius); max-height: 70vh; overflow: auto; }

/* report form */
.report-page .actions { display: flex; gap: 8px; align-items: center; }
.rate-info { font-size: 12.5px; color: var(--ink-2); padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius); margin: 4px 0 10px; }
.lines-box .tbl-wrap { overflow-x: auto; } .tbl.lines th.prod { max-width: 70px; white-space: normal; line-height: 1.2; }
.tbl.lines td.comp { font-variant-numeric: tabular-nums; } .tbl.lines .totals-row td { font-weight: 650; }
.tbl.lines .lookup { min-width: 200px; } .tbl.lines select.inp { padding: 4px 6px; }
.cash-box .notes { display: flex; flex-direction: column; gap: 4px; }
.note { display: grid; grid-template-columns: 64px 64px 1fr; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; }
.note[data-v="5000"] { border-left-color: #B9473F; } .note[data-v="2000"] { border-left-color: #2E6DB4; } .note[data-v="1000"] { border-left-color: #4E9E6A; } .note[data-v="500"] { border-left-color: #7E5BA8; } .note[data-v="200"] { border-left-color: #3E9A8E; } .note[data-v="100"] { border-left-color: #C2882B; } .note[data-v="50"] { border-left-color: #3F7EB0; } .note[data-v="10"] { border-left-color: #8A8A7A; }
.note-value { font-weight: 650; } .note-sum { text-align: right; color: var(--ink-2); }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tot-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.tot-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; } .tot-row:last-child { border-bottom: 0; }
.tot-row.strong { font-size: 15px; padding-top: 7px; } .tot-row.small { font-size: 12.5px; color: var(--ink-2); }
.tot-row b { font-weight: 650; }

/* venue rates */
.rate-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.rate-card.current { border-color: var(--ok); } .rate-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; margin-bottom: 10px; font-size: 13px; }
.grid-edit .tbl-wrap { max-height: 320px; overflow: auto; } .grid-edit .inp.num { width: 110px; }

/* archive */
.archive { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.archive-list { display: flex; flex-direction: column; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.archive-item { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line); } .archive-item:hover { background: var(--surface-2); text-decoration: none; } .archive-item.active { background: var(--accent-soft); }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .nav { flex-direction: row; flex-wrap: wrap; } .nav a span { display: none; } .page { padding: 14px 16px 40px; } .archive { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* login */
.login { grid-column: 1 / -1; min-height: 100vh; display: grid; place-items: center; background: var(--sidebar); padding: 20px; }
.login-box { background: var(--surface); border-radius: 12px; padding: 26px 28px 22px; width: min(400px, 100%); display: flex; flex-direction: column; gap: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-box .brand { padding: 0 0 14px; color: var(--ink); } .login-box .brand-text small { color: var(--muted); }
.login-box h2 { margin: 4px 0 10px; font-size: 17px; }
.who { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--sidebar-ink); font-size: 13px; } .who small { display: block; opacity: .6; font-size: 11px; }
.btn.dark { color: var(--sidebar-ink); border-color: #3A3F46; } .btn.dark:hover { background: var(--sidebar-active); }
/* compact report lines */
.tbl.lines td, .tbl.lines th { padding: 4px 6px; } .tbl.lines .lookup { min-width: 170px; } .tbl.lines .inp.num.sm { width: 48px; } .tbl.lines .inp.num { width: 70px; } .tbl.lines select.inp { padding: 4px 4px; font-size: 12.5px; }
.tbl.lines td.comp { font-size: 13px; }

.autosave { margin-right: 6px; }

/* этапы принятия отчёта: «на проверке» / «деньги не приняты» — зелёные, как непринятые отчёты в списке 1С */
.badge.pending { background: #d9f0c4; color: #2f6b1f; }
.tbl tr.pending td { background: #e9f6dc; } .tbl tr.pending:hover td { background: #ddf0c9; }
.status-stack { display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.tbl.lines td.cash-col, .tbl.lines th.cash-col { background: #f6f1e7; } .tbl.lines td.cash-col.neg { color: var(--err); }
.actions .muted.small { margin: 0 4px; }

.form-col.tight { gap: 6px; } .form-col.tight .row-inline .lookup { flex: 1; }
