/* Demo app layout: icon rail (expands on hover), dense work-software tables. */
body { display: flex; min-height: 100vh; }
.rail { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 64px; background: var(--ink); color: #C9CED2; display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; overflow: hidden; transition: width .18s ease; }
.rail:hover, .rail:focus-within { width: 208px; box-shadow: 8px 0 24px rgba(0,0,0,.18); }
.rail a { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 11px; border-radius: 8px; text-decoration: none; white-space: nowrap; font-weight: 600; font-size: 14px; }
.rail a:hover { background: var(--ink-2); color: #fff; }
.rail a.on { background: var(--pop); color: #121212; }
.rail a span { opacity: 0; transition: opacity .12s; }
.rail:hover a span, .rail:focus-within a span { opacity: 1; }
.rail svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main { flex: 1; margin-left: 64px; min-width: 0; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.co { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.co .mark { background: var(--ink); color: #fff; }
.co b { display: block; font-family: var(--head); }
.sample { display: block; color: var(--mute); font-size: 12px; }
.role { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.role select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--bg); color: var(--ink); font-weight: 600; }
#page { padding: 24px; max-width: 1240px; outline: none; }
.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { font-size: 26px; margin: 0 auto 0 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card h2 { font-size: 15px; margin-bottom: 10px; }
.kpi small { color: var(--mute); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi b { display: block; font: 800 26px var(--head); margin: 2px 0; }
.kpi span { font-size: 13px; color: var(--mute); }
.kpi.bad b { color: var(--bad); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--mute); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr[data-open] { cursor: pointer; }
.tbl tr[data-open]:hover td { background: var(--bg); }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--pop-soft); color: var(--ink); white-space: nowrap; }
.pill.good { background: #E1F0E7; color: var(--good); }
.pill.warn { background: #F6EBD6; color: var(--warn); }
.pill.bad { background: #F6E0E0; color: var(--bad); }
.pill.grey { background: #ECEEEF; color: var(--mute); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list li:last-child { border: 0; }
.list .when { margin-left: auto; color: var(--mute); font-size: 13px; white-space: nowrap; }
.prog { height: 8px; border-radius: 99px; background: #E6E9EB; overflow: hidden; margin: 6px 0 2px; }
.prog i { display: block; height: 100%; background: var(--ink); }
.muted { color: var(--mute); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--ink); color: #fff; }
.board { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(220px, 1fr)); overflow-x: auto; }
.col { background: #E9ECEE; border-radius: var(--r); padding: 10px; min-height: 120px; }
.col h3 { font: 700 13px var(--font); color: var(--mute); margin: 2px 4px 8px; }
.task { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.task:hover { border-color: var(--steel); }
.task small { display: block; color: var(--mute); margin-top: 4px; }
.update { border-bottom: 1px solid var(--line); padding: 14px 0; }
.update:last-child { border: 0; }
.update dl { display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; margin: 8px 0 0; font-size: 14px; }
.update dt { font-weight: 700; color: var(--mute); font-size: 12px; text-transform: uppercase; padding-top: 2px; }
.update dd { margin: 0; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pop-soft); font-size: 11px; font-weight: 700; flex: none; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--font); fill: var(--mute); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--mute); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.day { font-weight: 700; font-size: 13px; color: var(--mute); margin: 14px 0 4px; }
.day:first-child { margin-top: 0; }
form.stack { display: grid; gap: 10px; }
form.stack label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
form.stack input, form.stack select, form.stack textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card); font-weight: 400; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
dialog { border: 0; border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(20,22,24,.45); }
#dlgBody { padding: 22px; }
#dlgBody h2 { font-size: 20px; }
.x { float: right; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--mute); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.note { background: var(--pop-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.inv-paper { border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.inv-paper header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

@media (max-width: 760px) {
  .rail { inset: auto 0 0 0; width: auto; height: 62px; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .rail:hover, .rail:focus-within { width: auto; box-shadow: none; }
  .rail a { flex-direction: column; justify-content: center; gap: 2px; height: 50px; padding: 0 2px; flex: 1; font-size: 10px; font-weight: 600; min-width: 0; }
  .rail a span { opacity: 1; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .main { margin-left: 0; padding-bottom: 76px; }
  .bar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .exit { order: 2; }
  .role { order: 3; width: 100%; }
  .role select { flex: 1; }
  #page { padding: 16px; }
  .head h1 { font-size: 22px; }
  .board { grid-template-columns: repeat(3, 78vw); }
  .hide-sm { display: none; }
}
@media print {
  body * { visibility: hidden; }
  dialog, dialog * { visibility: visible; }
  dialog { position: absolute; inset: 0; box-shadow: none; width: 100%; max-height: none; }
  .no-print { display: none !important; }
}
