/* ============================================================
   COMMAND CENTER CORE · styles (neutral luxury)
   Cream, white, muted sage, taupe, charcoal. Bold Poppins.
   A module may add its own CSS after this file.
   ============================================================ */
:root {
  --bg: #F5F0E8; --surface: #FFFFFF; --surface2: #FBF8F3; --ink: #2E2D2B; --ink2: #4A4743; --muted: #7D766D; --line: #E6DDD0; --line2: #EFE9DF;
  --accent: #6F7F62; --accent-soft: rgb(111 127 98 / .14); --accent-ink: #fff;
  --sage: #6F7F62; --sage-soft: #E7ECE1; --taupe: #B5A495; --taupe-soft: #EFE8DF; --sand: #E9DCC6;
  --red: #A9564F; --red-soft: #F6E4E1; --amber: #B4873A; --amber-soft: #F6ECD8; --blue: #5F7397; --blue-soft: #E3E8F1; --rose: #B5747E; --rose-soft: #F5E6E8;
  --r: 18px; --r-sm: 12px; --shadow: 0 1px 2px rgb(46 45 43 / .04), 0 8px 24px rgb(46 45 43 / .06); --shadow-lg: 0 24px 60px rgb(46 45 43 / .22);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; --side: 252px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.cc-noscroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: 0; color: var(--ink); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .82rem; display: block; margin-top: 6px; }
.mt { margin-top: 18px; }
.up { color: var(--sage) !important; } .down { color: var(--red) !important; }

