@font-face { font-family: "Noto Sans Lao"; src: url("fonts/NotoSansLao-lao-vf.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0E80-0EFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Lao"; src: url("fonts/NotoSansLao-latin-vf.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2191-2193, U+2212; }

:root {
  color-scheme: light;
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f7;
  --text: #0f172a; --text-2: #475569; --muted: #8492a6; --line: #e5e9f0; --line-2: #d5dbe5;
  --brand: #1d4ed8; --brand-2: #2563eb; --brand-ink: #ffffff; --brand-soft: #e8efff; --brand-glow: rgba(37, 99, 235, .25);
  --good: #0ca30c; --good-soft: #e6f6e6; --good-ink: #006300;
  --warn: #fab219; --warn-soft: #fff5dc; --warn-ink: #8a5a00;
  --serious: #ec835a; --serious-soft: #fdeee7; --serious-ink: #a8431b;
  --crit: #d03b3b; --crit-soft: #fdeaea; --crit-ink: #a32222;
  --info-soft: #e7f1fd; --info-ink: #1c5cab;
  /* chart roles (validated reference palette) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-7: #4a3aa7;
  --grid: #e9edf3; --axis: #c9d1dc;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-2: 0 10px 30px -12px rgba(15, 23, 42, .18), 0 4px 10px -6px rgba(15, 23, 42, .08);
  --shadow-3: 0 30px 70px -20px rgba(15, 23, 42, .35);
  --r: 14px; --r-sm: 9px; --side: 250px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020; --surface: #131a2c; --surface-2: #182036; --surface-3: #1e2841;
  --text: #f1f5f9; --text-2: #b6c2d4; --muted: #7d8aa1; --line: #232d45; --line-2: #2e3a57;
  --brand: #3b82f6; --brand-2: #60a5fa; --brand-soft: #172649; --brand-glow: rgba(59, 130, 246, .3);
  --good-soft: #0f2a16; --good-ink: #4ade80; --warn-soft: #33270a; --warn-ink: #fbbf24; --serious-soft: #35190e; --serious-ink: #f4a582;
  --crit-soft: #3a1414; --crit-ink: #f87171; --info-soft: #12284a; --info-ink: #7fb4f5;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-7: #9085e9;
  --grid: #222c44; --axis: #33405f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 12px 32px -12px rgba(0, 0, 0, .6); --shadow-3: 0 30px 70px -20px rgba(0, 0, 0, .8);
}

@font-face { font-family: "Noto Sans Thai"; src: url("fonts/NotoSansThai-thai-vf.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 "Noto Sans Lao", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
::selection { background: var(--brand-glow); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); } ::-webkit-scrollbar-track { background: transparent; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- boot / keyframes ---------- */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); }
.boot-cube { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), #60a5fa); animation: cube 1.2s var(--ease) infinite; box-shadow: 0 12px 30px var(--brand-glow); }
@keyframes cube { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.72); border-radius: 50%; } 100% { transform: rotate(360deg) scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(208, 59, 59, .5); } 70% { box-shadow: 0 0 0 9px rgba(208, 59, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(208, 59, 59, 0); } }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, -50px) scale(1.12); } 66% { transform: translate(-30px, 30px) scale(.94); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-art { position: relative; overflow: hidden; background: linear-gradient(140deg, #0b1b4d 0%, #1d4ed8 55%, #38bdf8 120%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 16s ease-in-out infinite; }
.login-art .b1 { width: 380px; height: 380px; background: #60a5fa; top: -90px; right: -60px; }
.login-art .b2 { width: 300px; height: 300px; background: #22d3ee; bottom: -60px; left: -40px; animation-delay: -5s; }
.login-art .b3 { width: 220px; height: 220px; background: #a78bfa; top: 45%; left: 45%; animation-delay: -9s; }
.login-art > * { position: relative; z-index: 1; }
.login-art h1 { font-size: 34px; font-weight: 700; letter-spacing: -.01em; max-width: 460px; animation: rise .8s var(--ease) both; }
.login-art p { opacity: .85; max-width: 420px; font-size: 15px; animation: rise .8s .1s var(--ease) both; }
.login-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 470px; }
.login-feats div { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px); border-radius: 12px; padding: 11px 14px; font-size: 13px; animation: rise .7s var(--ease) both; }
.login-feats div:nth-child(2) { animation-delay: .08s; } .login-feats div:nth-child(3) { animation-delay: .16s; } .login-feats div:nth-child(4) { animation-delay: .24s; }
.login-form { display: grid; place-content: center; padding: 40px; }
.login-box { width: min(380px, 86vw); animation: pop .7s var(--ease) both; }
.login-box.shake { animation: shake .5s; }
.login-box h2 { font-size: 24px; margin-bottom: 4px; } .login-box .sub { color: var(--text-2); margin-bottom: 28px; }
.brand-mark { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, var(--brand), #38bdf8); display: grid; place-items: center; color: #fff; box-shadow: 0 10px 24px var(--brand-glow); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.side-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.side-brand b { display: block; font-size: 14.5px; line-height: 1.25; } .side-brand small { color: var(--muted); font-size: 11.5px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; transition: background .2s, color .2s, transform .2s var(--ease); }
.nav a:hover { background: var(--surface-3); color: var(--text); transform: translateX(2px); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); animation: fade .3s; }
.nav a .count { margin-left: auto; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side-user { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #38bdf8); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.side-user .who { min-width: 0; flex: 1; } .side-user .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .side-user .who small { color: var(--muted); font-size: 11.5px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.top h1 { font-size: 19px; } .top .crumb { color: var(--muted); font-size: 12.5px; }
.top .sp { flex: 1; }
/* 'backwards' only: a transform kept after the animation would make .page the containing block of position:fixed overlays */
.page { padding: 8px 28px 48px; animation: rise .45s var(--ease) backwards; }
.menu-btn { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; } .menu-btn { display: inline-flex; }
  .side { position: fixed; left: 0; width: var(--side); transform: translateX(-100%); transition: transform .35s var(--ease); box-shadow: var(--shadow-3); } .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 25; animation: fade .2s; }
  .page { padding: 8px 16px 40px; } .top { padding: 12px 16px; }
}

/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: transform .18s var(--ease), box-shadow .2s, background .2s, border-color .2s; position: relative; overflow: hidden; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-2); border-color: var(--muted); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px var(--brand-glow); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 12px 24px -8px var(--brand-glow); }
.btn.good { background: var(--good); border-color: transparent; color: #fff; } .btn.danger { background: var(--crit); border-color: transparent; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover:not(:disabled) { background: var(--surface-3); box-shadow: none; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; } .btn.icon { width: 38px; padding: 0; } .btn.sm.icon { width: 32px; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .25; transform: scale(0); animation: ripple .6s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); transition: box-shadow .3s, transform .3s var(--ease), border-color .3s; }
.card.hover:hover { box-shadow: var(--shadow-2); transform: translateY(-3px); border-color: var(--line-2); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; } .card-h h3 { font-size: 14.5px; font-weight: 650; } .card-h .sub { color: var(--muted); font-size: 12px; } .card-h .sp { flex: 1; }
.card-b { padding: 16px 18px 18px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g-23 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3, .g-23 { grid-template-columns: 1fr; } } @media (max-width: 700px) { .g2, .g4 { grid-template-columns: 1fr; } }
.stagger > * { animation: rise .55s var(--ease) both; }
.stagger > :nth-child(2) { animation-delay: .05s; } .stagger > :nth-child(3) { animation-delay: .1s; } .stagger > :nth-child(4) { animation-delay: .15s; } .stagger > :nth-child(5) { animation-delay: .2s; } .stagger > :nth-child(6) { animation-delay: .25s; } .stagger > :nth-child(n+7) { animation-delay: .3s; }

.stat { padding: 18px; position: relative; overflow: hidden; cursor: default; }
.stat .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; transition: transform .4s var(--ease); }
.stat:hover .ico { transform: scale(1.1) rotate(-6deg); }
.stat .label { color: var(--text-2); font-size: 12.5px; } .stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; } .stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat .foot { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stat.t-good .ico { background: var(--good-soft); color: var(--good-ink); } .stat.t-warn .ico { background: var(--warn-soft); color: var(--warn-ink); } .stat.t-crit .ico { background: var(--crit-soft); color: var(--crit-ink); } .stat.t-info .ico { background: var(--info-soft); color: var(--info-ink); }
.stat.click { cursor: pointer; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-soft); color: var(--good-ink); } .badge.warn { background: var(--warn-soft); color: var(--warn-ink); } .badge.serious { background: var(--serious-soft); color: var(--serious-ink); }
.badge.crit { background: var(--crit-soft); color: var(--crit-ink); } .badge.info { background: var(--info-soft); color: var(--info-ink); } .badge.crit.pulse::before { animation: pulse-ring 1.6s infinite; }
.badge.plain::before { display: none; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; } .delta.up { color: var(--crit-ink); } .delta.down { color: var(--good-ink); } .delta.same { color: var(--muted); }

.field { display: grid; gap: 6px; } .field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); } .field .hint { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s; }
textarea.input { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }
.input.sm { height: 32px; border-radius: 8px; padding: 0 8px; } .input.num-in { text-align: right; font-variant-numeric: tabular-nums; }
.input-ico { position: relative; } .input-ico svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; } .input-ico .input { padding-left: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; } .form-grid .full { grid-column: 1 / -1; } @media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; } .check input { width: 17px; height: 17px; accent-color: var(--brand); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; } .toolbar .sp { flex: 1; } .toolbar .input, .toolbar select.input { width: auto; min-width: 140px; } .toolbar .input-ico { flex: 1 1 220px; max-width: 340px; } .toolbar .input-ico .input { width: 100%; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 13px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all .25s var(--ease); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--text-2); cursor: pointer; position: relative; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 3px; background: var(--brand); transform: scaleX(0); transition: transform .3s var(--ease); }
.tabs button.on { color: var(--brand); } .tabs button.on::after { transform: scaleX(1); }

