/* Foundry - Nova theme */
:root {
  --bg: #f3f5fb; --card: #fff; --ink: #151b2e; --mut: #6b7491; --line: #e3e7f1; --line2: #eef1f7;
  --a1: #4f46e5; --a2: #0ea5e9; --grad: linear-gradient(135deg, #4f46e5, #0ea5e9);
  --side1: #0e1330; --side2: #1a1f4a; --amber: #f59e0b; --red: #e11d48; --green: #059669; --blue: #2563eb;
  --accent: #4f46e5; --accent-d: #4338ca; --steel: #151b2e; --steel2: #232a47; --steel3: #3a4263; --amber-d: #d97706;
  --r: 16px; --sh: 0 1px 2px rgba(21, 27, 46, .05), 0 10px 30px rgba(21, 27, 46, .06); --ease: cubic-bezier(.2, .8, .2, 1);
  --mono: "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(1200px 500px at 85% -10%, #e5e9ff 0%, transparent 60%), var(--bg); color: var(--ink); font: 14px/1.5 "Inter", "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--a1); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
::selection { background: #c7d2fe; }
.mono { font-family: var(--mono); font-size: .93em; } .mut { color: var(--mut); } .r { text-align: right; } .c { text-align: center; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 262px; flex: none; background: linear-gradient(180deg, var(--side1), var(--side2)); color: #b9c0e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden auto; transition: width .35s var(--ease); z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; position: relative; white-space: nowrap; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); flex: none; position: relative; box-shadow: 0 6px 16px rgba(79, 70, 229, .5); }
.mark::after { content: ""; position: absolute; inset: 8px; border: 2px solid #fff; border-radius: 3px; transform: rotate(45deg); }
.bname { font-weight: 700; letter-spacing: .16em; font-size: 15px; line-height: 1; color: #fff; }
.bname small { display: block; font-weight: 400; letter-spacing: .02em; font-size: 10.5px; color: #8b94c4; margin-top: 4px; }
.collapse { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; border: 1px solid #2d3566; background: #171d44; color: #aab2e0; cursor: pointer; display: grid; place-items: center; padding: 0; transition: transform .35s var(--ease), background .2s; }
.collapse:hover { background: #232b60; } .collapse svg { width: 14px; height: 14px; }
.sidebar nav { flex: 1; padding: 4px 12px 12px; }
.ngroup { text-transform: uppercase; letter-spacing: .14em; font-size: 10px; color: #6970a3; padding: 16px 10px 6px; white-space: nowrap; transition: opacity .2s; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: #b9c0e3; text-decoration: none; font-size: 13.5px; border-radius: 11px; margin-bottom: 2px; white-space: nowrap; transition: background .25s, color .25s, transform .25s var(--ease); }
.sidebar nav a svg { width: 19px; height: 19px; flex: none; transition: transform .3s var(--ease); }
.sidebar nav a span { flex: 1; transition: opacity .2s; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(3px); } .sidebar nav a:hover svg { transform: scale(1.12); }
.sidebar nav a.on { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(79, 70, 229, .4); }
.sidebar nav a em { font-style: normal; background: #fff; color: var(--a1); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 10px; line-height: 18px; animation: pop .5s var(--ease) both; }
.sidebar nav a:not(.on) em { background: var(--amber); color: #2a1a00; }
.suser { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-top: 1px solid #262d5c; white-space: nowrap; }
.av { width: 36px; height: 36px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.suser b { display: block; color: #fff; font-size: 13px; font-weight: 600; } .suser span { font-size: 11.5px; color: #8b94c4; }
.sfoot { padding: 0 18px 16px; font-size: 12px; } .sfoot a { color: #fbbf24; text-decoration: none; }
body.collapsed .sidebar { width: 82px; } body.collapsed .bname, body.collapsed .ngroup, body.collapsed .sidebar nav a span, body.collapsed .suser div:last-child, body.collapsed .sfoot { opacity: 0; pointer-events: none; width: 0; overflow: hidden; }
body.collapsed .collapse { transform: rotate(180deg); position: absolute; right: 8px; top: 62px; margin: 0; } body.collapsed .brand { padding-bottom: 38px; } body.collapsed .sidebar nav a em { position: absolute; margin: -16px 0 0 18px; }
body.collapsed .sidebar nav a { position: relative; justify-content: center; padding: 11px; } body.collapsed .suser { justify-content: center; }
.content { flex: 1; min-width: 0; }
.topbar { height: 62px; background: rgba(255, 255, 255, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.grow { flex: 1; } .crumb { color: var(--mut); } .crumb b { color: var(--ink); font-weight: 600; } .tdate { color: var(--mut); font-size: 13px; }
.rolechip { background: linear-gradient(135deg, #eef0ff, #e0f2fe); color: var(--a1); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.burger { display: none; border: 0; background: none; width: 36px; height: 36px; cursor: pointer; color: var(--ink); padding: 6px; } .burger svg { width: 100%; height: 100%; }
.cmdk { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px; color: var(--mut); transition: box-shadow .25s, border-color .25s; }
.cmdk:hover { border-color: #c7cbf6; box-shadow: 0 4px 14px rgba(79, 70, 229, .12); } .cmdk svg { width: 15px; height: 15px; }
kbd { font: 11px var(--mono); background: #f0f2fa; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--mut); }
.scrim { display: none; }
main { padding: 26px 30px 80px; max-width: 1560px; animation: pageIn .5s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }

/* header */
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.phead h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.phead p { margin: 3px 0 0; color: var(--mut); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* buttons */
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 16px; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block; border-radius: 11px; transition: transform .2s var(--ease), box-shadow .25s, background .2s, border-color .2s; position: relative; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(21, 27, 46, .1); border-color: #cfd5ea; } .btn:active { transform: translateY(0) scale(.98); }
.btn.pri { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .32); } .btn.pri:hover { box-shadow: 0 12px 24px rgba(79, 70, 229, .42); }
.btn.dark { background: var(--side1); border-color: var(--side1); color: #fff; } .btn.ghost { background: transparent; }
.btn.dang { color: var(--red); border-color: #fbc7d1; background: #fff; } .btn.dang:hover { background: #fff1f4; }
.btn.sm { padding: 4px 11px; font-size: 12.5px; border-radius: 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .5); transform: scale(0); animation: ripple .65s ease-out; pointer-events: none; } .btn:not(.pri):not(.dark) .ripple, .chip .ripple, .demo .ripple { background: rgba(79, 70, 229, .18); }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* cards */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 20px; overflow: hidden; transition: box-shadow .3s, transform .3s var(--ease); }
.panel > h3 { padding: 15px 18px; font-size: 14.5px; border-bottom: 1px solid var(--line2); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel > h3 a { font-size: 12.5px; font-weight: 500; text-decoration: none; }
.pad { padding: 16px 18px; }
.grid { display: grid; gap: 20px; } .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g5 { grid-template-columns: repeat(5, 1fr); } .g21 { grid-template-columns: 2fr 1fr; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.kpi:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(21, 27, 46, .12); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--steel3); }
.kpi.a::before { background: var(--amber); } .kpi.r::before { background: var(--red); } .kpi.g::before { background: var(--green); } .kpi.b::before { background: var(--grad); }
.kpi small { color: var(--mut); font-size: 12.5px; display: block; } .kpi b { font-size: 26px; font-weight: 700; display: block; margin: 4px 0 2px; letter-spacing: -.02em; } .kpi span { color: var(--mut); font-size: 12.5px; }
.flow { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 20px; overflow: hidden; box-shadow: var(--sh); }
.flow a { flex: 1; padding: 16px 18px; text-decoration: none; color: var(--ink); border-right: 1px solid var(--line2); transition: background .25s; position: relative; } .flow a:last-child { border: 0; }
.flow a:hover { background: #f6f7ff; } .flow a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); } .flow a:hover::after { transform: scaleX(1); }
.flow small { display: block; color: var(--mut); font-size: 12px; } .flow b { font-size: 24px; font-weight: 700; } .flow span { font-size: 12px; color: var(--mut); }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { background: #f8f9fe; color: var(--mut); text-transform: uppercase; letter-spacing: .07em; font-size: 11px; text-align: left; padding: 10px 14px; font-weight: 600; white-space: nowrap; }
.tbl th.r { text-align: right; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; } .tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .2s; } .tbl tbody tr:hover td { background: #f7f8ff; }
.tbl a.row { font-weight: 600; text-decoration: none; } .tbl a.row:hover { text-decoration: underline; }
.empty { padding: 30px; text-align: center; color: var(--mut); }
.tag { display: inline-block; padding: 2px 10px; font-size: 12px; font-weight: 500; border-radius: 20px; background: #eef0f7; color: #4b5470; white-space: nowrap; }
.t-draft, .t-not-started, .t-normal { background: #eef0f7; color: #4b5470; } .t-sent, .t-confirmed, .t-unpaid, .t-ready-for-dispatch, .t-in-transit { background: #e0f2fe; color: #0369a1; }
.t-pending-approval, .t-part-paid, .t-in-production, .t-dispatched, .t-in-progress, .t-on-leave, .t-high { background: #fef3c7; color: #92400e; }
.t-converted, .t-paid, .t-closed, .t-installed, .t-done, .t-ok, .t-delivered, .t-active { background: #d1fae5; color: #065f46; }
.t-lost, .t-overdue, .t-expired, .t-low, .t-late, .t-urgent, .t-inactive { background: #ffe4e6; color: #9f1239; }
.bar { display: flex; align-items: center; gap: 12px; margin: 9px 0; } .bar .lab { width: 150px; font-size: 13px; } .bar .trk { flex: 1; background: #eceffa; height: 10px; border-radius: 6px; overflow: hidden; }
.bar .fill, .mini i { height: 100%; display: block; border-radius: 6px; background: var(--grad); transition: width 1s var(--ease); } .bar .fill.a { background: linear-gradient(90deg, #f59e0b, #fbbf24); } .bar .n { width: 130px; text-align: right; font-family: var(--mono); font-size: 12px; }
.mini { height: 8px; background: #eceffa; border-radius: 5px; overflow: hidden; min-width: 90px; } .mini.ok i { background: linear-gradient(90deg, #059669, #34d399); }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; } .field label { font-size: 12px; font-weight: 500; color: var(--mut); }
input, select, textarea { font: inherit; border: 1px solid var(--line); background: #fff; padding: 8px 11px; border-radius: 10px; color: var(--ink); width: 100%; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 4px rgba(79, 70, 229, .14); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--a1); }
textarea { min-height: 80px; resize: vertical; }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; } .toolbar input, .toolbar select { width: auto; min-width: 220px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; padding: 5px 14px; font-size: 13px; cursor: pointer; border-radius: 20px; transition: all .25s var(--ease); position: relative; user-select: none; }
.chip:hover { border-color: #c7cbf6; transform: translateY(-1px); } .chip.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(79, 70, 229, .3); }

/* catalog */
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--sh); transition: transform .35s var(--ease), box-shadow .35s; }
.pcard:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(21, 27, 46, .14); }
.pcard .ph { background: linear-gradient(135deg, var(--side1), #2b3380); color: #fff; padding: 16px 18px; position: relative; overflow: hidden; }
.pcard .ph::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(14, 165, 233, .25); transition: transform .5s var(--ease); } .pcard:hover .ph::after { transform: scale(1.5); }
.pcard .ph small { color: #7dd3fc; font-size: 11.5px; letter-spacing: .05em; } .pcard .ph b { display: block; font-size: 16.5px; margin-top: 3px; position: relative; z-index: 1; }
.pcard ul { margin: 0; padding: 14px 18px 6px 34px; color: #454e6c; font-size: 13px; flex: 1; }
.pcard .pf { padding: 12px 18px; border-top: 1px solid var(--line2); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pcard .price { font-weight: 700; font-size: 16px; }
.cfg { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.cgroup { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; overflow: hidden; background: #fff; }
.cgroup h4 { background: #f8f9fe; padding: 11px 16px; font-size: 13px; display: flex; justify-content: space-between; }
.copt { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line2); cursor: pointer; transition: background .2s, padding-left .25s var(--ease); }
.copt:hover { background: #f7f8ff; padding-left: 20px; } .copt.sel { background: #eef0ff; } .copt .cl { flex: 1; } .copt .cp { font-family: var(--mono); font-size: 13px; }
.sticky { position: sticky; top: 80px; }
.sumrow2 { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; } .sumrow2.big { font-size: 19px; font-weight: 700; border: 0; padding-top: 12px; }

/* documents */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; align-items: start; } .side .panel { margin-bottom: 16px; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 36px 40px; max-width: 920px; box-shadow: var(--sh); font-size: 12.5px; }
.dhead { display: flex; justify-content: space-between; gap: 24px; border-bottom: 3px solid var(--side1); padding-bottom: 14px; margin-bottom: 14px; }
.dname { font-size: 18px; font-weight: 700; margin-bottom: 3px; } .dtitle { text-align: right; } .dtitle h2 { font-size: 22px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
table.meta { margin-left: auto; border-collapse: collapse; } table.meta td { padding: 1px 0 1px 12px; text-align: left; } table.meta td:first-child { color: var(--mut); text-align: right; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; } .party { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; } .party h4 { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); margin-bottom: 3px; } .pn { font-weight: 700; }
table.items { width: 100%; border-collapse: collapse; margin-bottom: 12px; } .items th { background: var(--side1); color: #fff; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 7px; text-align: left; } .items th.r { text-align: right; } .items th.c { text-align: center; }
.items td { padding: 8px 7px; border-bottom: 1px solid var(--line2); vertical-align: top; } ul.opts { margin: 3px 0 0; padding-left: 16px; color: #46506a; font-size: 11.5px; }
.dfoot { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
table.tot { width: 100%; border-collapse: collapse; } .tot td { padding: 5px 9px; border-bottom: 1px solid var(--line2); } .tot tr.grand td { background: var(--side1); color: #fff; font-weight: 700; font-size: 14px; border: 0; } .tot tr.bal td { background: #fef3c7; font-weight: 700; }
table.taxt { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 11.5px; } .taxt th { background: #f1f3fb; text-align: left; padding: 5px 8px; border: 1px solid var(--line); font-size: 10.5px; text-transform: uppercase; } .taxt th.r { text-align: right; } .taxt td { padding: 5px 8px; border: 1px solid var(--line); } .taxt tr.sumrow td { font-weight: 700; background: #f8f9fe; }
.words { border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; margin-bottom: 10px; background: #fafbff; }
.terms { font-size: 11px; white-space: pre-line; color: #3b4460; } .terms h4, .bank h4 { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); margin-bottom: 3px; }
.bank { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin: 10px 0; font-size: 11.5px; }
.sign { text-align: right; margin-top: 30px; } .sign .line { margin-top: 44px; border-top: 1px solid var(--ink); display: inline-block; padding-top: 3px; min-width: 190px; }
.sched td, .sched th { padding: 5px 8px; border: 1px solid var(--line); font-size: 11.5px; } .sched { border-collapse: collapse; width: 100%; margin: 6px 0 10px; } .sched th { background: #f1f3fb; text-align: left; font-size: 10.5px; text-transform: uppercase; }
.lrow { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; background: #fbfbfe; } .lrow .ln { font-weight: 600; font-size: 13px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 6px; } .lrow .frow { grid-template-columns: 1fr 1fr; }
.hist { font-size: 12.5px; color: var(--mut); } .hist div { padding: 4px 0; border-bottom: 1px dashed var(--line); animation: slideIn .4s var(--ease) both; }
.warn { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.sheet-hero { background: linear-gradient(135deg, var(--side1), #2b3380 70%, #0ea5e9); color: #fff; padding: 26px 30px; display: flex; justify-content: space-between; gap: 20px; align-items: center; margin: -36px -40px 22px; border-radius: 6px 6px 0 0; }
.sheet-hero h2 { font-size: 26px; } .sheet-hero small { color: #7dd3fc; letter-spacing: .1em; text-transform: uppercase; } .sheet-hero svg { width: 160px; height: 96px; flex: none; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.ebox { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: #fafbff; } .erow { display: grid; gap: 8px; margin-bottom: 6px; align-items: center; }

/* production */
.stg { display: grid; grid-template-columns: 30px 1fr 150px 130px 170px; gap: 12px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line2); transition: background .25s; } .stg:hover { background: #f8f9ff; }
.stg select { padding: 5px 8px; font-size: 12.5px; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-block; transition: all .4s var(--ease); } .dot.d { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 4px rgba(5, 150, 105, .15); } .dot.p { border-color: var(--amber); background: #fef3c7; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(245, 158, 11, .16); } }
.qcrow { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line2); cursor: pointer; transition: background .2s; } .qcrow:hover { background: #f8f9ff; }
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: #f1f3fb; border-radius: 14px; padding: 10px; min-height: 180px; border: 2px dashed transparent; transition: border-color .2s, background .2s; } .col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); padding: 2px 4px 8px; display: flex; justify-content: space-between; }
.col.over { border-color: var(--a1); background: #eef0ff; }
.wc { background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-left: 4px solid var(--a1); box-shadow: 0 2px 6px rgba(21, 27, 46, .06); cursor: grab; touch-action: none; user-select: none; transition: transform .2s var(--ease), box-shadow .2s; }
.wc:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(21, 27, 46, .12); } .wc.late { border-left-color: var(--red); } .wc.drag { position: fixed; z-index: 90; pointer-events: none; opacity: .92; transform: rotate(3deg) scale(1.04); box-shadow: 0 24px 50px rgba(21, 27, 46, .3); cursor: grabbing; width: 210px; }
.wc b { font-size: 12px; } .wc .t { font-size: 12.5px; } .wc .m { font-size: 11.5px; color: var(--mut); }
.crew { display: flex; flex-wrap: wrap; gap: 6px; } .pill { display: inline-flex; align-items: center; gap: 6px; background: #eef0ff; color: var(--a1); border-radius: 20px; padding: 3px 10px 3px 4px; font-size: 12.5px; } .pill i { width: 20px; height: 20px; border-radius: 50%; background: var(--grad); color: #fff; font-style: normal; font-size: 10px; display: grid; place-items: center; font-weight: 600; }
.fcard { padding: 18px; } .fcard h3 { font-size: 16px; } .fcard .stat { display: flex; gap: 22px; margin: 12px 0; } .fcard .stat div b { display: block; font-size: 20px; } .fcard .stat div span { font-size: 12px; color: var(--mut); }

/* reminders */
.rem { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--sh); touch-action: pan-y; position: relative; transition: box-shadow .25s, opacity .3s, transform .35s var(--ease); }
.rem .bell { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: #eef0ff; color: var(--a1); } .rem .bell svg { width: 19px; height: 19px; }
.rem.overdue .bell { background: #ffe4e6; color: var(--red); } .rem.today .bell { background: #fef3c7; color: #b45309; } .rem.done { opacity: .55; } .rem.done b { text-decoration: line-through; }
.rem .body { flex: 1; min-width: 0; } .rem b { display: block; } .rem .d { font-size: 12.5px; color: var(--mut); }
.rem.swiping { transition: none; } .rem.gone { opacity: 0; transform: translateX(120%); }
.swipehint { font-size: 12px; color: var(--mut); margin: 0 0 12px; }

/* modal, toast, palette */
.modal { position: fixed; inset: 0; background: rgba(14, 19, 48, .55); backdrop-filter: blur(5px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 60; overflow: auto; animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.mbox { background: #fff; width: 540px; max-width: 100%; border-radius: 20px; box-shadow: 0 40px 80px rgba(14, 19, 48, .4); animation: modalIn .4s var(--ease) both; overflow: hidden; } .mbox.wide { width: 800px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(30px) scale(.95); } to { opacity: 1; transform: none; } }
.mhead { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line2); font-size: 16px; } .x { border: 0; background: none; cursor: pointer; color: var(--mut); font: inherit; font-size: 13px; }
.mbody { padding: 20px 22px; max-height: 68vh; overflow: auto; } .mfoot { padding: 14px 22px; border-top: 1px solid var(--line2); display: flex; justify-content: flex-end; gap: 10px; background: #fafbff; }
#toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 40px) scale(.95); background: var(--side1); color: #fff; padding: 12px 22px; border-radius: 14px; opacity: 0; transition: all .35s var(--ease); z-index: 90; pointer-events: none; box-shadow: 0 16px 36px rgba(14, 19, 48, .35); border-left: 4px solid #34d399; }
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); } #toast.bad { border-left-color: #fb7185; }
.pal { position: fixed; inset: 0; background: rgba(14, 19, 48, .5); backdrop-filter: blur(5px); z-index: 80; display: flex; justify-content: center; padding-top: 12vh; animation: fade .2s both; }
.palbox { width: 600px; max-width: calc(100% - 24px); height: fit-content; background: #fff; border-radius: 18px; box-shadow: 0 40px 80px rgba(14, 19, 48, .45); overflow: hidden; animation: modalIn .3s var(--ease) both; }
.palbox input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 18px 20px; font-size: 16px; } .palbox input:focus { box-shadow: none; }
#pall a { display: flex; justify-content: space-between; padding: 11px 20px; text-decoration: none; color: var(--ink); } #pall a.on, #pall a:hover { background: #eef0ff; } #pall em { font-style: normal; font-size: 12px; color: var(--mut); } .palh { padding: 9px 20px; font-size: 12px; color: var(--mut); background: #fafbff; border-top: 1px solid var(--line2); }

/* login */
.lg { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.lg-l { background: linear-gradient(150deg, var(--side1), #2b3380 70%, #0e7490); color: #c3c9ee; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.lg-l::before, .lg-l::after { content: ""; position: absolute; border-radius: 50%; background: rgba(14, 165, 233, .18); animation: float 7s ease-in-out infinite; } .lg-l::before { width: 380px; height: 380px; right: -120px; top: -100px; } .lg-l::after { width: 240px; height: 240px; left: -60px; bottom: 60px; animation-delay: -3s; background: rgba(79, 70, 229, .3); }
.lg-l > * { position: relative; z-index: 1; } .lg-l h1 { color: #fff; font-size: 38px; line-height: 1.15; font-weight: 700; margin: 36px 0 14px; max-width: 520px; letter-spacing: -.02em; }
.lg-l ul { list-style: none; padding: 0; margin: 26px 0 0; } .lg-l li { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); max-width: 540px; animation: slideIn .6s var(--ease) both; } .lg-l li:nth-child(2) { animation-delay: .08s; } .lg-l li:nth-child(3) { animation-delay: .16s; } .lg-l li:nth-child(4) { animation-delay: .24s; } .lg-l li:nth-child(5) { animation-delay: .32s; } .lg-l li:nth-child(6) { animation-delay: .4s; } .lg-l li b { color: #fff; }
.lg-r { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: #fff; } .lg-box { width: 430px; max-width: 100%; animation: rise .7s var(--ease) both; } .lg-box h2 { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; } .demo button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 11px 13px; cursor: pointer; font: inherit; transition: all .3s var(--ease); position: relative; }
.demo button:hover { border-color: var(--a1); background: #f6f7ff; transform: translateY(-3px); box-shadow: 0 12px 24px rgba(79, 70, 229, .15); } .demo b { display: block; font-size: 13.5px; } .demo span { font-size: 12px; color: var(--mut); }
.err { background: #fff1f2; border: 1px solid #fecdd3; color: var(--red); padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; animation: shake .4s; } @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (max-width: 1000px) {
  .shell { display: block; } .sidebar { position: fixed; left: 0; top: 0; width: 278px !important; transform: translateX(-100%); transition: transform .4s var(--ease); box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  body.drawer .sidebar { transform: none; } body.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(14, 19, 48, .5); z-index: 25; animation: fade .3s both; }
  body.collapsed .bname, body.collapsed .ngroup, body.collapsed .sidebar nav a span, body.collapsed .suser div:last-child, body.collapsed .sfoot { opacity: 1; width: auto; pointer-events: auto; } .collapse { display: none; }
  .burger { display: block; } .cmdk span, .cmdk kbd, .tdate { display: none; } .topbar { padding: 0 14px; } main { padding: 18px 14px 70px; }
  .split, .cfg, .g21, .g2 { grid-template-columns: 1fr; } .g3, .g4, .g5 { grid-template-columns: 1fr 1fr; } .flow { flex-wrap: wrap; } .flow a { min-width: 45%; }
  .paper { padding: 18px; } .sheet-hero { margin: -18px -18px 18px; } .dhead, .dfoot, .parties { display: block; } .dtitle { text-align: left; margin-top: 10px; } table.meta { margin-left: 0; } .items { display: block; overflow-x: auto; }
  .stg { grid-template-columns: 28px 1fr; } .lg { display: block; } .lg-l { padding: 30px 24px; } .demo { grid-template-columns: 1fr; } .tbl { display: block; overflow-x: auto; }
}
@media (max-width: 560px) { .g3, .g4, .g5 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }
@media print {
  body { background: #fff; } .hide-print, .sidebar, .topbar, .scrim { display: none !important; } .shell { display: block; } main { padding: 0; max-width: none; animation: none; }
  .split { display: block; } .paper { border: 0; box-shadow: none; padding: 0; max-width: none; } .rise { animation: none; }
  .items th, .tot tr.grand td, .taxt th, .sheet-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; } @page { size: A4; margin: 12mm; }
}

/* ===== table polish, layout fixes, preview drawer ===== */
main { max-width: none; }
.kpi.r { text-align: left; }
.panel:has(> table.tbl) { overflow-x: auto; }
table.tbl { min-width: 640px; }
.tbl th { position: sticky; top: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 16px; vertical-align: middle; line-height: 1.35; }
.tbl td.r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl td:first-child { white-space: nowrap; }
.tbl td .tag { vertical-align: middle; }
.tbl .mono { font-family: inherit; font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: 0; }
.tbl td.r.mono { font-weight: 600; }
.tbl tbody tr:nth-child(even) td { background: #fbfcff; }
.tbl tbody tr:hover td { background: #f1f3ff; }
.tbl tbody tr:has(a[href]), .tbl tbody tr[data-pv], .wc, .pcard[data-pv] { cursor: pointer; }
.tbl tbody tr[data-pv] td:first-child b, .tbl tbody tr:hover a.row { color: var(--a1); }
.tbl a.row { color: var(--ink); }
.tbl td .mut { font-size: 12.5px; }
.tbl tbody tr { position: relative; }
.pvwrap { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.pvwrap.open { pointer-events: auto; }
.pv-scrim { position: absolute; inset: 0; background: rgba(14, 19, 48, 0); backdrop-filter: blur(0); transition: all .3s; }
.pvwrap.open .pv-scrim { background: rgba(14, 19, 48, .42); backdrop-filter: blur(3px); }
.pv { position: absolute; right: 0; top: 0; bottom: 0; width: min(700px, 100%); background: #fff; box-shadow: -30px 0 70px rgba(14, 19, 48, .3); transform: translateX(100%); transition: transform .38s var(--ease); display: flex; flex-direction: column; border-radius: 22px 0 0 22px; }
.pvwrap.open .pv { transform: none; }
.pvhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 26px 16px; border-bottom: 1px solid var(--line2); background: linear-gradient(135deg, #f6f7ff, #eefaff); border-radius: 22px 0 0 0; }
.pvhead small { color: var(--a1); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; } .pvhead h3 { font-size: 21px; margin-top: 2px; }
.pvbody { flex: 1; overflow: auto; padding: 18px 26px 26px; }
.pvfoot { padding: 14px 26px; border-top: 1px solid var(--line2); display: flex; justify-content: flex-end; gap: 10px; background: #fafbff; }
.pvkv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; margin-bottom: 8px; }
.pvkv div { background: #f7f8fe; border-radius: 12px; padding: 10px 12px; } .pvkv small { display: block; color: var(--mut); font-size: 11.5px; } .pvkv b { font-size: 14px; font-weight: 600; word-break: break-word; }
.pvsec { margin-top: 18px; animation: slideIn .4s var(--ease) both; } .pvsec h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--mut); margin-bottom: 8px; }
.pvx { overflow-x: auto; } .pvx .items { font-size: 11.5px; min-width: 560px; } .pvsec .taxt { margin: 0; } .pvsec .tot { margin-top: 0; }
@media (max-width: 700px) { .pvkv { grid-template-columns: 1fr 1fr; } .pv { border-radius: 0; } .pvhead { border-radius: 0; } }
@media print { .pvwrap { display: none !important; } }
