/* UltraInstinct 3D — design tokens, layout, components, motion */
:root {
  --bg: #f4f5fb; --bg-2: #eceef8; --surface: #ffffff; --surface-2: #f8f9fd; --border: #e2e5f0; --border-strong: #cfd4e6;
  --text: #171a2b; --text-2: #4b5168; --muted: #7a8099;
  --accent: #1f6bff; --accent-2: #22b8ff; --accent-soft: #e6f0ff; --accent-text: #1556d6;
  --ok: #0f9f6e; --ok-soft: #e3f7ef; --warn: #b7791f; --warn-soft: #fdf3e1; --bad: #d64545; --bad-soft: #fde8e8;
  --info: #2563eb; --info-soft: #e5edff;
  --shadow-sm: 0 1px 2px rgba(23,26,43,.06), 0 1px 1px rgba(23,26,43,.04);
  --shadow: 0 6px 24px -8px rgba(40,44,90,.18), 0 2px 6px -2px rgba(40,44,90,.08);
  --shadow-lg: 0 24px 48px -16px rgba(40,44,90,.28);
  --radius: 14px; --radius-sm: 10px;
  --grad: linear-gradient(135deg, #1f5eff 0%, #2f8bff 55%, #38d0ff 100%);
  --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.56,.64,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f1a; --bg-2: #121527; --surface: #161a2e; --surface-2: #1b2036; --border: #262b45; --border-strong: #343a5c;
    --text: #e8eaf6; --text-2: #b4b9d4; --muted: #8389a8;
    --accent: #4d94ff; --accent-2: #38c8ff; --accent-soft: #12264a; --accent-text: #a9cbff;
    --ok: #34d399; --ok-soft: #10302a; --warn: #fbbf24; --warn-soft: #33290f; --bad: #f87171; --bad-soft: #3a1a1f;
    --info: #60a5fa; --info-soft: #172544;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 8px 28px -10px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f1a; --bg-2: #121527; --surface: #161a2e; --surface-2: #1b2036; --border: #262b45; --border-strong: #343a5c;
  --text: #e8eaf6; --text-2: #b4b9d4; --muted: #8389a8;
  --accent: #4d94ff; --accent-2: #38c8ff; --accent-soft: #12264a; --accent-text: #a9cbff;
  --ok: #34d399; --ok-soft: #10302a; --warn: #fbbf24; --warn-soft: #33290f; --bad: #f87171; --bad-soft: #3a1a1f;
  --info: #60a5fa; --info-soft: #172544;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 8px 28px -10px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14.5px/1.55 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; transition: background .3s var(--ease), color .3s var(--ease);
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 750; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
small, .muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace; font-size: .9em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; font-weight: 800; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: .95rem; box-shadow: 0 6px 18px -6px #2f7bff; position: relative; overflow: hidden;
}
.logo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); animation: sheen 4.5s ease-in-out infinite 1s; }
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.brand small { display: block; font-weight: 600; font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; transform: translateX(2px); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); animation: grow .35s var(--spring); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.scrim { display: none; }
.main { min-width: 0; padding: 22px clamp(16px, 3vw, 36px) 60px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 0; color: var(--muted); }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 4px; }

