@font-face {
  font-family: "Manrope";
  src: url("./ERREPX_Fonts_Manrope/Manrope-Latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --canvas: #0b0d12;
  --canvas-raised: #0e1117;
  --surface: #12151c;
  --surface-2: #171b24;
  --surface-3: #1a1f29;
  --text: #f7f8fa;
  --muted: #a7b0be;
  --muted-2: #717b8c;
  --border: #2a3240;
  --border-soft: rgba(167, 176, 190, 0.13);
  --accent: #b8ff3b;
  --accent-ink: #0b0d12;
  --blue: #2f7ef7;
  --violet: #745cff;
  --cyan: #22c7e8;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --pink: #e348a7;
  --slate: #7c8799;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  --sidebar: 244px;
  --header: 68px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --canvas: #f5f5f4;
  --canvas-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f1ef;
  --surface-3: #e8e8e5;
  --text: #101114;
  --muted: #51555d;
  --muted-2: #777c85;
  --border: #d6d7d9;
  --border-soft: rgba(16, 17, 20, 0.11);
  --accent: #101114;
  --accent-ink: #ffffff;
  --shadow: 0 20px 55px rgba(26, 32, 44, 0.14);
}

[data-theme="light"] :focus-visible { outline-color: var(--blue); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--text);
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { cursor: pointer; }
svg { width: 18px; height: 18px; stroke-width: 1.75; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}
.skip-link:focus { transform: translateY(0); }

.app-shell { width: 100%; min-width: 0; height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); overflow: hidden; }

.global-sidebar {
  position: relative;
  z-index: 30;
  min-width: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--canvas-raised);
  border-right: 1px solid var(--border);
  display: grid;
  grid-template-rows: 68px 1fr auto;
  transition: width 220ms var(--ease);
}
.global-sidebar > * { min-width: 0; width: 100%; }

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-button { padding: 0; border: 0; background: transparent; display: flex; align-items: center; }
.brand { width: 116px; height: auto; display: block; }
.brand-light { display: none; }
[data-theme="light"] .brand-dark { display: none; }
[data-theme="light"] .brand-light { display: block; }