/* ---------- table ---------- */
.table-wrap { overflow: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); max-height: calc(100vh - 230px); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.t th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-size: 11.5px; font-weight: 650; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.t th.sort { cursor: pointer; } .t th.sort:hover { color: var(--brand); } .t th .arr { opacity: .9; margin-left: 3px; color: var(--brand); }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; } .t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .15s; } .t tbody tr:hover { background: var(--surface-2); } .t tbody tr.click { cursor: pointer; }
.t .r { text-align: right; font-variant-numeric: tabular-nums; } .t .c { text-align: center; } .t .dim { color: var(--muted); } .t .strong { font-weight: 600; }
.t tr.group td { background: var(--surface-3); font-weight: 650; font-size: 12px; color: var(--text-2); position: sticky; top: 37px; z-index: 1; }
.t tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line-2); padding: 10px 12px; }
.t td.sticky, .t th.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; } .t th.sticky { z-index: 3; background: var(--surface-2); }
.t .name { max-width: 340px; } .t .name b { font-weight: 600; display: block; } .t .name small { color: var(--muted); }
.cell-hi { background: color-mix(in srgb, var(--good-soft) 70%, transparent); font-weight: 650; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; } .bar-cell .track { flex: 1; height: 7px; border-radius: 7px; background: var(--surface-3); overflow: hidden; }
.bar-cell .fill { height: 100%; border-radius: 7px; background: var(--series-1); transform-origin: left; animation: grow-x .9s var(--ease) both; }
.fill.good { background: var(--good); } .fill.warn { background: var(--warn); } .fill.crit { background: var(--crit); }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 46px 20px; color: var(--muted); text-align: center; } .empty .ico { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-3); display: grid; place-items: center; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { width: min(var(--w, 560px), 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-3); animation: pop .35s var(--ease) both; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); } .modal-h h3 { font-size: 16px; flex: 1; }
.modal-b { padding: 20px 22px; overflow: auto; }
.modal-f:not(:has(.btn)) { display: none; } .modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--w, 620px), 100%); background: var(--surface); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide-in .4s var(--ease) both; z-index: 61; }
.overlay.side-r { place-items: stretch end; padding: 0; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 400px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); box-shadow: var(--shadow-2); animation: pop .4s var(--ease) both; white-space: pre-line; font-size: 13px; }
.toast.ok { border-left-color: var(--good); } .toast.err { border-left-color: var(--crit); } .toast.warn { border-left-color: var(--warn); }
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-height: 460px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-3); animation: pop .25s var(--ease) both; z-index: 40; }
.pop h4 { padding: 14px 16px 8px; font-size: 13px; } .pop .row { display: flex; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12.5px; cursor: pointer; } .pop .row:hover { background: var(--surface-2); } .pop .row b { display: block; font-weight: 600; } .pop .row small { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--info-ink); } .dot.danger { background: var(--crit); } .dot.warn { background: var(--warn); }
.bell { position: relative; } .bell .n { position: absolute; top: -4px; right: -4px; background: var(--crit); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; animation: pulse-ring 2s infinite; }

