/* MySmartInvoice – page styles (documents, workflow, settings). Tokens only. */
/* semantic buttons (functional list: green create/save/finish, red delete, blue/purple PDF/info, light secondary back) */
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { filter: brightness(1.07); background: var(--ok); }
.btn-danger-solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.07); background: var(--err); }
.btn-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
.btn-violet { background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 30%, transparent); color: var(--violet); }
.btn-back { background: var(--surface-3); border-color: var(--border); color: var(--text-2); }
[data-mode="dark"] .btn-success, [data-mode="dark"] .btn-danger-solid { color: #0b1426; }

/* status chips */
.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-all { background: var(--st-all-bg); color: var(--st-all); } .st-draft { background: var(--st-draft-bg); color: var(--st-draft); }
.st-pending, .st-open, .st-sent, .st-partial { background: var(--warn-bg); color: var(--warn); }
.st-accepted, .st-finished, .st-paid, .st-invoiced { background: var(--ok-bg); color: var(--ok); }
.st-rejected, .st-cancelled, .st-overdue { background: var(--err-bg); color: var(--err); }
.st-invoiced { background: var(--violet-bg); color: var(--violet); }
/* status filter pills with counts */
.pills { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px calc(var(--pad) + 4px); border-bottom: 1px solid var(--border); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font: 500 var(--fs-sm)/1 var(--font); color: var(--text-2); cursor: pointer; }
.pill b { font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.pill.active { border-color: var(--accent); background: var(--accent-50); color: var(--accent-700); }
[data-mode="dark"] .pill.active { color: var(--text); }
.pill.p-draft b { background: var(--st-draft-bg); color: var(--st-draft); } .pill.p-pending b, .pill.p-open b, .pill.p-sent b, .pill.p-partial b { background: var(--warn-bg); color: var(--warn); }
.pill.p-accepted b, .pill.p-paid b, .pill.p-finished b { background: var(--ok-bg); color: var(--ok); } .pill.p-rejected b, .pill.p-cancelled b, .pill.p-overdue b { background: var(--err-bg); color: var(--err); }
.pill.p-invoiced b { background: var(--violet-bg); color: var(--violet); }

/* document editor */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; align-items: start; }
@media (max-width: 1150px) { .doc-layout { grid-template-columns: minmax(0, 1fr); } }
.doc-status-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); margin-bottom: 16px; }
.doc-status-bar .num { font-weight: 700; font-size: var(--fs-lg); }
.lock-note { display: flex; gap: 8px; align-items: center; color: var(--text-2); font-size: var(--fs-sm); }
.lines-wrap { overflow-x: auto; }
table.lines { width: 100%; border-collapse: collapse; min-width: 900px; }
.lines td:nth-child(2) { min-width: 240px; }
.lines th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lines td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lines td.num, .lines th.num { text-align: right; }
.lines input, .lines select, .lines textarea { height: 36px; font-size: var(--fs-sm); padding: 0 8px; }
.lines textarea { min-height: 36px; height: 36px; padding: 7px 8px; }
.lines .c-pos { width: 44px; color: var(--text-3); padding-top: 14px; } .lines .c-qty { width: 92px; } .lines .c-unit { width: 110px; } .lines .c-price { width: 120px; }
.lines .c-disc { width: 76px; } .lines .c-tax { width: 150px; } .lines .c-total { width: 110px; padding-top: 14px; font-weight: 600; white-space: nowrap; } .lines .c-act { width: 40px; }
.lines.readonly td { padding: 10px 6px; }
.totals { margin-left: auto; width: min(380px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: var(--fs); }
.totals .lbl { color: var(--text-2); } .totals .val { text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 700; font-size: var(--fs-lg); border-top: 2px solid var(--text); padding-top: 8px; }
.num, .tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.legal-notes { font-size: var(--fs-sm); color: var(--text-2); border-left: 3px solid var(--accent); padding: 6px 12px; background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; }
.missing { display: flex; flex-direction: column; gap: 6px; }

/* workflow side navigation (Offer → Invoice → Delivery → Service report → Invoice fine) */
.wf { display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.wf-step { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); color: var(--text-2); font-size: var(--fs-sm); position: relative; }
.wf-step .ico { color: var(--text-3); }
.wf-step.here { background: var(--accent-50); color: var(--accent-700); font-weight: 600; } .wf-step.here .ico { color: var(--accent); }
.wf-step.done .ico { color: var(--ok); }
.wf-step:not(:last-child)::after { content: ""; position: absolute; left: 19px; bottom: -6px; width: 2px; height: 8px; background: var(--border-strong); }
.wf-docs { display: flex; flex-direction: column; gap: 2px; margin: 0 0 4px 38px; }
.wf-docs a { font-size: var(--fs-xs); }
.side-card + .side-card { margin-top: 16px; }

/* home */
.hero-home { padding: 28px; border-radius: var(--radius-xl); color: #fff; background: var(--brand-gradient); margin-bottom: 20px; position: relative; overflow: hidden; }
.hero-home h1 { color: #fff; } .hero-home p { opacity: .9; max-width: 640px; margin-top: 8px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
.quick a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.quick .q-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent); }
.quick b { font-size: var(--fs-md); } .quick span { color: var(--text-3); font-size: var(--fs-sm); }

/* settings landing / category cards */
.cards-sel { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cards-sel button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; color: var(--text); font: 500 var(--fs)/1.2 var(--font); }
.cards-sel button.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-100); }
.cards-sel .ico { color: var(--accent); }
.cards-sel small { color: var(--text-3); font-size: var(--fs-xs); }

