/* TeraByteCyber Suite. Colours come from the logo (navy + cyan); amber only means "needs you". */
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --navy: #0B3C6E; --cyan: #14A3C7; --cyan-s: #E2F5FA; --link: #0D7E9C;
  --bg: #F3F6FB; --sf: #fff; --sf2: #F8FAFD; --ink: #0F1E2E; --ink2: #4C5F76; --ink3: #6F8097; --line: #E4EAF2;
  --amber: #E8981F; --amber-s: #FEF3DF; --amber-t: #96600A; --red: #C93C3C; --red-s: #FDECEC; --green: #16855A; --green-s: #E1F6EE;
  --vio: #5B4BD6; --vio-s: #EEECFD; --nv-s: #E4ECF6; --nv-t: #0B3C6E; --primary: #0B3C6E; --on-primary: #fff;
  --sh: 0 1px 2px rgba(16, 40, 72, .05), 0 8px 24px rgba(16, 40, 72, .05); --tree: #C9D5E4;
  --r: 16px; --r-sm: 12px; --rail: linear-gradient(180deg, #0B3C6E, #082C52); font-size: 15px; color-scheme: light;
}
[data-theme=dark] {
  --bg: #0C1522; --sf: #141F2F; --sf2: #1A2739; --ink: #EAF0F7; --ink2: #A9B8CA; --ink3: #8797AB; --line: #25344A;
  --cyan-s: #12394A; --link: #6FD0E8; --amber-s: #3E2F14; --amber-t: #F4BE66; --red: #F07A7A; --red-s: #43211F; --green: #5AD2A0; --green-s: #123A2C;
  --vio: #B1A8F5; --vio-s: #2A2653; --nv-s: #1C3451; --nv-t: #9CC2EA; --primary: #14A3C7; --on-primary: #04202B; --sh: 0 1px 2px rgba(0, 0, 0, .3); --tree: #34465F;
  --rail: linear-gradient(180deg, #0F2238, #0A1626); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.75 Vazirmatn, Tahoma, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
h1, h2, h3, h4, p { margin: 0; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.muted { color: var(--ink3); } .small { font-size: .85rem; } .grow { flex: 1; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* shell */
.shell { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 100vh; }
.shell.anon { grid-template-columns: minmax(0, 1fr); }
.rail { background: var(--rail); color: #BFD2E6; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 0 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20; }
.rail .logo { width: 48px; height: 48px; background: #fff; border-radius: 15px; display: grid; place-items: center; margin-bottom: 12px; flex: none; }
.rail form { margin: 0; }
.ri { position: relative; width: 72px; padding: 8px 2px 6px; border: 0; border-radius: 14px; background: none; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font: inherit; font-size: .72rem; line-height: 1.4; text-align: center; text-decoration: none; }
.ri .icon { width: 22px; height: 22px; }
a.ri:hover, button.ri:hover { background: rgba(255, 255, 255, .08); }
.ri.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; }
.ri.on::before { content: ''; position: absolute; inset-inline-start: -8px; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--cyan); }
.badge-n { position: absolute; top: 2px; inset-inline-end: 12px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--amber); color: #231500; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #14A3C7, #2F7DE1); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; }
.me { width: 72px; display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 6px; font-size: .7rem; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 68px; padding: 0 28px; display: flex; align-items: center; gap: 12px; background: var(--sf); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top h1 { font-size: 1.2rem; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--nv-t); text-decoration: none; }
.lang { margin: 0; }
.lang select { height: 42px; padding: 0 10px; border: 0; border-radius: 13px; background: var(--bg); font-weight: 500; font-size: .87rem; }
.icon-btn { width: 42px; height: 42px; border: 0; border-radius: 13px; background: var(--bg); color: var(--ink2); display: grid; place-items: center; cursor: pointer; flex: none; }
.menu-btn { display: none; }
.content { flex: 1; min-width: 0; padding: 24px 28px 36px; }
.subnav { display: flex; gap: 6px; padding: 12px 28px 0; overflow-x: auto; scrollbar-width: none; }
.subnav a, .tabs a { height: 38px; padding: 0 13px; border-radius: 12px; display: flex; align-items: center; gap: 7px; color: var(--ink2); font-weight: 500; font-size: .87rem; text-decoration: none; white-space: nowrap; }
.subnav a .icon, .tabs a .icon { width: 18px; height: 18px; }
.subnav a.on, .tabs a.on { background: var(--primary); color: var(--on-primary); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tabs .n { min-width: 22px; padding: 0 7px; border-radius: 99px; background: rgba(127, 140, 160, .2); font-size: .74rem; text-align: center; }
.tabs a.on .n { background: rgba(255, 255, 255, .22); }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px; font-size: .8rem; color: var(--ink3); }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.scrim, .tabbar { display: none; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--sf); color: var(--ink); font-size: .87rem; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { border-color: var(--ink3); }
.btn .icon { width: 17px; height: 17px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.white { background: #fff; border-color: #fff; color: #0B3C6E; }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=email], select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sf); }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px var(--cyan-s); }
textarea { min-height: 96px; resize: vertical; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: .85rem; color: var(--ink2); }
.check { display: inline-flex; align-items: center; gap: 8px; }
.buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-row > input, .inline-row > select { flex: 1 1 180px; width: auto; }
.errors { list-style: none; margin: 0; padding: 0; color: var(--red); font-size: .9rem; }
.msgs { list-style: none; margin: 0 0 14px; padding: 0; }
.flash { padding: 10px 16px; border-radius: 12px; }
.flash.ok { background: var(--green-s); color: var(--green); }
.flash.error { background: var(--red-s); color: var(--red); }
dialog { width: min(480px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sf); color: var(--ink); }
dialog::backdrop { background: rgba(8, 24, 44, .45); }
dialog h3 { font-size: 1.05rem; margin-bottom: 12px; }

/* surfaces */
.panel { background: var(--sf); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.panel > header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel > header h3 { font-size: 1rem; font-weight: 700; }
.panel > .body, .panel > form.form { padding: 18px; }
.empty { padding: 36px 16px; text-align: center; color: var(--ink3); }
.lead { color: var(--ink2); margin-bottom: 14px; }
.sec-title { display: flex; align-items: center; font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 99px; background: var(--line); color: var(--ink2); font-size: .77rem; font-weight: 500; white-space: nowrap; }
.pill.s-new { background: var(--amber-s); color: var(--amber-t); }
.pill.s-open { background: var(--cyan-s); color: var(--link); }
.pill.s-hold { background: var(--vio-s); color: var(--vio); }
.pill.s-awaiting { background: var(--nv-s); color: var(--nv-t); }
.pill.s-done, .pill.s-closed { background: var(--green-s); color: var(--green); }
.pill.late { background: var(--red-s); color: var(--red); }
.overdue { color: var(--red); font-weight: 700; }
.glyph { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--nv-s); color: var(--nv-t); }
.glyph .icon { width: 23px; height: 23px; }
.glyph.cy { background: var(--cyan-s); color: var(--link); }
.glyph.nv { background: var(--nv-s); color: var(--nv-t); }
.glyph.vi { background: var(--vio-s); color: var(--vio); }
.glyph.gr { background: var(--green-s); color: var(--green); }
.glyph.am { background: var(--amber-s); color: var(--amber-t); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: .8rem; font-weight: 500; color: var(--ink3); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chips a { padding: 2px 12px; border-radius: 99px; background: var(--line); color: var(--ink2); font-size: .85rem; text-decoration: none; }
.chips a.on { background: var(--primary); color: var(--on-primary); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--sf2); }
form > .actions { border-bottom: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }

/* home */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 22px; align-items: start; }
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 24px 28px; border-radius: 22px; color: #fff; background: radial-gradient(600px 240px at 12% 0, rgba(20, 163, 199, .55), transparent 70%), linear-gradient(120deg, #0B3C6E, #123F78 60%, #0A3360); }
.hero h2 { font-size: 1.55rem; font-weight: 700; }
.hero p { color: #C4D6E9; }
.hero .stats { display: flex; gap: 10px; }
.stat { min-width: 108px; padding: 10px 18px; border-radius: 15px; background: rgba(255, 255, 255, .11); }
.stat b { display: block; font-size: 1.65rem; line-height: 1.4; }
.stat span { font-size: .8rem; color: #CFDDEC; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.app-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; color: inherit; text-decoration: none; font-weight: 700; }
a.app-card:hover, a.tile:hover { border-color: var(--cyan); }
.app-card small { display: block; font-size: .77rem; font-weight: 400; line-height: 1.5; color: var(--ink3); }
.app-card .badge-n { top: 10px; inset-inline-end: 10px; }
.line { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.line:last-child { border-bottom: 0; }
a.line:hover { background: var(--sf2); }
.line .txt { flex: 1; min-width: 0; }
.line .t, .item .t { display: block; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.line .sub { display: block; font-size: .8rem; color: var(--ink3); }

/* new ticket */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.steps { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--ink3); font-weight: 500; font-size: .87rem; white-space: nowrap; }
.step i { width: 28px; height: 28px; border-radius: 50%; background: var(--line); color: var(--ink2); font-style: normal; font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.step.on { color: var(--ink); }
.step.on i { background: var(--primary); color: var(--on-primary); }
.step-bar { flex: 0 1 60px; height: 2px; background: var(--line); }
.page-title { font-size: 1.6rem; font-weight: 700; }
.search-box { position: relative; margin-bottom: 18px; }
.search-box .icon { position: absolute; top: 18px; inset-inline-start: 18px; color: var(--ink3); }
.search-box input { height: 56px; padding-inline-start: 48px; border-radius: 16px; box-shadow: var(--sh); }
.search-hits { margin-top: 8px; overflow: hidden; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { display: block; padding: 22px; color: inherit; text-decoration: none; }
.tile .glyph { width: 58px; height: 58px; border-radius: 18px; margin-bottom: 14px; }
.tile .glyph .icon { width: 28px; height: 28px; }
.tile b { display: block; font-size: 1.1rem; }
.tile p { color: var(--ink3); font-size: .83rem; line-height: 1.8; }
.tile.plain { padding: 16px 18px; }
.tile.plain b { font-size: 1rem; font-weight: 500; }

/* cartable */
.kartable { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 18px; align-items: start; }
.list { overflow: hidden; }
.list-title { padding: 10px 15px; font-size: .82rem; font-weight: 700; color: var(--ink3); border-bottom: 1px solid var(--line); }
.items { max-height: calc(100vh - 200px); overflow-y: auto; }
.item { display: block; padding: 13px 15px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--sf2); }
.item.on { background: var(--cyan-s); box-shadow: inset -3px 0 0 var(--cyan); }
[dir=ltr] .item.on { box-shadow: inset 3px 0 0 var(--cyan); }
.item .head { display: flex; align-items: center; gap: 8px; }
.item .t { flex: 1; font-weight: 700; }
.item .meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 2px 0 8px; color: var(--ink3); font-size: .8rem; }
.item .left { margin-inline-start: auto; font-weight: 500; }
.sla { height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; }
.sla i { display: block; height: 100%; border-radius: 9px; }
.lv-ok { color: var(--green); --c: var(--green); } .lv-mid { color: var(--link); --c: var(--cyan); } .lv-warn { color: var(--amber-t); --c: var(--amber); }
.lv-late { color: var(--red); --c: var(--red); } .lv-paused { color: var(--ink3); --c: var(--ink3); }
.sla i { background: var(--c, var(--ink3)); }
.reader-empty { padding: 90px 20px; text-align: center; color: var(--ink3); }
.reader-empty .icon { width: 36px; height: 36px; margin: 0 auto 8px; stroke-width: 1.4; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { padding: 12px 16px; }
.kpi .n { font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
.kpi .l { font-size: .82rem; color: var(--ink2); }

/* ticket */
.ticket-head { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.ticket-head .crumb { font-size: .82rem; color: var(--ink3); }
.ticket-head h2 { font-size: 1.4rem; font-weight: 700; line-height: 1.5; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.title-row h2 { flex: 1; min-width: 200px; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 6px; color: var(--ink2); font-size: .85rem; }
.facts b { color: var(--ink); font-weight: 500; }
.flow { display: flex; padding: 16px 12px 14px; border-bottom: 1px solid var(--line); }
.flow-step { position: relative; flex: 1; min-width: 0; text-align: center; color: var(--ink3); font-size: .8rem; }
.flow-step::before { content: ''; position: absolute; top: 13px; inset-inline-end: 50%; width: 100%; height: 2px; background: var(--line); }
.flow-step:first-child::before { display: none; }
.flow-step.ok::before, .flow-step.now::before { background: var(--cyan); }
.flow-step u { position: relative; z-index: 1; width: 28px; height: 28px; margin: 0 auto 4px; border: 2px solid var(--line); border-radius: 50%; background: var(--sf); display: grid; place-items: center; text-decoration: none; }
.flow-step u .icon { width: 14px; height: 14px; }
.flow-step.ok u { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.flow-step.now u { border-color: var(--cyan); color: var(--link); box-shadow: 0 0 0 4px var(--cyan-s); }
.flow-step.ok, .flow-step.now { color: var(--ink); font-weight: 500; }
.desc { padding: 16px 22px; white-space: pre-wrap; }
.section { padding: 14px 22px; border-top: 1px solid var(--line); }
.section > h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .9rem; font-weight: 700; color: var(--ink2); }
.files { list-style: none; margin: 0; padding: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-bottom: 12px; padding-inline-start: 26px; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: 3px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--cyan); }
.timeline li::after { content: ''; position: absolute; inset-inline-start: 8px; top: 20px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: .78rem; color: var(--ink3); }

/* org chart */
.chart-scroll { overflow-x: auto; padding: 16px; }
.tree { display: flex; justify-content: center; width: max-content; min-width: 100%; }
.node { width: 200px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--sf); box-shadow: var(--sh); }
.node.vacant { border-style: dashed; box-shadow: none; background: var(--sf2); }
.node.off { opacity: .55; }
.node .title { font-size: .87rem; font-weight: 700; line-height: 1.5; }
.node .who { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: var(--ink2); font-size: .8rem; }
.node .avatar { width: 24px; height: 24px; font-size: .72rem; }
.node .foot-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.node .pill { margin-inline-start: auto; font-size: .68rem; padding: 0 8px; }
.flag { width: 22px; height: 22px; border-radius: 7px; background: var(--bg); color: var(--ink3); display: inline-grid; place-items: center; opacity: .55; }
.flag .icon { width: 13px; height: 13px; }
.flag.on { background: var(--cyan-s); color: var(--link); opacity: 1; }
.flag.on.asset { background: var(--amber-s); color: var(--amber-t); }
.node .ops { display: flex; gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.node .ops form { margin: 0; }
.op { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--ink2); display: grid; place-items: center; cursor: pointer; }
.op:hover { background: var(--bg); }
.op .icon { width: 15px; height: 15px; }
.op.danger { color: var(--red); }
.level { display: flex; flex-direction: column; align-items: center; }
.kids { position: relative; display: flex; justify-content: center; padding-top: 18px; }
.kids::before { content: ''; position: absolute; top: 0; left: 50%; height: 18px; border-left: 2px solid var(--tree); }
.kids > .level { position: relative; padding: 18px 9px 0; }
.kids > .level::before { content: ''; position: absolute; top: 0; inset-inline: 0; border-top: 2px solid var(--tree); }
.kids > .level::after { content: ''; position: absolute; top: 0; left: 50%; height: 18px; border-left: 2px solid var(--tree); }
.kids > .level:first-child::before { inset-inline-start: 50%; }
.kids > .level:last-child::before { inset-inline-end: 50%; }
.kids > .level:only-child::before { display: none; }
.vstack { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--ink2); font-size: .82rem; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* sign-in */
.login { max-width: 400px; margin: 36px auto; padding: 28px; background: var(--sf); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 10px; }
.login h2 { font-size: 1.25rem; font-weight: 700; text-align: center; }
.login .lead { text-align: center; margin-bottom: 6px; }
.login .logo { display: block; margin: 0 auto 4px; }
.login label { font-size: .85rem; color: var(--ink2); }
.login .btn { margin-top: 8px; }

/* responsive */
@media (max-width: 1180px) {
  .home, .two-col { grid-template-columns: minmax(0, 1fr); }
  .kartable { grid-template-columns: minmax(0, 1fr); }
  .kartable.reading .list { display: none; }
  .kartable .reader:has(.reader-empty) { display: none; }
  .items { max-height: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset-block: 0; inset-inline-start: 0; width: 96px; transform: translateX(100%); transition: transform .2s; z-index: 40; }
  [dir=ltr] .rail { transform: translateX(-100%); }
  .shell.open .rail { transform: none; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 24, 44, .45); z-index: 35; }
  .menu-btn { display: grid; }
  .top { height: 58px; padding: 0 12px; gap: 8px; }
  .top h1 { font-size: 1.05rem; flex: 1; }
  .subnav { padding: 10px 12px 0; }
  .content { padding: 14px 12px 104px; }
  .foot { padding-bottom: 92px; margin-top: -92px; }
  .hero { padding: 16px; gap: 12px; border-radius: 20px; }
  .hero h2 { font-size: 1.2rem; }
  .quick { display: none; }
  .lang select { max-width: 86px; padding: 0 6px; }
  .hero .stats { width: 100%; gap: 8px; }
  .stat { flex: 1; min-width: 0; padding: 7px 11px; }
  .stat b { font-size: 1.3rem; }
  .apps { grid-template-columns: repeat(4, 1fr); gap: 10px 4px; }
  .apps .app-card { flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; box-shadow: none; font-size: .72rem; font-weight: 500; text-align: center; line-height: 1.4; }
  .apps .app-card small { display: none; }
  .apps .glyph { width: 54px; height: 54px; border-radius: 17px; }
  .apps .badge-n { top: -4px; inset-inline-end: 6px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 15px; }
  .tile p { display: none; }
  .tile .glyph { width: 46px; height: 46px; border-radius: 14px; margin-bottom: 9px; }
  .tile b { font-size: .95rem; }
  .page-title { font-size: 1.25rem; }
  .ticket-head, .desc, .section { padding-inline: 14px; }
  .tabbar { display: flex; align-items: flex-start; position: fixed; inset-inline: 0; bottom: 0; height: 74px; padding-top: 9px; background: var(--sf); border-top: 1px solid var(--line); z-index: 30; }
  .tb-item { position: relative; flex: 1; border: 0; background: none; padding: 0; color: var(--ink3); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; font-size: .7rem; text-decoration: none; }
  .tb-item.on { color: var(--nv-t); font-weight: 700; }
  .tb-item .icon { width: 23px; height: 23px; }
  .tb-item .badge-n { top: -4px; inset-inline-end: calc(50% - 22px); }
  .fab { width: 56px; height: 56px; margin-top: -26px; border-radius: 19px; background: linear-gradient(135deg, #14A3C7, #1F7BD8); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 20px rgba(20, 120, 200, .4); }
  .fab .icon { width: 26px; height: 26px; }
  .reading .tabbar { display: none; }
  .reading .content { padding-bottom: 20px; }
  .reading .foot { padding-bottom: 12px; margin-top: 0; }
  .actions.sticky { position: sticky; bottom: 0; z-index: 5; border-top: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -6px 16px rgba(16, 40, 72, .08); }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } }
details.section > summary { cursor: pointer; font-size: .9rem; font-weight: 700; color: var(--ink2); }
details.section[open] > summary { margin-bottom: 12px; }

/* date and time picker */
.dtp { position: relative; display: flex; align-items: center; }
.dtp-field { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sf); display: flex; align-items: center; gap: 10px; color: var(--ink3); cursor: pointer; text-align: start; }
.dtp-field:hover { border-color: var(--cyan); }
.dtp-field > .icon { color: var(--link); }
.dtp.set .dtp-field { color: var(--ink); font-weight: 500; padding-inline-end: 44px; }
.dtp-rel { margin-inline-start: auto; font-weight: 500; }
.dtp-clear { position: absolute; inset-inline-end: 8px; }
dialog.dtp-pop { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 16px); padding: 0; overflow-y: auto; border: 0; border-radius: 22px; box-shadow: 0 30px 70px rgba(8, 24, 44, .35); }
.dtp-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 16px; padding: 18px 22px; color: #fff; background: radial-gradient(420px 170px at 8% 0, rgba(20, 163, 199, .6), transparent 70%), linear-gradient(120deg, #0B3C6E, #0A3360); }
.dtp-head span { grid-column: 1 / -1; font-size: .8rem; color: #C4D6E9; }
.dtp-head b { font-size: 1.3rem; }
.dtp-head em { font-style: normal; font-size: 1.5rem; font-weight: 700; display: flex; align-items: baseline; gap: 10px; }
.dtp-head em i { font-style: normal; font-size: .78rem; font-weight: 500; padding: 1px 10px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
.dtp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 22px 0; }
.dtp-chips.center { padding: 0; justify-content: center; }
.dtp-chip { padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--sf); color: var(--ink2); font-size: .8rem; font-weight: 500; cursor: pointer; }
.dtp-chip:hover { border-color: var(--cyan); color: var(--link); background: var(--cyan-s); }
.dtp-body { display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 20px; padding: 14px 22px; }
.dtp-month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dtp-nav { width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--bg); color: var(--ink2); display: grid; place-items: center; cursor: pointer; }
.dtp-nav .icon { width: 16px; height: 16px; }
.dtp-nav.next .icon, [dir=ltr] .dtp-nav.prev .icon { transform: rotate(180deg); }
[dir=ltr] .dtp-nav.next .icon { transform: none; }
.dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dtp-wd { padding: 4px 0; color: var(--ink3); font-size: .76rem; }
.dtp-day { aspect-ratio: 1; border: 0; border-radius: 11px; background: none; color: var(--ink); font-size: .9rem; font-weight: 500; cursor: pointer; }
.dtp-day:hover:not(:disabled) { background: var(--cyan-s); }
.dtp-day.off { color: var(--red); opacity: .7; }
.dtp-day.today { box-shadow: inset 0 0 0 1.5px var(--cyan); }
.dtp-day.on { background: var(--primary); color: var(--on-primary); opacity: 1; box-shadow: 0 6px 14px rgba(11, 60, 110, .3); }
.dtp-day:disabled { color: var(--ink3); opacity: .35; cursor: default; }
.dtp-time { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 12px; border-radius: 16px; background: var(--sf2); }
.dtp-clock { display: flex; align-items: center; justify-content: center; gap: 8px; }
.dtp-clock > span { font-size: 1.6rem; font-weight: 700; color: var(--ink3); }
.dtp-spin { display: flex; flex-direction: column; align-items: center; }
.dtp-spin b { width: 66px; padding: 4px 0; border-radius: 13px; background: var(--primary); color: var(--on-primary); font-size: 1.8rem; line-height: 1.4; text-align: center; }
.dtp-spin button { width: 40px; height: 28px; border: 0; background: none; color: var(--ink2); display: grid; place-items: center; cursor: pointer; }
.dtp-spin button .icon { width: 18px; height: 18px; transform: rotate(-90deg); }
.dtp-spin button:last-child .icon { transform: rotate(90deg); }
.dtp-mins { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dtp-min { width: 42px; height: 42px; border: 0; border-radius: 11px; background: var(--bg); color: var(--ink2); font-weight: 700; cursor: pointer; }
.dtp-min.on { background: var(--cyan); color: #04202B; }
.dtp-foot { display: flex; gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--line); }
.dtp-foot .btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) {
  dialog.dtp-pop { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: 22px 22px 0 0; overflow-y: auto; }
  .dtp-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dtp-foot .btn { flex: 1; min-height: 46px; }
}

/* admin panel */
.set { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-main { min-width: 0; }
.set-back { display: none; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--ink2); font-weight: 500; text-decoration: none; }
[dir=ltr] .set-back .icon { transform: rotate(180deg); }
.snav { padding: 10px; }
.snav h6 { margin: 10px 10px 4px; color: var(--ink3); font-size: .76rem; font-weight: 500; }
.snav h6:first-child { margin-top: 4px; }
.sl { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 11px; color: var(--ink2); font-size: .87rem; font-weight: 500; text-decoration: none; }
.sl .icon { width: 18px; height: 18px; }
.sl:hover { background: var(--bg); }
.sl.on { background: var(--primary); color: var(--on-primary); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid .wide { grid-column: 1 / -1; }
.field-label { font-size: .85rem; color: var(--ink2); }
.hint { display: block; color: var(--ink3); font-size: .78rem; line-height: 1.6; }
.ltr-input input { direction: ltr; text-align: left; }
input:disabled, select:disabled { background: var(--sf2); color: var(--ink3); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.narrow { max-width: 880px; }
.logo-box { height: 150px; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--sf2); display: grid; place-items: center; }
.logo-box img { max-width: 120px; max-height: 110px; object-fit: contain; }
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { display: block; height: 100%; border-radius: 99px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: inset-inline-start .15s; }
.switch input:checked + i { background: var(--cyan); }
.switch input:checked + i::after { inset-inline-start: 19px; }
.switch input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }
.switch input:disabled + i { opacity: .5; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; }
.switch-row .tx { flex: 1; min-width: 0; }
.switch-row b { display: block; font-size: .9rem; font-weight: 500; }
.switch-row small { display: block; color: var(--ink3); font-size: .79rem; line-height: 1.6; }
.toggle-form { margin: 0; display: inline-flex; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tools select { width: auto; min-height: 40px; }
.search-inline { position: relative; flex: 1 1 220px; min-width: 0; }
.search-inline .icon { position: absolute; top: 10px; inset-inline-start: 12px; width: 18px; height: 18px; color: var(--ink3); }
.search-inline input { padding-inline-start: 38px; }
.chips-inline { display: flex; gap: 6px; }
.chips-inline a { padding: 2px 11px; border-radius: 99px; background: var(--line); color: var(--ink2); font-size: .8rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.chips-inline a.on { background: var(--primary); color: var(--on-primary); }
.users { display: flex; overflow: hidden; overflow: clip; }
.ulist { flex: 1; min-width: 0; }
.who { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.who .avatar { width: 34px; height: 34px; font-size: .8rem; }
.who b { display: block; font-weight: 500; }
.who small { display: block; color: var(--ink3); font-size: .78rem; text-align: start; }
tr.sel td { background: var(--cyan-s); }
[dir=rtl] .cell-start { text-align: right; }
.drawer { width: 360px; flex: none; border-inline-start: 1px solid var(--line); }
.users > .drawer { position: sticky; top: 76px; align-self: flex-start; max-height: calc(100vh - 92px); overflow-y: auto; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head b { display: block; }
.drawer-head small { display: block; color: var(--ink3); font-size: .78rem; text-align: start; }
.drawer-body { padding: 16px 18px; }
.pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 12px; border-top: 1px solid var(--line); }
.per-page { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.per-page label { display: flex; align-items: center; gap: 8px; }
.per-page select { width: auto; min-height: 36px; padding: 4px 10px; }
.subjects-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.small-btn { min-height: 32px; padding: 0 12px; }
.line.sel { background: var(--cyan-s); }
.icons { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-opt { position: relative; cursor: pointer; }
.icon-opt input { position: absolute; opacity: 0; }
.icon-opt span { width: 38px; height: 38px; border-radius: 11px; background: var(--bg); color: var(--ink2); display: grid; place-items: center; }
.icon-opt .icon { width: 18px; height: 18px; }
.icon-opt input:checked + span { background: var(--cyan-s); color: var(--link); box-shadow: 0 0 0 2px var(--cyan); }
.icon-opt input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.day { position: relative; cursor: pointer; }
.day input { position: absolute; opacity: 0; }
.day span { display: grid; place-items: center; min-width: 66px; height: 40px; padding: 0 10px; border-radius: 12px; background: var(--bg); color: var(--ink2); font-size: .85rem; font-weight: 500; }
.day input:checked + span { background: var(--primary); color: var(--on-primary); }
.day input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.add-holiday { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dtp-body.date-only { grid-template-columns: minmax(0, 1fr); }
.line form { margin: 0; }
@media (max-width: 1180px) {
  .split, .subjects-layout { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 320px; }
}
@media (max-width: 860px) {
  .set { grid-template-columns: minmax(0, 1fr); }
  .set:not(.index) .snav { display: none; }
  .set.index .set-main { display: none; }
  .set-back { display: inline-flex; }
  .sl { padding: 12px 11px; }
  .fgrid, .fgrid.three { grid-template-columns: minmax(0, 1fr); }
  .users { display: block; }
  .users.editing .ulist { display: none; }
  .users th:nth-child(3), .users td:nth-child(3), .users th:nth-child(4), .users td:nth-child(4) { display: none; }
  .drawer { width: auto; border: 0; }
  .users > .drawer { position: static; max-height: none; }
}
.subjects-layout th { white-space: normal; }
.set-main .node { width: 176px; }
.set-main .kids > .level { padding-inline: 6px; }
@media (max-width: 1500px) {
  .users.editing th:nth-child(3), .users.editing td:nth-child(3), .users.editing th:nth-child(4), .users.editing td:nth-child(4) { display: none; }
}

/* assets */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; text-decoration: none; }
.stat-card b { display: block; font-size: 1.4rem; line-height: 1.3; }
.stat-card div span { font-size: .8rem; color: var(--ink2); }
.stat-card .glyph { width: 40px; height: 40px; border-radius: 12px; }
.code { font-weight: 700; font-size: .84rem; letter-spacing: .2px; text-decoration: none; }
.code.big { font-size: .95rem; color: var(--link); }
.cell-sub { display: block; font-size: .78rem; }
.pill.st-stock { background: var(--nv-s); color: var(--nv-t); }
.pill.st-assigned, .pill.st-active { background: var(--green-s); color: var(--green); }
.pill.st-repair { background: var(--vio-s); color: var(--vio); }
.pill.st-blocked { background: var(--amber-s); color: var(--amber-t); }
.pill.st-lost { background: var(--red-s); color: var(--red); }
.spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; margin: 0; }
.spec dt { font-size: .76rem; color: var(--ink3); }
.spec dd { margin: 0; font-weight: 500; text-align: start; }
.vault { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 14px; background: var(--amber-s); }
.vault small { display: block; color: var(--amber-t); font-size: .76rem; }
.vault .pw { font-weight: 700; letter-spacing: 2px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cat-tile { display: flex; align-items: center; gap: 10px; padding: 12px; color: inherit; font-weight: 700; font-size: .87rem; line-height: 1.5; text-decoration: none; }
.cat-tile small { display: block; font-size: .74rem; font-weight: 400; color: var(--ink3); }
.cat-tile.on { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-s); }
.cat-tile .glyph { width: 38px; height: 38px; border-radius: 12px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--sf); color: var(--ink2); font-size: .83rem; text-decoration: none; }
.chips-row a.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.code-preview { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; color: #fff; background: radial-gradient(300px 90px at 10% 0, rgba(20, 163, 199, .55), transparent), linear-gradient(120deg, #0B3C6E, #0A3360); }
.code-preview small { display: block; font-size: .76rem; color: #C4D6E9; }
.code-preview b { font-size: 1.15rem; letter-spacing: 1px; }
.small-preview { padding: 8px 14px; }
.small-preview b { font-size: .95rem; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.approve-row, .settle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.approve-row { padding: 13px 18px; border-bottom: 1px solid var(--line); }
.approve-row:last-child { border-bottom: 0; }
.approve-row a { color: inherit; text-decoration: none; }
.approve-row small, .settle-row small { display: block; color: var(--ink3); font-size: .78rem; }
.settle-row small { font-weight: 400; text-align: start; }
.seg-choice { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); font-size: .78rem; }
.seg-choice label { cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; }
.seg-choice span { display: block; padding: 3px 10px; border-radius: 8px; color: var(--ink2); }
.seg-choice input:checked + span { background: var(--sf); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.seg-choice input:focus-visible + span { outline: 2px solid var(--cyan); }
.asset-pick { border: 0; padding: 0; margin: 0; }
.asset-pick legend { padding: 0; margin-bottom: 10px; font-size: 1.05rem; font-weight: 700; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.asset-card { position: relative; cursor: pointer; }
.asset-card input { position: absolute; opacity: 0; }
.asset-card > span { display: flex; align-items: center; gap: 11px; padding: 12px; height: 100%; }
.asset-card .glyph { width: 40px; height: 40px; border-radius: 12px; }
.asset-card b { display: block; font-size: .9rem; }
.asset-card small { display: block; color: var(--ink3); font-size: .74rem; text-align: start; }
.asset-card input:checked + span { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-s); }
.asset-card input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.asset-card .dashed { border-style: dashed; box-shadow: none; background: transparent; }
.manual-item { display: none; margin-top: 10px; }
.asset-pick:has(#asset-none:checked) .manual-item { display: block; }
.list-new { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.list-new input { flex: 1 1 140px; width: auto; }
@media (max-width: 1180px) { .split-even { grid-template-columns: minmax(0, 1fr); } }
@media print { .rail, .top, .subnav, .foot, .tabbar, .no-print { display: none !important; } .shell { display: block; } }

/* permission groups */
.ck { width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0; border: 1.5px solid var(--line); border-radius: 7px; background: var(--sf); color: #fff; cursor: pointer; }
.ck.on { background: var(--accent, #14A3C7); border-color: var(--accent, #14A3C7); }
.ck svg { width: 15px; height: 15px; stroke-width: 3; }
.access-table th:not(:first-child), .access-table td:not(:first-child) { text-align: center; }
.access-table .sec-row td { background: var(--bg); font-weight: 700; font-size: .8rem; color: var(--ink2); text-align: start; }
.lim { display: inline-block; padding: 0 8px; border-radius: 99px; background: rgba(20, 163, 199, .14); color: #0D7E9C; font-size: .75rem; }
.people-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--bg); font-size: .85rem; }
.person button { display: inline-grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ink3); cursor: pointer; }
.person svg { width: 13px; height: 13px; }
.notice-vi { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 16px; background: rgba(124, 92, 219, .1); }
.notice-vi.flat { border-radius: 0; border-bottom: 1px solid var(--line); }
.notice-vi p { margin: 0; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-grid.scroll { max-height: 180px; overflow-y: auto; }
.pick { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .85rem; cursor: pointer; }
.pick:has(input:checked) { border-color: var(--accent, #14A3C7); background: rgba(20, 163, 199, .12); }
dialog.wide { width: min(640px, calc(100vw - 32px)); }
@media (max-width: 767px) { .subjects-layout .panel > header { flex-wrap: wrap; } }

/* checklists */
.check-edit { display: grid; grid-template-columns: minmax(0, 1fr) 64px 34px; gap: 8px; align-items: center; padding: 5px 0; }
.check-edit.head { font-size: .75rem; color: var(--ink3); padding-bottom: 0; }
.check-edit.head span:nth-child(2), .check-edit .must { text-align: center; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border: 0; }
.check-row > input[type=checkbox] { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.check-row input[type=text] { width: 100%; margin-top: 6px; }
.check-row input.bad { outline: 1.5px solid var(--red); outline-offset: 1px; }
.check-work { max-height: 60vh; overflow-y: auto; }
.check-line { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.check-line .ck { cursor: default; }
.wide-pick { display: flex; }

/* obligations */
.pill.ob-rd { background: var(--red-s); color: var(--red); }
.pill.ob-am { background: var(--amber-s); color: var(--amber-t); }
.pill.ob-gr { background: var(--green-s); color: var(--green); }
.pill.ob-cy { background: var(--cyan-s); color: #0D7E9C; }
.alert-mark { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.alert-mark:last-child { border: 0; }
.glyph.rd { background: var(--red-s); color: var(--red); }

/* notifications and group work */
.icon-btn.bell { position: relative; }
.icon-btn.bell .badge-n { top: -3px; inset-inline-end: -3px; }
.line.unread .t { font-weight: 700; }
.reader-empty.notices { padding: 0; text-align: start; color: inherit; }
.owner-pill { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 99px; background: var(--vio-s); color: var(--vio); font-size: .75rem; }
.owner-pill svg { width: 12px; height: 12px; }
.item-take { display: flex; justify-content: flex-end; padding: 0 14px 10px; margin: 0; border-bottom: 1px solid var(--line); }
.reader-empty.notices header { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); }

/* stock */
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.wh-card { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.wh-card small { display: block; font-size: .72rem; color: var(--ink3); }
.wh-card.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.wh-card.on small { color: inherit; opacity: .75; }
.stock-table th:not(:first-child), .stock-table td:not(:first-child) { text-align: center; }
.calc { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 6px; align-items: center; text-align: center; }
.calc div { padding: 8px 2px; border: 1px solid var(--line); border-radius: 12px; }
.calc b { display: block; font-size: 1.25rem; }
.calc small { font-size: .7rem; color: var(--ink3); }
.calc .add { border-color: var(--link); background: var(--cyan-s); }
.calc .total { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.calc .total small { color: inherit; opacity: .75; }

/* signed forms */
.with-group .check-edit { grid-template-columns: minmax(0, 1fr) 64px 150px 34px; }
.form-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.sheets { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sheet { display: flex; flex-direction: column; min-height: 640px; padding: 22px 26px; border-radius: 6px; background: #fff; color: #16263C; box-shadow: var(--sh, 0 6px 22px rgba(16, 40, 72, .12)); font-size: 12.5px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid #0B3C6E; }
.sheet-head h3 { flex: 1; text-align: center; font-size: 17px; }
.sheet-copy { padding: 3px 10px; border-radius: 99px; background: #0B3C6E; color: #fff; font-size: 11px; white-space: nowrap; }
.sheet-copy.user { background: #14A3C7; }
.sheet-meta { padding: 6px 0; font-size: 11.5px; color: #3C4D63; }
.sheet-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 8px 0; }
.sheet-info span { color: #5A6B80; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.sheet-table th { padding: 6px; border: 1px solid #CFD9E4; background: #EEF3F8; font-weight: 500; color: #16263C; }
.sheet-table td { padding: 6px; border: 1px solid #CFD9E4; text-align: center; color: #16263C; }
.sheet-text { padding: 12px 0; line-height: 2; }
.sheet-sign { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; margin-top: auto; }
.sign-box { height: 108px; padding: 8px; border: 1.5px solid #0B3C6E; border-radius: 6px; text-align: center; }
.sign-box small { display: block; color: #5A6B80; font-size: 10.5px; margin-top: 2px; }
.sheet-foot { padding-top: 9px; text-align: center; font-size: 10.5px; color: #5A6B80; }
@media (max-width: 900px) { .sheets { grid-template-columns: minmax(0, 1fr); } }
@media print {
  body, .main, .content { background: #fff !important; }
  .flash { display: none; }
  .sheets { display: block; }
  .sheet { box-shadow: none; min-height: 96vh; break-after: page; }
}

/* reports */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.filters select { width: auto; flex: 0 1 190px; }
.cols { position: relative; }
.cols summary { list-style: none; cursor: pointer; }
.cols-pop { position: absolute; z-index: 20; inset-inline-end: 0; display: flex; flex-direction: column; gap: 6px; width: 230px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--sf); box-shadow: 0 12px 30px rgba(16, 40, 72, .18); }
@media (max-width: 600px) { .cols-pop { position: fixed; inset-inline: 16px; width: auto; } }
.history-when { flex: none; width: 92px; }
.hc-who { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.hc-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 16px 12px; text-align: center; font-size: .72rem; color: var(--ink2); }
.hc-counts div { padding: 7px 2px; border-radius: 11px; background: var(--bg); }
.hc-counts b { display: block; font-size: 1.05rem; color: var(--ink); }
@media print { .table-wrap { overflow: visible; } .panel { box-shadow: none; border: 0; } table { font-size: 11px; } }

/* ticket conversation */
.chat { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chat .msg { background: var(--sf2); border-radius: 12px; padding: 8px 12px; max-width: 85%; }
.chat .msg.mine { align-self: flex-end; }
.chat .msg.internal { border: 1px dashed var(--amber, #c98a00); }
.chat .when { font-size: .8em; opacity: .8; margin-bottom: 2px; }

/* unseen marks in the cartable */
.item.unseen .t { font-weight: 700; }
.item .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-inline-end: 6px; vertical-align: middle; }
.tabs .new { margin-inline-start: 4px; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--amber); color: #231500; font-size: .7rem; font-weight: 700; }
.pill.prio-high { background: var(--amber-s); color: var(--amber-t); }
.pill.prio-urgent { background: var(--red-s); color: var(--red); font-weight: 700; }

/* Searchable lists (picker.js) */
.spick { position: relative; width: 100%; min-width: 0; }
.inline-row > .spick, .filters .spick, .tools .spick { flex: 1 1 200px; width: auto; }
.pick-native { position: absolute !important; inset-inline-start: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.pick-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sf); text-align: start; cursor: pointer; }
.pick-btn::after { content: ""; flex: none; margin-inline-start: auto; width: 7px; height: 7px; border-right: 2px solid var(--ink3); border-bottom: 2px solid var(--ink3); transform: translateY(-2px) rotate(45deg); }
.pick-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn.pick-empty .pick-text { color: var(--ink3); }
.pick-btn:focus-visible, .spick.open .pick-btn { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px var(--cyan-s); }
.pick-btn.pick-invalid { border-color: var(--red); }
.pick-panel { position: absolute; z-index: 60; inset-inline: 0; top: calc(100% + 4px); min-width: 240px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--sf); box-shadow: 0 12px 32px rgba(16, 40, 72, .16); }
.pick-panel .pick-search { margin-bottom: 6px; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.pick-list li { padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.pick-list li.cur { font-weight: 600; }
.pick-list li.on { background: var(--cyan-s); }
.pick-list li.pick-group { padding: 8px 10px 4px; font-size: .8rem; font-weight: 700; color: var(--ink3); cursor: default; }
.pick-list li.pick-none { color: var(--ink3); cursor: default; }
@media print { .pick-btn::after { display: none; } .pick-panel { display: none; } }
.exports { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* users page: bulk changes and in-page messages (users.js) */
.pick-cell { width: 36px; text-align: center; }
.pick-cell input { width: 18px; height: 18px; accent-color: var(--cyan); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 18px; background: var(--cyan-s); border-bottom: 1px solid var(--line); }
.bulk-bar[hidden] { display: none; }
.bulk-bar select { width: auto; min-height: 36px; padding: 4px 10px; }
.bulk-count { font-size: .9rem; }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); font-weight: 600; cursor: pointer; text-decoration: underline; }
.toasts { position: fixed; z-index: 100; inset-inline-start: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
[dir=rtl] .toasts { transform: translateX(50%); }
.toasts .flash { box-shadow: 0 10px 28px rgba(16, 40, 72, .2); font-weight: 600; }
@media (max-width: 760px) { .toasts { bottom: 86px; } }
.manage-box { background: var(--sf2); }
.notice-line { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--amber-s); color: var(--amber-t); }
.notice-line .icon { width: 18px; height: 18px; }

/* two-factor pages */
.tf-card { max-width: 520px; margin: 24px auto; padding: 26px; background: var(--sf); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 16px; }
.tf-card.wide { max-width: 640px; }
.tf-head { display: flex; align-items: center; gap: 14px; }
.tf-head h2 { font-size: 1.15rem; font-weight: 700; }
.tf-head p { margin: 2px 0 0; font-size: .88rem; }
.tf-head .pill { margin-inline-start: auto; }
.tf-steps { margin: 0; padding: 0; list-style: none; counter-reset: tf; display: flex; flex-direction: column; gap: 14px; }
.tf-steps > li { counter-increment: tf; position: relative; padding-inline-start: 44px; display: flex; flex-direction: column; gap: 8px; }
.tf-steps > li::before { content: counter(tf); position: absolute; inset-inline-start: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: .9rem; }
.tf-qr { align-self: flex-start; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; line-height: 0; }
.tf-secret { display: inline-block; margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--sf2); font-size: .95rem; letter-spacing: .05em; word-break: break-all; }
.tf-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tf-form.stacked { flex-direction: column; align-items: stretch; }
.tf-code { width: auto !important; flex: 1 1 160px; font-size: 1.35rem !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.tf-codes { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; border: 1px dashed var(--line); border-radius: 14px; background: var(--sf2); }
.tf-codes li { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; text-align: center; padding: 6px; border-radius: 8px; background: var(--sf); }
.tf-facts { display: flex; flex-wrap: wrap; gap: 16px; color: var(--ink2); font-size: .88rem; }
.tf-facts span { display: inline-flex; align-items: center; gap: 6px; }
.tf-facts .icon { width: 16px; height: 16px; }
.tf-admin { border-top: 1px solid var(--line); }
.tf-admin h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.center { text-align: center; }
a.me { color: inherit; text-decoration: none; }
@media print { .tf-card { box-shadow: none; border: 0; } }
.tf-form.stacked .tf-code { flex: none; width: 100% !important; }
[lang=fa] .tf-steps > li::before { content: counter(tf, persian); }
.tf-card .hint { display: flex; align-items: flex-start; gap: 6px; margin: 0; }
.tf-card .hint .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* bulk import pages */
.im-hero, .im-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; margin-bottom: 16px; }
.im-hero h2, .im-head h2 { font-size: 1.15rem; font-weight: 700; }
.im-hero p, .im-head p { margin: 4px 0 0; font-size: .88rem; }
.im-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.im-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
.im-card:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 10px 26px rgba(16, 40, 72, .12); }
.im-card .im-n { position: absolute; inset-inline-end: 14px; top: 14px; }
.im-n { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--sf2); color: var(--ink3); font-size: .8rem; font-weight: 700; flex: none; }
.im-steps .im-n { background: var(--primary); color: var(--on-primary); }
.im-order { margin-top: 14px; display: flex; gap: 6px; align-items: flex-start; }
.im-order .icon, .im-steps .hint .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.im-back { display: inline-flex; margin-bottom: 10px; }
.im-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.im-steps > li { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.im-step-head { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.im-steps .hint { display: flex; gap: 6px; margin: 0; }
.im-drop { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.im-file { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--sf2); cursor: pointer; color: var(--ink2); }
.im-file:hover { border-color: var(--cyan); }
.im-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.im-file .icon { width: 22px; height: 22px; color: var(--link); }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--sf2); color: var(--ink2); }
.chip.new { background: var(--green-s); color: var(--green); }
.chip.upd { background: var(--cyan-s); color: var(--link); }
.chip.same { background: var(--sf2); color: var(--ink3); }
.chip.err { background: var(--red-s); color: var(--red); }
.chip.req { background: var(--nv-s); color: var(--nv-t); }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.im-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.im-errs { margin: 0; padding-inline-start: 16px; color: var(--red); font-size: .85rem; }
tr.im-error td { background: color-mix(in srgb, var(--red-s) 50%, transparent); }
.im-result { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 12px; border-color: var(--green); }
.im-result .im-counts { margin-top: 6px; }
.im-actions form { display: inline; }

/* Vault */
.pill.lv-internal { background: var(--line); color: var(--ink2); }
.pill.lv-confidential { background: var(--cyan-s); color: var(--link); }
.pill.lv-highly { background: var(--amber-s); color: var(--amber-t); }
.pill.lv-secret { background: var(--vio-s); color: var(--vio); }
.pill.lv-top_secret { background: var(--red-s); color: var(--red); }
.secret-in, .secret-out { display: flex; gap: 6px; align-items: center; }
.secret-in input { flex: 1; font-family: ui-monospace, monospace; }
.secret-out code { direction: ltr; unicode-bidi: plaintext; padding: 2px 8px; border-radius: 6px; background: var(--line); user-select: all; word-break: break-all; }
.secret-out code.shown { background: var(--amber-s); color: var(--amber-t); }
.vault-form .vrow + .vrow { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.vault-form .field.wide { grid-column: 1 / -1; }
.pre { white-space: pre-wrap; }
.check-row.ok b.m { color: var(--green); }
.glyph.sm { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; vertical-align: middle; }
.glyph.sm svg { width: 18px; height: 18px; }
td.ops { white-space: nowrap; }
td.ops form { display: inline; }
.wh-card .glyph { width: 36px; height: 36px; border-radius: 11px; }
.wh-card { gap: 10px; }

/* org chart: experts stacked under their unit get a spine and a tick to each card */
.vstack { position: relative; padding-top: 20px; padding-inline-start: 22px; }
.vstack::before { content: ''; position: absolute; top: 0; left: 50%; height: 10px; border-left: 2px solid var(--tree); }
.vstack::after { content: ''; position: absolute; top: 10px; inset-inline-start: 9px; inset-inline-end: 50%; border-top: 2px solid var(--tree); }
.vstack > .level { position: relative; align-items: flex-start; }
.vstack > .level::before { content: ''; position: absolute; top: 50%; inset-inline-start: -13px; width: 13px; border-top: 2px solid var(--tree); }
.vstack > .level::after { content: ''; position: absolute; inset-inline-start: -13px; top: -8px; height: calc(50% + 9px); border-inline-start: 2px solid var(--tree); }
.vstack > .level:first-child::after { top: -10px; height: calc(50% + 11px); }

/* report dashboard */
.dash-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.bar-line { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; color: inherit; text-decoration: none; font-size: .85rem; }
a.bar-line:hover .bl-fill { background: var(--primary); }
.bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bl-fill { display: block; height: 100%; border-radius: 99px; background: var(--cyan); }
.bl-n { min-width: 2.5em; text-align: end; }

/* polish: file inputs and icons inside labels, everywhere */
input[type=file] { font: inherit; font-size: .85rem; color: var(--ink2); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; margin-inline-end: 10px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sf); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--bg); }
.field label > .icon, .field-label > .icon, .sec-title > .icon { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.secret-out { flex-wrap: wrap; }
.secret-out code { white-space: pre; word-break: normal; overflow-x: auto; max-width: 100%; }
td.ops > *, td.ops form > .op { display: inline-grid; vertical-align: middle; }
.dash .sec-title .hint { margin-inline-start: 8px; font-weight: 400; }
.bl-label[dir=ltr], .bl-label:dir(ltr) { text-align: end; }
#official td input[type=text] { width: 100%; min-width: 200px; }
#official td:nth-child(2) { min-width: 230px; }
.dimmed { opacity: .5; }

/* work calendar, one month */
.cal-bar select { width: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { text-align: center; font-size: .78rem; color: var(--ink3); padding: 4px 0; }
.cal-day { min-height: 74px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--sf); color: var(--ink); text-align: start; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font: inherit; }
.cal-day:hover { border-color: var(--primary); }
.cal-day b { font-size: 1rem; }
.cal-day small { color: var(--ink3); font-size: .68rem; }
.cal-day.rest { background: var(--bg); color: var(--ink3); }
.cal-day.off { background: var(--red-s); border-color: transparent; color: var(--red); }
.cal-day.now { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-day.empty { border: 0; background: none; cursor: default; }
.cal-note { font-size: .7rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-legend { margin-top: 10px; }
.cal-legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -2px; border: 1px solid var(--line); }
.cal-legend .sw.off { background: var(--red-s); } .cal-legend .sw.rest { background: var(--bg); } .cal-legend .sw.now { outline: 2px solid var(--primary); }
@media (max-width: 600px) { .cal-day { min-height: 54px; padding: 4px; } .cal-note { display: none; } .cal-day small { display: none; } }
.cal-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.cal-bar select { min-width: 7em; }
.panel > header { gap: 12px; flex-wrap: wrap; }
.panel > header > .grow { min-width: 0; flex: 1 1 260px; }
.sec-title > .icon { margin-inline-end: 6px; }

/* 4.15.0 redesign: one look for every page. Built on the tokens above; dark mode comes from them. */
input[type=checkbox], input[type=radio] { accent-color: var(--cyan); width: 17px; height: 17px; }
.top { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom-color: transparent; }
.top .icon-btn, .top .lang select { background: var(--sf); box-shadow: inset 0 0 0 1px var(--line); }
.top .icon-btn:hover { color: var(--ink); }
@media (min-width: 1181px) { .kartable:has(> .reader .notices) { grid-template-columns: minmax(0, 1fr) 380px; } }
.notices > header > .icon { width: 20px; height: 20px; margin: 0; stroke-width: 1.8; }
.top .h-ico { width: 38px; height: 38px; border-radius: var(--r-sm); }
.top .h-ico .icon { width: 20px; height: 20px; }
.content, .subnav { width: 100%; max-width: 1480px; margin-inline: auto; }
.content { padding-top: 18px; }
.panel { border-radius: var(--r); }
.panel > header { gap: 10px; }
.panel > header > .icon { color: var(--link); }
a.panel { transition: transform .15s, box-shadow .15s, border-color .15s; }
a.panel:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(16, 40, 72, .1); }
.sec-title { gap: 8px; color: var(--ink2); font-size: .92rem; }
.sec-title .icon { width: 18px; height: 18px; color: var(--link); }
.btn { border-radius: var(--r-sm); transition: background .15s, border-color .15s; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost:hover { background: var(--bg); }

/* home */
.hero { border-radius: calc(var(--r) + 6px); box-shadow: 0 14px 34px rgba(11, 60, 110, .22); }
.stat { position: relative; padding: 12px 18px; border: 1px solid rgba(255, 255, 255, .12); }
.stat > .icon { position: absolute; top: 12px; inset-inline-end: 12px; width: 18px; height: 18px; opacity: .55; }
.stat.warn { background: rgba(240, 122, 122, .22); border-color: rgba(240, 122, 122, .45); }
.home aside { position: sticky; top: 84px; }
.home aside > header { flex-wrap: nowrap; }

/* tabs as one segmented bar */
.tabs:not(.chips) { width: max-content; max-width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 15px; background: var(--sf); box-shadow: var(--sh); }
.tabs:not(.chips) a { height: 36px; border-radius: 11px; }
.tabs a:not(.on):hover, .subnav a:not(.on):hover { background: var(--bg); color: var(--ink); }
.tabs .new { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--amber); color: #231500; font-size: .72rem; font-weight: 700; text-align: center; }

/* cartable items */
.item { position: relative; padding: 14px 16px; transition: background .12s; }
.item .t { font-weight: 700; }
.sla { height: 4px; }
.item.unseen { background: color-mix(in srgb, var(--cyan-s) 45%, transparent); }
.item .dot { display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; background: var(--cyan); vertical-align: middle; }
.notices > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.notices > header > .icon { color: var(--link); }
.reader-empty.notices { padding: 0; text-align: start; color: inherit; }
.reader-empty.notices .empty .icon { margin: 0 auto 8px; }

/* ticket */
.ticket-head { padding: 18px 22px; }
.facts > span { display: inline-flex; align-items: center; gap: 6px; }
.facts .icon { width: 16px; height: 16px; color: var(--ink3); }
.flow-step u { width: 32px; height: 32px; }
.flow-step::before { top: 15px; }
.section > h4 .icon { width: 18px; height: 18px; color: var(--link); }

/* settings */
.snav { position: sticky; top: 84px; }
.sl.on .icon { color: inherit; }
.users th { background: var(--sf2); }
.users tr:not(:first-child):hover td { background: var(--sf2); }

@media (max-width: 860px) {
  .top .h-ico { display: none; }
  .content { padding-top: 12px; }
  .home aside, .snav { position: static; }
  .tabs:not(.chips) { width: auto; -webkit-mask-image: linear-gradient(to left, #000 85%, transparent); mask-image: linear-gradient(to left, #000 85%, transparent); }
  [dir=ltr] .tabs:not(.chips) { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  /* the ticket's action bar stays one swipeable row instead of covering half the screen */
  .actions.sticky { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 10px 12px; }
  .actions.sticky .grow { display: none; }
  .actions.sticky .btn { flex: none; }
  .facts { gap: 4px 14px; }
}
@media (max-width: 640px) {
  /* user list as cards */
  .users table, .users tbody { display: block; }
  .users tr:has(th) { display: none; }
  .users tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .users td { padding: 0; border: 0; }
  .users td:nth-child(2) { flex: 1; min-width: 0; }
  .users td.tg { order: 9; display: flex; align-items: center; gap: 8px; width: 100%; padding-inline-start: 27px; color: var(--ink2); font-size: .82rem; }
  .users td.tg::before { content: attr(data-label); flex: 1; }
  .users .tools .btn.primary { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { a.panel, .item, .btn { transition: none; } a.panel:hover { transform: none; } }

/* floating dock: centred on the start side, only as tall as its icons */
.rail { position: fixed; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); height: auto; max-height: calc(100vh - 24px); width: 76px; padding: 10px 6px; gap: 2px; border-radius: 24px; box-shadow: 0 18px 40px rgba(8, 30, 60, .28), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.rail .logo { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 6px; }
.rail .ri { width: 64px; padding: 7px 2px 5px; font-size: .68rem; }
.rail .ri .icon { width: 22px; height: 22px; transition: transform .15s; }
.rail a.ri:hover .icon { transform: scale(1.15); }
.rail .ri.on::before { inset-inline-start: -6px; }
.rail .badge-n { inset-inline-end: 8px; }
.rail-phone { display: none; }
.shell { grid-template-columns: 100px minmax(0, 1fr); }
.shell:not(.anon) > .main { grid-column: 2; }
.lang select { width: auto; }
.top-user { display: flex; align-items: center; gap: 8px; }
.top-user form { margin: 0; }
.top .icon-btn.on { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.user-chip { display: flex; align-items: center; gap: 8px; height: 42px; padding-inline: 4px 14px; border-radius: 99px; background: var(--sf); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: .85rem; font-weight: 500; text-decoration: none; }
.user-chip .avatar { width: 34px; height: 34px; font-size: .85rem; }
.user-chip .nm { max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hero-msg { white-space: normal; }
@media (max-width: 1100px) { .user-chip .nm { display: none; } .user-chip { padding: 4px; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell:not(.anon) > .main { grid-column: 1; }
  .rail { top: 0; bottom: 0; inset-inline-start: 0; transform: translateX(100%); max-height: none; width: 96px; border-radius: 0; padding: 16px 0 12px; }
  [dir=ltr] .rail { transform: translateX(-100%); }
  .shell.open .rail { transform: none; }
  .rail-phone { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: auto; padding-top: 10px; }
  .top-user { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rail .ri .icon { transition: none; } }

/* nothing is cut: long selects shrink, tabs wrap on wide screens and scroll (active one in view) on phones */
select { max-width: 100%; min-width: 0; }
.inline-row > * { min-width: 0; }
@media (min-width: 861px) { .tabs:not(.chips), .subnav { flex-wrap: wrap; overflow: visible; } }

/* org chart on phones: an indented list instead of a wide tree */
@media (max-width: 640px) {
  .chart-scroll { overflow-x: visible; padding: 12px; }
  .tree { display: block; width: auto; min-width: 0; }
  .level { align-items: stretch; }
  .kids, .vstack { display: block; padding: 8px 0 0; padding-inline-start: 14px; margin-inline-start: 12px; border-inline-start: 2px solid var(--tree); }
  .kids::before, .kids > .level::before, .kids > .level::after { display: none; }
  .kids > .level, .vstack > .level { padding: 0 0 8px; }
  .node, .set-main .node { width: auto; }
}
@media (max-width: 860px) {
  .shell:not(.anon) .top .lang { display: none; }
  .rail-phone .lang select { width: 80px; height: 36px; background: rgba(255, 255, 255, .1); color: #fff; font-size: .75rem; }
  .rail-phone .lang option { color: #000; }
}
.cell-link { display: block; color: var(--ink); font-weight: 500; text-decoration: none; }
.cell-link:hover { color: var(--link); }
.pill .icon { width: 13px; height: 13px; }
.bl-n small { display: inline-block; min-width: 38px; margin-inline-start: 8px; color: var(--ink3); font-size: .74rem; font-weight: 400; }
.stat-row + .sec-title, .dash-row + .sec-title { margin-top: 6px; }
/* suggested text (suggest.js) */
.sg-wrap { position: relative; display: block; }
.sg-ghost { position: absolute; inset: 0; padding: 9px 13px; overflow: hidden; white-space: pre; color: var(--ink3); pointer-events: none; line-height: 1.75; }
.sg-ghost i { font-style: normal; visibility: hidden; }
.sg-ghost b { font-weight: inherit; opacity: .75; }
.sg-ghost b::after { content: 'Tab'; margin-inline-start: 8px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font-size: .68rem; vertical-align: middle; }
/* date picker: month and year lists, labelled previous / next */
.dtp-month { gap: 6px; }
.dtp-nav { width: auto; padding: 0 10px; gap: 4px; display: inline-flex; align-items: center; font-size: .8rem; font-weight: 500; }
.dtp-pick { display: flex; gap: 6px; min-width: 0; }
.dtp-sel { width: auto; min-height: 34px; padding: 2px 8px; border-radius: 10px; font-size: .85rem; font-weight: 700; }
@media (max-width: 420px) { .dtp-nav span { display: none; } .dtp-nav { padding: 0 8px; } }
/* send to another unit: one tap per unit */
.unit-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.unit-pick { position: relative; cursor: pointer; }
.unit-pick input { position: absolute; opacity: 0; }
.unit-pick span { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sf); }
.unit-pick b { display: block; font-size: .87rem; }
.unit-pick small { color: var(--ink3); font-size: .76rem; }
.unit-pick input:checked + span { border-color: var(--cyan); background: var(--cyan-s); box-shadow: 0 0 0 1px var(--cyan); }
.unit-pick input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.vault-heading .sec-title .glyph { width: 34px; height: 34px; border-radius: 11px; }
.vault-heading .sec-title .glyph .icon { width: 18px; height: 18px; }
.vault-heading .tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
/* every printout: logo, organisation name and a frame */
.print-head { display: none; }
@media print {
  .print-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 2px solid #0B3C6E; color: #0B3C6E; }
  .print-head b { display: block; font-size: 14px; }
  .print-head span, .print-head small { color: #4C5F76; font-size: 11px; }
  .content { padding: 8mm !important; border: .5mm solid #0B3C6E; border-radius: 4mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .content:has(> .sheet), .content:has(.sheet-wrap) { border: 0; padding: 0 !important; }
  .sheet { border: .5mm solid #0B3C6E; border-radius: 4mm; box-shadow: none; }
  .panel { box-shadow: none; }
}
/* settings pop-ups are narrow: one field per row so labels of different length never push inputs out of line */
dialog .fgrid, dialog .fgrid.three { grid-template-columns: minmax(0, 1fr); }
.money-row input[data-money] { flex: 1 1 160px; text-align: left; font-variant-numeric: tabular-nums; }
.money-row select { flex: 0 0 auto; width: auto; }
/* text-only cards: the text sits in the middle, both ways */
.tile.plain { display: flex; align-items: center; justify-content: center; min-height: 76px; text-align: center; }
/* vault subject cards wear their heading's colour */
.tile.tone-cy { border: 1.5px solid var(--cyan); } .tile.tone-nv { border: 1.5px solid var(--nv-t); }
.tile.tone-vi { border: 1.5px solid var(--vio); } .tile.tone-gr { border: 1.5px solid var(--green); }
.tile.tone-am { border: 1.5px solid var(--amber); } .tile.tone-rd { border: 1.5px solid var(--red); }
.tile { text-align: center; } .tile .glyph { margin-inline: auto; }
/* quick search (core/_quick.html) */
.quick-box { margin-bottom: 12px; }
.quick-box input { height: 44px; border-radius: var(--r-sm); }
.snav .quick-box { margin: 0 0 8px; }
.snav[data-searching] h6 { display: none; }
.quick-wrap { position: relative; }
.quick-hits { position: absolute; inset-inline: 0; top: 50px; z-index: 15; max-height: 360px; overflow-y: auto; box-shadow: 0 16px 40px rgba(8, 30, 60, .18); }
/* settings quick access */
.shortcut { position: relative; }
.shortcut form { position: absolute; top: 6px; inset-inline-end: 6px; margin: 0; opacity: .55; }
.shortcut:hover form, .shortcut form:focus-within { opacity: 1; }
.add-card { border: 1.5px dashed var(--line); background: transparent; box-shadow: none; color: var(--ink2); cursor: pointer; font: inherit; font-weight: 700; }
.add-card:hover { border-color: var(--cyan); color: var(--link); }
dialog .shortcut-pick { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: 60vh; overflow-y: auto; }
dialog:has(.shortcut-pick) { width: min(720px, calc(100vw - 32px)); }
.shortcut-pick .app-card { cursor: pointer; font: inherit; font-weight: 700; text-align: start; }
/* every group of cards sits in a named box */
.group-box { padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sf); box-shadow: var(--sh); }
.group-box > .sec-title { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--ink); }
.group-box .app-card, .group-box .tile, .group-box .cat-tile { box-shadow: none; background: var(--sf2); }
@media (max-width: 860px) { .group-box { padding: 12px; } .apps.grid-4 .app-card { background: none; } }
/* a list row with its own edit button: the row opens, the button edits */
.line > .row-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
/* Vault subjects: rows edited in place, one save for all */
.subjects-layout .panel > header { flex-wrap: nowrap; }
.subjects-layout .panel > header > .grow { flex: 1 1 0; }
.vault-rows td, .vault-rows th { vertical-align: middle; }
.vault-rows td:nth-child(n+4) { white-space: nowrap; width: 1%; }
.vault-rows input.days { width: 5.5em; min-height: 36px; padding: 4px 8px; text-align: center; }
.vault-rows select { width: auto; min-height: 36px; padding: 4px 10px; }
.rows-buttons { padding: 12px 18px; border-top: 1px solid var(--line); margin: 0; }
@media (max-width: 767px) { .subjects-layout .panel > header { flex-wrap: wrap; } }
.subjects-layout.stack { grid-template-columns: minmax(0, 1fr); }
.heading-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.heading-grid .line { border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); }
.vault-rows td:first-child { min-width: 9em; }
