/* =============================================================
 * AquaVision Platform — IRIS 스타일 시스템 적용
 * 참고: /Users/woo/Simplify/docs/iris-style-guide.html
 * Palette: navy #003478 (primary) · sky #0F8BD9 (secondary)
 * Typography: Pretendard + Inter + Noto Sans KR + JetBrains Mono
 * Light / Dark theme 모두 지원
 * ============================================================= */
:root {
  --iris-navy-900: #002251;
  --iris-navy-700: #003478;
  --iris-navy-600: #0d4694;
  --iris-navy-500: #1C5CBF;
  --iris-sky-500:  #0F8BD9;
  --iris-sky-100:  #E6F3FC;
}
.theme-light {
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --surface-alt: #F0F4F8;
  --border: #D9DEE5;
  --border-soft: #EEF1F5;
  --text: #1A2332;
  --text-soft: #5F6A7D;
  --text-mute: #8C95A3;
  --accent: #003478;
  --accent-2: #0F8BD9;
  --accent-50: #E6F3FC;
  --accent-100: #CCE5F5;
  --positive: #1E9E5F;
  --positive-50: #E6F5EC;
  --negative: #D62839;
  --negative-50: #FBE8EA;
  --warning: #E8820E;
  --warning-50: #FDF1DE;
  --shadow-sm: 0 1px 2px rgba(0, 34, 81, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 34, 81, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 34, 81, 0.08);
}
.theme-dark {
  --bg: #0B1220;
  --surface: #141E33;
  --surface-alt: #1B2A47;
  --border: #2A3A5C;
  --border-soft: #1F2D4A;
  --text: #E8EEF8;
  --text-soft: #9CA8BE;
  --text-mute: #667083;
  --accent: #6EA1EE;
  --accent-2: #38B1F5;
  --accent-50: #1A2D4A;
  --accent-100: #22375A;
  --positive: #5CCB8D;
  --positive-50: #1A3328;
  --negative: #EC6B77;
  --negative-50: #3A1B20;
  --warning: #F0AF45;
  --warning-50: #3A2A15;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100vh; }
body {
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Inter", -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: 248px 1fr;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.skip-link { position: absolute; left: -9999px; top: 0; padding: 8px 12px; background: var(--accent); color: #fff; z-index: 10000; border-radius: 4px; }
.skip-link:focus { left: 8px; top: 8px; }

/* ============ SIDEBAR ============ */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  overflow-y: auto;
}
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; border-bottom: 1px solid var(--border-soft); }
.sb-logo {
  width: 40px; height: 40px; border-radius: 8px;
  background: linear-gradient(135deg, var(--iris-navy-700) 0%, var(--iris-sky-500) 100%);
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.02em;
}
.sb-brand-name { font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -0.015em; }
.sb-brand-name span { font-weight: 400; color: var(--text-soft); margin-left: 4px; }
.sb-brand-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; letter-spacing: 0.04em; }

.sb-nav { margin-top: 16px; display: flex; flex-direction: column; gap: 1px; }
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 6px;
  color: var(--text-soft); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.sb-link:hover { background: var(--surface-alt); color: var(--text); }
.sb-link.is-active { background: var(--accent-50); color: var(--accent); font-weight: 600; }
.theme-dark .sb-link.is-active { color: #fff; background: var(--iris-navy-700); }
.sb-ico { display: inline-flex; width: 20px; justify-content: center; font-size: 14px; opacity: .8; }
.sb-link-alt { border: 1px dashed var(--border); margin-top: 4px; }
.sb-link-alt.is-active { background: var(--accent); color: #fff; border-style: solid; border-color: var(--accent); }
.sb-badge {
  margin-left: auto;
  background: var(--negative); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px;
  min-width: 18px; text-align: center;
}
.sb-badge:empty { display: none; }
.sb-badge-alt { background: var(--iris-sky-500); color: #fff; font-weight: 600; letter-spacing: 0.04em; }
.sb-divider { height: 1px; background: var(--border-soft); margin: 10px 4px; }

.sb-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.sb-theme {
  width: 100%; padding: 8px 12px;
  background: var(--surface-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-bottom: 10px;
}
.sb-theme::before { content: "☀"; }
.theme-dark .sb-theme::before { content: "☾"; }
.sb-meta-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-mute); padding: 2px 4px; }
.sb-meta-row .mono { color: var(--text-soft); }

/* ============ MAIN / TOPBAR ============ */
.main { min-width: 0; padding: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex; align-items: center; gap: 20px;
  backdrop-filter: blur(8px);
}
.crumbs ol { list-style: none; display: flex; gap: 8px; font-size: 13px; color: var(--text-soft); }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 8px; color: var(--text-mute); }
.crumbs li:last-child { color: var(--text); font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
#globalSearch {
  width: 280px; padding: 8px 12px;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text);
}
#globalSearch:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--surface-alt); border-radius: 999px; }
.u-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.u-name { font-size: 13px; color: var(--text-soft); }