/* combined (collections): two lists side by side */
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .dual { grid-template-columns: 1fr; } }
.pick-list { max-height: 520px; overflow-y: auto; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.pick-row:last-child { border-bottom: 0; }
.pick-row .grow { min-width: 0; } .pick-row .t { font-weight: 600; } .pick-row .s { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* charts / chips / timeline */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart .bar.b2 { fill: var(--warn); } .chart .bar { fill: var(--accent); } .chart text { fill: var(--text-3); font-size: 11px; } .chart .grid-line { stroke: var(--border); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; } .chart .area { fill: var(--accent-50); }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.tl li:last-child { border-bottom: 0; }
.tl .when { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; min-width: 112px; }
.chg { font-size: var(--fs-xs); color: var(--text-3); }
.chg code { font-size: 11px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.req-list li { margin: 4px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--fs-sm); } .kv dt { color: var(--text-3); } .kv dd { margin: 0; }
.matrix th, .matrix td { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
.pdf-frame { width: 100%; height: 75vh; border: 0; border-radius: var(--radius); background: var(--surface-3); }
.footer-legal { display: flex; gap: 14px; justify-content: center; padding: 18px; font-size: var(--fs-xs); color: var(--text-3); }
@media (max-width: 700px) { .content { padding: 12px; } .page-head .actions { width: 100%; } .doc-status-bar { padding: 10px; } }
/* collapsible nav groups */
.nav-group summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--text-2); font-weight: 500; cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { background: var(--surface-3); color: var(--text); }
.nav-group summary .ico { color: var(--text-3); } .nav-group summary .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; }
.nav-group:not([open]) summary .chev { transform: rotate(-90deg); }
.nav a.sub { padding-left: 38px; font-size: var(--fs-sm); } .nav a.sub .ico { display: none; }
.admin-zone { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 4px; }
.codebox { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-3); font: 12.5px ui-monospace, monospace; }

input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--text-2); }
.lines.readonly { min-width: 0; }
@media (max-width: 700px) {
  .topbar .right { flex-wrap: nowrap; gap: 2px !important; } .topbar .btn-success span { display: none; } .topbar .btn-success { width: 38px; padding: 0; }
  .grid.g3, .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .value { font-size: 20px; }
  .doc-status-bar [data-actions] { margin-left: 0; width: 100%; }
}
