:root {
  --brand: #579FCD; --brand-dark: #3D86B8; --navy: #233556; --ink: #323338; --ink-2: #676879; --ink-3: #9699A6;
  --bg: #F6F7FB; --surface: #FFFFFF; --line: #D0D4E4; --line-2: #E6E9EF; --hover: #F0F3FF; --selected: #CCE5FF;
  --primary: #0073EA; --primary-hover: #0060B9;
  --green: #00C875; --green-dark: #037F4C; --orange: #FDAB3D; --red: #E2445C; --purple: #A25DDC; --blue: #579BFC;
  --dark-blue: #0086C0; --grey: #C4C4C4; --dark-grey: #808080; --teal: #00D1D1; --pink: #FF158A; --lime: #9CD326;
  --radius: 8px; --shadow: 0 4px 12px rgba(0,0,0,.08); --shadow-lg: 0 10px 40px rgba(0,0,0,.18);
  --font: "Figtree", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; }
button, input, select, textarea { font-family: inherit; font-size: 13px; color: var(--ink); }
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #C3C6D4; border-radius: 8px; border: 2px solid var(--bg); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 236px 1fr; grid-template-rows: 48px 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.topbar .logo { height: 30px; }
.topbar .product { font-weight: 700; color: var(--navy); font-size: 15px; padding-left: 14px; border-left: 1px solid var(--line); }
.topbar .product span { color: var(--ink-3); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .asof { color: var(--ink-2); font-size: 12px; }
.userpick { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 20px; padding: 3px 10px 3px 3px; cursor: pointer; }
.userpick select { border: none; background: transparent; font-weight: 600; cursor: pointer; outline: none; max-width: 200px; }
.rolechip { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--selected); color: var(--primary-hover); font-weight: 600; }

