:root { --bg:#f6f6f3; --panel:#fff; --ink:#1b1b19; --muted:#5d5d58; --line:#e1e0da; --accent:#1f56c3; --danger:#b42318; --ok:#1f7a3d; --warn:#8a5a00; --radius:8px;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
* { box-sizing: border-box; } body { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
header { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:10px 16px; background:var(--panel); border-bottom:1px solid var(--line); flex-wrap:wrap; position: sticky; top: 0; z-index: 5; }
header h1 { font-size: 1.1rem; margin: 0; white-space: nowrap; }
nav { display:flex; gap:4px; flex-wrap:wrap; flex: 1 1 auto; }
nav a { text-decoration:none; color: var(--muted); padding: 6px 10px; border-radius: 6px; }
nav a[aria-current="page"] { background: #e8eefb; color: var(--accent); font-weight: 600; }
main.wide { max-width: 1200px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
main.narrow { max-width: 440px; margin: 40px auto; padding: 16px; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
h1 { font-size: 1.15rem; margin: 0 0 8px; } h2 { font-size: 1rem; margin: 0 0 12px; } h3 { font-size: .95rem; margin: 16px 0 8px; }
.grid2 { display:grid; gap:16px; grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.cards { display:grid; gap:12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card .n { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; } .card .l { color: var(--muted); font-size: .85rem; }
@media (max-width: 800px) { .grid2 { grid-template-columns: minmax(0,1fr); } }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #fff4d6; color: #6b4e00; white-space: nowrap; }
.pill { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #eee; color: #333; white-space: nowrap; display: inline-block; }
.pill.ok { background:#e3f3e8; color: var(--ok); } .pill.warn { background:#fff4d6; color: var(--warn); } .pill.bad { background:#fde8e6; color: var(--danger); } .pill.blue { background:#e8eefb; color: var(--accent); }
button, a.button { font: inherit; color: inherit; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; } button.danger { color: var(--danger); } button:disabled { opacity: .6; cursor: progress; }
button.small { min-height: 30px; padding: 3px 10px; font-size: .85rem; }
.paycard { border: 1px solid #d9dde3; border-radius: 10px; padding: 10px 14px; margin: 10px 0; } .paycard h3 { margin: 0 0 6px; }
.paycard input[readonly] { width: 100%; } label.check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.ok-text { color: #1d6b2a; font-weight: 600; } .billrow { display: flex; justify-content: space-between; gap: 8px; padding: 8px 2px; border-bottom: 1px solid #e6e9ef; }
label { display: block; font-weight: 600; margin: 12px 0 4px; } .hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
input, textarea, select { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: inherit; }
textarea { min-height: 90px; }
[aria-invalid="true"] { border-color: var(--danger); } .error { color: var(--danger); font-size: .85rem; margin: 4px 0 0; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; } .toolbar input[type=search] { flex: 1 1 200px; width: auto; } .toolbar select, .toolbar input[type=date] { width: auto; max-width: 100%; min-width: 0; }
select { text-overflow: ellipsis; }
@media (max-width: 600px) { .toolbar select, .toolbar input[type=date] { flex: 1 1 45%; } }
.row { display:flex; gap:8px; flex-wrap: wrap; align-items:center; } .row.end { justify-content: flex-end; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; } td.num { font-variant-numeric: tabular-nums; text-align: right; }
tr.click { cursor: pointer; } tr.click:hover td { background: #fafaf7; }
@media (max-width: 600px) { table.stack thead { display: none; } table.stack tr, table.stack td { display: block; } table.stack td { border: 0; padding: 2px 0; } table.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); } table.stack td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: .8rem; } }
.skeleton { height: 14px; border-radius: 4px; background: linear-gradient(90deg, #eee, #f6f6f6, #eee); margin: 10px 0; }
.state { text-align: center; padding: 24px 8px; color: var(--muted); } .state strong { display: block; color: var(--ink); margin-bottom: 4px; }
.kanban { display:grid; gap:12px; grid-template-columns: repeat(6, minmax(200px, 1fr)); overflow-x: auto; }
.col { background: #efeee9; border-radius: var(--radius); padding: 8px; min-height: 120px; } .col h3 { margin: 4px 4px 8px; font-size: .85rem; color: var(--muted); }
.deal { background: var(--panel); border:1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; } .deal strong { display:block; }
.timeline { list-style:none; padding:0; margin:0; } .timeline li { border-left: 2px solid var(--line); padding: 4px 0 10px 12px; }
.lead-card { border:1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--panel); }
.lead-card .big { font-size: 1.1rem; font-weight: 600; }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 16px; width: min(560px, 94vw); } dialog::backdrop { background: rgba(0,0,0,.35); }
#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 20; max-width: 90vw; }
audio { width: 100%; max-width: 320px; height: 36px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: pulse 1.2s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .5; } } }

.stars { display:flex; gap:6px; margin: 10px 0 16px; }
.star { font-size: 2.6rem; line-height: 1; padding: 4px 6px; background: none; border: none; color: #f5a623; cursor: pointer; min-width: 52px; min-height: 52px; }
.star:disabled { cursor: default; opacity: 1; }
.fine { margin-top: 48px; font-size: 11px; color: #9a9a9a; } .fine a { color: #9a9a9a; text-decoration: none; }