.sidebar-scroll { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 18px 12px 28px; scrollbar-width: thin; overscroll-behavior: contain; }
.nav-eyebrow, .eyebrow {
  margin: 0 8px 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-heading-row { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }
.nav-divider { height: 1px; margin: 18px 6px; background: var(--border-soft); }
.nav-item {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 40px;
  margin: 2px 0;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: 140ms ease;
}
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--text); background: var(--surface-2); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; width: 3px; height: 21px; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav-item.active [data-icon] { color: var(--accent); }
.nav-count { min-width: 20px; padding: 2px 6px; color: var(--muted); background: var(--surface-3); border-radius: 999px; font-size: 10px; text-align: center; }
.nav-count.violet { color: #bfb5ff; background: rgba(116, 92, 255, 0.16); }
.mini-button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.mini-button:hover { background: var(--surface); color: var(--text); }
.mini-button svg { width: 15px; height: 15px; }

.operation-switch {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.operation-switch.active { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent); border-color: color-mix(in srgb, var(--accent) 16%, transparent); }
.operation-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.operation-copy { display: flex; flex-direction: column; min-width: 0; }
.operation-copy strong { font-size: 13px; }
.operation-copy small { color: var(--muted-2); font-size: 11px; }
.operation-switch > svg { color: var(--muted-2); width: 15px; }
.operation-subnav { min-width: 0; margin-top: 8px; padding-left: 8px; border-left: 1px solid var(--border-soft); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border-soft); }
.user-card { width: 100%; padding: 8px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.user-card:hover { background: var(--surface); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; }
.avatar-owner { color: var(--accent-ink); background: var(--accent); }
.user-copy { min-width: 0; display: flex; flex-direction: column; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy small { color: var(--muted); font-size: 10px; }
.user-card > svg { width: 15px; color: var(--muted); }

.workspace-shell { width: 100%; min-width: 0; height: 100vh; display: grid; grid-template-rows: var(--header) 48px minmax(0, 1fr); overflow: hidden; }
.workspace-shell.global-context { grid-template-rows: var(--header) 1fr; }
.workspace-shell.global-context .operation-tabs { display: none; }
.context-header { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: var(--canvas-raised); border-bottom: 1px solid var(--border); }
.context-left, .header-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.scope-switcher { height: 44px; display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 5px; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; }
.scope-switcher:hover { background: var(--surface); border-color: var(--border); }
.scope-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #0b0d12; background: var(--accent); border-radius: 9px; font-weight: 900; }
.scope-switcher > span:nth-child(2) { display: flex; flex-direction: column; }
.scope-switcher small { color: var(--muted-2); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.scope-switcher strong { font-size: 12px; }
.scope-switcher > svg { width: 14px; color: var(--muted); }
.sync-badge { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--slate); }
.status-partial { background: var(--amber); }
.status-synced { background: var(--green); }
.icon-button { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); }
.icon-button:hover { color: var(--text); background: var(--surface); border-color: var(--border); }
.notification-button { position: relative; }
.notification-button i { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--canvas-raised); }
.date-filter { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 600; }
.date-filter svg { width: 15px; }
.ai-launch { height: 38px; padding: 0 14px; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(116,92,255,.42); border-radius: 10px; color: #ded9ff; background: rgba(116,92,255,.15); font-size: 12px; font-weight: 700; }
.ai-launch:hover { background: rgba(116,92,255,.25); }
[data-theme="light"] .ai-launch { color: #4d3db3; background: #eeeaff; border-color: #cfc6ff; }
[data-theme="light"] .ai-launch:hover { background: #e2dcff; }
.mobile-menu { display: none; }

.operation-tabs { padding: 0 28px; display: flex; align-items: end; gap: 24px; overflow-x: auto; background: var(--canvas-raised); border-bottom: 1px solid var(--border); }
.operation-tabs button { position: relative; height: 47px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.operation-tabs button:hover, .operation-tabs button.active { color: var(--text); }
.operation-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }

#main-content { min-width: 0; overflow: auto; padding: 28px 30px 64px; background: var(--canvas); }
.page { width: min(1540px, 100%); margin: 0 auto; animation: page-in 220ms var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-title-wrap { min-width: 0; }
.page-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page-kicker::before { content: ""; width: 16px; height: 2px; background: currentColor; }
.page-header h1 { margin: 0; font-size: clamp(23px, 2.2vw, 29px); line-height: 1.16; letter-spacing: -.035em; }
.page-header p { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.button { min-height: 40px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--radius-md); font-size: 12px; font-weight: 750; transition: 140ms ease; }
.button svg { width: 16px; height: 16px; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 11px; }
.button.primary { color: var(--accent-ink); background: var(--accent); }
.button.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.button.secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.button.secondary:hover { background: var(--surface-2); }
.button.ghost { color: var(--muted); background: transparent; }
.button.ghost:hover { color: var(--text); background: var(--surface); }
.button.ai { color: #f5f3ff; background: var(--violet); }
.button.danger { color: #fff; background: var(--red); }

.metrics-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { position: relative; overflow: hidden; min-height: 125px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.metric-card.featured { grid-column: span 1; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.metric-card.featured::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.metric-value { margin-top: 16px; font-size: 25px; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; font-weight: 750; }
.metric-bottom { margin-top: 13px; display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 9px; }
.trend { display: inline-flex; align-items: center; gap: 2px; color: var(--green); font-weight: 800; }
.trend.down { color: var(--red); }
.trend.neutral { color: var(--amber); }
.trend svg { width: 12px; height: 12px; }
.source-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap: 16px; margin-bottom: 16px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.panel-header { min-height: 65px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border-soft); }
.panel-title { min-width: 0; }
.panel-title h2, .panel-title h3 { margin: 0; font-size: 14px; letter-spacing: -.015em; }
.panel-title p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-tools { display: flex; align-items: center; gap: 6px; }
.panel-body { padding: 18px; }

.production-board { padding: 20px 18px 18px; }
.production-bars { display: grid; gap: 15px; }
.production-row { display: grid; grid-template-columns: 84px 1fr 32px; align-items: center; gap: 12px; }
.production-row label { color: var(--muted); font-size: 10px; font-weight: 650; }
.bar-track { height: 7px; overflow: hidden; border-radius: 10px; background: var(--surface-3); }
.bar-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.bar-fill.violet { background: var(--violet); }
.bar-fill.accent { background: var(--accent); }
.bar-fill.cyan { background: var(--cyan); }
.bar-fill.amber { background: var(--amber); }
.production-row strong { font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.production-summary { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--border-soft); display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.production-summary div { display: flex; flex-direction: column; gap: 3px; }
.production-summary strong { font-size: 15px; }
.production-summary small { color: var(--muted); font-size: 9px; }

.ai-insight-panel { position: relative; overflow: hidden; background: linear-gradient(150deg, rgba(116,92,255,.16), var(--surface) 50%); }
.ai-insight-panel::after { content: ""; position: absolute; width: 180px; height: 180px; right: -80px; top: -90px; border: 1px solid rgba(116,92,255,.25); border-radius: 50%; box-shadow: 0 0 0 28px rgba(116,92,255,.04), 0 0 0 55px rgba(116,92,255,.025); }
.ai-head { display: flex; align-items: center; gap: 10px; }
.agent-avatar, .ai-mark { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(116,92,255,.4); border-radius: 10px; color: #c8c0ff; background: rgba(116,92,255,.18); }
.agent-avatar svg, .ai-mark svg { width: 17px; }
.insight-list { display: grid; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.insight-item { padding: 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px; border: 1px solid var(--border-soft); border-radius: 11px; background: rgba(18,21,28,.64); }
[data-theme="light"] .insight-item { background: rgba(255,255,255,.7); }
.insight-number { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: #d8d3ff; background: rgba(116,92,255,.2); font-size: 9px; font-weight: 800; }
.insight-item p { margin: 0; font-size: 10px; }
.insight-item p strong { display: block; margin-bottom: 2px; font-size: 11px; }
.insight-item > svg { width: 14px; color: var(--muted-2); }

.overview-bottom { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.distribution { display: grid; grid-template-columns: 112px 1fr; gap: 22px; align-items: center; }
.donut { position: relative; width: 108px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--violet) 0 33%, var(--cyan) 33% 58%, var(--accent) 58% 100%); }
.donut::after { content: ""; position: absolute; inset: 14px; background: var(--surface); border-radius: 50%; }
.donut-label { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-label strong { font-size: 19px; }
.donut-label small { color: var(--muted); font-size: 8px; }
.legend { display: grid; gap: 10px; }
.legend-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 10px; }
.legend-row i { width: 7px; height: 7px; border-radius: 50%; }
.legend-row span { color: var(--muted); }

.coverage-grid { display: grid; gap: 11px; }
.coverage-row { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 9px; }
.coverage-row > span { color: var(--muted); font-size: 9px; }
.coverage-track { display: grid; grid-template-columns: repeat(var(--parts), 1fr); gap: 3px; }
.coverage-track i { height: 6px; border-radius: 3px; background: var(--border); }
.coverage-track i.on { background: var(--accent); }
.coverage-row strong { font-size: 9px; }

.winner-list { display: grid; gap: 8px; }
.winner-row { padding: 8px 0; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--border-soft); }
.winner-row:last-child { border: 0; }
.winner-thumb { width: 38px; height: 38px; border-radius: 8px; background: linear-gradient(145deg, #2e3644, #0a0c10); position: relative; overflow: hidden; }
.winner-thumb::after { content: "T"; position: absolute; right: 5px; bottom: 2px; color: var(--accent); font-size: 18px; font-weight: 900; }
.winner-copy { min-width: 0; }
.winner-copy strong { display: block; font-size: 10px; }
.winner-copy small { color: var(--muted); font-size: 8px; }
.winner-result { text-align: right; }
.winner-result strong { display: block; color: var(--green); font-size: 11px; }
.winner-result small { color: var(--muted); font-size: 8px; }

.filter-bar { margin-bottom: 16px; padding: 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.search-field { min-width: 220px; flex: 1; height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--canvas); }
.search-field svg { width: 15px; color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.select-control { height: 38px; min-width: 120px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: var(--surface) no-repeat right 10px center; font-size: 10px; }
.view-toggle { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 9px; }
.view-toggle button { width: 31px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; color: var(--muted); background: transparent; }
.view-toggle button.active { color: var(--text); background: var(--surface-3); }
.view-toggle svg { width: 15px; }

.data-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; white-space: nowrap; }
.data-table th { position: sticky; top: 0; z-index: 2; height: 44px; padding: 0 14px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: left; font-size: 9px; letter-spacing: .03em; }
.data-table td { height: 58px; padding: 0 14px; border-bottom: 1px solid var(--border-soft); color: var(--muted); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: 120ms ease; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td:first-child { color: var(--text); }
.creative-cell { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.creative-id { color: var(--muted-2); font-family: Consolas, monospace; font-size: 9px; }
.creative-copy strong { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.creative-copy small { color: var(--muted-2); }
.check-box { width: 15px; height: 15px; border: 1px solid var(--border); border-radius: 4px; background: transparent; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 8px; font-weight: 700; }
.chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
[data-theme="dark"] .chip.accent { color: var(--accent); }
.chip.violet { color: #a99dff; border-color: rgba(116,92,255,.3); background: rgba(116,92,255,.1); }
.chip.blue { color: #75a8ff; border-color: rgba(47,126,247,.28); background: rgba(47,126,247,.09); }
.chip.green { color: #55d982; border-color: rgba(34,197,94,.26); background: rgba(34,197,94,.08); }
.chip.amber { color: #f7b942; border-color: rgba(245,158,11,.28); background: rgba(245,158,11,.08); }
.chip.red { color: #fb7575; border-color: rgba(239,68,68,.28); background: rgba(239,68,68,.08); }
.chip.pink { color: #f07abd; border-color: rgba(227,72,167,.28); background: rgba(227,72,167,.08); }
.owner-cell { display: flex; align-items: center; gap: 7px; }
.owner-mini { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-size: 7px; font-weight: 800; }

.kanban-shell { overflow-x: auto; padding-bottom: 10px; }
.kanban { min-width: 1320px; display: grid; grid-template-columns: repeat(6, minmax(205px, 1fr)); gap: 12px; align-items: start; }
.kanban-column { min-height: 560px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.kanban-column.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.kanban-header { height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 3px 10px; }
.kanban-title { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.kanban-title i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate); }
.kanban-title i.blue { background: var(--blue); }
.kanban-title i.violet { background: var(--violet); }
.kanban-title i.amber { background: var(--amber); }
.kanban-title i.green { background: var(--green); }
.kanban-header span:last-child { min-width: 20px; padding: 2px 5px; border-radius: 6px; color: var(--muted); background: var(--surface-3); text-align: center; font-size: 9px; }
.kanban-cards { display: grid; gap: 8px; }
.kanban-card { padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--canvas-raised); box-shadow: 0 2px 0 rgba(0,0,0,.04); cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .45; }
.kanban-card:hover { border-color: var(--muted-2); transform: translateY(-1px); }
.kanban-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-family: Consolas, monospace; font-size: 8px; }
.priority-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.kanban-card h3 { margin: 9px 0 6px; font-size: 11px; line-height: 1.35; }
.kanban-card p { margin: 0 0 10px; color: var(--muted); font-size: 9px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 2px 6px; border-radius: 5px; color: var(--muted); background: var(--surface-3); font-size: 7px; font-weight: 700; }
.kanban-meta { margin-top: 12px; padding-top: 9px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border-soft); }
.kanban-meta .owner-mini { width: 22px; height: 22px; }
.kanban-meta time { color: var(--muted-2); font-size: 8px; }
.add-card-button { width: 100%; height: 36px; margin-top: 8px; border: 1px dashed var(--border); border-radius: 9px; background: transparent; color: var(--muted); font-size: 9px; }
.add-card-button:hover { color: var(--text); border-color: var(--muted-2); }

.library-grid { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 14px; }
.media-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: 160ms ease; }
.media-card:hover { transform: translateY(-3px); border-color: var(--muted-2); }
.media-preview { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #101218; }
.media-visual { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.visual-watch { background: radial-gradient(circle at 54% 40%, #434c58 0 8%, #171b20 9% 20%, transparent 21%), linear-gradient(145deg, #2a2e34, #090a0c); }
.visual-watch::before { content: "MONACO"; font-size: clamp(24px, 3vw, 42px); letter-spacing: .12em; font-weight: 900; color: rgba(255,255,255,.9); transform: rotate(-8deg); }
.visual-watch::after { content: "TOMI"; position: absolute; bottom: 16px; color: var(--accent); font-size: 10px; letter-spacing: .3em; }
.visual-blue { background: linear-gradient(125deg, #071127, #15439a 60%, #37a8dc); }
.visual-blue::before { content: "PARECE CARO."; max-width: 80%; color: #fff; font-size: 26px; line-height: .95; font-weight: 900; letter-spacing: -.05em; }
.visual-lime { background: linear-gradient(140deg, #d5ff83, #7fb90b); }
.visual-lime::before { content: "O DETALHE MUDA TUDO"; width: 78%; color: #0b0d12; font-size: 25px; line-height: .96; font-weight: 900; }
.visual-ugc { background: linear-gradient(30deg, #1d1713, #7b5b45 60%, #cab49e); }
.visual-ugc::before { content: "POV"; padding: 6px 10px; border: 2px solid #fff; border-radius: 99px; color: #fff; font-size: 20px; font-weight: 900; }
.visual-gift { background: linear-gradient(145deg, #321928, #8b2f64 65%, #e26ca5); }
.visual-gift::before { content: "PRESENTE CERTO"; color: white; font-size: 25px; font-weight: 900; text-align: center; line-height: .95; }
.visual-steel { background: linear-gradient(145deg, #23272c, #79828a); }
.visual-steel::before { content: "3 LOOKS"; color: white; font-size: 30px; font-weight: 900; }
.preview-overlay { position: absolute; inset: 0; padding: 10px; display: flex; align-items: flex-start; justify-content: space-between; background: linear-gradient(180deg, rgba(0,0,0,.28), transparent 40%, rgba(0,0,0,.4)); }
.play-button { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; color: #fff; background: rgba(0,0,0,.35); backdrop-filter: blur(5px); }
.play-button svg { width: 15px; }
.duration { align-self: flex-end; margin-left: auto; padding: 3px 6px; border-radius: 5px; color: #fff; background: rgba(0,0,0,.65); font-size: 8px; }
.media-body { padding: 13px; }
.media-title { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.media-title strong { font-size: 11px; }
.media-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.winner-badge { color: var(--accent); font-size: 11px; }
.media-tags { margin: 11px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.media-results { padding-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border-soft); }
.media-results div { display: flex; flex-direction: column; }
.media-results strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.media-results small { color: var(--muted-2); font-size: 7px; text-transform: uppercase; }

.mining-metrics { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mining-toolbar { margin-bottom: 16px; padding: 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.mining-toolbar-note { margin-left: auto; color: var(--muted-2); font-size: 8px; }
.mining-board-shell { overflow-x: auto; padding-bottom: 12px; }
.mining-board { min-width: 1570px; display: grid; grid-template-columns: repeat(5, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.mining-column { min-height: 610px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: 140ms ease; }
.mining-column.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.mining-column-header { min-height: 62px; padding: 5px 4px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border-soft); }
.mining-column-header > div { display: flex; flex-direction: column; gap: 5px; }
.mining-column-header .kanban-title { height: auto; }
.mining-column-header small { color: var(--muted-2); font-size: 7px; }
.mining-count { min-width: 23px; padding: 3px 6px; border-radius: 6px; color: var(--muted); background: var(--surface-3); font-size: 9px; text-align: center; }
.mining-cards { display: grid; gap: 9px; padding-top: 9px; }
.mining-card { padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--canvas-raised); cursor: grab; transition: 140ms ease; }
.mining-card:hover { border-color: var(--muted-2); transform: translateY(-1px); }
.mining-card.dragging { opacity: .42; }
.mining-card-head { min-height: 26px; display: flex; align-items: center; justify-content: space-between; }
.mining-card-head .icon-button { width: 27px; height: 27px; }
.mining-card-actions { display: flex; align-items: center; gap: 2px; }
.danger-icon:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 8%, transparent); }
.mining-card h3 { margin: 9px 0 4px; font-size: 11px; line-height: 1.4; }
.mining-store { margin: 0; color: var(--muted); font-size: 8px; }
.mining-summary { margin: 7px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.mining-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.mining-tags span { padding: 4px 6px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 7px; font-weight: 700; }
.mining-tags .market-chip { color: var(--text); border-color: color-mix(in srgb, var(--blue) 24%, var(--border)); background: color-mix(in srgb, var(--blue) 7%, var(--surface-2)); }
.mining-offer { margin-top: 10px; padding: 9px; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--surface-2); }
.mining-offer small, .mining-arguments small { display: block; margin-bottom: 3px; color: var(--muted-2); font-size: 6px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mining-offer strong { font-size: 8px; line-height: 1.4; }
.mining-arguments { margin-top: 7px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mining-arguments > div { padding: 8px; border: 1px solid var(--border-soft); border-radius: 8px; }
.mining-arguments span { display: block; color: var(--muted); font-size: 7px; line-height: 1.4; }
.mining-links { margin: 11px 0; display: flex; gap: 6px; }
.mining-link { min-height: 27px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 7px; color: var(--blue); background: var(--surface-2); font-size: 8px; font-weight: 700; text-decoration: none; }
.mining-link:hover { border-color: var(--blue); }
.mining-link.missing { color: var(--muted-2); border-style: dashed; }
.ads-signal { min-height: 82px; padding: 11px; display: grid; grid-template-columns: 1fr 90px; align-items: end; gap: 10px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-2); }
.ads-signal > div:first-child { display: flex; flex-direction: column; }
.ads-signal small { color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: .04em; }
.ads-signal strong { margin: 2px 0; font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; }
.ads-trend { display: flex; align-items: center; gap: 3px; font-size: 7px; font-weight: 800; }
.ads-trend.up { color: var(--green); }
.ads-trend.down { color: var(--red); }
.ads-trend.neutral { color: var(--muted); }
.offer-lifecycle { margin-top: 8px; padding: 9px; display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.offer-lifecycle > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); background: var(--surface-3); }
.offer-lifecycle small { display: block; color: var(--muted-2); font-size: 6px; font-weight: 800; letter-spacing: .07em; }
.offer-lifecycle strong { display: block; margin-top: 1px; font-size: 8px; }
.offer-lifecycle p { margin: 2px 0 0; color: var(--muted); font-size: 7px; line-height: 1.35; }
.offer-lifecycle.recent { border-color: color-mix(in srgb, var(--blue) 30%, var(--border)); }
.offer-lifecycle.recent > span { color: var(--blue); background: color-mix(in srgb, var(--blue) 11%, transparent); }
.offer-lifecycle.validating { border-color: color-mix(in srgb, var(--amber) 30%, var(--border)); }
.offer-lifecycle.validating > span { color: var(--amber); background: color-mix(in srgb, var(--amber) 11%, transparent); }
.offer-lifecycle.scaling, .offer-lifecycle.established { border-color: color-mix(in srgb, var(--green) 32%, var(--border)); }
.offer-lifecycle.scaling > span, .offer-lifecycle.established > span { color: var(--green); background: color-mix(in srgb, var(--green) 11%, transparent); }
.mining-spark { height: 46px; display: flex; align-items: end; justify-content: flex-end; gap: 4px; }
.mining-spark i { width: 12px; min-height: 6px; border-radius: 3px 3px 1px 1px; background: var(--accent); opacity: .88; }
.mining-last-read { margin-top: 9px; display: flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 7px; }
.monitoring-pill { margin-left: auto; padding: 3px 5px; border-radius: 999px; color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); font-weight: 800; }
.monitoring-pill.due { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.mining-map-stats { margin-top: 8px; display: flex; gap: 6px; }
.mining-map-stats span { flex: 1; padding: 6px; border: 1px solid var(--border-soft); border-radius: 7px; color: var(--muted); font-size: 7px; text-align: center; }
.mining-map-stats b { color: var(--text); }
.mining-map { margin-top: 8px; padding: 7px 9px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 7px; }
.mining-map summary { color: var(--text); cursor: pointer; font-weight: 800; }
.mining-map p { margin: 7px 0 0; white-space: pre-line; line-height: 1.5; }
.mining-note { margin: 9px 0 0; padding: 8px; border-left: 2px solid var(--violet); color: var(--muted); background: rgba(116,92,255,.05); font-size: 8px; line-height: 1.45; }
.mining-card-footer { margin-top: 11px; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border-soft); }
.mining-card-footer > div { display: flex; gap: 5px; }
.snapshot-fields { margin: 20px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.snapshot-history { margin: 0 0 20px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.snapshot-history > strong { display: block; margin-bottom: 9px; font-size: 10px; }
.snapshot-history > div { min-height: 32px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 8px; }
.snapshot-history b { color: var(--text); font-size: 9px; }

.concept-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; }
.concept-card { position: relative; min-height: 235px; padding: 20px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.concept-card::after { content: attr(data-index); position: absolute; right: -4px; bottom: -27px; color: var(--surface-2); font-size: 104px; font-weight: 900; line-height: 1; }
.concept-card:hover { border-color: var(--muted-2); }
.concept-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.concept-code { color: var(--accent); font-family: Consolas, monospace; font-size: 9px; }
.concept-card h2 { position: relative; z-index: 1; max-width: 88%; margin: 22px 0 8px; font-size: 17px; line-height: 1.25; letter-spacing: -.025em; }
.concept-card > p { position: relative; z-index: 1; max-width: 88%; margin: 0; color: var(--muted); font-size: 9px; }
.concept-stats { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 18px; display: grid; grid-template-columns: repeat(3, 1fr); }
.concept-stats div { display: flex; flex-direction: column; border-right: 1px solid var(--border-soft); }
.concept-stats div + div { padding-left: 12px; }
.concept-stats div:last-child { border: 0; }
.concept-stats strong { font-size: 13px; }
.concept-stats small { color: var(--muted-2); font-size: 7px; text-transform: uppercase; }

.family-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.family-list { padding: 8px; }
.family-selector { width: 100%; padding: 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; }
.family-selector:hover, .family-selector.active { border-color: var(--border); background: var(--surface-2); }
.family-selector .winner-thumb { width: 35px; height: 35px; }
.family-selector strong { display: block; font-size: 10px; }
.family-selector small { color: var(--muted); font-size: 8px; }
.family-selector > span:last-child { color: var(--muted-2); font-size: 9px; }
.lineage-canvas { min-height: 590px; position: relative; overflow: auto; padding: 30px; background-image: radial-gradient(var(--border-soft) 1px, transparent 1px); background-size: 20px 20px; }
.tree { min-width: 760px; display: flex; flex-direction: column; align-items: center; gap: 74px; }
.tree-level { position: relative; display: flex; justify-content: center; gap: 50px; }
.tree-level::before { content: ""; position: absolute; left: 50%; top: -74px; width: 1px; height: 74px; background: var(--border); }
.tree-level:first-child::before { display: none; }
.tree-level.branch::after { content: ""; position: absolute; top: -37px; left: 86px; right: 86px; height: 1px; background: var(--border); }
.tree-node { position: relative; z-index: 1; width: 174px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 5px 15px rgba(0,0,0,.08); }
.tree-node.root { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 5%, transparent); }
.tree-node::before { content: ""; position: absolute; top: -38px; left: 50%; width: 1px; height: 38px; background: var(--border); }
.tree-node.root::before { display: none; }
.tree-node small { color: var(--muted-2); font-family: Consolas, monospace; font-size: 8px; }
.tree-node strong { display: block; margin: 4px 0; font-size: 10px; }
.tree-node p { margin: 0; color: var(--muted); font-size: 8px; }
.tree-node .chip { margin-top: 8px; }

.matrix-layout { display: grid; grid-template-columns: 1fr 290px; gap: 16px; }
.matrix-toolbar { padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-soft); }
.axis-selector { display: flex; align-items: center; gap: 7px; }
.axis-selector label { color: var(--muted); font-size: 9px; }
.axis-x { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--accent-ink); background: var(--accent); font-size: 8px; font-weight: 900; }
.axis-y { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: white; background: var(--violet); font-size: 8px; font-weight: 900; }
.heatmap-wrap { overflow: auto; padding: 18px; }
.heatmap { min-width: 680px; display: grid; grid-template-columns: 110px repeat(5, 1fr); gap: 6px; }
.heat-label { min-height: 42px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 8px; font-weight: 700; text-align: center; }
.heat-label.row { justify-content: flex-start; }
.heat-cell { position: relative; min-height: 76px; padding: 9px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid transparent; border-radius: 10px; text-align: left; background: color-mix(in srgb, var(--accent) calc(var(--intensity) * 1%), var(--surface-2)); }
.heat-cell:hover { border-color: var(--accent); transform: translateY(-1px); }
.heat-cell strong { font-size: 17px; }
.heat-cell small { color: var(--muted); font-size: 7px; }
.heat-cell.gap { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.25); }
.heat-cell.gap strong { color: var(--amber); }
.matrix-aside { display: grid; gap: 12px; }
.gap-card { padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.gap-card-top { display: flex; align-items: center; justify-content: space-between; }
.gap-card-top span { color: var(--amber); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.gap-card h3 { margin: 13px 0 5px; font-size: 12px; }
.gap-card p { margin: 0 0 13px; color: var(--muted); font-size: 9px; }

.creative-map { position: relative; min-height: 650px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background-color: var(--surface); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; }
.map-toolbar { position: absolute; z-index: 6; top: 14px; left: 50%; transform: translateX(-50%); padding: 5px; display: flex; gap: 3px; border: 1px solid var(--border); border-radius: 11px; background: var(--canvas-raised); box-shadow: var(--shadow); }
.map-toolbar button { width: 35px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
.map-toolbar button:hover, .map-toolbar button.active { color: var(--text); background: var(--surface-3); }
.map-toolbar .toolbar-divider { width: 1px; margin: 4px 3px; background: var(--border); }
.map-node { position: absolute; z-index: 3; width: 172px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--canvas-raised); box-shadow: 0 10px 25px rgba(0,0,0,.14); cursor: move; }
.map-node small { color: var(--muted-2); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.map-node strong { display: block; margin-top: 5px; font-size: 10px; }
.map-node.product { left: 8%; top: 18%; border-top: 3px solid var(--accent); }
.map-node.avatar-node { left: 30%; top: 35%; border-top: 3px solid var(--blue); }
.map-node.pain { left: 49%; top: 15%; border-top: 3px solid var(--red); }
.map-node.angle { left: 56%; top: 49%; border-top: 3px solid var(--amber); }
.map-node.concept { left: 75%; top: 29%; border-top: 3px solid var(--violet); }
.map-node.hook { left: 73%; top: 68%; border-top: 3px solid var(--pink); }
.map-node.creative { left: 39%; top: 72%; border-top: 3px solid var(--green); }
.map-connector { position: absolute; z-index: 1; height: 1px; transform-origin: left center; background: var(--border); }
.map-connector::after { content: ""; position: absolute; right: -1px; top: -3px; width: 6px; height: 6px; border-top: 1px solid var(--muted); border-right: 1px solid var(--muted); transform: rotate(45deg); }

.intelligence-hero { margin-bottom: 16px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; }
.signal-panel { min-height: 280px; padding: 22px; position: relative; overflow: hidden; background: linear-gradient(135deg, rgba(116,92,255,.13), var(--surface) 56%); }
.signal-panel::after { content: ""; position: absolute; right: -120px; top: -145px; width: 360px; height: 360px; border: 1px solid rgba(116,92,255,.18); border-radius: 50%; box-shadow: 0 0 0 42px rgba(116,92,255,.03), 0 0 0 88px rgba(116,92,255,.018); }
.signal-label { display: inline-flex; align-items: center; gap: 7px; color: #b8adff; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.signal-panel h2 { max-width: 620px; margin: 30px 0 10px; font-size: clamp(23px, 2.5vw, 34px); line-height: 1.14; letter-spacing: -.045em; }
.signal-panel > p { max-width: 620px; color: var(--muted); font-size: 11px; }
.signal-footer { position: absolute; z-index: 1; left: 22px; right: 22px; bottom: 22px; display: flex; align-items: center; justify-content: space-between; }
.confidence { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.confidence-track { width: 70px; height: 4px; border-radius: 5px; background: var(--border); }
.confidence-track i { display: block; width: 82%; height: 100%; border-radius: inherit; background: var(--violet); }
.explore-card { padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.ratio-visual { margin: 22px 0; }
.ratio-numbers { display: flex; align-items: baseline; justify-content: space-between; }
.ratio-numbers strong { font-size: 32px; letter-spacing: -.04em; }
.ratio-numbers div:last-child { text-align: right; }
.ratio-numbers span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.ratio-bar { height: 9px; margin-top: 12px; display: flex; overflow: hidden; border-radius: 9px; }
.ratio-bar i:first-child { width: 67%; background: var(--accent); }
.ratio-bar i:last-child { flex: 1; background: var(--violet); }
.intelligence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rank-list { display: grid; }
.rank-row { padding: 11px 0; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--border-soft); }
.rank-row:last-child { border: 0; }
.rank-index { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); background: var(--surface-2); font-size: 8px; font-weight: 800; }
.rank-copy strong { display: block; font-size: 9px; }
.rank-copy small { color: var(--muted); font-size: 8px; }
.rank-value { text-align: right; }
.rank-value strong { display: block; color: var(--green); font-size: 10px; }
.rank-value small { color: var(--muted); font-size: 7px; }
.fatigue-list { display: grid; gap: 12px; }
.fatigue-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.fatigue-item p { margin: 0; font-size: 9px; }
.fatigue-item p small { display: block; color: var(--muted); }
.mini-progress { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 5px; background: var(--border); }
.mini-progress i { display: block; height: 100%; background: var(--amber); }

.planning-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 16px; }
.campaign-card { padding: 19px; border-bottom: 1px solid var(--border-soft); }
.campaign-card:last-child { border: 0; }
.campaign-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.campaign-top h3 { margin: 0; font-size: 13px; }
.campaign-top p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.campaign-progress { margin-top: 17px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.campaign-progress .mini-progress { grid-column: auto; align-self: center; }
.campaign-progress strong { font-size: 9px; }
.campaign-meta { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 8px; }
.campaign-meta span { display: flex; align-items: center; gap: 5px; }
.campaign-meta svg { width: 12px; }
.calendar-mini { padding: 18px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.calendar-head strong { font-size: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-grid span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 7px; color: var(--muted); font-size: 8px; }
.calendar-grid .weekday { color: var(--muted-2); font-weight: 800; text-transform: uppercase; }
.calendar-grid .event { color: var(--accent-ink); background: var(--accent); font-weight: 900; }
.calendar-grid .has-event { box-shadow: inset 0 -2px var(--violet); color: var(--text); }

.knowledge-grid { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 14px; }
.knowledge-card { min-height: 175px; padding: 17px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.knowledge-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: rgba(47,126,247,.1); }
.knowledge-icon.violet { color: #a99dff; background: rgba(116,92,255,.12); }
.knowledge-icon.amber { color: var(--amber); background: rgba(245,158,11,.1); }
.knowledge-icon.pink { color: var(--pink); background: rgba(227,72,167,.1); }
.knowledge-card h3 { margin: 17px 0 5px; font-size: 12px; }
.knowledge-card p { margin: 0; color: var(--muted); font-size: 9px; }
.knowledge-card footer { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 8px; }

.tasks-layout { display: grid; grid-template-columns: 210px 1fr; gap: 16px; }
.task-filters { padding: 10px; align-self: start; }
.task-filter { width: 100%; height: 39px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 10px; text-align: left; }
.task-filter:hover, .task-filter.active { color: var(--text); background: var(--surface-2); }
.task-filter span { min-width: 21px; padding: 2px 5px; border-radius: 6px; background: var(--surface-3); font-size: 8px; text-align: center; }
.task-list { overflow: hidden; }
.task-row { min-height: 65px; padding: 0 16px; display: grid; grid-template-columns: auto 1fr 110px 100px auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--border-soft); }
.task-row:last-child { border: 0; }
.task-check { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 5px; background: transparent; }
.task-check.done { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.task-check svg { width: 12px; }
.task-copy strong { display: block; font-size: 10px; }
.task-copy small { color: var(--muted); font-size: 8px; }
.task-due { color: var(--muted); font-size: 8px; }
.task-due.overdue { color: var(--red); }

.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; }
.agent-card { padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.agent-card-head { display: flex; align-items: center; gap: 10px; }
.agent-card-head .agent-avatar { width: 42px; height: 42px; }
.agent-card-head > div:nth-child(2) { flex: 1; }
.agent-card-head strong { display: block; font-size: 11px; }
.agent-card-head small { color: var(--muted); font-size: 8px; }
.status-pill { min-height: 22px; padding: 0 7px; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 7px; font-weight: 800; }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.violet { color: #ae9fff; background: rgba(116,92,255,.13); }
.status-pill.green { color: #55d982; background: rgba(34,197,94,.1); }
.status-pill.amber { color: #f7b942; background: rgba(245,158,11,.1); }
.agent-card > p { min-height: 40px; margin: 16px 0; color: var(--muted); font-size: 9px; }
.agent-stats { padding: 12px 0; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.agent-stats div { display: flex; flex-direction: column; }
.agent-stats strong { font-size: 12px; }
.agent-stats small { color: var(--muted-2); font-size: 7px; }
.agent-card footer { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; }

.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.settings-nav { padding: 10px; align-self: start; }
.settings-nav button { width: 100%; height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; text-align: left; font-size: 10px; }
.settings-nav button:hover, .settings-nav button.active { color: var(--text); background: var(--surface-2); }
.settings-nav svg { width: 15px; }
.settings-content { display: grid; gap: 16px; }
.integration-card { padding: 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.integration-logo { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; color: #79aaff; background: rgba(47,126,247,.12); font-size: 20px; font-weight: 900; }
.integration-copy h3 { margin: 0; font-size: 12px; }
.integration-copy p { margin: 4px 0 8px; color: var(--muted); font-size: 9px; }
.permission-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mapping-flow { padding: 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.mapping-box { padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.mapping-box small { color: var(--muted); font-size: 8px; }
.mapping-box strong { display: block; margin-top: 5px; font-family: Consolas, monospace; font-size: 10px; }
.mapping-arrow { color: var(--accent); }
.users-table .permission-badges { display: flex; gap: 5px; }

.home-hero { min-height: 320px; padding: 30px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); }
.home-hero::before { content: ""; position: absolute; inset: 0; opacity: .08; background-image: url("./Banner Desktop.png"); background-size: cover; background-position: center; }
.home-hero > * { position: relative; z-index: 1; }
.home-hero h1 { max-width: 780px; margin: 22px 0 10px; font-size: clamp(32px, 5vw, 64px); line-height: .98; letter-spacing: -.06em; }
.home-hero h1 span { color: var(--accent); }
.home-hero p { max-width: 620px; color: var(--muted); }
.home-operations { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.operation-card { min-height: 165px; padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.operation-card.active { border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.operation-card h3 { margin: 20px 0 3px; }
.operation-card p { margin: 0; color: var(--muted); font-size: 9px; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-2); }
.empty-state h2 { margin: 0 0 7px; color: var(--text); font-size: 15px; }
.empty-state p { max-width: 430px; margin: 0 auto 18px; font-size: 10px; }

.agent-drawer { position: fixed; z-index: 80; top: 0; right: 0; width: min(480px, 100vw); height: 100vh; display: grid; grid-template-rows: auto auto 1fr auto; background: var(--canvas-raised); border-left: 1px solid var(--border); box-shadow: var(--shadow); transform: translateX(102%); transition: transform 230ms var(--ease); }
.agent-drawer.open { transform: translateX(0); }
.drawer-backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(0,0,0,.48); opacity: 0; pointer-events: none; transition: 180ms ease; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer-header { min-height: 73px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.agent-title { display: flex; align-items: center; gap: 10px; }
.agent-title > div { display: flex; flex-direction: column; }
.agent-title small { color: var(--muted); font-size: 8px; }
.agent-title strong { font-size: 12px; }
.drawer-header .status-pill { margin-left: 6px; }
.agent-scope { margin: 14px 18px 0; padding: 11px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.agent-scope svg { width: 15px; color: var(--violet); }
.agent-scope div { display: flex; flex-direction: column; }
.agent-scope strong { font-size: 9px; }
.agent-scope small { color: var(--muted); font-size: 7px; }
.chat-stream { overflow: auto; padding: 20px 18px; }
.chat-day { margin-bottom: 18px; color: var(--muted-2); font-size: 8px; text-align: center; }
.agent-message { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.message-avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #c8c0ff; background: rgba(116,92,255,.16); }
.message-avatar svg { width: 14px; }
.message-content { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 4px 13px 13px 13px; background: var(--surface); }
.message-content > p { margin: 0; color: var(--muted); font-size: 10px; }
.message-content > p strong { color: var(--text); }
.agent-plan { margin: 14px 0; display: grid; gap: 7px; }
.agent-plan > div { padding: 9px; display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start; border-radius: 9px; background: var(--surface-2); }
.agent-plan > div > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: #c9c1ff; background: rgba(116,92,255,.16); font-size: 8px; font-weight: 800; }
.agent-plan p { margin: 0; }
.agent-plan strong { display: block; font-size: 9px; }
.agent-plan small { color: var(--muted); font-size: 8px; }
.message-actions { display: flex; gap: 7px; }
.source-note { margin-top: 12px !important; padding-top: 10px; display: flex; align-items: center; gap: 5px; border-top: 1px solid var(--border-soft); color: var(--muted-2) !important; font-size: 7px !important; }
.source-note svg { width: 11px; }
.chat-composer { margin: 0 18px 18px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.chat-composer:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(116,92,255,.12); }
.chat-composer textarea { width: 100%; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 10px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 7px; }
.send-button { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 8px; color: white; background: var(--violet); }
.send-button svg { width: 14px; }

.miner-drawer { width: min(570px, 100vw); grid-template-rows: auto auto 1fr auto; }
.miner-avatar { color: var(--accent-ink); background: var(--accent); }
.steve-api-setup { margin: 12px 18px 0; padding: 13px; border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--border)); border-radius: 11px; background: color-mix(in srgb, var(--amber) 6%, var(--surface)); }
.steve-api-setup[hidden] { display: none; }
.steve-api-setup > div { display: flex; flex-direction: column; gap: 3px; }
.steve-api-setup strong { font-size: 12px; }
.steve-api-setup small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.steve-api-setup form { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.steve-api-setup input { min-width: 0; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--canvas-raised); font-size: 12px; }
.miner-composer { margin: 0 18px 18px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.miner-composer:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(116,92,255,.1); }
.miner-link-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.miner-composer .field input, .miner-composer .field textarea { background: var(--canvas-raised); }
.miner-submit-actions { display: flex; align-items: center; gap: 8px; }
.miner-question { margin: 9px 0; }
.miner-user-message { max-width: 82%; margin: 14px 0 14px auto; padding: 11px 12px; border-radius: 12px 4px 12px 12px; color: white; background: var(--violet); font-size: 9px; line-height: 1.5; }
.miner-agent-message { margin-bottom: 15px; }
.steve-loading { display: flex; align-items: center; gap: 7px; }
.steve-loading svg { animation: steve-spin 1s linear infinite; }
@keyframes steve-spin { to { transform: rotate(360deg); } }
.steve-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.steve-result-head > div { display: flex; flex-direction: column; gap: 2px; }
.steve-result-head small, .steve-map small, .steve-copy small { color: var(--muted-2); font-size: 6px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.steve-result-head strong { font-size: 12px; }
.steve-result-head > span { padding: 3px 6px; border-radius: 999px; color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); font-size: 7px; font-weight: 800; }
.steve-result > p { margin-top: 8px; }
.steve-grid { margin: 12px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steve-grid > div { padding: 8px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface-2); }
.steve-grid small { display: block; color: var(--muted-2); font-size: 6px; text-transform: uppercase; }
.steve-grid b { display: block; margin-top: 3px; font-size: 8px; line-height: 1.35; }
.steve-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.steve-copy p, .steve-map { margin: 0; padding: 9px; border-left: 2px solid var(--violet); color: var(--muted); background: color-mix(in srgb, var(--violet) 5%, transparent); font-size: 8px; line-height: 1.45; }
.steve-copy small { display: block; margin-bottom: 3px; }
.steve-map { margin-top: 8px; border-left-color: var(--blue); }
.steve-map p { margin: 4px 0 0; white-space: pre-line; }
.steve-analysis { margin: 9px 0 !important; padding-top: 9px; border-top: 1px solid var(--border-soft); }
.steve-sources { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.steve-sources a { color: var(--blue); font-size: 7px; }
.steve-result .message-actions { margin-top: 11px; }

.app-dialog { width: min(850px, calc(100vw - 30px)); max-width: calc(100vw - 30px); max-height: calc(100vh - 30px); padding: 0; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--border); border-radius: 18px; color: var(--text); background: var(--canvas-raised); box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(2px); }
.dialog-header { padding: 22px 24px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); }
.dialog-header .eyebrow { margin: 0 0 8px; color: var(--accent); }
.dialog-header h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.dialog-header p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.form-section { padding: 20px 24px; border-bottom: 1px solid var(--border-soft); }
.form-section-title { margin-bottom: 17px; display: flex; align-items: center; gap: 10px; }
.form-section-title > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--accent-ink); background: var(--accent); font-size: 9px; font-weight: 900; }
.form-section-title > div { display: flex; flex-direction: column; }
.form-section-title strong { font-size: 11px; }
.form-section-title small { color: var(--muted); font-size: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 650; }
.field.span-2 { grid-column: span 2; }
.field input, .field select, .field textarea { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; outline: 0; color: var(--text); background: var(--surface); font-size: 10px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.dialog-footer { position: sticky; bottom: 0; padding: 14px 24px; display: flex; justify-content: flex-end; gap: 8px; background: var(--canvas-raised); border-top: 1px solid var(--border); }
.compact-dialog { width: min(560px, calc(100vw - 30px)); }
.details-inner { padding: 24px; }
.details-inner h2 { margin: 0 0 8px; font-size: 18px; }
.details-inner > p { color: var(--muted); font-size: 10px; }
.details-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.details-grid div { padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.details-grid small { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.details-grid strong { display: block; margin-top: 3px; font-size: 10px; }
.details-actions { display: flex; justify-content: flex-end; gap: 8px; }
.delete-confirmation { text-align: center; }
.delete-confirmation .page-kicker { justify-content: center; margin-top: 13px; color: var(--red); }
.delete-confirmation-icon { width: 48px; height: 48px; margin: 0 auto; display: grid; place-items: center; border-radius: 13px; color: var(--red); background: color-mix(in srgb, var(--red) 10%, var(--surface)); }
.delete-confirmation > p { max-width: 410px; margin: 0 auto 24px; }
.delete-confirmation .details-actions { justify-content: center; }

.command-palette { position: fixed; z-index: 100; inset: 0; padding-top: 12vh; display: flex; justify-content: center; background: rgba(0,0,0,.58); opacity: 0; pointer-events: none; transition: 140ms ease; }
.command-palette.open { opacity: 1; pointer-events: auto; }
.command-box { width: min(650px, calc(100vw - 30px)); align-self: flex-start; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--canvas-raised); box-shadow: var(--shadow); transform: translateY(-8px); transition: 180ms var(--ease); }
.command-palette.open .command-box { transform: none; }
.command-input-row { height: 58px; padding: 0 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.command-input-row svg { color: var(--muted); }
.command-input-row input { flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; }
kbd { padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: var(--surface); font-size: 8px; }
.command-results { max-height: 380px; overflow: auto; padding: 8px; }
.command-result { width: 100%; min-height: 48px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border: 0; border-radius: 9px; color: var(--text); background: transparent; text-align: left; }
.command-result:hover { background: var(--surface); }
.command-result-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: var(--surface-2); }
.command-result strong { display: block; font-size: 10px; }
.command-result small { color: var(--muted); font-size: 8px; }
.command-result > span:last-child { color: var(--muted-2); font-size: 8px; }

.toast-region { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { min-width: 290px; max-width: 380px; padding: 12px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-3); box-shadow: var(--shadow); animation: toast-in 200ms var(--ease); }
.toast-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--accent-ink); background: var(--accent); }
.toast strong { display: block; font-size: 10px; }
.toast small { color: var(--muted); font-size: 8px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.sidebar-collapsed { --sidebar: 72px; }
.sidebar-collapsed .brand-button { display: none; }
.sidebar-collapsed .brand-row { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar-toggle { display: grid; color: var(--text); background: var(--surface); border-color: var(--border); transform: rotate(180deg); }
.sidebar-collapsed .nav-eyebrow, .sidebar-collapsed .operation-copy, .sidebar-collapsed .nav-item > span:nth-child(2), .sidebar-collapsed .nav-count, .sidebar-collapsed .operation-switch > svg, .sidebar-collapsed .user-copy, .sidebar-collapsed .user-card > svg, .sidebar-collapsed .nav-heading-row .mini-button { display: none; }
.sidebar-collapsed .nav-item { grid-template-columns: 1fr; place-items: center; padding: 0; }
.sidebar-collapsed .nav-item svg { width: 19px; }
.sidebar-collapsed .operation-switch { grid-template-columns: 1fr; place-items: center; }
.sidebar-collapsed .operation-subnav { padding-left: 0; border-left: 0; }
.sidebar-collapsed .user-card { grid-template-columns: 1fr; place-items: center; }

@media (max-width: 1240px) {
  .metrics-grid { grid-template-columns: repeat(4, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .overview-bottom { grid-template-columns: repeat(2, 1fr); }
  .overview-bottom > :last-child { grid-column: span 2; }
  .library-grid { grid-template-columns: repeat(3, 1fr); }
  .concept-grid { grid-template-columns: repeat(2, 1fr); }
  .knowledge-grid { grid-template-columns: repeat(3, 1fr); }
  .mining-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  :root { --sidebar: 220px; }
  .brand { width: 104px; }
  .brand-row { padding: 0 12px 0 16px; }
  .context-header, .operation-tabs { padding-left: 20px; padding-right: 20px; }
  #main-content { padding: 24px 20px 55px; }
  .date-filter span { display: none; }
  .date-filter { width: 38px; padding: 0; justify-content: center; }
  .date-filter svg:last-child { display: none; }
  .matrix-layout, .intelligence-hero, .planning-grid, .settings-layout, .family-layout { grid-template-columns: 1fr; }
  .family-list, .settings-nav { display: flex; overflow-x: auto; }
  .family-selector { min-width: 210px; }
  .settings-nav button { min-width: 150px; }
  .intelligence-grid { grid-template-columns: 1fr 1fr; }
  .agent-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { overflow: auto; }
  .app-shell { display: block; height: auto; }
  .global-sidebar { position: fixed; left: 0; top: 0; width: 244px; transform: translateX(-102%); transition: transform 220ms var(--ease); box-shadow: var(--shadow); }
  .global-sidebar.mobile-open { transform: translateX(0); }
  .brand { width: 116px; height: auto; object-fit: contain; }
  .brand-row { padding: 0 16px 0 20px; }
  .nav-eyebrow, .operation-copy, .nav-item > span:nth-child(2), .nav-count, .operation-switch > svg, .user-copy, .user-card > svg, .nav-heading-row .mini-button { display: initial; }
  .nav-item { grid-template-columns: 22px minmax(0,1fr) auto; place-items: initial; align-items: center; padding: 0 10px; }
  .operation-switch { grid-template-columns: auto 1fr auto; place-items: initial; align-items: center; }
  .user-card { grid-template-columns: auto 1fr auto; place-items: initial; align-items: center; }
  .operation-subnav { padding-left: 8px; border-left: 1px solid var(--border-soft); }
  body.sidebar-collapsed .global-sidebar .brand-button { display: flex; }
  body.sidebar-collapsed .global-sidebar .brand-row { justify-content: space-between; padding: 0 16px 0 20px; }
  body.sidebar-collapsed .global-sidebar .sidebar-toggle { display: grid; transform: none; }
  body.sidebar-collapsed .global-sidebar .nav-eyebrow,
  body.sidebar-collapsed .global-sidebar .operation-copy,
  body.sidebar-collapsed .global-sidebar .nav-item > span:nth-child(2),
  body.sidebar-collapsed .global-sidebar .nav-count,
  body.sidebar-collapsed .global-sidebar .operation-switch > svg,
  body.sidebar-collapsed .global-sidebar .user-copy,
  body.sidebar-collapsed .global-sidebar .user-card > svg,
  body.sidebar-collapsed .global-sidebar .nav-heading-row .mini-button { display: initial; }
  body.sidebar-collapsed .global-sidebar .nav-item { grid-template-columns: 22px minmax(0, 1fr) auto; place-items: initial; align-items: center; padding: 0 10px; }
  body.sidebar-collapsed .global-sidebar .operation-switch { grid-template-columns: auto 1fr auto; place-items: initial; align-items: center; }
  body.sidebar-collapsed .global-sidebar .operation-subnav { padding-left: 8px; border-left: 1px solid var(--border-soft); }
  body.sidebar-collapsed .global-sidebar .user-card { grid-template-columns: auto 1fr auto; place-items: initial; align-items: center; }
  body.sidebar-collapsed .logout-button { display: grid; }
  .workspace-shell { height: auto; min-height: 100vh; grid-template-rows: 62px 45px auto; }
  .context-header { position: sticky; top: 0; padding: 0 12px; }
  .mobile-menu { display: grid; }
  .scope-switcher { padding-right: 4px; }
  .scope-switcher > span:nth-child(2), .scope-switcher > svg, .sync-badge, .header-actions .icon-button:not(#search-button), .date-filter { display: none; }
  .ai-launch { width: 38px; padding: 0; justify-content: center; }
  .ai-launch span:last-child { display: none; }
  .operation-tabs { padding: 0 14px; gap: 20px; }
  #main-content { padding: 20px 14px 45px; overflow: visible; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-value { font-size: 21px; }
  .overview-bottom, .intelligence-grid { grid-template-columns: 1fr; }
  .overview-bottom > :last-child { grid-column: auto; }
  .library-grid, .concept-grid, .knowledge-grid, .agent-grid, .home-operations { grid-template-columns: 1fr; }
  .filter-bar { flex-wrap: wrap; }
  .mining-toolbar { flex-wrap: wrap; }
  .mining-toolbar-note { width: 100%; margin-left: 0; }
  .mining-metrics { grid-template-columns: 1fr 1fr; }
  .search-field { min-width: 100%; }
  .select-control { flex: 1; }
  .tasks-layout { grid-template-columns: 1fr; }
  .task-filters { display: flex; overflow-x: auto; }
  .task-filter { min-width: 120px; }
  .task-row { grid-template-columns: auto 1fr auto; }
  .task-row > :nth-child(3), .task-row > :nth-child(4) { display: none; }
  .form-grid, .form-grid.cols-3, .form-grid.cols-2 { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .distribution { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .integration-card, .mapping-flow { grid-template-columns: 1fr; }
  .mapping-arrow { transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Escala de leitura — prioriza legibilidade e reduz a sensação de interface “micro”. */
body { font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font-size: 13px; }
.button { min-height: 40px; padding: 0 15px; font-size: 13px; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.icon-button { width: 38px; height: 38px; }
.nav-item { min-height: 42px; font-size: 13px; }
.nav-eyebrow { font-size: 10px; letter-spacing: .1em; }
.operation-copy strong, .user-copy strong { font-size: 13px; }
.operation-copy small, .user-copy small { font-size: 11px; }
.scope-switcher small, .sync-badge, .operation-tabs button { font-size: 11px; }
.scope-switcher strong { font-size: 13px; }
.page-header { margin-bottom: 26px; }
.page-header h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.12; }
.page-header p { max-width: 720px; font-size: 14px; line-height: 1.6; }
.page-kicker { font-size: 11px; letter-spacing: .1em; }
#main-content small { font-size: 11px !important; line-height: 1.45; }
#main-content p { line-height: 1.6; }
.panel-title h2 { font-size: 17px; }
.panel-title p { font-size: 12px; }
.metric-top { font-size: 11px; }
.metric-value { font-size: 30px; }
.metric-bottom { font-size: 11px; }
.chip, .tag { min-height: 25px; font-size: 11px; }
.data-table { font-size: 12px; }
.data-table th { font-size: 10px; }
.field { gap: 8px; font-size: 12px; }
.field input, .field select, .field textarea { min-height: 44px; padding: 10px 12px; font-size: 13px; }
.field textarea { min-height: 84px; }
.form-section-title strong { font-size: 14px; }
.form-section-title small { font-size: 11px; }
.dialog-header h2 { font-size: 24px; }
.dialog-header p { font-size: 13px; }
.status-pill { min-height: 28px; padding: 0 10px; font-size: 10px; }
.agent-title small, .agent-scope small, .message-content > p, .source-note, .composer-actions { font-size: 11px !important; }
.agent-title strong { font-size: 15px; }
.agent-scope strong { font-size: 12px; }

/* Cards compactos da mineração: resumo na esteira, contexto completo ao abrir. */
.mining-board { width: max-content; min-width: 100%; grid-template-columns: repeat(5, 320px); gap: 14px; }
.mining-column { width: 320px; min-width: 0; max-width: 320px; min-height: 460px; padding: 12px; overflow: hidden; border-radius: 18px; }
.mining-column-header { min-height: 72px; padding: 6px 5px 15px; }
.mining-column-header .kanban-title { font-size: 13px; }
.mining-column-header small { font-size: 11px; }
.mining-count { min-width: 28px; padding: 5px 8px; font-size: 11px; }
.mining-cards { width: 100%; min-width: 0; max-width: 100%; gap: 12px; padding-top: 12px; overflow: hidden; }
.mining-card.compact { width: 100%; min-width: 0; max-width: 100%; padding: 14px; overflow: hidden; contain: inline-size; border-radius: 15px; cursor: pointer; }
.mining-card.compact > *, .mining-card.compact h3, .mining-card.compact p { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.mining-card.compact:focus-visible { border-color: var(--blue); }
.mining-product-media { width: auto; min-width: 0; max-width: none; height: 108px; position: relative; margin: -14px -14px 12px; overflow: hidden; border-radius: 14px 14px 8px 8px; background: var(--surface-2); }
.mining-product-media img { width: 100%; min-width: 0; max-width: 100%; height: 100%; display: block; object-fit: cover; }
.mining-media-fallback { width: 100%; height: 100%; position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 72% 20%, rgba(116,92,255,.32), transparent 34%), radial-gradient(circle at 18% 82%, rgba(47,126,247,.24), transparent 40%), linear-gradient(145deg, var(--surface-3), var(--canvas-raised)); }
.mining-media-fallback::after { content: ""; width: 110px; height: 110px; position: absolute; right: -22px; bottom: -45px; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); border-radius: 50%; }
.mining-media-fallback > span { color: color-mix(in srgb, var(--text) 78%, transparent); font-size: 48px; font-weight: 850; letter-spacing: -.06em; }
.mining-media-fallback small { position: absolute; left: 13px; bottom: 11px; color: var(--muted); font-size: 10px !important; }
.media-source { position: absolute; top: 10px; right: 10px; padding: 4px 7px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: white; background: rgba(0,0,0,.5); font-size: 9px; backdrop-filter: blur(8px); }
.mining-product-media.large { height: 240px; margin: -24px -24px 24px; border-radius: 16px 16px 10px 10px; }
.mining-product-media.large img { object-fit: contain; background: #f6f6f4; }
.mining-card-head .creative-id { font-size: 11px; }
.mining-card-head .icon-button { width: 34px; height: 34px; }
.mining-card.compact h3 { margin: 10px 0 3px; overflow: hidden; font-size: 16px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.mining-card.compact .mining-store { font-size: 12px; }
.mining-card.compact .mining-summary { margin-top: 7px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; font-size: 11px; line-height: 1.5; }
.mining-card.compact .mining-tags { margin-top: 12px; }
.mining-card.compact .mining-tags span { padding: 5px 8px; font-size: 10px; }
.compact-offer { width: 100%; min-width: 0; max-width: 100%; margin-top: 10px; padding: 9px 10px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface-2); font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.compact-signal { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compact-signal > div { min-width: 0; min-height: 66px; padding: 9px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.compact-signal small { color: var(--muted-2); font-size: 10px; }
.compact-signal > div:first-child > strong { font-size: 24px; line-height: 1; }
.compact-signal .ads-trend { margin-top: 5px; font-size: 10px; }
.compact-life strong { margin-top: 3px; font-size: 13px; }
.compact-life.recent { border-color: color-mix(in srgb, var(--blue) 35%, var(--border)); }
.compact-life.validating { border-color: color-mix(in srgb, var(--amber) 35%, var(--border)); }
.compact-life.scaling, .compact-life.established { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.mining-card.compact .mining-last-read { margin-top: 10px; font-size: 10px; }
.mining-card.compact .monitoring-pill { padding: 4px 7px; font-size: 9px; }
.mining-card.compact .mining-card-footer { margin-top: 13px; padding-top: 12px; }
.mining-card.compact .owner-mini { width: 32px; height: 32px; font-size: 11px; }

.mining-details { width: 100%; max-width: 820px; min-width: 0; overflow: hidden; }
.mining-details *, .mining-detail-section, .mining-detail-copy section, .mining-detail-kpis > div { min-width: 0; }
.mining-details-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.mining-details-heading h2 { margin: 8px 0 4px; font-size: 30px; line-height: 1.15; }
.mining-details-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.mining-details-summary { margin: 20px 0; color: var(--muted); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.mining-detail-kpis { margin: 22px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mining-detail-kpis > div { padding: 16px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.mining-detail-kpis small, .mining-detail-section > small, .mining-detail-copy small { color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.mining-detail-kpis strong { margin: 5px 0; font-size: 28px; }
.mining-detail-kpis span { color: var(--muted); font-size: 11px; }
.mining-detail-section { margin-top: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.mining-detail-section h3 { margin: 7px 0 12px; font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.mining-detail-section p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.mining-detail-copy { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mining-detail-copy section { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.mining-detail-copy p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.mining-detail-links { margin: 14px 0; display: flex; gap: 8px; }
.mining-details .snapshot-history > strong { font-size: 13px; }
.mining-details .snapshot-history > div { min-height: 42px; font-size: 12px; }
.mining-details .snapshot-history b { font-size: 12px; }
.mining-details .details-actions { flex-wrap: wrap; }

@media (max-width: 720px) {
  .page-header h1 { font-size: 29px; }
  .mining-detail-kpis, .mining-detail-copy { grid-template-columns: 1fr; }
  .mining-details-heading { flex-direction: column; }
}

/* Authentication */
.auth-gate { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 15%, rgba(112, 84, 255, .2), transparent 30%), radial-gradient(circle at 85% 80%, rgba(51, 133, 255, .14), transparent 34%), var(--bg); }
.auth-gate[hidden] { display: none; }
.auth-panel { width: min(440px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 32px 90px rgba(0, 0, 0, .22); }
.auth-logo { width: 132px; height: auto; margin-bottom: 34px; }
.auth-logo-light { display: none; }
[data-theme="light"] .auth-logo-dark { display: none; }
[data-theme="light"] .auth-logo-light { display: block; }
.auth-kicker { margin: 0 0 12px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.auth-panel h1 { margin: 0; font-size: clamp(30px, 6vw, 42px); line-height: 1.05; letter-spacing: -.045em; }
.auth-intro { margin: 14px 0 28px; color: var(--muted); line-height: 1.6; }
.auth-form { display: grid; gap: 16px; }
.auth-form .field { gap: 8px; font-size: 13px; font-weight: 700; }
.auth-form input { min-height: 52px; font-size: 16px; }
.auth-submit { min-height: 52px; justify-content: center; margin-top: 2px; font-size: 15px; }
.auth-error { min-height: 0; margin: 0; color: #e55353; font-size: 13px; line-height: 1.45; }
.auth-error:empty { display: none; }
.auth-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-local { width: 100%; justify-content: center; margin-top: 12px; }
.app-shell.auth-pending { visibility: hidden; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; }
.sidebar-footer .user-card { min-width: 0; flex: 1; }
.logout-button { flex: 0 0 auto; }
body.sidebar-collapsed .logout-button { display: none; }
@media (max-width: 640px) { .auth-panel { padding: 30px 22px; border-radius: 20px; } .auth-logo { margin-bottom: 26px; } }
@media (max-width: 720px) { body.sidebar-collapsed .global-sidebar.mobile-open .logout-button { display: grid; } }

/* ERREPX minimal design system — clean, progressive and consistent. */
:root {
  --canvas: #101114;
  --canvas-raised: #111318;
  --surface: #191c22;
  --surface-2: #22262e;
  --surface-3: #282d36;
  --text: #f3f4f6;
  --muted: #969eaa;
  --muted-2: #6f7783;
  --border: #30343c;
  --border-soft: rgba(243, 244, 246, .08);
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

[data-theme="light"] {
  --canvas: #f7f7f5;
  --canvas-raised: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --surface-3: #e8e8e4;
  --text: #202124;
  --muted: #666b73;
  --muted-2: #8a8f97;
  --border: #d9dad6;
  --border-soft: rgba(32, 33, 36, .09);
  --accent: #17191d;
  --accent-ink: #ffffff;
  --shadow: 0 16px 44px rgba(30, 32, 36, .12);
}

body { background: var(--canvas); font-size: 15px; line-height: 1.55; }
.app-shell { background: var(--canvas); }
.global-sidebar { background: var(--canvas-raised); border-right-color: var(--border-soft); }
.brand-row { height: 64px; border-bottom: 0; }
.brand { width: 112px; }
.sidebar-scroll { padding: 14px 10px 24px; }
.nav-eyebrow, .eyebrow, .page-kicker { color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: none; }
.nav-divider { margin: 18px 8px 12px; background: var(--border-soft); }
.nav-item { min-height: 40px; height: auto; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 550; }
.nav-item:hover { color: var(--text); background: color-mix(in srgb, var(--surface-2) 68%, transparent); }
.nav-item.active { color: var(--text); background: var(--surface-2); }
.nav-item.active::before { display: none; }
.nav-count { color: var(--muted); background: transparent; font-size: 10px; }
.operation-switch { min-height: 52px; border: 0; border-radius: 7px; }
.operation-switch.active, .operation-switch:hover { background: var(--surface); border: 0; }
.operation-switch > svg { transition: transform 160ms ease; }
.operation-switch.is-collapsed > svg { transform: rotate(-90deg); }
.operation-subnav { margin: 5px 0 4px; padding-left: 10px; border-left: 0; }
.operation-subnav.is-collapsed, .operation-subnav[hidden] { display: none !important; }
.operation-markers:empty { display: none; }
.sidebar-footer { border-top-color: var(--border-soft); }
.user-card { border-radius: 7px; }

.workspace-shell { background: var(--canvas); }
.context-header { height: 64px; padding-inline: 28px; border-bottom-color: var(--border-soft); background: color-mix(in srgb, var(--canvas) 92%, transparent); }
.operation-tabs { min-height: 46px; padding-inline: 28px; gap: 24px; border-bottom-color: var(--border-soft); background: var(--canvas); }
.operation-tabs button { padding: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.operation-tabs button::after { height: 2px; border-radius: 0; }
#main-content { padding: 34px 34px 72px; }
.page { width: min(1480px, 100%); margin-inline: auto; }
.page-header { margin-bottom: 30px; align-items: end; }
.page-header h1 { margin-top: 6px; font-size: clamp(30px, 3vw, 42px); font-weight: 650; letter-spacing: -.04em; }
.page-header p { max-width: 700px; color: var(--muted); font-size: 14px; }
.page-actions { gap: 8px; }

.button { min-height: 38px; border: 0; border-radius: 7px; font-size: 12px; font-weight: 650; box-shadow: none; }
.button.primary { color: var(--accent-ink); background: var(--accent); }
.button.secondary { color: var(--text); background: var(--surface-2); border: 0; }
.button.secondary:hover, .button.ghost:hover { background: var(--surface-3); }
.button.ghost { color: var(--muted); background: transparent; border: 0; }
.button.ai, .ai-launch { color: var(--text); background: var(--surface-2); border: 0; box-shadow: none; }
.button.ai:hover, .ai-launch:hover { background: var(--surface-3); }
.icon-button { border: 0; background: transparent; border-radius: 7px; color: var(--muted); }
.icon-button:hover { color: var(--text); background: var(--surface-2); }
.chip, .tag, .status-pill { border: 0; background: var(--surface-2); font-weight: 600; }
.status-pill.green { color: #79db9a; background: rgba(34, 197, 94, .12); }
.status-pill.amber { color: #f0b957; background: rgba(245, 158, 11, .12); }
.status-pill.violet { color: #b8aefa; background: rgba(116, 92, 255, .12); }

.panel, .metric-card, .knowledge-card, .agent-card, .operation-card, .concept-card, .campaign-card {
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}
.panel-header { padding: 18px 20px; border-bottom-color: var(--border-soft); }
.panel-body { padding: 18px 20px; }
.panel-title h2, .panel-title h3 { font-weight: 650; }
.panel-title p { margin-top: 3px; }
.metrics-grid, .mining-metrics { gap: 0; padding: 2px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.metric-card { min-height: 112px; padding: 18px 20px; border-right: 1px solid var(--border-soft); border-radius: 0; background: transparent; }
.metric-card:last-child { border-right: 0; }
.metric-card.featured { color: var(--text); background: transparent; }
.metric-value { font-size: 28px; font-weight: 650; }
.source-indicator { display: none; }
.metric-bottom { color: var(--muted-2); }
.trend { color: #79db9a; }
.dashboard-grid, .overview-bottom, .planning-grid, .tasks-layout { gap: 14px; }
.production-summary > div, .insight-item, .winner-row, .rank-row, .fatigue-item { border: 0; border-radius: 0; background: transparent; }
.production-summary > div + div, .insight-item + .insight-item, .winner-row + .winner-row, .rank-row + .rank-row, .fatigue-item + .fatigue-item { border-top: 1px solid var(--border-soft); }
.donut { box-shadow: none; }

.filter-bar, .mining-toolbar { min-height: 58px; padding: 9px 0; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: transparent; }
.search-field, .select-control { min-height: 40px; border: 0; border-radius: 7px; background: var(--surface); }
.search-field:focus-within, .select-control:focus { box-shadow: 0 0 0 1px var(--muted-2); }
.mining-toolbar-note { color: var(--muted-2); }

.data-table-wrap { border: 0; border-radius: 0; background: transparent; }
.data-table th { color: var(--muted-2); font-weight: 650; letter-spacing: .03em; }
.data-table th, .data-table td { border-bottom-color: var(--border-soft); }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }

.kanban-shell, .mining-board-shell { border: 0; border-radius: 0; background: transparent; }
.kanban, .mining-board { gap: 12px; }
.kanban-column, .mining-column { border: 0; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 72%, transparent); }
.kanban-header, .mining-column-header { border-bottom-color: var(--border-soft); }
.kanban-card { padding: 14px; border: 0; border-radius: 9px; background: var(--surface-2); box-shadow: none; }
.kanban-card h3 { margin: 10px 0 4px; font-size: 14px; font-weight: 650; }
.kanban-card p { margin: 0; color: var(--muted); }
.kanban-meta { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--border-soft); color: var(--muted-2); }
.add-card-button { border: 0; background: transparent; color: var(--muted-2); }
.add-card-button:hover { color: var(--text); background: var(--surface-2); }

.mining-board { grid-template-columns: repeat(5, 292px); }
.mining-column { width: 292px; max-width: 292px; padding: 10px; }
.mining-column-header { min-height: 66px; padding: 8px 6px 14px; }
.mining-cards { gap: 10px; padding-top: 10px; }
.mining-card.compact { padding: 0; border: 0; border-radius: 10px; background: var(--surface); box-shadow: none; contain: inline-size; }
.mining-card.compact:hover { background: var(--surface-2); transform: translateY(-1px); }
.mining-product-media { height: 150px; margin: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.mining-media-fallback { background: var(--surface-2); }
.mining-media-fallback::after, .media-source { display: none; }
.mining-media-fallback > span { color: var(--muted); font-size: 42px; font-weight: 600; }
.mining-card-body { padding: 14px; }
.mining-card-head { min-height: 26px; }
.mining-card.compact h3 { margin: 10px 0 2px; font-size: 15px; font-weight: 650; }
.mining-card.compact .mining-store { color: var(--muted); font-size: 12px; }
.mining-card.compact .mining-card-footer { margin-top: 16px; padding-top: 10px; display: flex; justify-content: space-between; border-top: 1px solid var(--border-soft); color: var(--muted-2); font-size: 10px; }
.card-menu { position: relative; margin-left: auto; }
.card-menu summary { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); list-style: none; cursor: pointer; }
.card-menu summary::-webkit-details-marker { display: none; }
.card-menu summary:hover { color: var(--text); background: var(--surface-3); }
.card-menu-popover { position: absolute; z-index: 20; top: 32px; right: 0; width: 190px; padding: 6px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); box-shadow: var(--shadow); }
.card-menu-popover button { width: 100%; min-height: 36px; padding: 0 9px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 6px; color: var(--text); background: transparent; font-size: 12px; text-align: left; }
.card-menu-popover button:hover { background: var(--surface-3); }
.card-menu-popover .danger-text { color: #ef7d7d; }

.library-grid { gap: 14px; }
.media-card { overflow: hidden; border: 0; border-radius: 10px; background: var(--surface); box-shadow: none; cursor: pointer; }
.media-card:hover { background: var(--surface-2); transform: translateY(-1px); }
.media-preview { aspect-ratio: 16 / 10; }
.media-visual { background: var(--surface-2) !important; }
.preview-overlay { align-items: end; justify-content: end; background: transparent; }
.duration { background: rgba(16, 17, 20, .82); }
.media-body { padding: 14px; }
.media-title strong { font-size: 14px; font-weight: 650; }
.media-title small { margin-top: 3px; color: var(--muted); }
.media-detail-preview { height: 260px; position: relative; overflow: hidden; margin: -24px -24px 24px; background: var(--surface-2); }
.media-detail-preview .media-visual { height: 100%; }
.media-detail-preview > span { position: absolute; right: 14px; bottom: 14px; padding: 4px 7px; border-radius: 5px; background: rgba(16, 17, 20, .82); color: white; font-size: 11px; }

.task-filters { padding: 8px; }
.task-filter { border-radius: 6px; }
.task-filter.active { background: var(--surface-2); }
.task-list { padding: 0; }
.task-row { border-bottom-color: var(--border-soft); }
.knowledge-card, .agent-card, .operation-card, .concept-card, .campaign-card { padding: 18px; }

.operation-home-page { max-width: 980px; margin-inline: 0; }
.operation-home-list { border-top: 1px solid var(--border-soft); }
.operation-home-row { width: 100%; min-height: 78px; padding: 14px 4px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 18px; gap: 14px; align-items: center; border: 0; border-bottom: 1px solid var(--border-soft); color: var(--text); background: transparent; text-align: left; }
.operation-home-row:hover { background: color-mix(in srgb, var(--surface) 68%, transparent); }
.operation-home-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); background: var(--surface); }
.operation-home-row strong { display: block; font-size: 14px; font-weight: 650; }
.operation-home-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.operation-home-meta { color: var(--muted-2); font-size: 11px; }

.app-dialog { border: 1px solid var(--border); border-radius: 12px; background: var(--canvas-raised); box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: none; }
.compact-dialog { width: min(720px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0 0 0 auto; border-width: 0 0 0 1px; border-radius: 0; }
.compact-dialog #details-content { height: 100%; overflow-y: auto; }
.details-inner { padding: 26px; }
.details-grid { gap: 0; border-top: 1px solid var(--border-soft); }
.details-grid > div { padding: 14px 0; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; }
.details-actions { position: sticky; bottom: -26px; margin: 26px -26px -26px; padding: 14px 26px; border-top: 1px solid var(--border-soft); background: var(--canvas-raised); }
.mining-details { max-width: none; }
.mining-product-media.large { height: 300px; margin: -26px -26px 26px; border-radius: 0; }
.mining-detail-kpis { gap: 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.mining-detail-kpis > div { padding: 16px 14px; border: 0; border-right: 1px solid var(--border-soft); border-radius: 0; background: transparent; }
.mining-detail-kpis > div:last-child { border-right: 0; }
.mining-detail-section, .mining-detail-copy section { padding: 16px 0; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: transparent; }
.mining-detail-copy { gap: 22px; }
.snapshot-history > div { border-bottom-color: var(--border-soft); }
.agent-drawer { background: var(--canvas-raised); border-left-color: var(--border-soft); }
.drawer-header, .agent-scope { border-bottom-color: var(--border-soft); }
.agent-scope { background: transparent; }
.message-content, .agent-plan { border: 0; background: var(--surface); }

.auth-gate { background: var(--canvas); }
.auth-panel { border: 0; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }

@media (max-width: 980px) {
  #main-content { padding: 28px 22px 60px; }
  .context-header, .operation-tabs { padding-inline: 20px; }
  .metrics-grid, .mining-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:nth-child(2n) { border-right: 0; }
  .metric-card { border-bottom: 1px solid var(--border-soft); }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  #main-content { padding: 24px 16px 48px; }
  .context-header { padding-inline: 12px; }
  .operation-tabs { padding-inline: 16px; gap: 22px; }
  .page-header { align-items: stretch; }
  .page-actions .button { flex: 1; justify-content: center; }
  .metrics-grid, .mining-metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 100px; padding: 14px; }
  .metric-value { font-size: 24px; }
  .library-grid { grid-template-columns: 1fr; }
  .operation-home-row { grid-template-columns: 34px minmax(0, 1fr) 16px; }
  .operation-home-meta { display: none; }
  .compact-dialog { width: 100vw; }
  .details-inner { padding: 22px 18px; }
  .details-actions { bottom: -22px; margin: 22px -18px -22px; padding: 12px 18px; }
  .mining-product-media.large, .media-detail-preview { margin: -22px -18px 22px; }
  .mining-detail-kpis { grid-template-columns: 1fr; }
  .mining-detail-kpis > div { border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .mining-detail-kpis > div:last-child { border-bottom: 0; }
}