/* ---------- misc ---------- */
.chart-box { position: relative; height: var(--h, 260px); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.list { display: grid; } .list .li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); } .list .li:last-child { border: 0; } .list .li .grow { flex: 1; min-width: 0; } .list .li b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .list .li small { color: var(--muted); }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); flex: none; } .rank.top { background: var(--brand-soft); color: var(--brand); }
.steps { display: flex; gap: 0; margin: 4px 0 18px; } .steps .st { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); position: relative; padding-top: 22px; }
.steps .st::before { content: ""; position: absolute; top: 4px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--line-2); z-index: 1; transition: all .4s var(--ease); }
.steps .st::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line-2); } .steps .st:first-child::after { display: none; }
.steps .st.done { color: var(--text); font-weight: 600; } .steps .st.done::before { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); } .steps .st.done::after { background: var(--good); }
.steps .st.bad::before { background: var(--crit); box-shadow: 0 0 0 4px var(--crit-soft); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--info-soft); color: var(--info-ink); font-size: 13px; margin-bottom: 14px; } .note.warn { background: var(--warn-soft); color: var(--warn-ink); } .note.crit { background: var(--crit-soft); color: var(--crit-ink); }
.meter { height: 9px; border-radius: 9px; background: var(--surface-3); overflow: hidden; } .meter > i { display: block; height: 100%; border-radius: 9px; background: var(--series-1); transform-origin: left; animation: grow-x 1s var(--ease) both; }
.stars { display: inline-flex; gap: 3px; } .stars button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--line-2); transition: transform .2s var(--ease), color .2s; } .stars button.on { color: var(--warn); } .stars button:hover { transform: scale(1.25); }
.grade { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; font-weight: 800; background: var(--surface-3); } .grade.A { background: var(--good-soft); color: var(--good-ink); } .grade.B { background: var(--info-soft); color: var(--info-ink); } .grade.C { background: var(--warn-soft); color: var(--warn-ink); } .grade.D { background: var(--crit-soft); color: var(--crit-ink); }
.drop { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 30px; text-align: center; color: var(--text-2); transition: all .25s; cursor: pointer; } .drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); transform: scale(1.01); }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .sp { flex: 1; } .mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.report-card { padding: 16px; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; } .report-card .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; } .report-card b { display: block; font-size: 13.5px; } .report-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
@media print { .side, .top, .toolbar, .tabs, .toasts, .no-print { display: none !important; } .shell { display: block; } .table-wrap { max-height: none; overflow: visible; border: 0; } .page { padding: 0; } body { background: #fff; } }

/* ---------- language switch + account shortcut ---------- */
.seg.lang button { height: 28px; padding: 0 10px; font-size: 12px; }
.seg.lang.on-dark { background: rgba(255, 255, 255, .14); } .seg.lang.on-dark button { color: rgba(255, 255, 255, .8); } .seg.lang.on-dark button.on { background: #fff; color: #1d4ed8; }
.login-lang { display: none; } @media (max-width: 860px) { .login-lang { display: block; } }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 4px 0; } .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.quick { height: 54px; justify-content: flex-start; gap: 12px; padding: 0 14px; border-style: dashed; border-color: var(--brand); background: var(--brand-soft); } .btn.quick > span:nth-child(2) { flex: 1; }
@media (max-width: 700px) { .top .seg.lang { display: none; } }

/* =====================================================================
   Phone experience ("super app"): tab bar, hero home, cards, bottom sheets
   ===================================================================== */
.tone-blue { background: #e7f0ff; color: #1d4ed8; } .tone-teal { background: #dff7f1; color: #0d8a6a; } .tone-indigo { background: #eae8ff; color: #4a3aa7; } .tone-orange { background: #ffeede; color: #c4521b; }
.tone-pink { background: #ffe6f0; color: #b83268; } .tone-violet { background: #f1e8ff; color: #7a3fc4; } .tone-green { background: #e3f7e3; color: #15803d; } .tone-amber { background: #fff3d1; color: #a16207; }
.tone-sky { background: #e0f4ff; color: #0369a1; } .tone-slate { background: #e9eef5; color: #475569; }
:root[data-theme="dark"] [class*="tone-"] { background: color-mix(in srgb, currentColor 18%, transparent); filter: brightness(1.45); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
.tile { display: grid; justify-items: center; gap: 7px; padding: 4px 2px; border: 0; background: none; color: var(--text); font-size: 11.5px; font-weight: 500; line-height: 1.25; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tile-ico { position: relative; width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; transition: transform .25s var(--ease); }
.tile:active .tile-ico { transform: scale(.9); } .tile.on .tile-ico { box-shadow: 0 0 0 2px var(--brand); }
.tile-ico i, .tabbar .ti i { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--crit); color: #fff; font: 700 11px/19px system-ui; text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }

@media (max-width: 760px) {
  body { font-size: 14.5px; background: var(--bg); overscroll-behavior-y: none; }
  .input, select.input, textarea.input { font-size: 16px; height: 44px; border-radius: 12px; } .input.sm { height: 38px; font-size: 15px; } /* 16px stops iOS zooming on focus */
  .btn { height: 44px; border-radius: 12px; } .btn.sm { height: 36px; } .btn.icon { width: 44px; } .btn.sm.icon { width: 36px; }
  .btn:hover:not(:disabled) { transform: none; box-shadow: none; }
  .app-m { min-height: 100vh; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .app-m .page { padding: 12px 14px 24px; } .app-m .page.home { padding: 0 0 24px; }

  .m-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .m-top h1 { flex: 1; font-size: 16.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-back { width: 42px; height: 42px; border: 0; background: none; color: var(--text); display: grid; place-items: center; transform: scaleX(-1); border-radius: 12px; } .m-back:active { background: var(--surface-3); }
  .m-top .pop, .hero .pop { position: fixed; top: calc(60px + env(safe-area-inset-top)); left: 10px; right: 10px; width: auto; max-height: 70vh; color: var(--text); }

  /* tab bar */
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: space-around; height: calc(64px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(18px); border-top: 1px solid var(--line); box-shadow: 0 -8px 30px -18px rgba(15, 23, 42, .35); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 9px 0 8px; color: var(--muted); font-size: 10.5px; font-weight: 600; -webkit-tap-highlight-color: transparent; transition: color .2s; }
  .tabbar a .ti { position: relative; display: grid; place-items: center; width: 44px; height: 28px; border-radius: 14px; transition: background .3s var(--ease), transform .3s var(--ease); }
  .tabbar a.on { color: var(--brand); } .tabbar a.on .ti { background: var(--brand-soft); transform: translateY(-1px); }
  .tabbar .fab { flex: none; width: 58px; height: 58px; margin: 0 6px 14px; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--brand), #38bdf8); box-shadow: 0 12px 26px -6px var(--brand-glow), 0 0 0 5px var(--surface); display: grid; place-items: center; transition: transform .25s var(--ease); }
  .tabbar .fab:active { transform: scale(.9) rotate(90deg); }

  /* home */
  .hero { padding: calc(18px + env(safe-area-inset-top)) 16px 22px; color: #fff; background: linear-gradient(150deg, #0b1b4d 0%, #1d4ed8 58%, #38bdf8 130%); border-radius: 0 0 28px 28px; position: relative; overflow: hidden; }
  .hero::before { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -110px; border-radius: 50%; background: rgba(255, 255, 255, .12); } .hero::after { content: ""; position: absolute; width: 180px; height: 180px; left: -70px; bottom: -90px; border-radius: 50%; background: rgba(56, 189, 248, .35); filter: blur(30px); }
  .hero > * { position: relative; z-index: 1; }
  .hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; } .hero-top .avatar { width: 44px; height: 44px; background: rgba(255, 255, 255, .2); border: 1.5px solid rgba(255, 255, 255, .45); }
  .hero-top small { display: block; opacity: .8; font-size: 12px; } .hero-top b { font-size: 16px; } .hero .bell .btn { color: #fff; background: rgba(255, 255, 255, .16); border-radius: 50%; }
  .wallet { background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(10px); border-radius: 22px; padding: 16px 18px; animation: rise .6s var(--ease) both; }
  .wallet small { opacity: .8; font-size: 12px; } .wallet-v { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1.25; } .wallet-v span { font-size: 13px; font-weight: 500; opacity: .8; }
  .wallet-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .2); } .wallet-row b { display: block; font-size: 15px; }
  .wallet-bud { margin-top: 12px; } .wallet-bud .meter { background: rgba(255, 255, 255, .25); height: 7px; margin-top: 5px; } .wallet-bud .meter > i { background: #fff; }
  .m-sec { padding: 20px 16px 0; animation: rise .55s var(--ease) both; } .m-sec:nth-child(3) { animation-delay: .06s; } .m-sec:nth-child(n+4) { animation-delay: .12s; }
  .m-sec h3 { font-size: 15px; margin-bottom: 12px; } .m-sec .row-flex h3 { margin-bottom: 0; } .m-sec .row-flex { margin-bottom: 12px; } .m-sec .row-flex a { font-size: 12.5px; font-weight: 600; }
  .m-sec > .tiles { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px 8px 14px; box-shadow: var(--shadow-1); margin-top: -2px; }
  .chips { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 118px; scroll-snap-align: start; display: grid; gap: 2px; text-align: left; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
  .chip .ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; } .chip b { font-size: 22px; line-height: 1.1; } .chip small { color: var(--text-2); font-size: 11.5px; }
  .chip.t-crit .ico { background: var(--crit-soft); color: var(--crit-ink); } .chip.t-warn .ico { background: var(--warn-soft); color: var(--warn-ink); } .chip.t-good .ico { background: var(--good-soft); color: var(--good-ink); } .chip.t-info .ico { background: var(--info-soft); color: var(--info-ink); }
  .top-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); } .top-row:last-child { border: 0; } .top-row b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .top-row .meter { height: 5px; margin-top: 6px; } .top-row small { display: block; }

  /* lists of cards instead of tables */
  .m-list { display: grid; gap: 10px; }
  .m-group { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 3; margin: 6px -14px 0; padding: 7px 16px; font-size: 12px; font-weight: 700; color: var(--text-2); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); }
  .m-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 13px 14px; box-shadow: var(--shadow-1); animation: rise .4s var(--ease) both; transition: transform .2s var(--ease); }
  .m-card.click:active { transform: scale(.985); background: var(--surface-2); } .m-card.todo { display: flex; align-items: center; gap: 10px; } .m-card.todo .dot { margin: 0; }
  .m-card-h { display: flex; align-items: flex-start; gap: 10px; } .m-title { flex: 1; min-width: 0; font-weight: 600; } .m-title .name { max-width: none; } .m-title small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
  .m-kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line-2); }
  .m-kv > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; } .m-kv span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .m-kv b { font-weight: 600; text-align: right; } .m-kv .bar-cell { min-width: 90px; } .m-kv .input { width: 96px !important; }
  .m-total { background: var(--brand-soft); border-color: transparent; } .m-total .m-kv { margin: 0; padding: 0; border: 0; grid-template-columns: 1fr; }

  /* page chrome */
  .toolbar { gap: 8px; } .toolbar .input-ico { flex: 1 1 100%; max-width: none; } .toolbar .input, .toolbar select.input { min-width: 0; flex: 1 1 44%; } .toolbar .sp { display: none; } .toolbar .btn { flex: 1 1 auto; } .toolbar .btn.ghost { flex: 0 0 auto; }
  .toolbar .seg, .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; } .seg button { white-space: nowrap; height: 36px; }
  .tabs { margin: -4px -14px 14px; padding: 0 10px; position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 4; background: var(--bg); scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
  .grid { gap: 12px; } .stat { padding: 15px; } .stat .value { font-size: 22px; } .card-h { flex-wrap: wrap; } .card { border-radius: 18px; }
  .table-wrap { max-height: none; border-radius: 16px; } .table-wrap table.t { min-width: 540px; } .t .name { max-width: 200px; }
  .kv { grid-template-columns: 104px 1fr; } .steps .st { font-size: 10.5px; }

  /* dialogs become bottom sheets */
  .overlay, .overlay.side-r { place-items: end stretch; padding: 0; }
  .modal, .drawer { position: relative; width: 100%; max-height: 93vh; border-radius: 24px 24px 0 0; animation: sheet-up .38s var(--ease) both; padding-bottom: env(safe-area-inset-bottom); }
  .drawer { height: 93vh; top: auto; right: auto; bottom: auto; }
  .modal::before, .drawer::before { content: ""; display: block; width: 42px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 9px auto 0; flex: none; }
  .modal-h { padding: 10px 16px 12px; } .modal-b { padding: 16px; } .modal-f { padding: 12px 16px; position: sticky; bottom: 0; background: var(--surface); } .modal-f .btn { flex: 1 1 auto; } .modal-f .sp { flex: 1 1 100%; }
  .modal.more { padding: 0 16px calc(90px + env(safe-area-inset-bottom)); } .modal.more::before { display: none; } .grab { width: 42px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 9px auto 14px; }
  .overlay.sheet { z-index: 45; }
  .more-user { display: flex; align-items: center; gap: 12px; padding: 4px 4px 18px; } .more-user b { display: block; font-size: 16px; } .more-user small { color: var(--muted); }
  .more-rows { margin-top: 20px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; } .more-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 500; } .more-row:last-child { border: 0; } .more-row:active { background: var(--surface-2); } .more-row.danger { color: var(--crit-ink); }
  .toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); } .toast { min-width: 0; max-width: none; }
  .chart-box { height: var(--h, 210px); }
  .login-form { padding: 28px 20px; place-content: start center; padding-top: 12vh; } .login-box h2 { font-size: 22px; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 760px) {
  .grid.g4 { grid-template-columns: 1fr 1fr; } .grid.g4 .stat .ico { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 9px; } .grid.g4 .stat .value { font-size: 18px; } .grid.g4 .stat .value small { font-size: 11px; } .grid.g4 .stat .label { font-size: 12px; }
}
@media (max-width: 760px) { .app-m .page { overflow-x: clip; } .toolbar > svg { display: none; } }
.t td .name { min-width: 210px; }
.note > svg { flex: none; }