/* ---------- motion: page enter, stagger ---------- */
.reveal > * { animation: rise .55s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: .05s; } .reveal > *:nth-child(3) { animation-delay: .1s; }
.reveal > *:nth-child(4) { animation-delay: .15s; } .reveal > *:nth-child(5) { animation-delay: .2s; }
.reveal > *:nth-child(6) { animation-delay: .25s; } .reveal > *:nth-child(n+7) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px; transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s var(--ease);
}
.card.hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.row > input:not([type=checkbox]):not([type=radio]):not([type=file]), .row > select { width: auto; flex: 0 1 auto; min-width: 0; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi .label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 1.55rem; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .hint { font-size: .8rem; color: var(--muted); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--grad); opacity: .09; transition: transform .6s var(--ease); }
.kpi:hover::after { transform: scale(1.35); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: var(--surface-2); font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tr.total td { font-weight: 800; background: var(--surface-2); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 42px; height: 42px; opacity: .5; display: block; margin: 0 auto 8px; }

/* ---------- forms ---------- */
label { display: block; font-weight: 650; font-size: .84rem; margin-bottom: 5px; color: var(--text-2); }
.field { margin-bottom: 12px; }
.field .help { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.field .err, .errorlist { color: var(--bad); font-size: .8rem; margin: 4px 0 0; padding: 0; list-style: none; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s, background .2s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input[aria-invalid="true"], .invalid input, .invalid select { border-color: var(--bad); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: -3px; }
input[type=file] { font: inherit; color: var(--text-2); }
input[type=file]::file-selector-button { border: 0; background: var(--accent-soft); color: var(--accent-text); padding: 8px 12px; border-radius: 9px; font-weight: 700; margin-right: 10px; cursor: pointer; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.fgrid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .82rem; pointer-events: none; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.recipe-row { display: grid; grid-template-columns: 1.3fr 1.1fr .7fr 1fr auto; gap: 8px; margin-bottom: 8px; animation: pop .25s var(--ease); }
.extra-row { display: grid; grid-template-columns: 2fr .8fr auto; gap: 8px; margin-bottom: 8px; animation: pop .25s var(--ease); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, opacity .2s;
}
.btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--grad); background-size: 160% 160%; color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px #2f7bff; }
.btn.primary:hover { background-position: 100% 50%; box-shadow: 0 12px 26px -10px #2f7bff; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn.icon { padding: 7px; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- badges / alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 750; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 currentColor; } 50% { box-shadow: 0 0 0 5px transparent; } }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid; margin-bottom: 12px; animation: rise .4s var(--ease); }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); }
.alert.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pos { color: var(--ok); } .negv { color: var(--bad); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 100; max-width: min(420px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toastIn .45s var(--spring) both; position: relative; overflow: hidden;
}
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.toast.success::before { background: var(--ok); } .toast.error::before { background: var(--bad); } .toast.warning::before { background: var(--warn); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--grad); animation: bar 6s linear forwards; }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
.toast p { margin: 0; word-break: break-word; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes bar { from { width: 100%; } to { width: 0; } }

/* ---------- tabs / details ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; margin-bottom: 14px; }
.tabs a, .tabs button { padding: 7px 13px; border-radius: 9px; font-weight: 700; color: var(--text-2); white-space: nowrap; border: 0; background: none; font: inherit; cursor: pointer; transition: background .2s, color .2s; }
.tabs a.active, .tabs button.active { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-sm); }
.tabs a:hover { text-decoration: none; }
.tab-panel { animation: fade .3s var(--ease); }
details.fold { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
details.fold > summary { cursor: pointer; padding: 11px 14px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "›"; display: inline-block; transition: transform .25s var(--ease); font-size: 1.2em; color: var(--muted); }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > .fold-body { padding: 0 14px 14px; animation: rise .3s var(--ease); }

/* ---------- breakdown ---------- */
.breakdown dl { display: grid; grid-template-columns: 1fr auto; margin: 0; }
.breakdown dt, .breakdown dd { padding: 6px 0; border-bottom: 1px dashed var(--border); margin: 0; }
.breakdown dd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.breakdown .grand dt, .breakdown .grand dd { border-bottom: 0; font-weight: 800; font-size: 1.05rem; padding-top: 10px; }
.bar-stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: 8px 0 12px; }
.bar-stack span { height: 100%; transition: width .7s var(--ease); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.tier-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tier { padding: 10px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface-2); transition: transform .25s var(--spring), border-color .2s; }
.tier.on { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-3px); }
.tier .t { font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.tier .p { font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
[data-preview].busy { opacity: .55; transition: opacity .2s; }

/* progress */
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; width: 0; transition: width 1s var(--ease); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.lane { background: var(--bg-2); border-radius: var(--radius); padding: 10px; min-height: 120px; border: 1px solid var(--border); }
.lane h3 { display: flex; justify-content: space-between; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 6px 8px; margin: 0; }
.job-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s; animation: pop .35s var(--ease) both; }
.job-card:hover { transform: translateY(-2px) rotate(-.2deg); box-shadow: var(--shadow); text-decoration: none; }

/* media */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.thumb:hover img { transform: scale(1.07); }
.thumb .ops { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transform: translateY(6px); transition: .25s var(--ease); }
.thumb:hover .ops, .thumb:focus-within .ops { opacity: 1; transform: none; }
.thumb .cover { position: absolute; left: 6px; top: 6px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 18px; text-align: center; transition: border-color .2s, background .2s; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }

/* login */
.auth-bg { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.auth-bg::before, .auth-bg::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(70px); opacity: .45; animation: float 14s ease-in-out infinite; }
.auth-bg::before { background: #1f5eff; top: -160px; left: -120px; }
.auth-bg::after { background: #38d0ff; bottom: -180px; right: -140px; animation-delay: -7s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.1); } }
.auth-card { position: relative; z-index: 1; width: min(410px, 100%); padding: 30px; border-radius: 22px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(20px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop .6s var(--spring); }
.auth-card .logo { width: 48px; height: 48px; font-size: 1.2rem; border-radius: 14px; margin-bottom: 14px; }
.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* cube loader for empty dashboard flair */
.cube { width: 22px; height: 22px; display: inline-block; background: var(--grad); border-radius: 6px; animation: cube 2.4s var(--ease) infinite; }
@keyframes cube { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.8); border-radius: 50%; } 100% { transform: rotate(360deg) scale(1); } }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 14px; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; font-weight: 650; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); padding: 12px 0; margin-top: 10px; z-index: 5; display: flex; gap: 10px; flex-wrap: wrap; }
.theme-toggle svg { transition: transform .5s var(--spring); }
.theme-toggle:hover svg { transform: rotate(40deg); }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 12px 26px; animation: rise .4s var(--ease) both; }
.timeline li::before { content: ""; position: absolute; left: 1px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.steps span { flex: 1; min-width: 72px; text-align: center; font-size: .72rem; font-weight: 750; padding: 6px 4px; border-radius: 8px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); transition: .3s; }
.steps span.done { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.steps span.now { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px #2f7bff; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-105%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); background: var(--surface); }
  body.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(10,12,25,.45); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 30; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
  .main { padding: 16px 16px 80px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .steps span { min-width: 56px; }
  .page-head > .row, .page-head > form { width: 100%; }
  .recipe-row { grid-template-columns: 1fr 1fr; } .recipe-row > :nth-child(4) { grid-column: 1 / 2; }
  .kanban { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; } .lane { scroll-snap-align: start; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 1.2rem; } h1 { font-size: 1.3rem; } .tier-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media print { .sidebar, .topbar, .toasts, .sticky-actions, .btn { display: none !important; } .shell { display: block; } }

/* ---------- AI ---------- */
.ai-btn { position: relative; overflow: hidden; }
.ai-btn:not(.primary) { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border-color: transparent; color: var(--accent-text); }
.ai-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-120%); }
.ai-btn:hover::after { animation: sheenOnce .9s var(--ease); }
@keyframes sheenOnce { to { transform: translateX(120%); } }
.ai-btn.working svg { animation: spin 1.4s linear infinite; }
textarea.ai-writing { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); font-weight: 650; font-size: .84rem; cursor: pointer; transition: .2s var(--ease); }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); transform: translateY(-1px); }
.chip input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.ai-slot { aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); position: relative; overflow: hidden; display: grid; place-items: center; border: 1px dashed var(--border-strong); }
.ai-slot::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--accent) 35%, transparent), transparent 40%); animation: spin 2.4s linear infinite; }
.ai-slot::after { content: ""; position: absolute; inset: 3px; border-radius: 10px; background: var(--surface-2); }
.ai-slot svg { position: relative; z-index: 1; width: 26px; height: 26px; color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.thumb.pick { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.thumb.pick .tick { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); display: grid; place-items: center; color: transparent; transition: .2s var(--spring); }
.thumb.pick:has(input:checked) { box-shadow: 0 0 0 3px var(--accent); transform: scale(.97); }
.thumb.pick:has(input:checked) .tick { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.1); }
.thumb.pick:has(input:focus-visible) { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.thumb.fresh { animation: pop .5s var(--spring) both; }
.ai-price-big { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reveal-in { animation: rise .45s var(--ease) both; }

/* ---------- brand (Semesta3D) ---------- */
.logo-img { flex: none; width: 40px; height: 40px; border-radius: 10px; filter: drop-shadow(0 6px 14px rgba(47,123,255,.35)); transition: transform .5s var(--spring); }
.brand:hover .logo-img { transform: rotate(-8deg) scale(1.06); }
.topbar .logo-img { width: 32px; height: 32px; }
.brand-3d { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-logo { display: block; width: min(250px, 72%); height: auto; margin: -6px auto 14px; animation: floatLogo 6s ease-in-out infinite; }
@keyframes floatLogo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.auth-card h1 { text-align: center; }

/* brand checkbox grid in master form */
.brand-checks { grid-column: 1 / -1; }
.brand-checks > div:not(.help) { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.brand-checks > div:not(.help) label { display: flex; gap: 8px; align-items: center; font-weight: 600; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; margin: 0; transition: .2s var(--ease); }
.brand-checks > div:not(.help) label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.desc-text { white-space: normal; line-height: 1.65; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 6px; max-height: 360px; overflow: auto; }
.num-in { width: 140px !important; text-align: right; padding: 6px 9px !important; display: inline-block; }
.spool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.spool-card { padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); transition: transform .2s var(--ease), box-shadow .2s; }
.spool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.spool-card.low { border-color: var(--warn); }
.spool-left { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 6px; }
/* ---------- in-app guides ---------- */
.guide { border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)), var(--surface)); border-radius: var(--radius); margin-bottom: 16px; }
.guide > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--accent-text); }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary svg { flex: none; }
.guide .guide-toggle::after { content: "Sembunyikan"; } .guide:not([open]) .guide-toggle::after { content: "Tampilkan"; }
.guide-body { padding: 0 16px 14px; animation: rise .35s var(--ease); }
.guide-steps { margin: 0 0 8px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.guide-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; align-items: start; }
.guide-steps li::before { content: counter(s); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: .78rem; display: grid; place-items: center; margin-top: 1px; }
.guide-steps li span { color: var(--text-2); font-size: .9rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); }
.checklist .ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 900; }
.checklist .ok .ic { background: var(--ok-soft); color: var(--ok); } .checklist .todo .ic { background: var(--bad-soft); color: var(--bad); } .checklist .opt .ic { background: var(--warn-soft); color: var(--warn); }
.checklist .todo { outline: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); }
.level-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.level-row .tier { padding: 8px; } .level-row .tier .p { font-size: .92rem; } .level-row .tier .t { font-size: .66rem; }
@media (max-width: 1280px) { .g-side .level-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .level-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.release table td { min-width: 140px; }
.release table td:first-child { min-width: 120px; }
.brand .ver { color: var(--accent-text); font-weight: 800; margin-left: 4px; text-decoration: none; }