.view { padding: 28px; flex: 1; }
.view-head { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.view-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.view-sub { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; letter-spacing: -0.005em;
  transition: all .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--iris-navy-600); }
.btn-secondary { background: var(--accent-2); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: var(--iris-sky-500); filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); border-color: var(--accent); color: var(--accent); }
.btn-warn { background: transparent; color: var(--negative); border-color: var(--negative); }
.btn-warn:hover:not(:disabled) { background: var(--negative); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ============ Cards & Tiles ============ */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.card-title small { font-weight: 400; color: var(--text-mute); margin-left: 6px; font-size: 12px; }

.kpi-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.kpi-tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.kpi-tile.accent-2::before { background: var(--accent-2); }
.kpi-tile.positive::before { background: var(--positive); }
.kpi-tile.warning::before  { background: var(--warning); }
.kpi-tile.negative::before { background: var(--negative); }
.kpi-label { font-size: 12px; color: var(--text-mute); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.1; letter-spacing: -0.02em; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-soft); margin-left: 4px; }
.kpi-delta { font-size: 12px; color: var(--positive); font-weight: 500; }
.kpi-delta.neg { color: var(--negative); }

/* ============ Tables (IRIS style) ============ */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
  background: var(--surface-alt); color: var(--text-soft);
  text-align: left; font-weight: 600; font-size: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}
table.data tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-soft);
  color: var(--text);
}
table.data tbody tr { cursor: pointer; transition: background .1s; }
table.data tbody tr:hover { background: var(--surface-alt); }
table.data tbody tr:last-child td { border-bottom: none; }
.tnum { font-variant-numeric: tabular-nums; font-family: "JetBrains Mono", monospace; font-size: 12.5px; }

/* ============ Badges ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.badge-accent   { background: var(--accent-50); color: var(--accent); }
.badge-positive { background: var(--positive-50); color: var(--positive); }
.badge-warning  { background: var(--warning-50); color: var(--warning); }
.badge-negative { background: var(--negative-50); color: var(--negative); }
.badge-dot::before { content: "●"; margin-right: 4px; font-size: 8px; }

/* ============ Media / snapshot card ============ */
.snap {
  width: 100%; aspect-ratio: 16/9; background: #0B1220 center/cover no-repeat;
  border-radius: 6px; position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.snap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.55) 100%);
}
.snap-meta {
  position: absolute; bottom: 8px; left: 10px; right: 10px; z-index: 1;
  display: flex; justify-content: space-between; align-items: end;
  color: #fff; font-size: 11px; font-family: "JetBrains Mono", monospace;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}

/* ============ Forms ============ */
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row input, .form-row select {
  padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; min-width: 160px;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--accent); }
.form-row label { font-size: 12px; color: var(--text-soft); align-self: center; }

/* ============ Filters bar ============ */
.filter-bar {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.filter-bar select, .filter-bar input {
  padding: 6px 10px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 4px; font-size: 12.5px; color: var(--text);
}
.pill {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; color: var(--text-soft); background: var(--surface-alt); cursor: pointer;
}
.pill.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============ Decisions / use case cards ============ */
.uc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.uc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm);
}
.uc-head { display: flex; justify-content: space-between; align-items: center; }
.uc-type {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; color: var(--text);
}
.uc-type .uc-ic {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent-50); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.uc-ic.prio-1 { background: var(--negative-50); color: var(--negative); }
.uc-ic.prio-2 { background: var(--warning-50); color: var(--warning); }
.uc-ic.prio-3 { background: var(--accent-50);   color: var(--accent); }
.uc-ic.prio-4 { background: var(--positive-50); color: var(--positive); }
.uc-ic.prio-5 { background: var(--surface-alt); color: var(--text-soft); }
.uc-score {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; font-weight: 600; color: var(--accent);
}
.uc-snap { width: 100%; aspect-ratio: 16/9; background-size: cover; background-position: center; border-radius: 4px; }
.uc-meta { font-size: 12px; color: var(--text-soft); }
.uc-meta strong { color: var(--text); font-weight: 600; }
.uc-reason { font-size: 12.5px; color: var(--text-soft); background: var(--surface-alt); padding: 8px 10px; border-radius: 4px; border-left: 2px solid var(--accent); }
.uc-actions { display: flex; gap: 6px; margin-top: auto; }
.uc-weights { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; font-size: 10.5px; font-family: "JetBrains Mono", monospace; }
.uc-weights span { text-align: center; padding: 3px 2px; background: var(--surface-alt); border-radius: 3px; }
.uc-weights span b { display: block; font-weight: 600; color: var(--accent); }

