/* ASboard design system — dark cinematic */
:root {
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #070b16;
  --bg-2: #0c1222;
  --bg-3: #111a2e;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edf7;
  --text-2: #b7c0d4;
  --muted: #8a94ab;
  --primary: #7c8cff;
  --primary-2: #2fd4ff;
  --primary-ink: #0b1020;
  --danger: #ff6b6b;
  --warn: #f5b73d;
  --ok: #3ecf8e;
  --info: #5b8def;
  --st-requested: #5b8def;
  --st-in-progress: #f5b73d;
  --st-review: #b48cff;
  --st-rerequested: #ff7a59;
  --st-completed: #3ecf8e;
  --st-closed: #8a94ab;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --sidebar-w: 264px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; font-feature-settings: "ss05";
  word-break: keep-all; overflow-wrap: anywhere; letter-spacing: -0.01em;
}
.table, .mono, .t-no, .kv { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; font-weight: 700; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 12px; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.w-full { width: 100%; }
.inline { display: inline; }
.hidden { display: none !important; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 20px; }
.grad { background: linear-gradient(92deg, var(--primary) 0%, var(--primary-2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------ background fx */
.bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 140, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(47, 212, 255, 0.08), transparent 60%),
    linear-gradient(180deg, #080d1a 0%, var(--bg) 60%);
}
.bg-fx::after { content: ""; position: absolute; inset: 0; opacity: 0.35;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 30% 0%, #000 0%, transparent 70%); }
.glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; }
.g1 { width: 520px; height: 520px; left: -160px; top: -140px; background: #4c5cff; }
.g2 { width: 420px; height: 420px; right: -120px; top: 20%; background: #1ab9ff; opacity: 0.25; }
.g3 { width: 600px; height: 400px; left: 35%; bottom: -260px; background: #7a4dff; opacity: 0.18; }

/* ------------------------------------------------ app shell */
.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px 16px; border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; filter: drop-shadow(0 6px 18px rgba(88, 120, 255, 0.45)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 21px; letter-spacing: -0.02em; }
.brand-text b { font-weight: 800; background: linear-gradient(92deg, #a5b1ff, #5fe1ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text small { font-size: 11.5px; color: var(--muted); margin-top: 4px; letter-spacing: 0.02em; }
.brand-lg .brand-mark { width: 46px; height: 46px; }
.brand-lg .brand-text { font-size: 26px; }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-sec { margin: 16px 10px 6px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; transition: background .2s var(--ease), color .2s; }
.nav-item .ico { width: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(124,140,255,0.22), rgba(47,212,255,0.08)); color: #fff; box-shadow: inset 0 0 0 1px rgba(124,140,255,0.35); }
.nav-item.active .ico { color: var(--primary-2); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; font-weight: 700; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 18px rgba(88,120,255,0.35); }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.avatar.staff { background: linear-gradient(135deg, #ff9a5a, #ff5c8a); }

.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 22, 0.72); backdrop-filter: blur(16px); }
.crumbs { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a { color: var(--text-2); }
.crumbs .sep { opacity: 0.5; }
.topbar-right { display: flex; gap: 8px; }
.menu-toggle { display: none; }
.main { padding: 28px; max-width: 1400px; width: 100%; margin: 0 auto; flex: 1; }
.foot { padding: 18px 28px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 29; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; letter-spacing: -0.02em; }
.page-head .sub { color: var(--muted); margin-top: 6px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(10px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 15.5px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card + .card { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.stat { position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.stat::before { content: ""; position: absolute; inset: 0; background: radial-gradient(300px 120px at 100% 0%, var(--stat-c, rgba(124,140,255,0.22)), transparent 70%); opacity: .8; }
.stat .label { position: relative; color: var(--muted); font-size: 12.5px; letter-spacing: 0.04em; }
.stat .value { position: relative; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; line-height: 1.1; }
.stat .delta { position: relative; color: var(--text-2); font-size: 12.5px; margin-top: 6px; }
.stat.c-requested { --stat-c: rgba(91,141,239,0.35); }
.stat.c-progress { --stat-c: rgba(245,183,61,0.3); }
.stat.c-review { --stat-c: rgba(180,140,255,0.32); }
.stat.c-done { --stat-c: rgba(62,207,142,0.3); }

/* ------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-strong); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.badge.st-requested { color: #9dbcff; background: rgba(91,141,239,0.14); border-color: rgba(91,141,239,0.4); }
.badge.st-in-progress { color: #ffd27a; background: rgba(245,183,61,0.14); border-color: rgba(245,183,61,0.4); }
.badge.st-review { color: #d3bcff; background: rgba(180,140,255,0.16); border-color: rgba(180,140,255,0.45); }
.badge.st-rerequested { color: #ffb39d; background: rgba(255,122,89,0.16); border-color: rgba(255,122,89,0.45); }
.badge.st-completed { color: #8fe9c0; background: rgba(62,207,142,0.14); border-color: rgba(62,207,142,0.4); }
.badge.st-closed { color: #b3bccd; background: rgba(138,148,171,0.14); border-color: rgba(138,148,171,0.4); }
.badge.plain::before { display: none; }
.badge.lg { font-size: 14px; padding: 6px 14px; }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.pill.role-ADMIN { color: #ffb0c4; border-color: rgba(255,92,138,0.45); background: rgba(255,92,138,0.12); }
.pill.role-DEVELOPER { color: #ffd0a8; border-color: rgba(255,154,90,0.45); background: rgba(255,154,90,0.12); }
.pill.role-COMPANY { color: #a9d8ff; border-color: rgba(47,212,255,0.4); background: rgba(47,212,255,0.1); }
.pill.us-PENDING { color: #ffd27a; border-color: rgba(245,183,61,0.4); }
.pill.us-ACTIVE { color: #8fe9c0; border-color: rgba(62,207,142,0.4); }
.pill.us-REJECTED, .pill.us-DISABLED { color: #ff9b9b; border-color: rgba(255,107,107,0.4); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-2); box-shadow: 0 0 10px var(--primary-2); }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.turn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); font-weight: 600; }
.turn.theirs { color: var(--muted); font-weight: 500; }

/* ------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; line-height: 1.2; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s; }
.btn:hover { background: var(--surface-3); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { border-color: transparent; color: #fff; background: linear-gradient(92deg, #6d7dff 0%, #35b9ff 100%); box-shadow: 0 8px 24px rgba(88,120,255,0.35); }
.btn-primary:hover { background: linear-gradient(92deg, #7b8aff 0%, #4ac4ff 100%); box-shadow: 0 10px 30px rgba(88,120,255,0.45); }
.btn-ghost { background: transparent; }
.btn-danger { color: #ffb4b4; border-color: rgba(255,107,107,0.45); background: rgba(255,107,107,0.08); }
.btn-danger:hover { background: rgba(255,107,107,0.16); }
.btn-ok { color: #a6f0cf; border-color: rgba(62,207,142,0.45); background: rgba(62,207,142,0.1); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 16px; }

/* ------------------------------------------------ forms */
.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group.span-2 { grid-column: span 2; }
label.lbl, .lbl { font-size: 13px; font-weight: 600; color: var(--text-2); }
.lbl .req { color: var(--danger); margin-left: 3px; }
.input, .select, .textarea { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border-strong); background: rgba(255,255,255,0.04); color: var(--text); font: inherit; font-size: 14.5px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s; }
.input::placeholder { color: #6b748a; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(124,140,255,0.8); box-shadow: 0 0 0 4px rgba(124,140,255,0.16); background: rgba(255,255,255,0.06); }
.input.is-invalid { border-color: rgba(255,107,107,0.7); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.select option { background: #101827; color: var(--text); }
.textarea { min-height: 110px; resize: vertical; }
.help { font-size: 12.5px; color: var(--muted); }
.error-text { font-size: 12.5px; color: #ff9b9b; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.input-sm { padding: 8px 11px; font-size: 13.5px; }
.search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-bar .input { max-width: 320px; }

/* status choice */
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 13.5px; transition: all .15s; }
.choice span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); box-shadow: 0 0 8px var(--c, transparent); }
.choice input:checked + span { border-color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 16%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--primary)) 22%, transparent); }
.choice input:focus-visible + span { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.choice.st-requested { --c: var(--st-requested); } .choice.st-in-progress { --c: var(--st-in-progress); } .choice.st-review { --c: var(--st-review); }
.choice.st-rerequested { --c: var(--st-rerequested); } .choice.st-completed { --c: var(--st-completed); } .choice.st-closed { --c: var(--st-closed); }
.choice.keep { --c: var(--muted); }

/* ------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .t-title { font-weight: 600; color: var(--text); }
.table .t-title a { color: var(--text); }
.table .t-title a:hover { color: var(--primary-2); }
.table .t-no { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.table .t-meta { color: var(--muted); font-size: 12.5px; }
tr.row-link { cursor: pointer; }
tr.is-turn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* ------------------------------------------------ ticket list cards (mobile) */
.ticket-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ticket-row-title .cnt { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------ tabs / filters */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); width: fit-content; max-width: 100%; }
.tab { padding: 7px 13px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tab:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.tab.active { background: var(--surface-3); color: #fff; box-shadow: inset 0 0 0 1px var(--border-strong); }
.tab .n { margin-left: 6px; font-size: 12px; color: var(--muted); }
.tab.active .n { color: var(--primary-2); }

/* ------------------------------------------------ flash */
.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 14px; word-break: break-all; }
.flash-success { border-color: rgba(62,207,142,0.45); background: rgba(62,207,142,0.1); color: #c8f5e0; }
.flash-error { border-color: rgba(255,107,107,0.45); background: rgba(255,107,107,0.1); color: #ffd0d0; }
.flash-warning { border-color: rgba(245,183,61,0.45); background: rgba(245,183,61,0.1); color: #ffe6b0; }
.flash-info { border-color: rgba(91,141,239,0.45); background: rgba(91,141,239,0.1); color: #cfe0ff; }
.flash-x { margin-left: auto; background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; opacity: .7; }

/* ------------------------------------------------ empty state */
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 34px; opacity: .6; margin-bottom: 8px; }
.empty h3 { color: var(--text-2); margin-bottom: 6px; }

/* ------------------------------------------------ pagination */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; }
.pagination a:hover { background: var(--surface-2); text-decoration: none; }
.pagination .cur { background: var(--surface-3); color: #fff; border-color: var(--border-strong); font-weight: 700; }
.pagination .info { border: 0; color: var(--muted); margin-left: 8px; }

/* ------------------------------------------------ ticket detail */
.ticket-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ticket-head h1 { font-size: 24px; flex: 1; min-width: 240px; word-break: break-word; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; margin-top: 10px; }
.ticket-meta b { color: var(--text-2); font-weight: 600; }
.prose { font-size: 15px; line-height: 1.75; color: var(--text); word-break: break-word; overflow-wrap: anywhere; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; }
.prose p { margin: 0 0 10px; }
.prose h1, .prose h2, .prose h3 { margin: 18px 0 8px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 12px; }
.prose blockquote { margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--text-2); }
.prose pre { background: #0a0f1c; border: 1px solid var(--border); padding: 14px; border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: 13px; }
.prose code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; max-width: 100%; margin: 10px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border-strong); padding: 6px 10px; }
.prose a { color: var(--primary-2); text-decoration: underline; text-underline-offset: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--border-strong); margin: 16px 0; }

.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-size: 13px; max-width: 100%; }
.att:hover { background: var(--surface-3); text-decoration: none; }
.att .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.att .sz { color: var(--muted); font-size: 12px; }
.att .ic { color: var(--primary-2); }

.timeline { position: relative; display: grid; gap: 14px; }
.tl-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 40px; bottom: -14px; width: 2px; background: var(--border-strong); }
.tl-item:last-child .tl-rail::before { display: none; }
.tl-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tl-body.staff { border-color: rgba(255,154,90,0.35); }
.tl-body.status-change { border-color: rgba(124,140,255,0.4); }
.tl-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: rgba(255,255,255,0.02); }
.tl-head .who { font-weight: 700; }
.tl-head .when { color: var(--muted); font-size: 12.5px; }
.tl-head .arrow { color: var(--muted); }
.tl-content { padding: 16px; }
.tl-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-deleted { padding: 12px 16px; color: var(--muted); font-style: italic; }

.status-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.status-flow .step { padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--border-strong); }
.status-flow .step.done { border-style: solid; color: var(--text-2); }
.status-flow .step.cur { border-style: solid; border-color: var(--primary); color: #fff; background: rgba(124,140,255,0.16); }
.status-flow .arr { opacity: .5; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }

/* ------------------------------------------------ editor / dropzone */
.editor-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--border-strong); }
.editor-wrap .tox-tinymce { border: 0 !important; }
.editor-fallback { min-height: 320px; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: 13.5px; background: var(--surface); transition: all .2s; cursor: pointer; }
.dropzone.over { border-color: var(--primary); background: rgba(124,140,255,0.08); color: var(--text); }
.dropzone input { display: none; }
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.file-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .rm { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; }
.file-item .rm:hover { color: var(--danger); }

/* ------------------------------------------------ auth layout */
.auth-body { overflow-x: hidden; }
.auth-layout { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero { display: flex; flex-direction: column; padding: 48px 56px; border-right: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(124,140,255,0.10), rgba(47,212,255,0.04) 60%, transparent); }
.hero-copy { margin: auto 0; max-width: 560px; }
.hero-copy h1 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 800; margin-bottom: 20px; }
.hero-copy p { font-size: 16.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 26px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hero-points li { position: relative; padding-left: 26px; color: var(--text-2); font-size: 14.5px; }
.hero-points li::before { content: "◆"; position: absolute; left: 0; top: 1px; color: var(--primary-2); font-size: 11px; }
.hero-points b { color: var(--text); }
.hero-foot { color: var(--muted); font-size: 12.5px; letter-spacing: 0.08em; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 480px; padding: 36px; border-radius: 20px; border: 1px solid var(--border-strong); background: rgba(12,18,34,0.7); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.auth-card.wide { max-width: 640px; }
.auth-card h2 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 24px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.anon-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* ------------------------------------------------ error page */
.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-size: 96px; font-weight: 800; letter-spacing: -0.06em; line-height: 1; background: linear-gradient(92deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { margin: 12px 0 8px; }
.error-page .btn { margin-top: 16px; }

/* ------------------------------------------------ company cards */
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 10px; }
.co-card { display: flex; flex-direction: column; gap: 5px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.co-card:hover { transform: translateY(-2px); border-color: rgba(124,140,255,0.5); box-shadow: 0 10px 26px rgba(0,0,0,0.35); text-decoration: none; }
.co-card.inactive { opacity: .55; }
.co-card .co-name { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.co-card .co-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-card .co-name .avatar.sm { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }
.co-card .co-code { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-card .co-stats { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); }
.co-card .co-stats b { color: var(--text); font-size: 14px; margin-right: 3px; }
.co-card .co-stats .hot b { color: var(--warn); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .ttl { flex: 1; min-width: 0; }
.list-plain .ttl a { color: var(--text); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-plain .ttl small { color: var(--muted); }

.modal { display: none; position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; padding: 20px; background: rgba(3,6,14,0.7); backdrop-filter: blur(6px); }
.modal.open { display: flex; }
.modal-card { width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; background: #0e1526; border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow); }
.modal-card .card-head { position: sticky; top: 0; background: #0e1526; z-index: 1; }
details.disclosure summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13.5px; list-style: none; }
details.disclosure summary::before { content: "▸ "; color: var(--muted); }
details.disclosure[open] summary::before { content: "▾ "; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.code-inline { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 2px 6px; border-radius: 5px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.main > * { animation: rise .35s var(--ease) both; }
.auth-card { animation: rise .45s var(--ease) both; }

/* ------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; width: min(84vw, 300px); transform: translateX(-105%); transition: transform .28s var(--ease); box-shadow: var(--shadow); background: #0b1121; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .scrim { display: block; }
  .menu-toggle { display: inline-grid; }
  .main { padding: 18px 14px; }
  .topbar { padding: 10px 14px; }
  .grid-2, .grid-3, .form-grid.cols-2 { grid-template-columns: 1fr; }
  .form-group.span-2 { grid-column: auto; }
  .page-head h1 { font-size: 22px; }
  .stat .value { font-size: 26px; }
  .table th.hide-sm, .table td.hide-sm { display: none; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-rail { display: none; }
  .auth-card { padding: 26px 20px; }
  .kv { grid-template-columns: 90px 1fr; }
}
