:root {
  --bg: #F1F5F9;
  --sidebar-bg: #0F172A;
  --sidebar-card: #1E293B;
  --card: #FFFFFF;
  --border: #CBD5E1;
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --amber: #D97706;
  --teal: #0F766E;
  --danger: #DC2626;
  --success: #059669;
  --text: #0F172A;
  --muted: #475569;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

/* Top Global Header */
.topbar {
  background: #0B1120;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #1E293B;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563EB, #0EA5E9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  background: #F59E0B;
  color: #111827;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.brand-sub {
  font-size: 11px;
  color: #94A3B8;
}

.mode-switcher {
  display: flex;
  background: #1E293B;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid #334155;
}

.mode-btn {
  border: none;
  background: transparent;
  color: #CBD5E1;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mode-btn.active {
  background: #2563EB;
  color: #fff;
}

.zero-pii-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6EE7B7;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* Workspace Layout */
.workspace-container {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
  background: var(--sidebar-bg);
  color: #E2E8F0;
  padding: 16px 14px;
  border-right: 1px solid #1E293B;
  display: flex;
  flex-direction: column;
}

.sidebar-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  margin-bottom: 6px;
}

.vehicle-selector-box {
  background: var(--sidebar-card);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px;
}

.vehicle-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0F172A;
  color: #fff;
  border: 1px solid #475569;
  font-size: 12.5px;
  font-weight: 700;
}

.vehicle-quick-meta {
  margin-top: 8px;
  font-size: 11px;
  color: #CBD5E1;
  line-height: 1.45;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: #CBD5E1;
  padding: 10px 11px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: #1E3A8A;
  border-color: #3B82F6;
  color: #fff;
}

.nav-icon {
  font-size: 18px;
}

.nav-text {
  flex: 1;
}

.nav-title {
  font-size: 12.5px;
  font-weight: 800;
}

.nav-desc {
  font-size: 10px;
  color: #94A3B8;
}

.nav-pill-alert {
  background: #DC2626;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 99px;
}

.nav-pill-teal {
  background: #0D9488;
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 99px;
}

.competitor-summary-box {
  margin-top: auto;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11px;
  color: #94A3B8;
}

.comp-title {
  color: #FBBF24;
  font-weight: 800;
  margin-bottom: 4px;
}

.competitor-summary-box ul {
  list-style: none;
}

/* Main Panel */
.main-panel {
  padding: 18px 22px 48px;
  overflow-y: auto;
}

.kpi-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.kpi-value {
  font-size: 18px;
  font-weight: 900;
  margin-top: 2px;
  color: var(--text);
}

.kpi-sub {
  font-size: 10.5px;
  color: #64748B;
  margin-top: 2px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 900;
  color: #0F172A;
}

.section-header p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kanban-col {
  background: #E2E8F0;
  border-radius: 12px;
  padding: 10px;
  min-height: 400px;
}

.kanban-col-header {
  font-size: 12px;
  font-weight: 800;
  color: #1E293B;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 2px solid #CBD5E1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-card {
  background: #fff;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  padding: 11px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}

.kanban-card.selected {
  border: 2px solid #2563EB;
}

.kanban-plate {
  display: inline-block;
  background: #F8FAFC;
  border: 1px solid #94A3B8;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 800;
}

/* Panels & Two-Col Layout */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
}

.panel-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-header-row h3 {
  font-size: 14.5px;
  font-weight: 800;
}

.card-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Memos & AI Suspects */
.memo-list-stack,
.ai-suspect-stack,
.records-stack,
.transfer-ledger-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memo-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 12px;
}

.ai-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.ai-card.rank-S {
  border-color: #FCA5A5;
  background: #FFFBFB;
}

.rank-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 900;
  color: #fff;
}

.rank-badge.S { background: #DC2626; }
.rank-badge.A { background: #EA580C; }
.rank-badge.B { background: #D97706; }
.rank-badge.C { background: #2563EB; }

.filter-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #334155;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.pill.active {
  background: #0F172A;
  color: #fff;
  border-color: #0F172A;
}

/* Forms & Buttons */
.compact-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 12px;
  border-radius: 10px;
}

.compact-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 3px;
}

.compact-form input,
.compact-form select,
.compact-form textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #CBD5E1;
  border-radius: 7px;
  font-size: 12.5px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-block {
  width: 100%;
  padding: 10px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-navy {
  background: #1E3A5F;
  color: #fff;
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-outline {
  background: #fff;
  border: 1px solid #94A3B8;
  color: #1E293B;
}

/* Transfer Hero Banner */
.transfer-hero-banner {
  background: linear-gradient(135deg, #0F766E, #115E59);
  color: #fff;
  padding: 14px;
  border-radius: 12px;
}

.transfer-hero-title {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 4px;
}

.transfer-hero-banner p {
  font-size: 11.5px;
  opacity: 0.94;
}

.transfer-code-display {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.transfer-code-display strong {
  font-size: 16px;
  letter-spacing: 1px;
  color: #5EEAD4;
}

/* Symphony Estimate Table */
.estimate-meta-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.meta-item label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.meta-item input {
  width: 95px;
  padding: 5px 8px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-weight: 800;
}

.doc-type-tabs {
  display: flex;
  gap: 6px;
}

.doc-tab {
  border: 1px solid #CBD5E1;
  background: #fff;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.doc-tab.active {
  background: #1E3A8A;
  color: #fff;
  border-color: #1E3A8A;
}

.symphony-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.symphony-table th,
.symphony-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #E2E8F0;
  text-align: left;
  font-size: 12px;
}

.symphony-table th {
  background: #F8FAFC;
  font-weight: 800;
  color: #334155;
}

.code-preview-box {
  background: #0F172A;
  color: #38BDF8;
  padding: 12px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 11.5px;
  margin-top: 10px;
  white-space: pre-wrap;
}

.tag-badge {
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}

.tag-green {
  background: #D1FAE5;
  color: #065F46;
}

/* Workspace 2: iOS Simulator Preview */
.workspace-sim-container {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 28px;
  padding: 28px 40px;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
}

.sim-info-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.sim-info-panel h2 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 8px;
}

.sim-feature-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.sim-feat-item {
  background: #F8FAFC;
  border-left: 4px solid #D9814E;
  padding: 12px 14px;
  border-radius: 8px;
}

.sim-feat-item strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 3px;
}

.iphone-frame-wrap {
  display: flex;
  justify-content: center;
}

.iphone-frame {
  width: 396px;
  height: 812px;
  background: #111827;
  border-radius: 48px;
  padding: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  position: relative;
}

.iphone-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 38px;
  background: #F7F5F2;
}