.sidebar { background: var(--surface); border-right: 1px solid var(--line-2); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.sidebar .ws { display: flex; align-items: center; gap: 10px; padding: 10px 10px 14px; font-weight: 700; color: var(--navy); }
.sidebar .ws .wsicon { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--navy)); color: #fff; display: grid; place-items: center; font-size: 13px; }
.sidebar .sec { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 12px 12px 4px; }
.navitem { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; cursor: pointer; color: var(--ink); font-weight: 500; }
.navitem:hover { background: var(--hover); }
.navitem.active { background: var(--selected); color: var(--primary-hover); font-weight: 700; }
.navitem .ico { width: 18px; text-align: center; font-size: 14px; }
.navitem .cnt { margin-left: auto; font-size: 11px; background: var(--line-2); border-radius: 10px; padding: 1px 7px; color: var(--ink-2); font-weight: 600; }
.navitem.active .cnt { background: #fff; }
.navitem .dot { width: 10px; height: 10px; border-radius: 3px; }
.navitem .cnt.hot { background: var(--pink); color: #fff; }
.rdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
table.replies td { white-space: normal; vertical-align: top; padding-top: 9px; }
table.replies td.action { font-size: 12px; color: var(--ink-2); min-width: 260px; }
.quick .cnt { font-size: 10px; background: var(--line-2); border-radius: 8px; padding: 0 5px; margin-left: 3px; }
.sidebar .foot { margin-top: auto; padding: 10px 12px; font-size: 11px; color: var(--ink-3); line-height: 1.5; }

.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.boardhead { padding: 14px 24px 0; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.boardhead h1 { margin: 0; font-size: 24px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.boardhead .sub { color: var(--ink-2); font-size: 13px; margin: 4px 0 10px; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 8px 14px; border-radius: 6px 6px 0 0; cursor: pointer; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; }
.tab:hover { background: var(--hover); color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: transparent; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.outline { border-color: var(--line); background: var(--surface); }
.btn.danger { background: var(--red); color: #fff; }
.btn.success { background: var(--green); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; background: var(--surface); min-width: 220px; }
.search input { border: none; outline: none; width: 100%; background: transparent; }
.toolbar select, .filters select, .filters input { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.content { overflow: auto; padding: 16px 24px 60px; flex: 1; }

/* ---- board groups ---- */
.group { margin-bottom: 26px; }
.grouphead { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; user-select: none; }
.grouphead .chev { width: 18px; color: var(--ink-3); transition: transform .15s; }
.group.collapsed .grouphead .chev { transform: rotate(-90deg); }
.grouphead h3 { margin: 0; font-size: 16px; font-weight: 600; }
.grouphead .n { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.grouphead .desc { color: var(--ink-3); font-size: 12px; margin-left: 4px; }
.group.collapsed .tblwrap { display: none; }
.tblwrap { background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.04); border: 1px solid var(--line-2); overflow: auto; }
table.board { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1240px; }
table.board th { position: sticky; top: 0; background: var(--surface); z-index: 2; font-weight: 500; color: var(--ink-2); font-size: 12px; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); white-space: nowrap; }
table.board td { padding: 0 10px; height: 38px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
table.board tr:hover td { background: var(--hover); }
table.board td:first-child, table.board th:first-child { border-left: 6px solid var(--gcolor, var(--brand)); position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.board tr:hover td:first-child { background: var(--hover); }
table.board td.item { font-weight: 600; cursor: pointer; min-width: 240px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
table.board td.item .rid { color: var(--ink-3); font-weight: 400; font-size: 11px; margin-left: 6px; }
table.board td.status { padding: 0; text-align: center; min-width: 128px; }
table.board td.num { text-align: center; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; color: #fff; min-width: 100px; text-align: center; }
.cellstatus { display: flex; align-items: center; justify-content: center; height: 38px; color: #fff; font-weight: 600; font-size: 12px; }
.prio { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; }
.prio i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.prio.Stat { color: var(--red); } .prio.Stat i { background: var(--red); }
.prio.Urgent { color: #D9891A; } .prio.Urgent i { background: var(--orange); }
.prio.Routine { color: var(--ink-2); } .prio.Routine i { background: var(--blue); }
td.provider { line-height: 1.15; }
.provname { display: block; font-weight: 600; font-size: 12.5px; color: var(--navy); }
.provfirst { display: block; font-size: 11px; color: var(--ink-3); }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--brand-dark); }
.dots i.max { background: var(--purple); }
.touch { font-size: 10px; color: var(--dark-blue); margin-left: 4px; white-space: nowrap; }
.ev.ecw_touch .t { color: var(--ink-2); font-weight: 500; }
.datepill { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); }
.datepill.overdue { background: #FDE2E6; color: var(--red); }
.datepill.today { background: #FFF1DC; color: #C77700; }
.datepill.future { background: #E0F5EA; color: var(--green-dark); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; background: var(--brand); vertical-align: middle; }
.avatar.empty { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: var(--line-2); color: var(--ink-2); font-weight: 600; }
.chip.office { color: #fff; }
.smschip { font-size: 11px; font-weight: 600; }
.loadmore { text-align: center; padding: 10px; }
.empty { padding: 30px; text-align: center; color: var(--ink-3); }

/* ---- drawer ---- */
.overlay { position: fixed; inset: 0; background: rgba(41,47,76,.45); display: none; z-index: 20; }
.overlay.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(1080px, 94vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 21; transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.dhead { padding: 18px 26px 0; border-bottom: 1px solid var(--line-2); }
.dhead .top { display: flex; align-items: flex-start; gap: 14px; }
.dhead h2 { margin: 0; font-size: 22px; font-weight: 600; }
.dhead .meta { color: var(--ink-2); font-size: 13px; margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.dhead .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.dhead .x { font-size: 20px; color: var(--ink-3); cursor: pointer; padding: 2px 8px; }
.dhead .x:hover { color: var(--ink); }
.dtabs { display: flex; gap: 2px; margin-top: 12px; }
.dbody { display: grid; grid-template-columns: 1fr 320px; flex: 1; min-height: 0; }
.dmain { overflow: auto; padding: 20px 26px 60px; }
.dside { border-left: 1px solid var(--line-2); padding: 18px; overflow: auto; background: #FBFBFD; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; }
.kv .k { color: var(--ink-3); }
.dside h4 { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.stat .v { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 11px; color: var(--ink-2); }

/* ---- phases ---- */
.phases { display: flex; align-items: stretch; margin: 6px 0 18px; }
.phase { flex: 1; position: relative; padding: 10px 12px 8px 22px; background: var(--line-2); color: var(--ink-3); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%); margin-right: -6px; min-height: 58px; }
.phase:first-child { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); padding-left: 12px; border-radius: 6px 0 0 6px; }
.phase.reached { background: #DCEBF7; color: var(--navy); }
.phase.current { background: var(--brand); color: #fff; }
.phase.done { background: var(--green-dark); color: #fff; }
.phase.closedp { background: var(--dark-grey); color: #fff; }
.phase .pn { font-weight: 700; font-size: 12px; }
.phase .pd { font-size: 11px; opacity: .9; }
.phase .pdays { font-size: 11px; font-weight: 600; opacity: .95; }

/* ---- SOW overlay ---- */
.sow { background: var(--bg); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; }
.sow h4 { margin: 0 0 6px; font-size: 13px; }
.sow .legend { font-size: 11px; color: var(--ink-2); display: flex; gap: 14px; margin-bottom: 6px; }
.sow .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.sow svg { width: 100%; height: 86px; display: block; }
.sowtbl { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sowtbl .s { font-size: 11px; padding: 3px 8px; border-radius: 10px; background: #fff; border: 1px solid var(--line-2); }
.sowtbl .s.done { border-color: var(--green); color: var(--green-dark); }
.sowtbl .s.missed { border-color: var(--red); color: var(--red); }
.sowtbl .s.planned { color: var(--ink-2); }
.sowtbl .s.na { opacity: .5; }

/* ---- event stream ---- */
.stream { position: relative; padding-left: 26px; }
.stream:before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.ev { position: relative; padding: 6px 10px 6px 10px; margin-bottom: 4px; border-radius: 6px; }
.ev:hover { background: var(--hover); }
.ev .dot { position: absolute; left: -22px; top: 10px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--line); background: var(--grey); }
.ev.ecw .dot { background: var(--blue); } .ev.ecw_touch .dot { background: var(--dark-blue); } .ev.ecw_view .dot { background: var(--grey); }
.ev.staff .dot { background: var(--green); } .ev.sms .dot { background: var(--purple); } .ev.change .dot { background: var(--orange); }
.ev.ecw_note .dot { background: var(--teal); }
.ev.ecw_note .d { white-space: pre-wrap; color: var(--ink); background: #F0FBFB; border-left: 3px solid var(--teal); padding: 4px 8px; border-radius: 4px; margin-top: 3px; }
.chip.dx { background: #E3F1FA; color: #0B5C8E; font-family: Consolas, monospace; font-weight: 700; }
.notes .note { border-left: 3px solid var(--teal); background: #F0FBFB; border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; }
.notes .nh { font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.notes .nt { font-size: 12px; white-space: pre-wrap; }
.ev .t { font-weight: 600; font-size: 13px; }
.ev .d { font-size: 12px; color: var(--ink-2); }
.ev .w { font-size: 11px; color: var(--ink-3); }
.ev .day { font-size: 10px; color: var(--ink-3); background: var(--line-2); border-radius: 8px; padding: 1px 6px; margin-left: 6px; }
.ev.attempt .t:after { content: "attempt"; font-size: 10px; color: var(--dark-blue); background: #E3F1FA; padding: 1px 6px; border-radius: 8px; margin-left: 6px; font-weight: 600; }
.daysep { font-size: 11px; color: var(--ink-3); margin: 12px 0 4px; font-weight: 600; }
.stream.hideviews .ev.ecw_view { display: none; }

/* ---- forms ---- */
.form { background: var(--bg); border-radius: 8px; padding: 14px; margin-bottom: 18px; }
.form h4 { margin: 0 0 10px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.field label { display: block; font-size: 11px; color: var(--ink-2); margin-bottom: 3px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; background: #fff; }
.field textarea { min-height: 54px; resize: vertical; }
.form .row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.rulebox { font-size: 12px; padding: 8px 10px; border-radius: 6px; background: #FFF4E5; color: #8A5A00; margin-top: 8px; }
.rulebox.ok { background: #E0F5EA; color: var(--green-dark); }
.rulebox.bad { background: #FDE2E6; color: var(--red); }
.fulist .fu { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.fulist .fu .h { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.fulist .fu .b { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12px; margin-top: 6px; }
.fulist .fu .b span { color: var(--ink-3); }
.simreply { display: flex; gap: 6px; flex-wrap: wrap; }
.simreply .btn { border: 1px solid var(--line); }
.smsbox { background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; font-size: 12px; color: var(--ink-2); white-space: pre-wrap; }

/* ---- dashboard slicers ---- */
.slicers { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; margin-bottom: 14px; }
.slicer { background: var(--surface); border-radius: 10px; padding: 12px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.slabel { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.daterow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.daterow input { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.mslider { position: relative; height: 26px; margin: 4px 4px 0; }
.mslider .track { position: absolute; top: 11px; left: 0; right: 0; height: 4px; background: var(--line); border-radius: 2px; }
.mslider .fill { position: absolute; top: 11px; height: 4px; background: var(--primary); border-radius: 2px; }
.mslider input[type=range] { position: absolute; left: 0; right: 0; top: 0; width: 100%; margin: 0; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; height: 26px; }
.mslider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; margin-top: 5px; }
.mslider input[type=range]::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.mlabels { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin: 0 2px 6px; }
.mlabels #mRange { color: var(--primary); font-weight: 700; }
.presets { display: flex; gap: 5px; flex-wrap: wrap; }
.presets .btn, .srow select { border: 1px solid var(--line); background: #fff; font-size: 12px; }
.presets .btn.on { background: var(--selected); border-color: var(--primary); color: var(--primary-hover); }
.srow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.srow select { border-radius: 6px; padding: 5px 8px; max-width: 220px; }
.active { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 26px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; background: var(--selected); color: var(--primary-hover); border-radius: 12px; padding: 3px 8px 3px 10px; font-size: 12px; font-weight: 600; }
.fchip b { cursor: pointer; font-size: 14px; line-height: 1; }
/* ---- dashboard ---- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpis.seven { grid-template-columns: 1.15fr repeat(6, 1fr); }
.kpi.total { background: linear-gradient(160deg, #FFFFFF, #EEF4FA); }
.kpi.total .v { color: var(--navy); }
.kpi { background: var(--surface); border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); border-top: 4px solid var(--kc, var(--brand)); }
.kpi .v { font-size: 28px; font-weight: 700; }
.kpi .l { font-size: 12px; color: var(--ink-2); }
.kpi .s { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.charts { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.card { background: var(--surface); border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.card .hint { font-size: 11px; color: var(--ink-3); margin-bottom: 6px; }
.card canvas { max-height: 260px; }
.span3 { grid-column: span 3; } .span4 { grid-column: span 4; } .span6 { grid-column: span 6; } .span8 { grid-column: span 8; } .span12 { grid-column: span 12; }

/* ---- audit ---- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .quick { display: flex; gap: 6px; flex-wrap: wrap; }
.filters .quick .btn { border: 1px solid var(--line); background: #fff; font-size: 12px; }
.filters .quick .btn.on { background: var(--selected); border-color: var(--primary); color: var(--primary-hover); }
table.plain { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 8px; overflow: hidden; }
table.plain th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line-2); background: var(--surface); position: sticky; top: 0; }
table.plain td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); font-size: 13px; white-space: nowrap; }
table.plain tr:hover td { background: var(--hover); cursor: pointer; }

/* ---- demo mode ---- */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 36px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .knob { left: 18px; }
body.demo .switch { color: var(--green-dark); }
body.demo [data-demo-hl] { outline: 1px dashed rgba(0,115,234,.35); outline-offset: 2px; }
.tipbox { position: fixed; z-index: 60; max-width: 320px; background: #1F2933; color: #fff; border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow-lg); font-size: 12.5px; line-height: 1.45; pointer-events: none; opacity: 0; transition: opacity .12s; }
.tipbox.show { opacity: 1; }
.tipbox .tt { font-weight: 700; font-size: 13px; margin-bottom: 3px; color: #9FD3FF; }
.tipbox .tk { font-size: 10px; color: #A3ACB9; margin-top: 6px; text-transform: uppercase; letter-spacing: .4px; }
.tour-spot { position: fixed; z-index: 70; border-radius: 10px; box-shadow: 0 0 0 4px rgba(0,115,234,.6), 0 0 0 9999px rgba(20,25,40,.62); pointer-events: none; transition: all .25s ease; }
.tour-card { position: fixed; z-index: 71; width: 380px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 16px 18px; }
.tour-card .step { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.tour-card h4 { margin: 4px 0 6px; font-size: 16px; }
.tour-card p { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.tour-card .row { display: flex; gap: 6px; align-items: center; }
.tour-card .row .spacer { flex: 1; }
.tour-card .dots { gap: 4px; }
.tour-card .dots i { width: 7px; height: 7px; }
/* ---- upload + validation report ---- */
.uprow { display: flex; gap: 10px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.uprow input[type=file] { font-size: 12px; }
.report { border-radius: 10px; padding: 12px 14px; margin-top: 8px; border: 1px solid var(--line-2); background: var(--bg); }
.report.ok { border-color: var(--green); } .report.warn { border-color: var(--orange); } .report.error { border-color: var(--red); }
.report .rhead { font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.report .verdict { margin-left: auto; font-weight: 700; }
.report.ok .verdict { color: var(--green-dark); } .report.warn .verdict { color: #C77700; } .report.error .verdict { color: var(--red); }
.checks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.checks li { font-size: 12.5px; display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; border-radius: 6px; background: #fff; }
.checks li .ic { width: 16px; text-align: center; font-weight: 700; }
.checks li.ok .ic { color: var(--green-dark); } .checks li.warn .ic { color: #C77700; } .checks li.error .ic { color: var(--red); }
.checks li.error { background: #FDE2E6; } .checks li.warn { background: #FFF4E5; }
.preview { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.preview b { color: var(--ink); font-size: 15px; margin-right: 4px; }
/* ---- users ---- */
.users-grid { display: grid; grid-template-columns: 380px 1fr; gap: 14px; align-items: start; }
.roles .role { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: start; font-size: 12px; color: var(--ink-2); padding: 6px 0; border-top: 1px solid var(--line-2); }
table.users td { vertical-align: middle; }
table.users select, table.users input { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 12px; background: #fff; }
table.users tr.inactive td { opacity: .55; }
table.users tr:hover td { cursor: default; }
/* ---- login ---- */
.login { position: fixed; inset: 0; z-index: 80; background: linear-gradient(160deg, #EEF4FA, #DCEBF7); display: grid; place-items: center; }
.loginbox { width: 360px; background: #fff; border-radius: 14px; padding: 28px 30px; box-shadow: var(--shadow-lg); text-align: center; }
.loginbox h2 { margin: 4px 0 2px; font-size: 18px; color: var(--navy); }
.loginbox .field { text-align: left; margin-top: 10px; }
.loginbox .lerr { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 6px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 500; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.err { background: var(--red); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.mono { font-family: Consolas, monospace; font-size: 12px; }

@media print {
  .sidebar, .topbar, .boardhead, .toolbar, .overlay, .dhead .actions, .dtabs, .form, .simreply { display: none !important; }
  .drawer { position: static; width: 100%; transform: none; box-shadow: none; height: auto; }
  .dbody { grid-template-columns: 1fr; }
  .dside { border: none; }
}

.orphans { border: 1px solid #F6D6DD; background: #FFF7F9; border-radius: 10px; padding: 10px 12px 4px; margin: 4px 0 14px; }
.orphans .ohead { font-weight: 700; font-size: 13px; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