/* ---------- shell ---------- */
.app { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; background: var(--surface2); }
.brand b { display: block; font-weight: 700; font-size: 1rem; line-height: 1.2; }
.brand small { color: var(--muted); font-size: .74rem; font-weight: 500; }
#sideNav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-i { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink2); text-align: left; position: relative; transition: background .15s, color .15s; }
.nav-i:hover { background: var(--surface2); color: var(--ink); }
.nav-i.on { background: var(--accent-soft); color: var(--accent); }
.nav-i .badge, .dk .badge, .more-i .badge { margin-left: auto; }
.badge { background: var(--accent); color: var(--accent-ink); font-style: normal; font-weight: 700; font-size: .7rem; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; }
.side-foot { border-top: 1px solid var(--line2); padding-top: 10px; }
.main { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px; padding: 12px 28px; background: rgb(245 240 232 / .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.tb-title { display: none; font-weight: 700; }
.lang-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: .78rem; cursor: pointer; }
#view { padding: 4px 28px 40px; outline: none; flex: 1; }
.page { animation: fade .22s ease; max-width: 1600px; margin: 0 auto; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.dock { display: none; }
.only-phone { display: none; }
.bell { position: relative; } .bell .badge { position: absolute; top: -2px; right: -4px; background: var(--red); color: #fff; }

/* ---------- page header ---------- */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.page-h h1 { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; }
.page-h p { margin: 4px 0 0; color: var(--muted); max-width: 640px; }
.page-h.hero h1 { font-size: 2.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 600; color: var(--taupe) !important; margin: 0 0 4px !important; }
.page-btns, .btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row.wrap { flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: var(--taupe); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px var(--accent-soft); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.ok { background: var(--sage-soft); border-color: transparent; color: var(--sage); }
.btn.ok.on, .btn.on { outline: 2px solid currentColor; outline-offset: 1px; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--red); border-color: var(--red-soft); }
.btn.sm { padding: 6px 10px; font-size: .8rem; border-radius: 10px; }
.btn.big { padding: 14px 22px; font-size: 1rem; width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: var(--ink2); }
.icon-btn:hover { background: var(--surface); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.link { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font-size: .85rem; display: inline-flex; align-items: center; gap: 4px; }
.file-btn { position: relative; }

/* ---------- cards / grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; border: 0; padding: 0; margin-top: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.card-h .n, .seg .n, .kcol h4 .n { background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: .74rem; font-weight: 700; }
.card h4 { font-size: .9rem; margin: 10px 0 4px; }
.card p { margin: 0 0 8px; }
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin: 18px 0; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card.wide { margin-bottom: 18px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; text-align: left; border: 1px solid var(--line2); background: var(--surface); border-radius: var(--r); padding: 16px 16px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; cursor: pointer; transition: transform .15s, box-shadow .15s; min-width: 0; }
.kpi:disabled { cursor: default; color: inherit; opacity: 1; }
.kpi:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgb(46 45 43 / .09); }
.kpi-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.kpi-l { font-size: .78rem; color: var(--muted); font-weight: 500; }
.kpi-v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.kpi-s { font-size: .76rem; color: var(--muted); font-weight: 500; }
.kpi.alert { border-color: var(--red-soft); } .kpi.alert .kpi-ic { background: var(--red-soft); color: var(--red); }
.profile .kpis { margin-top: 2px; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--surface2); border: 1px solid var(--line); color: var(--ink2); white-space: nowrap; vertical-align: middle; }
.chip.sage { background: var(--sage-soft); border-color: transparent; color: #4F5D44; }
.chip.amber { background: var(--amber-soft); border-color: transparent; color: #8A6424; }
.chip.red { background: var(--red-soft); border-color: transparent; color: var(--red); }
.chip.rose { background: var(--rose-soft); border-color: transparent; color: #8E4F59; }
.chip.blue { background: var(--blue-soft); border-color: transparent; color: #455A7E; }
.chip.taupe { background: var(--taupe-soft); border-color: transparent; color: #75685B; }
.chip.sand { background: var(--sand); border-color: transparent; color: #6E5B3E; }
.chip.ink { background: var(--ink); border-color: transparent; color: #fff; }
.pf { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--pc); color: #fff; font-size: .62rem; font-weight: 700; margin-right: 2px; vertical-align: middle; }

/* ---------- tooltips ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .74rem; font-weight: 500; line-height: 1.35; padding: 7px 10px; border-radius: 9px; width: max-content; max-width: 240px; white-space: normal; z-index: 40; pointer-events: none; text-align: left; }
.tip { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--line); font-size: .66rem; font-weight: 700; color: var(--muted); cursor: help; margin-left: 4px; vertical-align: 1px; }

/* ---------- tables ---------- */
.tbl-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tbl-tools.hide-empty { display: none; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; flex: 1 1 240px; max-width: 420px; color: var(--muted); }
.search input { border: 0; background: transparent; outline: none; padding: 10px 0; width: 100%; color: var(--ink); }
select { border: 1px solid var(--line); background: var(--surface2); border-radius: 12px; padding: 9px 30px 9px 12px; font-weight: 500; font-size: .86rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237D766D' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; max-width: 100%; cursor: pointer; }
.tbl-count { color: var(--muted); font-size: .8rem; margin-left: auto; font-weight: 500; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line2); border-radius: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-weight: 600; font-size: .74rem; color: var(--muted); background: var(--surface2); padding: 0; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tbl th button { border: 0; background: none; width: 100%; text-align: inherit; padding: 10px 12px; cursor: pointer; font-weight: 600; color: inherit; text-transform: uppercase; letter-spacing: .04em; font-size: .7rem; }
.tbl th.num button, .tbl th.num { text-align: right; }
.tbl th button.on { color: var(--ink); } .tbl th button.on.asc::after { content: " ↑"; } .tbl th button.on.desc::after { content: " ↓"; }
.tbl thead th:not(:has(button)) { padding: 10px 12px; text-transform: uppercase; letter-spacing: .04em; font-size: .7rem; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr[data-act] { cursor: pointer; transition: background .12s; }
.tbl tr[data-act]:hover { background: var(--surface2); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.tbl .sub { display: block; color: var(--muted); font-size: .76rem; font-weight: 500; }
.tbl tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tbl tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.tbl td.none { text-align: center; color: var(--muted); padding: 26px; }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.tbl.pl tr.sum td { background: var(--surface2); }
.tbl.pl tr.big td { font-size: .98rem; }
.tbl-sum { text-align: right; color: var(--muted); margin: 10px 2px 0; font-size: .86rem; }

/* ---------- empty states / notes ---------- */
.empty { text-align: center; padding: 38px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { color: var(--taupe); }
.empty h3 { color: var(--ink); font-size: 1.05rem; }
.empty p { max-width: 380px; margin: 0 0 6px; }
.note { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; }
.note.warn { background: var(--amber-soft); border-color: transparent; }
.demo-note { display: flex; align-items: center; gap: 10px; background: var(--sage-soft); color: #44503A; padding: 10px 14px; border-radius: 14px; margin-bottom: 16px; font-weight: 500; font-size: .88rem; flex-wrap: wrap; }
.demo-note span { flex: 1; min-width: 200px; }
.ok-msg { display: flex; gap: 8px; align-items: center; color: var(--sage) !important; font-weight: 600; }
.chart-empty { color: var(--muted); padding: 30px 0; text-align: center; font-size: .88rem; }

/* ---------- segmented tabs / toolbars ---------- */
.seg { display: inline-flex; gap: 4px; background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 600; font-size: .84rem; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgb(46 45 43 / .1); }
.bar-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.nav-btns { display: flex; align-items: center; gap: 4px; }
.cal-title { font-size: 1.15rem; margin-left: 8px; }

/* ---------- lists ---------- */
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.mini-list li:hover { background: var(--surface2); }
.mini-list .d { min-width: 74px; font-size: .78rem; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.mini-list .tt { flex: 1; font-weight: 600; font-size: .88rem; min-width: 0; }
.mini-list .tt small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.mini-list li.late .d { color: var(--red); }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alerts li { display: flex; align-items: center; gap: 6px; }
.alerts li > button:first-child { flex: 1; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-radius: 12px; padding: 11px 12px; cursor: pointer; font-weight: 600; font-size: .86rem; }
.al.red > button:first-child { background: var(--red-soft); color: #7E3A34; }
.al.amber > button:first-child { background: var(--amber-soft); color: #75531B; }
.al.blue > button:first-child { background: var(--blue-soft); color: #3D506F; }
.alerts span { flex: 1; }
.dl dt { color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; }
.dl dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.camps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.camps li { display: grid; grid-template-columns: 1fr 120px auto; gap: 10px; align-items: center; cursor: pointer; }
.camps small { display: block; color: var(--muted); font-size: .76rem; }
.camps .cp { font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.edit-list { list-style: none; margin: 0 0 10px; padding: 0; }
.edit-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.edit-list span { flex: 1; color: var(--muted); font-size: .84rem; }
.prog { display: inline-block; width: 100%; max-width: 160px; height: 8px; background: var(--line2); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.prog i { display: block; height: 100%; background: var(--taupe); border-radius: 99px; }
.prog.ok i { background: var(--sage); } .prog.low i { background: var(--red); }

/* ---------- charts ---------- */
.chart { margin: 0; } .chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line2); stroke-width: 1; } .chart .grid.zero { stroke: var(--line); }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); font-weight: 500; }
.chart .bar { transition: opacity .15s; } .chart .bar:hover { opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .76rem; color: var(--muted); font-weight: 500; margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-foot { color: var(--muted); font-size: .8rem; margin: 8px 0 0 !important; }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0 0 10px; }
.donut .slice:hover { opacity: .85; }
.d-big { font: 700 18px var(--font); fill: var(--ink); } .d-sm { font: 500 11px var(--font); fill: var(--muted); }
.d-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.d-legend li { display: flex; align-items: center; gap: 8px; } .d-legend span { flex: 1; } .d-legend i { width: 10px; height: 10px; border-radius: 3px; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .84rem; }
.hb-l { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; background: var(--line2); border-radius: 99px; overflow: hidden; } .hb-track i { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.hb-v { font-size: .82rem; }

/* ---------- posts / kanban ---------- */
.post { background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 3px rgb(46 45 43 / .05); }
.post.late { border-color: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); }
.post header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.post .cl { font-size: .72rem; font-weight: 600; color: var(--taupe); text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post h4 { font-size: .92rem; margin: 0; cursor: pointer; }
.post h4:hover { color: var(--accent); }
.post .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .76rem; color: var(--muted); font-weight: 500; }
.post .cap { font-size: .84rem; color: var(--ink2); margin: 0; white-space: pre-wrap; }
.post .tags { font-size: .78rem; color: var(--blue); margin: 0; }
.post .fb { font-size: .82rem; background: var(--rose-soft); color: #7A434C; border-radius: 10px; padding: 8px 10px; margin: 0; font-style: italic; }
.post footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.post details { font-size: .8rem; color: var(--muted); } .post details ul { margin: 6px 0 0; padding-left: 18px; }
.ap-dates { display: flex; gap: 12px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.kcol { background: var(--surface2); border: 1px solid var(--line2); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; scroll-snap-align: start; }
.kcol h4 { font-size: .84rem; display: flex; justify-content: space-between; align-items: center; margin: 2px 4px; }
.kcol .kv { color: var(--muted); font-size: .74rem; margin: -6px 4px 0; font-weight: 600; }
.kempty { color: var(--muted); font-size: .8rem; text-align: center; padding: 18px 0; margin: 0; }
.post.lead .meta b { margin-left: auto; color: var(--ink); }

/* ---------- calendar ---------- */
.cal-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-tools .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; }
.cal-h { background: var(--surface2); text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 8px 0; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line2); }
.cal-d { min-height: 112px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; transition: background .12s; }
.cal-d:nth-child(7n + 7) { border-right: 0; }
.cal-d:hover { background: var(--surface2); }
.cal-d.out { background: #FCFAF7; } .cal-d.out .dn { color: #C8BFB3; }
.cal-d .dn { font-size: .78rem; font-weight: 700; color: var(--ink2); }
.cal-d.today .dn { background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 0 7px; align-self: flex-start; }
.cal-d .more { font-size: .72rem; color: var(--muted); font-weight: 600; padding-left: 4px; }
.pc { display: flex; align-items: center; gap: 5px; width: 100%; border: 0; text-align: left; background: var(--surface2); border-radius: 7px; padding: 3px 6px; font-size: .72rem; font-weight: 600; cursor: pointer; min-width: 0; color: var(--ink2); }
.pc i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pc .tm { color: var(--muted); font-weight: 500; flex: none; }
.pc .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc.s-idea, .lg.s-idea { background: var(--taupe-soft); } .pc.s-draft, .lg.s-draft { background: var(--sand); } .pc.s-review, .lg.s-review { background: var(--amber-soft); } .pc.s-revise, .lg.s-revise { background: var(--rose-soft); }
.pc.s-approved, .lg.s-approved { background: var(--sage-soft); } .pc.s-scheduled, .lg.s-scheduled { background: var(--blue-soft); } .pc.s-published, .lg.s-published { background: #E8E6E3; color: var(--muted); }
.pc.late, .lg.late { box-shadow: inset 0 0 0 1.5px var(--red); }
.legend.stages { margin-top: 12px; gap: 6px; } .lg { padding: 2px 9px; border-radius: 7px; font-size: .72rem; font-weight: 600; color: var(--ink2); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cw-col { background: var(--surface2); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 260px; min-width: 0; }
.cw-col.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cw-h { border: 0; background: none; font-weight: 600; font-size: .8rem; color: var(--muted); cursor: pointer; text-align: left; padding: 2px; } .cw-h b { color: var(--ink); font-size: 1rem; }
.cw-col .pc { background: var(--surface); padding: 6px; white-space: normal; } .cw-col .pc .tt { white-space: normal; }
.cw-add { margin-top: auto; border: 1px dashed var(--line); background: transparent; border-radius: 10px; padding: 6px; cursor: pointer; color: var(--muted); }
.cal-day { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* ---------- goals ---------- */
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.goal { background: var(--surface2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.goal .gl { font-size: .78rem; color: var(--muted); font-weight: 600; }
.goal b { font-size: 1.5rem; font-weight: 800; } .goal small { color: var(--muted); font-size: .78rem; }
.goal .prog { max-width: none; height: 10px; margin-top: 6px; } .goal .gp { font-weight: 700; color: var(--ink2); }

/* ---------- reports ---------- */
.report-tile { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 8px; color: var(--ink); font: inherit; transition: transform .15s; }
.report-tile:hover { transform: translateY(-2px); }
.report-tile .ic { color: var(--accent); } .report-tile p { color: var(--muted); font-size: .86rem; flex: 1; }
.report { font-size: .9rem; } .report h3 { margin: 18px 0 8px; font-size: 1rem; }
.r-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 16px; }
.r-head h1 { font-size: 1.6rem; font-weight: 800; } .r-head p { margin: 2px 0 0; color: var(--muted); }
.r-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.r-kpis div { background: var(--surface2); border-radius: 12px; padding: 10px 12px; } .r-kpis span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; } .r-kpis b { font-size: 1.3rem; font-weight: 800; display: block; } .r-kpis small { font-weight: 600; }
.r-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.inv-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; }
.invoice header { display: flex; gap: 16px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.invoice header > div:nth-child(2), .invoice header > div:first-child:not(.inv-meta) { flex: 1; }
.invoice h1 { font-size: 1.3rem; } .invoice header p { color: var(--muted); margin: 4px 0 0; font-size: .84rem; }
.inv-meta { text-align: right; } .inv-meta h2 { font-size: 1.5rem; letter-spacing: .08em; font-weight: 800; } .inv-meta p { color: var(--ink2) !important; }
.paid-stamp { display: inline-block; border: 2px solid var(--sage); color: var(--sage) !important; font-weight: 800; padding: 2px 10px; border-radius: 8px; transform: rotate(-4deg); }
.invoice .bill { margin: 16px 0; } .invoice .bill h4 { font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.invoice table { width: 100%; border-collapse: collapse; } .invoice th, .invoice td { padding: 9px 6px; border-bottom: 1px solid var(--line2); text-align: left; } .invoice .num { text-align: right; }
.invoice tfoot td { border: 0; padding: 5px 6px; text-align: right; } .invoice tfoot .grand td { font-weight: 800; font-size: 1.1rem; border-top: 2px solid var(--ink); padding-top: 10px; }
.inv-notes { margin-top: 14px; color: var(--ink2); } .inv-thanks { margin-top: 18px; font-weight: 600; color: var(--accent); }

/* ---------- pop-ups ---------- */
.cc-pop { position: fixed; inset: 0; z-index: 50; background: rgb(46 45 43 / .38); display: grid; place-items: center; padding: 24px 16px; opacity: 0; transition: opacity .16s; overflow-y: auto; }
.cc-pop.in { opacity: 1; } .cc-pop.out { opacity: 0; }
.cc-pop-card { background: var(--surface); width: 100%; max-width: 580px; border-radius: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 48px); transform: translateY(10px) scale(.98); transition: transform .18s ease; outline: none; }
.cc-pop.in .cc-pop-card { transform: none; }
.cc-pop.wide .cc-pop-card { max-width: 960px; }
.cc-pop.small .cc-pop-card { max-width: 460px; }
.cc-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 10px; }
.cc-pop-head h2 { font-size: 1.2rem; font-weight: 700; }
.cc-pop-body { padding: 4px 20px 16px; overflow-y: auto; }
.cc-pop-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px 16px; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.lead { color: var(--ink2); margin: 0 0 12px; }
.choice { display: grid; gap: 10px; }
.choice-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: 1px solid var(--line); background: var(--surface2); border-radius: 16px; padding: 16px; cursor: pointer; }
.choice-btn:hover { border-color: var(--accent); } .choice-btn .ic { color: var(--accent); } .choice-btn span { color: var(--muted); font-size: .86rem; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-i { border: 1px solid var(--line2); background: var(--surface2); border-radius: 16px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; font-size: .8rem; cursor: pointer; position: relative; }
.more-i.on { border-color: var(--accent); color: var(--accent); } .more-i .badge { position: absolute; top: 6px; right: 8px; }
.tour { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; } .tour b { display: inline-flex; gap: 6px; align-items: center; }
.hist { margin-top: 12px; background: var(--surface2); border-radius: 12px; padding: 10px 14px; } .hist ul { margin: 6px 0 0; padding-left: 18px; font-size: .84rem; }

/* ---------- forms ---------- */
.cc-form { display: flex; flex-wrap: wrap; gap: 12px 14px; }
.field { flex: 1 1 100%; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.half { flex: 1 1 calc(50% - 7px); min-width: 200px; }
.field.third { flex-basis: calc(33% - 10px); min-width: 140px; }
.field label { font-size: .78rem; font-weight: 600; color: var(--ink2); }
.req { color: var(--red); font-style: normal; }
.f-sec { flex: 1 1 100%; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--taupe); margin-top: 6px; border-top: 1px solid var(--line2); padding-top: 12px; }
.f-sec:first-child { border: 0; padding-top: 0; margin-top: 0; }
.field input:not([type=checkbox]):not([type=color]), .field textarea, .field select, .items input, #apOut input, .cc-pop .field input { width: 100%; border: 1px solid var(--line); background: var(--surface2); border-radius: 12px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px; }
.field input:focus, .field textarea:focus, .field select:focus, .items input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.field textarea { resize: vertical; }
.field input[type=color] { width: 64px; height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: var(--surface2); }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--red); }
.err-msg { color: var(--red); font-size: .76rem; font-weight: 600; min-height: 0; }
.field:not(.bad) .err-msg { display: none; }
.affix { display: flex; align-items: center; border: 1px solid var(--line); background: var(--surface2); border-radius: 12px; overflow: hidden; }
.affix span { padding: 0 10px; color: var(--muted); font-weight: 600; } .affix input { border: 0 !important; box-shadow: none !important; background: transparent !important; }
.chips-in { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { cursor: pointer; } .chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); font-size: .82rem; font-weight: 600; }
.chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; font-size: .88rem; padding-top: 22px; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.items { flex: 1 1 100%; margin-top: 14px; border-top: 1px solid var(--line2); padding-top: 12px; }
.item-row { display: grid; grid-template-columns: 1fr 80px 110px 30px; gap: 8px; margin-bottom: 8px; align-items: center; }
.inv-total { text-align: right; font-size: 1.05rem; margin: 8px 0 0; } .inv-total b { font-size: 1.25rem; }
.logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.logo-prev { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: var(--surface2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.settings .card > .btn { margin-top: 14px; }

/* ---------- toast ---------- */
.cc-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
.cc-toast.show { opacity: 1; transform: translate(-50%, 0); }
.cc-toast.err { background: var(--red); }

/* ---------- welcome / add to home screen ---------- */
.a2hs { position: fixed; inset: 0; z-index: 60; background: linear-gradient(180deg, rgb(111 127 98 / .45), rgb(46 45 43 / .72)); display: grid; place-items: center; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.a2hs-card { background: var(--surface); color: var(--ink); width: 100%; max-width: 440px; border-radius: 28px; padding: 26px 22px 20px; text-align: center; box-shadow: var(--shadow-lg); overflow: hidden; }
.a2hs-hero { width: calc(100% + 44px); margin: -26px -22px 14px; height: 150px; object-fit: cover; display: block; }
.a2hs-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 10px 24px rgb(46 45 43 / .18); }
.a2hs-hero + .a2hs-icon { margin-top: -58px; border: 4px solid var(--surface); }
.a2hs h2 { font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.15; margin: 14px 0 8px; }
.a2hs-card > p { margin: 0 0 14px; color: var(--muted); }
.a2hs-steps { text-align: left; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: a; display: grid; gap: 10px; }
.a2hs-steps li { counter-increment: a; position: relative; padding: 10px 12px 10px 48px; background: var(--surface2); border-radius: 14px; font-weight: 500; font-size: .9rem; }
.a2hs-steps li::before { content: counter(a); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.a2hs-steps svg { vertical-align: -3px; color: var(--accent); }
.a2hs-go { width: 100%; margin-bottom: 14px; padding: 14px; font-size: 1.02rem; }
.a2hs-skip { width: 100%; background: transparent; border: 0; color: var(--accent); }

/* ---------- client review page (guest) ---------- */
body.guest { background: var(--bg); }
.review { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; display: flex; flex-direction: column; gap: 14px; }
.rv-head h1 { font-size: 1.7rem; font-weight: 800; margin: 2px 0 6px; } .rv-head p { color: var(--muted); margin: 0; }
.rv-count { font-weight: 700; color: var(--accent) !important; margin-top: 8px !important; }
.rv-card { background: var(--surface); border: 1px solid var(--line2); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.rv-card.approved { border-color: var(--sage); } .rv-card.revise { border-color: var(--rose); } .rv-card.rejected { border-color: var(--red); }
.rv-card h2 { font-size: 1.15rem; } .rv-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); }
.rv-card .cap { white-space: pre-wrap; margin: 0; } .rv-card .tags { color: var(--blue); margin: 0; font-size: .86rem; }
.rv-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; } .rv-btns .btn { white-space: normal; padding: 10px 8px; }
.rv-fb { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .84rem; } .rv-fb textarea { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface2); }
.rv-foot { position: sticky; bottom: 12px; background: var(--surface); padding: 12px; border-radius: 18px; box-shadow: var(--shadow-lg); }
.rv-foot .hint { text-align: center; }

/* ---------- tablet / phone ---------- */
@media (max-width: 1080px) { :root { --side: 214px; } #view { padding: 4px 20px 40px; } .topbar { padding: 12px 20px; } }
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .side { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: rgb(245 240 232 / .94); border-bottom-color: var(--line2); }
  .tb-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .only-phone { display: inline-grid; }
  #view { padding: 4px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .dock { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgb(255 255 255 / .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .dk { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .66rem; font-weight: 600; color: var(--muted); padding: 4px 0; cursor: pointer; position: relative; }
  .dk.on { color: var(--accent); }
  .dk .badge { position: absolute; top: 0; right: calc(50% - 22px); min-width: 17px; height: 17px; font-size: .62rem; }
  .page-h h1 { font-size: 1.5rem; } .page-h.hero h1 { font-size: 1.65rem; }
  .page-btns { width: 100%; } .page-btns .btn { flex: 1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; } .kpi-v { font-size: 1.3rem; } .kpi-ic { width: 30px; height: 30px; margin-bottom: 4px; }
  .dash, .grid2 { grid-template-columns: 1fr; }
  .dash .attn { grid-row: auto; }
  .card { padding: 14px; border-radius: 16px; }
  .cc-pop { padding: 0; place-items: end stretch; }
  .cc-pop-card, .cc-pop.wide .cc-pop-card, .cc-pop.small .cc-pop-card { max-width: none; border-radius: 22px 22px 0 0; max-height: 94vh; transform: translateY(30px); }
  .cc-pop-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .cc-pop-foot .btn { flex: 1; }
  .field.half, .field.third { flex-basis: 100%; min-width: 0; }
  /* tables become cards */
  .tbl-wrap { border: 0; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 8px 12px; margin-bottom: 8px; }
  .tbl td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; align-items: center; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: .74rem; font-weight: 600; text-align: left; flex: none; }
  .tbl td:first-child { text-align: left; display: block; font-size: .95rem; } .tbl td:first-child::before { display: none; }
  .tbl td[data-label=""]::before { display: none; }
  .tbl td.num { text-align: right; }
  .tbl tr.bad td:first-child, .tbl tr.warn td:first-child { box-shadow: none; } .tbl tr.bad { border-left: 4px solid var(--red); } .tbl tr.warn { border-left: 4px solid var(--amber); }
  .search { max-width: none; flex-basis: 100%; }
  .tbl-tools select { flex: 1; }
  .cal-tools { flex-direction: column; align-items: stretch; } .cal-tools .filters select { flex: 1; }
  .cal-d { min-height: 64px; padding: 4px 2px; } .cal-d .pc .tt, .cal-d .pc .tm { display: none; } .cal-d .pc { width: auto; padding: 3px; background: none !important; display: inline-flex; } .cal-d .pc i { width: 8px; height: 8px; }
  .cal-d { flex-direction: row; flex-wrap: wrap; align-content: flex-start; } .cal-d .dn { width: 100%; text-align: center; } .cal-d.today .dn { align-self: center; width: auto; margin: 0 auto; }
  .cal-week { grid-template-columns: 1fr; } .cw-col { min-height: 0; }
  .kanban { grid-auto-columns: 82%; }
  .item-row { grid-template-columns: 1fr 64px 90px 30px; }
  .more-grid { grid-template-columns: repeat(3, 1fr); }
  .camps li { grid-template-columns: 1fr auto; } .camps .prog { grid-column: 1 / -1; max-width: none; order: 3; }
  .hb { grid-template-columns: 96px 1fr auto; }
  .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; } .seg button { flex: none; }
  .cc-toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- print ---------- */
@media print {
  body.printing > *:not(.cc-pop.printable) { display: none !important; }
  body.printing .cc-pop.printable { position: static; background: none; padding: 0; display: block; opacity: 1; }
  body.printing .cc-pop-card { box-shadow: none; max-height: none; max-width: none; border-radius: 0; transform: none; }
  body.printing .cc-pop-head, body.printing .cc-pop-foot, body.printing .no-print { display: none !important; }
  body.printing .cc-pop-body { overflow: visible; padding: 0; }
  .tbl tr { break-inside: avoid; }
  @page { margin: 14mm; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.icon-btn.only-phone { display: none; }
@media (max-width: 760px) { .icon-btn.only-phone { display: inline-grid; } }

/* illustrated icons (module art) */
.art-ic { display: block; flex: none; object-fit: contain; }
.kpi-ic:has(.art-ic) { background: none; width: 38px; height: 38px; }
.kpi.alert .kpi-ic:has(.art-ic) { background: none; }
.nav-i .art-ic { margin: -3px 0; }
.icon-btn .art-ic { width: 28px; height: 28px; }

/* free demo build */
.demo-bar { background: var(--ink, #2E2D2B); color: #fff; padding: 8px 16px; display: flex; gap: 10px 14px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; font-weight: 500; text-align: center; }
.demo-bar a { background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.btn.block { display: flex; width: 100%; }
a.btn { text-decoration: none; }
@media print { .demo-bar { display: none !important; } }
.demo-bar .only-narrow { display: none; }
@media (max-width: 760px) { .demo-bar { padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px; justify-content: space-between; flex-wrap: nowrap; } .demo-bar .only-wide { display: none; } .demo-bar .only-narrow { display: inline; } .demo-bar a { padding: 5px 12px; } }