/* ---------- product pictures ---------- */
.thumb { flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); display: inline-grid; place-items: center; }
.thumb.ph { background: var(--surface-3); color: var(--muted); border-color: transparent; }
img.thumb { transition: transform .25s var(--ease); } tr:hover img.thumb, .m-card:active img.thumb { transform: scale(1.08); }
.item-hero { display: flex; gap: 16px; align-items: flex-start; } .item-hero .thumb { border-radius: 16px; }
.pop .row .thumb { margin-top: 0; }

/* ---------- approval flow designer ---------- */
.flow-wrap { display: grid; grid-template-columns: 1fr 310px; gap: 14px; height: calc(100vh - 170px); min-height: 520px; }
.flow-canvas { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background-color: var(--surface-2); background-image: radial-gradient(var(--line-2) 1.2px, transparent 1.2px); touch-action: none; cursor: grab; user-select: none; }
.flow-canvas:active { cursor: grabbing; }
.flow-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.flow-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.flow-edges .edge { pointer-events: stroke; cursor: pointer; } .flow-edges .hit { fill: none; stroke: transparent; stroke-width: 16; }
.flow-edges .line { fill: none; stroke: var(--axis); stroke-width: 2.2; transition: stroke .2s; } .flow-edges .edge.true .line { stroke: var(--good); } .flow-edges .edge.false .line { stroke: var(--crit); }
.flow-edges .edge:hover .line, .flow-edges .edge.sel .line { stroke: var(--brand); stroke-width: 3.2; } .flow-edges .line.ghost { stroke: var(--brand); stroke-dasharray: 6 5; }
.flow-edges .edge.run .line { stroke: var(--brand); stroke-width: 3.2; stroke-dasharray: 9 6; animation: flow-dash .7s linear infinite; }
@keyframes flow-dash { to { stroke-dashoffset: -15; } }
.flow-node { position: absolute; display: flex; align-items: center; gap: 11px; padding: 0 16px 0 14px; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-1); cursor: grab; transition: box-shadow .2s, border-color .2s, transform .15s; animation: pop .3s var(--ease) both; }
.flow-node:hover { box-shadow: var(--shadow-2); } .flow-node.sel { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow), var(--shadow-2); } .flow-node.bad { border-color: var(--crit); border-style: dashed; }
.flow-node.run { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); } .flow-node.t-start, .flow-node.t-end { border-radius: 38px; } .flow-node.t-condition { border-left: 5px solid var(--warn); }
.flow-node .tile-ico { width: 38px; height: 38px; border-radius: 12px; flex: none; }
.flow-node-t { min-width: 0; } .flow-node-t b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .flow-node-t small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--axis); top: 50%; margin-top: -7px; transition: transform .15s, background .15s; }
.port.in { left: -8px; } .port.out { right: -8px; cursor: crosshair; border-color: var(--brand); } .port.out:hover { transform: scale(1.5); background: var(--brand); }
.port.out.yes { top: 24px; border-color: var(--good); } .port.out.yes:hover { background: var(--good); } .port.out.no { top: auto; bottom: 17px; border-color: var(--crit); } .port.out.no:hover { background: var(--crit); }
.flow-palette { position: absolute; left: 12px; top: 12px; z-index: 3; display: flex; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); }
.flow-palette button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 5px 10px 5px 5px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; } .flow-palette button:hover { background: var(--surface-3); } .flow-palette .tile-ico { width: 30px; height: 30px; border-radius: 9px; }
.flow-zoom { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); font-size: 12px; color: var(--muted); }
.flow-zoom button { width: 30px; height: 30px; border: 0; background: none; border-radius: 8px; font-size: 17px; color: var(--text); cursor: pointer; display: grid; place-items: center; } .flow-zoom button:hover { background: var(--surface-3); } .flow-zoom span { padding: 0 8px; }
.flow-hint { position: absolute; left: 14px; bottom: 12px; font-size: 11.5px; color: var(--muted); pointer-events: none; max-width: calc(100% - 200px); }
.flow-side { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; } .flow-insp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-1); }
.flow-trail .ft, .trail .ft { display: flex; gap: 10px; padding: 0 0 12px; position: relative; animation: rise .4s var(--ease) both; } .ft > i { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); margin-top: 4px; flex: none; z-index: 1; box-shadow: 0 0 0 3px var(--brand-soft); }
.ft::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; background: var(--line-2); } .ft:last-of-type::before { display: none; } .ft b { display: block; font-size: 12.5px; } .ft small { color: var(--muted); font-size: 11.5px; }
.ft.condition > i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); border-radius: 3px; transform: rotate(45deg); } .ft.end > i, .ft.approved > i { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); } .ft.rejected > i { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); } .ft.pending > i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); animation: pulse-ring 1.8s infinite; }
.trail { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 4px; margin-bottom: 14px; background: var(--surface-2); } .trail h4 { font-size: 12.5px; margin-bottom: 12px; color: var(--text-2); }
@media (max-width: 980px) { .flow-wrap { grid-template-columns: 1fr; height: auto; } .flow-canvas { height: 62vh; } .flow-hint { display: none; } .flow-palette button { font-size: 0; gap: 0; padding: 4px; } }

/* proposal page */
.proposal-head { padding: 16px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.proposal-head .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft, var(--info-soft)); color: var(--brand, var(--info-ink)); flex: none; }
.proposal-head .sp { flex: 1; min-width: 220px; } .proposal-head h3 { font-size: 15px; margin: 0 0 6px; }
.proposal-head .acts { flex-wrap: wrap; } .proposal-head a.btn { text-decoration: none; }
.proposal-frame { padding: 0; overflow: hidden; } .proposal-frame iframe { display: block; width: 100%; height: calc(100vh - 300px); min-height: 520px; border: 0; background: #cbd5e1; }
.app-m .proposal-frame iframe { height: 70vh; min-height: 0; }