/* ============ Sensor mini-chart ============ */
.mini-chart { width: 100%; height: 56px; background: var(--surface-alt); border-radius: 4px; }

/* ============ Drawer (decision detail) ============ */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(11, 18, 32, 0.45);
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 560px; max-width: 96vw;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 101;
  transform: translateX(100%); transition: transform .25s ease-out;
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  position: sticky; top: 0; background: var(--surface); z-index: 1;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-head h3 { font-size: 17px; font-weight: 700; }
.drawer-close { background: transparent; border: none; font-size: 22px; color: var(--text-soft); }
.drawer-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.drawer-section h4 { font-size: 13px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }

/* score bar */
.score-row { display: flex; flex-direction: column; gap: 6px; }
.score-row .sr-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-soft); }
.score-bar { height: 6px; background: var(--surface-alt); border-radius: 3px; overflow: hidden; }
.score-bar > span { display: block; height: 100%; background: var(--accent-2); }

/* timeline */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 14px; }
.timeline-item::before { content: ""; position: absolute; left: -16px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.timeline-item.ai::before       { background: var(--accent-2); }
.timeline-item.approved::before { background: var(--positive); }
.timeline-item.rejected::before { background: var(--text-mute); }
.timeline-item.applied::before  { background: var(--accent); }
.timeline-item .ts { font-size: 11px; color: var(--text-mute); font-family: "JetBrains Mono", monospace; }
.timeline-item .act { font-size: 13px; font-weight: 600; }
.timeline-item .note { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 10px 16px; background: transparent; border: none; border-bottom: 2px solid transparent;
  font-size: 13px; font-weight: 500; color: var(--text-soft); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab .tab-count { margin-left: 6px; background: var(--surface-alt); color: var(--text-soft); font-size: 11px; padding: 1px 7px; border-radius: 999px; font-family: "JetBrains Mono", monospace; }
.tab.is-active .tab-count { background: var(--accent-50); color: var(--accent); }

/* ============ AQUA23 container ============ */
.aqua23-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.aqua23-intro {
  padding: 16px 20px; border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(135deg, var(--accent-50) 0%, transparent 100%);
}
.aqua23-intro h3 { font-size: 16px; color: var(--accent); margin-bottom: 4px; }
.aqua23-intro p { font-size: 13px; color: var(--text-soft); margin: 0; }

/* embedded counter (AQUA23) */
.counter-body { padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.counter-section h4 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); padding-bottom: 6px; border-bottom: 1px solid var(--border-soft); }
.counter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.counts-mini { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.counts-mini > div { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px; padding: 10px; text-align: center; }
.counts-mini .lbl { font-size: 10px; color: var(--text-mute); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; display: block; margin-bottom: 4px; }
.counts-mini .cv { font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
progress#prog { width: 100%; height: 3px; appearance: none; border: none; background: var(--border); border-radius: 2px; }
progress#prog::-webkit-progress-bar { background: var(--border); }
progress#prog::-webkit-progress-value { background: var(--accent); }
.stage { position: relative; width: 100%; background: #000; border-radius: 6px; overflow: hidden; min-height: 320px; border: 1px solid var(--border); }
.stage img, .stage video { width: 100%; display: block; min-height: 320px; background: #000; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.status-bar { font-size: 12px; color: var(--text-soft); padding: 8px 12px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.status-bar::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-mute); }
.status-bar.is-running::before { background: var(--positive); animation: pulse 1.2s ease-in-out infinite; }
.status-bar.is-paused::before  { background: var(--warning); }
.status-bar.is-done::before    { background: var(--accent-2); }
.status-bar.is-error::before   { background: var(--negative); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

.line-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 4px; max-height: 120px; overflow-y: auto; }
.line-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--surface-alt); border: 1px solid var(--border-soft); border-radius: 4px; font-size: 12px; }
.line-list li button { padding: 2px 8px; font-size: 11px; background: transparent; border: 1px solid var(--border); border-radius: 3px; color: var(--negative); }

.modes { display: flex; gap: 16px; font-size: 13px; margin-bottom: 8px; }
.slider-row { display: grid; grid-template-columns: 120px 1fr 100px; gap: 10px; align-items: center; font-size: 12px; color: var(--text-soft); }
input[type=range] { appearance: none; height: 3px; background: var(--border); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); cursor: pointer; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.jobs-lib { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.jobs-lib li { display: grid; grid-template-columns: auto 1fr auto auto auto auto; gap: 12px; align-items: center; padding: 10px 14px; background: var(--surface-alt); border: 1px solid var(--border-soft); border-radius: 6px; font-size: 12.5px; }
.jobs-lib li.empty { grid-template-columns: 1fr; justify-items: center; padding: 16px; color: var(--text-mute); font-style: italic; }
.jobs-lib li.jl-head { grid-template-columns: 1fr auto; background: var(--surface); border-style: dashed; padding: 8px 14px; }
.jl-head-sum { color: var(--text-soft); font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.jl-head-btns { display: flex; gap: 6px; }
.jl-del { background: transparent; border: 1px solid var(--border); color: var(--text-mute); width: 26px; height: 26px; border-radius: 4px; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.jl-del:hover { border-color: var(--negative); color: var(--negative); }
.jl-icon { color: var(--accent); font-weight: 700; }
.jl-main { min-width: 0; }
.jl-src { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jl-meta { color: var(--text-mute); font-family: "JetBrains Mono", monospace; font-size: 11px; }
.jl-stat { color: var(--text-soft); font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.jl-badge { font-size: 10px; padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px; font-weight: 600; letter-spacing: 0.04em; }
.jl-badge.done { color: var(--accent-2); }
.jl-badge.running { color: var(--positive); }
.jl-badge.paused { color: var(--warning); }
.jl-badge.error { color: var(--negative); }
.jl-action { font-size: 12px; color: var(--accent); padding: 4px 10px; border: 1px solid var(--accent); border-radius: 3px; }
.jl-action:hover { background: var(--accent); color: #fff; }
.jl-action.is-disabled { color: var(--text-mute); border-color: var(--border); pointer-events: none; }
.hist canvas, canvas#chart, canvas#hist { width: 100%; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 4px; }
.hist-title { font-size: 11px; color: var(--text-mute); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; margin-top: 12px; }
.muted { color: var(--text-mute); font-size: 12px; }
.muted.mono { color: var(--text-soft); font-family: "JetBrains Mono", monospace; font-size: 11.5px; margin-top: 4px; }

/* ============ Responsive ============ */
@media (max-width: 1120px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .sb-nav { flex-direction: row; overflow-x: auto; flex: 1; }
  .sb-foot, .sb-brand-text { display: none; }
  .view { padding: 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  #globalSearch { width: 160px; }
  .counter-grid { grid-template-columns: 1fr; }
  .counts-mini { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
 * iter5 · alerts · reports · modal · toast · export-hub
 * ============================================================ */

/* toast */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent-2);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); font-size: 13px; min-width: 240px; max-width: 360px;
  opacity: 0; transform: translateX(12px); transition: opacity .22s ease, transform .22s ease; }
.toast.is-show { opacity: 1; transform: translateX(0); }
.toast-success { border-left-color: var(--positive); }
.toast-error   { border-left-color: var(--negative); }
.toast-warn    { border-left-color: var(--warning); }
.toast-ic { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--accent-50); color: var(--accent-2); font-weight: 700; font-size: 11px; }
.toast-success .toast-ic { background: var(--positive-50); color: var(--positive); }
.toast-error .toast-ic   { background: var(--negative-50); color: var(--negative); }
.toast-warn .toast-ic    { background: var(--warning-50); color: var(--warning); }
.toast-msg { color: var(--text); }

/* filter-bar (공통) */
.filter-bar { display: flex; gap: 10px; align-items: center; padding: 10px 0 14px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input[type="search"], .filter-bar input[type="text"] {
  height: 32px; padding: 4px 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 6px; font-size: 13px; }
.filter-count { margin-left: auto; font-size: 12px; color: var(--text-soft); }
.empty-state { padding: 40px; text-align: center; color: var(--text-soft); background: var(--surface-alt); border-radius: 8px; border: 1px dashed var(--border); }

/* alerts */
.alert-filter-bar { margin-top: 0; }
.alert-group { margin-bottom: 16px; }
.alert-group-head { display: flex; align-items: center; gap: 10px; padding: 6px 2px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 10px; }
.alert-day { font-weight: 600; color: var(--text); font-size: 13px; }
.alert-day-count { font-size: 11px; color: var(--text-soft); background: var(--surface-alt); padding: 2px 8px; border-radius: 10px; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: flex-start;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 8px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.alert-card:hover { background: var(--surface-alt); border-color: var(--border); }
.alert-card:active { transform: translateY(1px); }
.alert-card.is-unread { border-left: 3px solid var(--negative); }
.alert-card.is-read { opacity: .72; }
.alert-card.sev-critical.is-unread { border-left-color: var(--negative); }
.alert-card.sev-warning.is-unread  { border-left-color: var(--warning); }
.alert-card.sev-info.is-unread     { border-left-color: var(--accent-2); }
.alert-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--accent-2); }
.alert-card.sev-critical .alert-dot { background: var(--negative); }
.alert-card.sev-warning  .alert-dot { background: var(--warning); }
.alert-card.sev-info     .alert-dot { background: var(--accent-2); }
.alert-top { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.alert-time { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-soft); margin-left: auto; }
.alert-new { font-size: 10px; font-weight: 700; color: var(--negative); background: var(--negative-50); padding: 2px 6px; border-radius: 3px; }
.alert-msg { color: var(--text); font-size: 13px; margin-bottom: 4px; }
.alert-meta { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-soft); }

/* reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 8px; }
.report-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: 10px; cursor: pointer; transition: border-color .15s, transform .1s; }
.report-card:hover { border-color: var(--accent-2); }
.report-card:active { transform: translateY(1px); }
.report-card-head { display: flex; align-items: center; gap: 10px; }
.report-ic { display: inline-flex; width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent-50); color: var(--accent-2); align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.report-title { font-weight: 600; font-size: 14px; color: var(--text); }
.report-period { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-soft); }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); font-size: 12px; }
.report-stats .muted { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.report-metric-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.m-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; background: var(--surface-alt);
  border: 1px solid var(--border-soft); padding: 4px 8px; border-radius: 12px; }
.m-chip .mc-k { color: var(--text-soft); }
.m-chip .mc-v { color: var(--text); font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.m-chip.trend-up { background: var(--positive-50); border-color: transparent; }
.m-chip.trend-up .mc-v { color: var(--positive); }
.m-chip.trend-down { background: var(--negative-50); border-color: transparent; }
.m-chip.trend-down .mc-v { color: var(--negative); }
.report-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* report drawer extras */
.drawer-wide { width: 620px; max-width: 92vw; }
.kv-grid { display: grid; grid-template-columns: 100px 1fr; gap: 8px 14px; font-size: 12.5px; }
.kv-grid .muted { color: var(--text-soft); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric-tile { background: var(--surface-alt); border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; }
.metric-tile .mt-k { font-size: 11px; color: var(--text-soft); margin-bottom: 4px; }
.metric-tile .mt-v { font-size: 16px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.metric-tile .mt-trend { font-size: 10px; margin-top: 4px; }
.metric-tile.trend-up   { border-left: 3px solid var(--positive); }
.metric-tile.trend-up   .mt-v { color: var(--positive); }
.metric-tile.trend-up   .mt-trend { color: var(--positive); }
.metric-tile.trend-down { border-left: 3px solid var(--negative); }
.metric-tile.trend-down .mt-v { color: var(--negative); }
.metric-tile.trend-down .mt-trend { color: var(--negative); }
.report-para { font-size: 13px; line-height: 1.6; color: var(--text); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: 6px 0 6px 22px; position: relative; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border-soft); }
.check-list li:last-child { border-bottom: 0; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--positive); font-weight: 700; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9996; opacity: 0; animation: mb-in .18s ease forwards; }
@keyframes mb-in { to { opacity: 1; } }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 520px; max-width: 94vw; max-height: 90vh;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); z-index: 9997;
  display: flex; flex-direction: column; opacity: 0; animation: m-in .2s ease forwards; }
@keyframes m-in { to { opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-soft); }
.modal-hint { margin-top: 14px; padding: 10px 12px; background: var(--accent-50); color: var(--accent); font-size: 12px; border-radius: 6px; }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.form-row label { font-size: 12px; color: var(--text-soft); }
.form-row select, .form-row input { height: 34px; padding: 4px 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 6px; font-size: 13px; }

/* export hub menu */
.export-menu { position: fixed; z-index: 9999; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18); min-width: 220px; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.export-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: transparent; border: 0; color: var(--text);
  font-size: 13px; cursor: pointer; border-radius: 6px; text-align: left; }
.export-menu-item:hover { background: var(--surface-alt); }
.em-ic { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-2); }
