/* Demo Kit styles — app chrome + components used inside the 18 demos */
.app-frame { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 620px; background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-1); font-size: .92rem; }
.app-side { background: var(--ink); color: #D7D8DC; display: flex; flex-direction: column; padding: 16px 12px; gap: 14px; }
.app-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-brand b { display: block; color: #fff; font-family: var(--f-display); font-size: .95rem; line-height: 1.2; }
.app-brand small { display: block; font-size: .72rem; color: #9A9CA3; }
.app-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--orange); color: var(--ink); display: grid; place-items: center; flex: none; }
.app-nav { display: grid; gap: 2px; }
.app-nav-i { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #C4C6CC; text-align: left; padding: 10px 10px; border-radius: 10px; font-weight: 600; font-size: .88rem; }
.app-nav-i:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-nav-i.on { background: rgba(255,122,0,.16); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.app-nav-i.on .i { color: var(--orange); }
.app-nav-i em { margin-left: auto; font-style: normal; font-size: .7rem; font-weight: 800; background: var(--orange); color: var(--ink); border-radius: 999px; padding: 1px 7px; }
.app-user { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px 6px 2px; border-top: 1px solid rgba(255,255,255,.08); }
.app-user b { display: block; color: #fff; font-size: .82rem; }
.app-user small { display: block; font-size: .7rem; color: #9A9CA3; }
.app-frame > *, .app-body > *, .app-main > * { min-width: 0; }
.app-main { min-width: 0; display: flex; flex-direction: column; background: #FAFAFB; }
.app-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.app-top h3 { margin: 0; font-size: 1.12rem; }
.app-top p { margin: 2px 0 0; color: var(--text-3); font-size: .82rem; }
.app-top-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.app-body { padding: 18px 20px 22px; display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (max-width: 900px) {
  .app-frame { grid-template-columns: 1fr; border-radius: 18px; }
  .app-side { padding: 10px; gap: 8px; }
  .app-brand { border: 0; padding: 4px; }
  .app-nav { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: thin; padding-bottom: 2px; }
  .app-nav-i { flex: none; padding: 8px 12px; white-space: nowrap; }
  .app-nav-i.on { box-shadow: inset 0 -3px 0 var(--orange); }
  .app-user { display: none; }
  .app-body { padding: 14px; }
  .app-top { padding: 12px 14px; }
}

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.kpi-h { display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: .8rem; font-weight: 700; }
.kpi-ic { width: 26px; height: 26px; border-radius: 8px; background: var(--orange-50); color: var(--orange-700); display: grid; place-items: center; }
.kpi-v { font-family: var(--f-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-f { display: flex; gap: 8px; align-items: center; font-size: .76rem; justify-content: space-between; min-height: 22px; }
.kpi-f .spark { margin-left: auto; }
.kpi-bad { border-color: #F5C4BF; background: #FFF9F8; }
.kpi-warn { border-color: #FFE1B0; background: #FFFCF6; }
.delta { display: inline-flex; gap: 2px; align-items: center; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.delta.up { color: var(--ok); background: var(--ok-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }

/* Panel cards */
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.pcard-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 0; flex-wrap: wrap; }
.pcard-h h4 { margin: 0; font-size: .98rem; }
.pcard-h p { margin: 2px 0 0; font-size: .78rem; color: var(--text-3); }
.pcard-a { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pcard-b { padding: 14px 16px 16px; }
.dgrid { display: grid; gap: 16px; min-width: 0; }
.dgrid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dgrid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dgrid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dgrid-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dgrid-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .dgrid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dgrid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dgrid-2, .dgrid-3, .dgrid-21, .dgrid-12 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) { .dgrid-4 { grid-template-columns: minmax(0, 1fr); } }

/* Table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: left; font-size: .74rem; font-weight: 800; color: var(--text-3); padding: 10px 12px; background: #FAFAFB; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.dense td { padding: 8px 12px; }
.tbl .a-r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .a-c { text-align: center; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #FFF9F3; }
.tbl tr.sel td { background: var(--orange-50); }
.th-sort { border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; text-transform: inherit; }
.th-sort:hover { color: var(--ink); }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main b { display: block; font-weight: 700; }
.cell-main small { display: block; color: var(--text-3); font-size: .76rem; }
@media (max-width: 620px) {
  .tbl-wrap.stack, .tbl-wrap { border: 0; background: transparent; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 6px 0; }
  .tbl td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 12px; text-align: right !important; }
  .tbl td::before { content: attr(data-label); font-weight: 700; color: var(--text-3); font-size: .76rem; text-align: left; }
  .tbl td[data-label=""]::before { content: none; }
  .tbl .cell-main { text-align: left; }
}

/* Badges, pills, seg, avatar */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.b-neutral { background: var(--bg-2); color: var(--text-2); }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-brand { background: var(--orange-50); color: var(--orange-700); }
.b-dark { background: var(--ink); color: #fff; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; flex: none; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: .8rem; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }
.pill { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .8rem; color: var(--text-2); }
.pill.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.searchbox { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 0 10px; background: #fff; min-height: 36px; color: var(--text-3); min-width: 0; }
.searchbox input { border: 0; outline: 0; min-width: 0; width: 100%; padding: 7px 0; font-size: .86rem; background: transparent; color: var(--text); }
.searchbox:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,122,0,.15); }
.tbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.tbar-l, .tbar-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.tbar-l .searchbox { width: 240px; max-width: 100%; }
.prog { display: block; height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; min-width: 60px; }
.prog > span { display: block; height: 100%; border-radius: 8px; background: var(--orange); transition: width .3s; }
.prog-ok > span { background: #22A355; } .prog-warn > span { background: #E6A100; } .prog-bad > span { background: var(--bad); } .prog-info > span { background: #3B5BA9; }
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 34px 16px; color: var(--text-3); }
.empty b { color: var(--text); }
.empty p { margin: 0; font-size: .88rem; }
.mstat { display: grid; gap: 2px; }
.mstat small { font-size: .74rem; color: var(--text-3); font-weight: 700; }
.mstat b { font-family: var(--f-display); font-size: 1.05rem; }

/* Fields inside modals / demos */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: grid; gap: 6px; font-size: .82rem; font-weight: 700; grid-column: 1 / -1; color: var(--text-2); }
.field.half { grid-column: auto; }
.field i { color: var(--orange-700); font-style: normal; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; font-size: .92rem; font-weight: 500; color: var(--text); }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,122,0,.15); }
.field small { font-weight: 500; color: var(--text-3); }
[aria-invalid=true] { border-color: var(--bad) !important; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } .field.half { grid-column: 1 / -1; } }

/* Charts */
.chart-wrap { width: 100%; min-width: 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--f-body); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(31,31,31,.04); }
.chart rect[data-tip]:hover { opacity: .8; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--text-2); margin-bottom: 6px; font-weight: 650; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .84rem; }
.hbar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-weight: 600; }
.hbar-track { height: 10px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; border-radius: 6px; }
.hbar-v { font-weight: 800; font-variant-numeric: tabular-nums; }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.donut svg circle[data-tip] { cursor: default; }
.donut-c { font-family: var(--f-display); font-weight: 700; font-size: 20px; fill: var(--ink); }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .84rem; min-width: 150px; flex: 1; }
.donut-legend li { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend span { color: var(--text-2); flex: 1; }
.ring-t { font-family: var(--f-display); font-weight: 700; font-size: 18px; fill: var(--ink); }

/* Timeline */
.tl { list-style: none; margin: 0; padding: 0; display: grid; }
.tl li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.tl li:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.tl li.done:not(:last-child)::before { background: var(--orange); }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; display: grid; place-items: center; color: var(--ink); }
.tl li.done .tl-dot { background: var(--orange); border-color: var(--orange); }
.tl li.cur .tl-dot { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255,122,0,.18); }
.tl b { font-size: .9rem; }
.tl small { display: block; color: var(--text-3); font-size: .76rem; }
.tl p { margin: 2px 0 0; font-size: .84rem; color: var(--text-2); }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--bg-2); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 260px; transition: background .15s, box-shadow .15s; }
.kcol.drop-over { background: var(--orange-50); box-shadow: inset 0 0 0 2px var(--orange); }
.kcol-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: .82rem; padding: 2px 4px 4px; }
.kcol-h small { color: var(--text-3); font-weight: 700; }
.kitem { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: grab; display: grid; gap: 6px; font-size: .84rem; }
.kitem:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.kitem.dragging { opacity: .45; }
.kitem-f { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* Misc demo helpers */
.list { display: grid; gap: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main small { display: block; color: var(--text-3); font-size: .76rem; }
.li-end { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 12px; text-align: left; display: grid; gap: 4px; font-size: .84rem; transition: border-color .12s, transform .12s; }
.tile:hover { border-color: var(--orange); }
.tile:active { transform: scale(.98); }
.tile.on { border-color: var(--orange); background: var(--orange-50); }
.tile-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); color: var(--text-2); margin-bottom: 4px; }
.tile b { font-size: .88rem; }
.tile small { color: var(--text-3); }
.tile .price { font-family: var(--f-display); font-weight: 700; color: var(--ink); }
.split-v { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .split-v { grid-template-columns: minmax(0, 1fr); } }
.sticky-panel { position: sticky; top: 84px; }
.total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .88rem; }
.total-row.grand { border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 12px; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.qty button { border: 0; background: #fff; width: 28px; height: 28px; display: grid; place-items: center; }
.qty button:hover { background: var(--bg-2); }
.qty span { min-width: 26px; text-align: center; font-weight: 800; font-size: .84rem; }
.receipt { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .82rem; background: #fff; border: 1px dashed var(--line-2); padding: 16px; border-radius: 10px; }
.receipt .r { display: flex; justify-content: space-between; gap: 10px; }
.receipt hr { border: 0; border-top: 1px dashed var(--line-2); margin: 8px 0; }
.calendar-grid { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: #fff; }
.cg-row { display: contents; }
.cg-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 44px; padding: 4px; font-size: .76rem; position: relative; }
.cg-head { background: #FAFAFB; font-weight: 800; color: var(--text-2); padding: 8px; position: sticky; top: 0; z-index: 1; }
.cg-time { color: var(--text-3); font-weight: 700; background: #FAFAFB; }
.evt { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--orange); background: var(--orange-50); border-radius: 6px; padding: 4px 6px; font-size: .74rem; color: var(--ink); line-height: 1.25; margin-bottom: 2px; }
.evt.blue { border-left-color: #3B5BA9; background: var(--info-bg); }
.evt.teal { border-left-color: #14A38B; background: #E3F6F2; }
.evt.violet { border-left-color: #9A4FBF; background: #F3EAF8; }
.evt.grey { border-left-color: var(--text-3); background: var(--bg-2); }
.slot-btn { width: 100%; height: 100%; min-height: 36px; border: 1px dashed transparent; background: transparent; border-radius: 6px; color: transparent; font-size: .72rem; }
.slot-btn:hover, .slot-btn:focus-visible { border-color: var(--orange); color: var(--orange-700); }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow-y: auto; background: #fff; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: .88rem; line-height: 1.45; white-space: pre-wrap; }
.msg.bot { background: var(--bg-2); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--ink); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg small { display: block; font-size: .68rem; opacity: .6; margin-top: 4px; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.device { margin: 0 auto; width: 340px; max-width: 100%; border-radius: 44px; background: var(--ink); padding: 12px; box-shadow: var(--shadow-2); }
.device-screen { border-radius: 34px; overflow: hidden; background: #fff; height: 640px; display: flex; flex-direction: column; position: relative; }
.device-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 22px 6px; font-size: .74rem; font-weight: 800; }
.device-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 96px; height: 24px; background: var(--ink); border-radius: 14px; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .82em; }
.hr { height: 1px; background: var(--line); margin: 4px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.tag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.signpad { width: 100%; height: 160px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: #FCFCFD; touch-action: none; cursor: crosshair; }
