/* ops views — stock, finance, billing, invoice, disciplines, settings, team, reports */

/* tabs (own class so other areas can style theirs) */
.otabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.otabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--mute); border-bottom: 2px solid transparent; white-space: nowrap; }
.otabs a .ico { width: 17px; height: 17px; }
.otabs a:hover { color: var(--ink); } .otabs a.on { color: var(--ink); border-bottom-color: var(--clay); }
.ops-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sticky-act { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); margin-top: 8px; z-index: 5; }
.r { text-align: end !important; } .c { text-align: center; }
.fld.inline { flex-direction: row; align-items: center; gap: 8px; } .fld.inline input { width: auto; }

/* ---------------- stock */
.inv-q { margin-bottom: 12px; max-width: 360px; }
.inv-cat { margin-bottom: 12px; } .inv-list { display: flex; flex-direction: column; }
.inv-row { display: grid; grid-template-columns: minmax(180px, 1.6fr) minmax(170px, 1.2fr) 110px 110px auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.inv-row:last-child { border-bottom: 0; }
.inv-name { border: 0; background: none; text-align: start; padding: 0; cursor: pointer; color: var(--ink); font: inherit; }
.inv-name b { font: 700 16px var(--f-head); } .inv-name small { display: block; color: var(--mute); font-size: 12.5px; }
.inv-qty b { font-size: 17px; } .inv-qty small { font-size: 11px; }
.lvl { position: relative; display: block; height: 6px; border-radius: 6px; background: var(--line); margin: 5px 0 3px; overflow: visible; }
.lvl > i { display: block; height: 100%; border-radius: 6px; background: var(--sage); }
.lvl.warn > i { background: var(--straw); } .lvl.bad > i { background: var(--clay); }
.lvl em { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--ink2); opacity: .5; }
.inv-days { display: flex; flex-direction: column; } .inv-days b { font-size: 17px; } .inv-days small { font-size: 11px; }
.inv-acts { display: flex; gap: 4px; align-items: center; } .inv-acts .btn { min-width: 34px; justify-content: center; font-size: 17px; padding: 3px 10px; }
.count-tbl input { width: 110px; padding: 5px 8px; } .qty-in { width: 100px; padding: 5px 8px; }
.po-row { display: grid; grid-template-columns: minmax(220px, 1fr) 140px 110px 110px auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.po-row:last-child { border-bottom: 0; } .po-row small { display: block; color: var(--mute); font-size: 12.5px; }
.po-acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sup { text-decoration: none; display: flex; flex-direction: column; gap: 8px; border-radius: var(--arch); }
.sup:hover { border-color: var(--clay); } .sup header { display: flex; justify-content: space-between; gap: 8px; } .sup h3 { margin: 0; }
.sup.add { border: 1.5px dashed var(--line2); background: transparent; align-items: center; justify-content: center; text-align: center; cursor: pointer; color: var(--ink); font: inherit; min-height: 160px; }
.sup.add small { color: var(--mute); }
.chips-ro { display: flex; flex-wrap: wrap; gap: 3px; }
.mini-dl { display: grid; grid-template-columns: 90px 1fr; gap: 3px 8px; margin: 0; font-size: 13.5px; }
.mini-dl dt { font: 600 10px var(--f-mono); letter-spacing: .08em; color: var(--mute); text-transform: uppercase; padding-top: 3px; } .mini-dl dd { margin: 0; }

/* ---------------- finance */
.year-pick { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; } .year-pick b { font-size: 16px; }
.fin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dual-bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; }
.db { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.db-c { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.db-c i { width: 38%; border-radius: 4px 4px 1px 1px; min-height: 2px; } .db small { font: 500 9.5px var(--f-mono); color: var(--mute); margin-top: 4px; }
i.inv { background: var(--green); } :root[data-theme="dark"] i.inv { background: var(--oat); } i.rec { background: var(--clay); }
.legend { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--mute); margin: 8px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.cat-bar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.cat-bar > i { display: block; height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; } .cat-bar > i > i { display: block; height: 100%; background: var(--clay); border-radius: 8px; }
.cat-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aging { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.ag { border-radius: 8px; padding: 8px; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; }
.ag small { font: 600 10px var(--f-mono); color: var(--mute); text-transform: uppercase; } .ag b { font-size: 15px; } .ag span { font-size: 12px; color: var(--mute); }
.ag.warn { background: var(--warn-bg); border-color: var(--straw); } .ag.bad { background: var(--bad-bg); border-color: transparent; }
.tbl tfoot td { padding: 9px 12px; background: var(--panel2); border-top: 1px solid var(--line); }
.stmt-acts { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 10px; }
.bill-sum { margin-inline-start: auto; font-size: 15px; }
.bill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.bill header { display: flex; justify-content: space-between; align-items: center; } .bill header h3 { margin: 0; } .bill header b { font-size: 16px; }
.bill.off { opacity: .45; } .bill .tbl td { cursor: default; }

/* ---------------- documents (invoice, statement) */
.inv-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.doc { background: #fff; color: #12201A; border: 1px solid var(--line); border-radius: 6px; padding: 40px 46px; max-width: 860px; margin: 0 auto; position: relative; box-shadow: var(--shadow); font-size: 14px; }
.doc a { color: #12201A; }
.doc.a4 { min-height: 1120px; display: flex; flex-direction: column; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid #12201A; }
.doc-brand { display: flex; gap: 14px; align-items: flex-start; } .doc-brand b { display: block; font: 700 22px var(--f-head); letter-spacing: .06em; }
.doc-brand small { display: block; color: #6E766C; font-size: 12.5px; }
.doc-title { text-align: end; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.doc-title h2 { font: 700 26px var(--f-head); letter-spacing: .12em; color: #12201A; } .doc-title .big { font-size: 16px; font-weight: 600; }
.doc-meta { display: flex; justify-content: space-between; gap: 20px; margin: 22px 0; }
.doc-to { display: flex; flex-direction: column; gap: 1px; } .doc-to small, .doc-notes small, .doc-pays small { font: 600 10px var(--f-mono); letter-spacing: .14em; color: #6E766C; }
.doc-to b { font: 700 18px var(--f-head); } .doc-to span { color: #3E4A42; font-size: 13px; }
.doc-dl { display: grid; grid-template-columns: auto auto; gap: 3px 16px; margin: 0; align-content: start; }
.doc-dl dt { font: 600 10px var(--f-mono); letter-spacing: .1em; color: #6E766C; text-transform: uppercase; padding-top: 3px; } .doc-dl dd { margin: 0; text-align: end; }
.doc-sub { font-size: 17px; margin: 0 0 8px; }
.doc-tbl { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.doc-tbl th { font: 600 10px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; text-align: start; color: #6E766C; border-bottom: 1.5px solid #12201A; padding: 8px 6px; }
.doc-tbl td { padding: 8px 6px; border-bottom: 1px solid #E5E2D8; vertical-align: top; } .doc-tbl a { text-decoration: none; }
.doc-sums { display: flex; justify-content: space-between; gap: 30px; }
.doc-notes { flex: 1; font-size: 13px; color: #3E4A42; } .doc-notes p { margin: 0 0 10px; white-space: pre-wrap; }
.doc-tot { display: grid; grid-template-columns: auto 140px; gap: 5px 18px; margin: 0; min-width: 300px; align-content: start; }
.doc-tot dt { color: #6E766C; text-align: end; } .doc-tot dd { margin: 0; text-align: end; font-family: var(--f-mono); }
.doc-tot .t { font: 700 17px var(--f-head); color: #12201A; border-top: 1.5px solid #12201A; padding-top: 6px; } .doc-tot dd.t { font-family: var(--f-mono); font-size: 16px; }
.doc-pays { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.doc-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid #E5E2D8; display: flex; justify-content: space-between; font-size: 11.5px; color: #6E766C; }
.doc-total { display: flex; justify-content: flex-end; gap: 20px; align-items: baseline; font: 700 18px var(--f-head); }
.stamp { position: absolute; top: 160px; inset-inline-end: 60px; transform: rotate(-14deg); border: 4px solid #2E7D4F; color: #2E7D4F; font: 700 40px var(--f-head); letter-spacing: .2em; padding: 2px 18px; border-radius: 10px; opacity: .55; }
.stamp.bad { border-color: #A8341F; color: #A8341F; } .doc.void .doc-tbl, .doc.void .doc-tot { opacity: .5; text-decoration: line-through; }
.doc .b { background: #FFF3D1; color: #6B5200; }

/* ---------------- disciplines */
.disc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.disc-tile { position: relative; border-radius: 22px 22px 8px 8px; border: 1.5px dashed var(--line2); background: transparent; min-height: 110px; }
.disc-tile.on { border: 1.5px solid color-mix(in srgb, var(--dc) 60%, var(--line)); background: color-mix(in srgb, var(--dc) 14%, var(--panel)); }
.disc-tile.sel { box-shadow: 0 0 0 3px var(--dc); }
.dt-main { width: 100%; height: 100%; min-height: 110px; border: 0; background: none; text-align: start; padding: 14px 12px 12px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; color: var(--ink); font: inherit; border-radius: inherit; }
.dt-main small { font-size: 10px; color: var(--mute); display: flex; align-items: center; gap: 6px; }
.dt-main small::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--dc); }
.dt-main b { font: 700 18px var(--f-head); line-height: 1.05; margin: 6px 0 2px; } .dt-main span { font-size: 12.5px; color: var(--mute); }
.disc-tile:not(.on) b { color: var(--mute); }
.dt-sw { position: absolute; top: 10px; inset-inline-end: 10px; transform: scale(.85); }
.disc-ed { border-top: 4px solid var(--dc); padding-top: 14px; }
.disc-ed-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.disc-ed-head h2 { font-size: 28px; letter-spacing: .05em; }
.disc-stats { display: flex; gap: 8px; } .disc-stats a { display: flex; flex-direction: column; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 18px 18px 6px 6px; background: var(--panel); text-decoration: none; min-width: 84px; }
.disc-stats b { font: 700 22px var(--f-head); } .disc-stats small { font: 500 10px var(--f-mono); color: var(--mute); text-transform: uppercase; }
.disc-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; } .disc-cols .wide { grid-column: 1 / -1; }
.ord { list-style: none; counter-reset: o; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ord li { counter-increment: o; display: flex; align-items: center; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 2px 4px 2px 8px; font-weight: 600; }
.ord li::before { content: counter(o); font: 500 10px var(--f-mono); color: var(--mute); width: 20px; }
.ord li span { flex: 1; } .ord li .icon-btn { font-size: 9px; color: var(--mute); }
.ord-add { display: flex; gap: 4px; } .ord-add input { padding: 6px 8px; }

/* ---------------- settings */
.set-wrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 70px; }
.set-nav a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--ink2); }
.set-nav a:hover { background: var(--panel); } .set-nav a.on { background: var(--panel); color: var(--ink); box-shadow: inset 3px 0 0 var(--clay); }
.set-nav .ico { width: 17px; height: 17px; }
.set-body { display: flex; flex-direction: column; gap: 14px; }
.set-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tog-list { display: flex; flex-direction: column; margin-top: 12px; }
.tog-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.tog-row:last-child { border-bottom: 0; } .tog-row small { display: block; color: var(--mute); font-size: 13px; }
.perm td, .perm th { text-align: center; } .perm td:first-child, .perm th:first-child { text-align: start; } .perm tr { cursor: default !important; }
.pm { font: 600 10.5px var(--f-mono); padding: 1px 6px; border-radius: 99px; color: var(--mute); }
.pm.W { background: var(--ok-bg); color: var(--ok); } .pm.R { background: var(--info-bg); color: var(--info); }
.cf-group h4 { font: 700 14px var(--f-head); letter-spacing: .06em; margin: 10px 0 4px; }
.cf-row { display: flex; gap: 10px; align-items: center; padding: 4px 0; } .cf-row span { flex: 1; font-size: 12px; }
.cf-add { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line2); }
.exp-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.int { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 18px 18px 6px 6px; text-decoration: none; background: var(--panel2); }
.int:hover { border-color: var(--clay); } .int small { color: var(--mute); font-size: 13px; flex: 1; } .int .b { align-self: flex-start; }

/* ---------------- reports */
.rep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } .rep-grid .wide2 { grid-column: span 2; }
.big-num { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; } .big-num b { font: 700 40px var(--f-head); } .big-num span { color: var(--mute); }

@media (max-width: 1100px) { .rep-grid { grid-template-columns: 1fr 1fr; } .inv-row { grid-template-columns: 1fr 1fr 90px; } .inv-row > div:nth-child(4) { display: none; } }
@media (max-width: 760px) {
  .ops-kpis { grid-template-columns: 1fr 1fr; } .fin-grid, .rep-grid { grid-template-columns: minmax(0, 1fr); } .rep-grid .wide2 { grid-column: auto; }
  .inv-row { grid-template-columns: 1fr auto; } .inv-row .inv-days, .inv-row > div:nth-child(4) { display: none; }
  .po-row { grid-template-columns: 1fr auto; } .po-row > div:nth-child(2), .po-row > div:nth-child(3) { display: none; }
  .set-wrap { grid-template-columns: 1fr; } .set-nav { position: static; flex-direction: row; overflow-x: auto; } .set-nav a { white-space: nowrap; }
  .doc { padding: 20px 16px; } .doc-head, .doc-meta, .doc-sums { flex-direction: column; } .doc-title { align-items: flex-start; text-align: start; } .doc-tot { min-width: 0; }
  .aging { grid-template-columns: 1fr 1fr; } .bill-grid { grid-template-columns: 1fr; }
}
@media print {
  .doc { box-shadow: none; border: 0; max-width: none; padding: 0; margin: 0; } .doc.a4 { min-height: 0; }
  .inv-bar, .stmt-acts, .otabs, .toolbar, .sticky-act { display: none !important; }
  @page { size: A4; margin: 16mm; }
}
