/* ── DESIGN TOKENS ── */
:root {
  --primary:        #d97706;
  --primary-dark:   #b45309;
  --primary-bg:     #fef3c7;
  --dark:           #1f2937;
  --page-bg:        #f8fafc;
  --white:          #ffffff;
  --border:         #e5e7eb;
  --text:           #1f2937;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;
  --success:        #10b981;
  --success-bg:     #d1fae5;
  --success-dark:   #059669;
  --danger:         #ef4444;
  --danger-bg:      #fee2e2;
  --danger-dark:    #dc2626;
  --info:           #3b82f6;
  --info-bg:        #dbeafe;
  --shadow:         0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --radius:         8px;
  --nav-h:          56px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--page-bg);
  color: var(--text);
  font-size: 14px;
  min-width: 1280px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── LOGIN SCREEN ── */
#login-screen {
  position: fixed; inset: 0;
  background: var(--page-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px 24px;
  width: 400px;
  display: flex; flex-direction: column; gap: 40px; align-items: center;
}
.login-brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 0;
}
.login-icon {
  width: 80px; height: 80px;
  background: var(--dark);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.login-icon svg { color: var(--white); }
.login-title { font-size: 28px; color: var(--dark); }
.login-title strong { font-weight: 700; }
.login-fields { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.login-input {
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 15px; color: var(--text);
  outline: none; transition: border-color .15s;
}
.login-input::placeholder { color: var(--text-light); }
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,119,6,.12); }
.login-error {
  background: var(--danger-bg); color: var(--danger-dark);
  border-radius: 6px; padding: 10px 14px;
  font-size: 13px; display: none;
}
.login-error.visible { display: block; }
.btn-login {
  width: 100%; padding: 14px;
  background: var(--dark); color: var(--white);
  border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  transition: background .15s;
}
.btn-login:hover { background: #374151; }
.login-hint { font-size: 13px; color: var(--text-muted); text-align: center; line-height: 1.6; }
.login-hint strong { color: var(--primary); }

/* Role quick-select (demo shortcut) */
.role-pills {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding-top: 4px;
}
.role-pill {
  font-size: 11px; font-weight: 500; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 9999px;
  cursor: pointer; transition: all .15s; color: var(--text-muted);
  background: var(--white);
}
.role-pill:hover { border-color: var(--primary); color: var(--primary); }

/* ── NAVBAR ── */
.navbar {
  display: flex; align-items: center; gap: 80px;
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: var(--nav-h);
  position: sticky; top: 0; z-index: 50;
}
.navbar-logo { font-size: 16px; color: var(--dark); white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; gap: 12px; }
.navbar-logo strong { font-weight: 700; }
.navbar-imtron-wordmark { font-size: 15px; font-weight: 800; letter-spacing: 2px; color: var(--dark); }
.navbar-logo-divider { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }
.navbar-nav { display: flex; gap: 2px; align-items: center; flex: 1; }
.navbar-nav a {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  padding: 8px 12px; border-radius: 6px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.navbar-nav a:hover:not(.active) { background: var(--page-bg); color: var(--text); }
.navbar-nav a.active { color: var(--primary); }
.navbar-nav a.hidden { display: none; }
.nav-divider { width: 1px; height: 28px; background: var(--border); margin: 0 8px; }
.navbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.navbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
}
.navbar-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.navbar-role-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 9999px; background: var(--primary-bg); color: var(--primary);
}
.btn-icon {
  width: 32px; height: 32px; border: none; background: none;
  border-radius: 6px; color: var(--text-muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.btn-icon:hover { background: var(--page-bg); }

/* ── PAGE HEADER ── */
.page-header { padding: 16px 24px 8px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.page-title { font-size: 20px; font-weight: 500; color: var(--text-muted); }
.page-title-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}

/* ── LAYOUT ── */
.page-content { padding: 8px 24px 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body { padding: 16px 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; }

/* ── KPI CARD ── */
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}
.kpi-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--dark); line-height: 1; }
.kpi-value.primary { color: var(--primary); }
.kpi-value.danger  { color: var(--danger); }
.kpi-value.success { color: var(--success); }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.kpi-trend-up   { color: var(--danger); }
.kpi-trend-down { color: var(--success); }

/* ── ALERT BANNER ── */
.alert {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-radius: var(--radius);
  margin-bottom: 12px; font-size: 13px; font-weight: 500;
}
.alert-warning { background: var(--primary-bg); color: var(--primary-dark); border: 1px solid #fcd34d; }
.alert-danger   { background: var(--danger-bg);  color: var(--danger-dark);  border: 1px solid #fca5a5; }
.alert-success  { background: var(--success-bg); color: var(--success-dark); border: 1px solid #6ee7b7; }
.alert-info     { background: var(--info-bg);    color: #1d4ed8;             border: 1px solid #93c5fd; }
.alert svg, .alert .alert-icon { flex-shrink: 0; }
.alert-close { margin-left: auto; background: none; border: none; font-size: 18px; line-height: 1; opacity: .6; cursor: pointer; }
.alert-close:hover { opacity: 1; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 9999px; white-space: nowrap;
}
.badge-amber   { background: var(--primary-bg); color: var(--primary); }
.badge-green   { background: var(--success-bg); color: var(--success-dark); }
.badge-red     { background: var(--danger-bg);  color: var(--danger-dark); }
.badge-gray    { background: #f3f4f6;           color: var(--text-muted); }
.badge-blue    { background: var(--info-bg);    color: #1d4ed8; }
.badge-dark    { background: var(--dark);       color: var(--white); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; border: none;
  transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--page-bg); }
.btn-outline-primary { background: var(--white); color: var(--primary); border: 1.5px solid var(--primary); font-weight: 600; }
.btn-outline-primary:hover { background: var(--primary-bg); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: var(--danger-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-link { background: none; border: none; color: var(--primary); padding: 0; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.form-input, .form-select {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text); background: var(--white);
  outline: none; transition: border-color .15s;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(217,119,6,.1); }

/* Filter bar */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-bottom: 1px solid var(--border);
  background: var(--page-bg); flex-wrap: wrap;
}
.filter-bar .form-input, .filter-bar .form-select { width: auto; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 9999px;
  padding: 6px 14px; background: var(--white); min-width: 240px;
}
.search-box input { border: none; outline: none; font-size: 13px; color: var(--text); flex: 1; background: none; }
.search-box svg { color: var(--text-light); flex-shrink: 0; }

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--page-bg); border-bottom: 1px solid var(--border); }
thead th {
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--text-muted); padding: 10px 16px;
  white-space: nowrap; text-transform: uppercase; letter-spacing: .4px;
}
thead th.right { text-align: right; }
tbody tr { border-bottom: 1px solid #f3f4f6; transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafafa; }
tbody tr.row-danger  { background: #fff8f8; }
tbody tr.row-warning { background: #fffbf0; }
tbody tr.row-danger:hover  { background: #fef2f2; }
tbody tr.row-warning:hover { background: #fef9ec; }
tbody td { padding: 12px 16px; font-size: 13px; color: var(--text); vertical-align: middle; }
tbody td.muted { color: var(--text-muted); font-size: 12px; }
tbody td.right { text-align: right; }
tbody td.action { white-space: nowrap; }
.table-footer { padding: 10px 16px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }

/* Clickable row */
tbody tr.clickable { cursor: pointer; }

/* ── STATUS TABS ── */
.status-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  padding: 0 20px; background: var(--white);
}
.status-tab {
  padding: 12px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all .15s; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none;
}
.status-tab:hover { color: var(--text); }
.status-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count {
  display: inline-block; min-width: 18px; height: 18px;
  background: var(--page-bg); border-radius: 9999px;
  font-size: 11px; font-weight: 600; padding: 0 5px;
  line-height: 18px; margin-left: 4px; text-align: center;
}
.status-tab.active .tab-count { background: var(--primary-bg); color: var(--primary); }

/* Detail tabs */
.detail-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.detail-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all .15s; background: none; border-top: none; border-left: none; border-right: none;
}
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── MILESTONE TIMELINE (horizontal) ── */
.milestone-track {
  display: flex; align-items: flex-start;
  padding: 20px 0 8px; overflow-x: auto;
  gap: 0;
}
.milestone-step {
  display: flex; flex-direction: column; align-items: center;
  min-width: 90px; position: relative; flex: 1;
}
.milestone-step::before {
  content: '';
  position: absolute; top: 13px; left: calc(-50% + 13px); right: calc(50% + 13px);
  height: 2px; background: var(--border);
  z-index: 0;
}
.milestone-step:first-child::before { display: none; }
.milestone-step.done::before { background: var(--success); }
.milestone-step.overdue::before { background: var(--danger); }
.milestone-step.current::before { background: var(--primary); }

.milestone-dot {
  width: 26px; height: 26px; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; border: 2px solid var(--border); background: var(--white);
}
.milestone-step.done    .milestone-dot { background: var(--success); border-color: var(--success); color: var(--white); }
.milestone-step.current .milestone-dot { background: var(--primary); border-color: var(--primary); color: var(--white); }
.milestone-step.overdue .milestone-dot { background: var(--danger);  border-color: var(--danger);  color: var(--white); }
.milestone-step.pending .milestone-dot { background: var(--white);   border-color: var(--border);  color: var(--text-light); }

.milestone-label { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 6px; max-width: 80px; line-height: 1.3; }
.milestone-date  { font-size: 10px; color: var(--text-light);  text-align: center; margin-top: 2px; }
.milestone-step.done    .milestone-label { color: var(--success-dark); }
.milestone-step.current .milestone-label { color: var(--primary); font-weight: 600; }
.milestone-step.overdue .milestone-label { color: var(--danger-dark); font-weight: 600; }

/* ── VERTICAL TIMELINE ── */
.vtimeline { padding: 16px 0; }
.vtimeline-item {
  display: flex; gap: 16px; padding-bottom: 20px; position: relative;
}
.vtimeline-item::before {
  content: ''; position: absolute;
  left: 15px; top: 30px; bottom: 0; width: 2px;
  background: var(--border);
}
.vtimeline-item:last-child::before { display: none; }
.vtimeline-dot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; z-index: 1;
}
.vtimeline-item.done    .vtimeline-dot { background: var(--success); border-color: var(--success); color: var(--white); }
.vtimeline-item.current .vtimeline-dot { background: var(--primary); border-color: var(--primary); color: var(--white); }
.vtimeline-item.overdue .vtimeline-dot { background: var(--danger);  border-color: var(--danger);  color: var(--white); }
.vtimeline-body { flex: 1; padding-top: 4px; }
.vtimeline-title { font-size: 13px; font-weight: 600; }
.vtimeline-item.done    .vtimeline-title { color: var(--success-dark); }
.vtimeline-item.current .vtimeline-title { color: var(--primary); }
.vtimeline-item.overdue .vtimeline-title { color: var(--danger-dark); }
.vtimeline-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.vtimeline-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; padding: 8px 10px; background: var(--page-bg); border-radius: 6px; }

/* ── INFO FIELDS ── */
.info-row { display: flex; gap: 0; flex-wrap: wrap; }
.info-field { padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--border); }
.info-field:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.info-label { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.info-value { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }
.info-value.large { font-size: 18px; font-weight: 700; }

/* ── PROGRESS BAR ── */
.progress-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill  { height: 6px; border-radius: 3px; transition: width .3s; }
.progress-fill.amber  { background: var(--primary); }
.progress-fill.green  { background: var(--success); }
.progress-fill.red    { background: var(--danger); }

/* ── MAP ── */
#map-container { height: calc(100vh - var(--nav-h) - 60px); min-height: 500px; border-radius: var(--radius); overflow: hidden; }

/* ── DOCUMENT LIST ── */
.doc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid #f3f4f6;
  transition: background .1s;
}
.doc-row:hover { background: #fafafa; }
.doc-row:last-child { border-bottom: none; }
.doc-icon {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--page-bg); display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; color: var(--text-muted);
}
.doc-name { font-size: 13px; font-weight: 500; flex: 1; }
.doc-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.doc-actions { display: flex; gap: 6px; }

/* ── CHECKLIST ── */
.checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid #f3f4f6;
}
.checklist-item:last-child { border-bottom: none; }
.check-icon { font-size: 16px; flex-shrink: 0; }
.check-label { flex: 1; font-size: 13px; font-weight: 500; }
.check-meta { font-size: 11px; color: var(--text-muted); }

/* ── NOTIFICATION ITEM ── */
.notif-item {
  display: flex; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6; cursor: default;
  transition: background .1s;
}
.notif-item:hover { background: #fafafa; }
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.notif-dot.red    { background: var(--danger); }
.notif-dot.amber  { background: var(--primary); }
.notif-dot.green  { background: var(--success); }
.notif-dot.gray   { background: var(--text-light); }
.notif-text { font-size: 12px; color: var(--text); flex: 1; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text-light); white-space: nowrap; margin-top: 2px; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted); font-size: 13px;
}
.empty-state .empty-icon { font-size: 32px; margin-bottom: 12px; }

/* ── LOADING SPINNER ── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes odFadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

/* ── DEMO SIDEBAR ── */
.app-body { display: flex; height: calc(100vh - var(--nav-h)); overflow: hidden; }
.screen-area { flex: 1; overflow-y: auto; padding-bottom: 44px; }

.demo-sidebar {
  width: 300px; flex-shrink: 0;
  background: var(--white); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .2s ease;
}
.demo-sidebar.collapsed { width: 32px; }
.demo-sidebar.collapsed .sidebar-content,
.demo-sidebar.collapsed .sidebar-controls { display: none; }
.demo-sidebar.collapsed .sidebar-header-title { display: none; }

.sidebar-header {
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 16px; border-bottom: 1px solid var(--border);
  height: 44px; flex-shrink: 0;
}
.sidebar-header-title {
  flex: 1; font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.sidebar-toggle {
  width: 28px; height: 28px; border: none; background: none;
  border-radius: 6px; color: var(--text-muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: color .15s;
}
.sidebar-toggle:hover { color: var(--primary); }
.demo-sidebar.collapsed .sidebar-toggle { margin: auto; }

.sidebar-content {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.sidebar-module {
  font-size: 10px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .6px;
}
.sidebar-screen-title { font-size: 14px; font-weight: 600; color: var(--text); }
.sidebar-bullets { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.sidebar-bullets li {
  font-size: 12px; color: var(--text-muted); padding-left: 14px;
  position: relative; line-height: 1.5;
}
.sidebar-bullets li::before { content: '›'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

.sidebar-controls {
  border-top: 1px solid var(--border); padding: 14px 16px 42px;
  display: flex; flex-direction: column; gap: 7px; flex-shrink: 0;
}

/* ── APP FOOTER ── */
.app-footer {
  position: fixed; left: 680px; right: 0; bottom: 0;
  height: 28px; z-index: 46;
  background: var(--white); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.app-footer a { color: var(--text-muted); text-decoration: underline; }
.app-footer a:hover { color: var(--text); }
.footer-sep { color: var(--text-light); }
.sidebar-controls-title {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px;
}
.demo-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--white); font-size: 12px; color: var(--text);
  cursor: pointer; text-align: left; transition: all .15s; width: 100%;
}
.demo-trigger:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.demo-trigger-icon { font-size: 13px; flex-shrink: 0; }
.btn-reset-demo {
  width: 100%; padding: 7px 10px; background: none;
  border: 1px solid var(--danger); color: var(--danger);
  border-radius: var(--radius); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; margin-top: 2px;
}
.btn-reset-demo:hover { background: var(--danger-bg); }

/* ── UTILITIES ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.font-600 { font-weight: 600; }
.text-primary { color: var(--primary); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.hidden { display: none !important; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-dialog {
  background: var(--white); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  width: 720px; max-width: 100%; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-dialog.modal-lg { width: 880px; }
.modal-dialog.modal-fullscreen { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; }

/* Transport prenomination score pill */
.tp-score {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  color: var(--success-dark);
  background: var(--success-bg);
  padding: 2px 8px; border-radius: 12px;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px; border: none; background: none;
  font-size: 22px; color: var(--text-muted); cursor: pointer; line-height: 1;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--page-bg); color: var(--text); }
.modal-body { flex: 1; overflow-y: auto; padding: 24px; }
.modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; border-top: 1px solid var(--border);
  background: var(--page-bg); flex-shrink: 0;
}

/* ── IMPORT WIZARD STEPS ── */
.wizard-steps { display: flex; align-items: flex-start; margin-bottom: 28px; }
.wizard-step-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wizard-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  border: 2px solid var(--border); color: var(--text-muted); background: var(--white);
}
.wizard-step-item.active .wizard-num { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.wizard-step-item.done   .wizard-num { border-color: var(--success); color: var(--white); background: var(--success); }
.wizard-step-label { font-size: 11px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.wizard-step-item.active .wizard-step-label { color: var(--primary); font-weight: 600; }
.wizard-step-item.done   .wizard-step-label { color: var(--success-dark); }
.wizard-connector { flex: 1; height: 2px; background: var(--border); margin: 13px 6px 0; }
.wizard-connector.done { background: var(--success); }

/* ── DROPZONE ── */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 44px 24px; text-align: center; cursor: pointer;
  transition: all .2s; color: var(--text-muted);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.dropzone-icon { font-size: 32px; margin-bottom: 10px; }
.dropzone-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.dropzone-sub { font-size: 13px; }

/* ── IMPORT VALIDATION ROWS ── */
.import-row-ok td:first-child      { border-left: 3px solid var(--success); }
.import-row-warning td:first-child  { border-left: 3px solid var(--primary); }
.import-row-error td:first-child    { border-left: 3px solid var(--danger); }
.import-row-error   { background: #fff8f8; }
.import-row-warning { background: #fffbf0; }
.import-issue { font-size: 11px; margin-top: 2px; line-height: 1.4; }
.import-issue.error   { color: var(--danger-dark); }
.import-issue.warning { color: var(--primary-dark); }

/* ── AI HINT CARD ── */
.ai-hint-card {
  border: 1px solid #fcd34d; border-radius: var(--radius);
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  padding: 14px 16px;
}
.ai-hint-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; color: var(--primary-dark);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.ai-badge {
  font-size: 10px; font-weight: 800; padding: 2px 6px;
  border-radius: 4px; background: var(--primary); color: var(--white); letter-spacing: .3px;
}
.ai-hint-body { font-size: 13px; color: var(--text); line-height: 1.6; }
.ai-hint-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ── BRAND PILLS ── */
.brand-pill {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; letter-spacing: .2px;
}
.brand-peaq   { background: #dbeafe; color: #1e40af; }
.brand-isy    { background: #d1fae5; color: #065f46; }
.brand-koenic { background: #ede9fe; color: #5b21b6; }
.brand-ok     { background: #f3f4f6; color: #374151; }

/* ── INCOTERM PILL ── */
.incoterm-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  background: var(--dark); color: var(--white);
}

/* ── SOURCE PILLS ── */
.source-pill { display:inline-block; font-size:10px; font-weight:700; padding:1px 6px; border-radius:4px; letter-spacing:.3px; }
.source-sap  { background:var(--info-bg); color:#1d4ed8; }
.source-sp   { background:#ede9fe; color:#6d28d9; }

/* ── RDD DELTA PILL ── */
.delta-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 9999px;
}
.delta-pill.safe   { background: var(--success-bg); color: var(--success-dark); }
.delta-pill.risk   { background: var(--primary-bg); color: var(--primary-dark); }
.delta-pill.overdue { background: var(--danger-bg); color: var(--danger-dark); }

/* ── WORKFLOW GRAPH ── */
.workflow-graph { display: flex; gap: 0; min-width: max-content; }
.wf-phase {
  min-width: 170px; border: 1px solid var(--border); border-right: none;
  background: var(--white); display: flex; flex-direction: column;
}
.wf-phase:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.wf-phase:last-child  { border-right: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.wf-phase-header {
  padding: 8px 12px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: var(--white);
  flex-shrink: 0;
}
.wf-phase:first-child  .wf-phase-header { border-radius: calc(var(--radius) - 1px) 0 0 0; }
.wf-phase:last-child   .wf-phase-header { border-radius: 0 calc(var(--radius) - 1px) 0 0; }
.wf-milestones { padding: 6px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.wf-milestone-node {
  padding: 7px 9px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--page-bg); transition: box-shadow .15s;
}
.wf-milestone-node:hover { box-shadow: 0 2px 6px rgba(0,0,0,.07); }
.wf-milestone-node.done    { border-color: #6ee7b7; background: #f0fdf4; }
.wf-milestone-node.current { border-color: #fcd34d; background: var(--primary-bg); }
.wf-milestone-node.overdue { border-color: #fca5a5; background: var(--danger-bg); }
.wf-ms-label { font-size: 11px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.wf-ms-icon  { margin-right: 3px; }
.wf-ms-meta  { font-size: 10px; color: var(--text-muted); line-height: 1.4; }

/* ── CONTAINER SPLIT PREVIEW ── */
.container-split-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--page-bg); margin-bottom: 6px;
}
.cs-id { font-weight: 600; font-size: 13px; min-width: 120px; }
.cs-boxes { display: flex; gap: 3px; flex-wrap: wrap; flex: 1; }
.cs-box {
  width: 26px; height: 22px; border-radius: 3px;
  background: var(--primary-bg); border: 1px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; color: var(--primary);
}
.cs-summary { font-size: 12px; color: var(--text-muted); min-width: 80px; text-align: right; white-space: nowrap; }

/* ── TASKBAR ── */
.taskbar {
  position: fixed; bottom: 0; left: 0; z-index: 45;
  width: 680px;
  background: #111827; height: 44px; overflow: hidden;
  transition: height .25s ease;
  border-top-right-radius: 8px;
}
.taskbar.expanded { height: 360px; }
.taskbar-bar {
  height: 44px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; cursor: pointer; flex-shrink: 0;
}
.taskbar-bar-label {
  font-size: 11px; font-weight: 600; color: #9ca3af;
  text-transform: uppercase; letter-spacing: .5px; margin-right: 4px;
}
.task-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 9999px; font-size: 12px; font-weight: 700;
}
.task-badge-very-urgent { background: #7f1d1d; color: #fca5a5; }
.task-badge-urgent      { background: #78350f; color: #fcd34d; }
.task-badge-normal      { background: #1f2937; color: #9ca3af; border: 1px solid #374151; }
.taskbar-bar-chevron { margin-left: auto; color: #6b7280; font-size: 12px; transition: transform .2s; }
.taskbar.expanded .taskbar-bar-chevron { transform: rotate(180deg); }
.taskbar-inner {
  width: 100%; height: 316px;
  display: flex; flex-direction: column; border-top: 1px solid #1f2937;
}
.taskbar-panel-tabs {
  display: flex; padding: 6px 16px; gap: 4px; border-bottom: 1px solid #1f2937; flex-shrink: 0;
}
.taskbar-tab {
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: none; border: none; color: #6b7280; cursor: pointer; transition: all .15s;
}
.taskbar-tab.active, .taskbar-tab:hover { background: #1f2937; color: #f9fafb; }
.taskbar-task-list {
  flex: 1; overflow-y: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 4px;
}
.task-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px;
  border-radius: 6px; cursor: pointer; transition: background .12s; border: 1px solid transparent;
}
.task-row:hover { background: #1f2937; }
.task-priority-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.task-priority-dot.very-urgent { background: #ef4444; }
.task-priority-dot.urgent      { background: #f59e0b; }
.task-priority-dot.normal      { background: #6b7280; }
.task-row-body { flex: 1; min-width: 0; }
.task-row-title { font-size: 12px; font-weight: 600; color: #f9fafb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row-detail { font-size: 11px; color: #6b7280; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row-due { font-size: 11px; color: #9ca3af; flex-shrink: 0; align-self: center; }
.task-row-resolve {
  padding: 3px 8px; font-size: 11px; font-weight: 500; border-radius: 4px;
  background: #1f2937; border: 1px solid #374151; color: #9ca3af;
  cursor: pointer; flex-shrink: 0; align-self: center; transition: all .15s;
}
.task-row-resolve:hover { background: var(--success); color: #fff; border-color: var(--success); }

/* ── PUSH NOTIFICATION ── */
.push-notif {
  position: fixed; top: 68px; right: 12px; width: 300px; z-index: 300;
  background: #1f2937; border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transform: translateX(320px); transition: transform .3s cubic-bezier(.22,1,.36,1);
  border-left: 4px solid #6b7280;
}
.push-notif.visible { transform: translateX(0); }
.push-notif.very-urgent { border-left-color: #ef4444; }
.push-notif.urgent      { border-left-color: #f59e0b; }
.push-notif.normal      { border-left-color: #3b82f6; }
.push-notif-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.push-notif-label { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .4px; }
.push-notif-close { background: none; border: none; color: #6b7280; font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1; }
.push-notif-title { font-size: 13px; font-weight: 600; color: #f9fafb; margin-bottom: 4px; }
.push-notif-detail { font-size: 12px; color: #9ca3af; line-height: 1.5; }
.push-notif-link { font-size: 12px; color: #60a5fa; margin-top: 6px; cursor: pointer; }

/* ── AI MATCH SUGGESTION (wizard step 2) ── */
.ai-match-banner {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding: 12px 14px;
  background: linear-gradient(135deg,#fffbeb 0%,#fef3c7 100%);
  border: 1px solid #fcd34d; border-radius: var(--radius);
}
.ai-match-body { flex: 1; }
.ai-match-title { font-size: 11px; font-weight: 700; color: var(--primary-dark); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.ai-match-suggestion { font-size: 13px; font-weight: 600; color: var(--text); }
.ai-match-conf { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ai-match-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ai-match-resolved {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 14px;
  background: var(--success-bg); border: 1px solid #6ee7b7; border-radius: var(--radius);
  font-size: 13px; color: var(--success-dark); font-weight: 500;
}

/* ── TASK DETAIL DRAWER ── */
.task-drawer {
  position: fixed; top: var(--nav-h); right: 0; bottom: 0; width: 420px; z-index: 160;
  background: var(--white); border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
  transform: translateX(440px); transition: transform .25s cubic-bezier(.22,1,.36,1);
}
.task-drawer.visible { transform: translateX(0); }
.task-drawer-header {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.task-drawer-title { font-size: 14px; font-weight: 600; flex: 1; line-height: 1.5; padding-top: 2px; }
.task-drawer-close {
  width: 28px; height: 28px; border: none; background: none; font-size: 20px;
  color: var(--text-muted); cursor: pointer; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.task-drawer-close:hover { background: var(--page-bg); color: var(--text); }
.task-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.task-drawer-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-drawer-detail {
  font-size: 13px; color: var(--text); line-height: 1.65;
  padding: 12px; background: var(--page-bg); border-radius: var(--radius); border: 1px solid var(--border);
}
.task-drawer-link { font-size: 13px; color: var(--info); cursor: pointer; font-weight: 500; }
.task-drawer-link:hover { text-decoration: underline; }
.ai-action-section { display: flex; flex-direction: column; gap: 8px; }
.ai-action-section-title {
  font-size: 11px; font-weight: 700; color: var(--primary-dark);
  text-transform: uppercase; letter-spacing: .5px;
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.ai-action-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; background: var(--white);
  display: flex; align-items: flex-start; gap: 10px; transition: border-color .15s;
}
.ai-action-card:hover:not(.done) { border-color: var(--primary); }
.ai-action-card.done { background: var(--success-bg); border-color: #6ee7b7; }
.ai-action-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.ai-action-body { flex: 1; font-size: 12px; color: var(--text); line-height: 1.5; }
.ai-action-result { font-size: 11px; color: var(--success-dark); margin-top: 4px; font-style: italic; }
.ai-action-btn {
  padding: 5px 11px; font-size: 12px; font-weight: 600; border-radius: 5px;
  background: var(--primary); color: var(--white); border: none; cursor: pointer;
  flex-shrink: 0; transition: background .15s; white-space: nowrap; align-self: flex-start;
}
.ai-action-btn:hover:not([disabled]) { background: var(--primary-dark); }
.ai-action-btn[disabled] { background: var(--border); color: var(--text-muted); cursor: default; }
.task-drawer-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0; }

/* ── CONTAINER PLANNER ── */
.planner-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
  display: flex; align-items: stretch; justify-content: center; padding: 20px;
}
.planner-modal {
  width: 100%; max-width: 1400px; background: var(--page-bg);
  border-radius: 12px; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 32px 80px rgba(0,0,0,.35);
}
.planner-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid #374151;
  background: #1f2937; flex-shrink: 0;
}
.planner-title    { font-size: 15px; font-weight: 700; color: #f9fafb; }
.planner-subtitle { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.planner-opp-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; flex-shrink: 0;
  background: #fffbeb; border-bottom: 1px solid #fcd34d;
  font-size: 13px; color: #92400e;
}
.planner-lcl-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; flex-shrink: 0;
  background: #ecfdf5; border-bottom: 2px solid #34d399; border-left: 4px solid #10b981;
  font-size: 13px; color: #065f46;
}

/* LCL detail drawer — slides from right, above planner */
.lcl-detail-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; z-index: 270;
  background: var(--white); box-shadow: -8px 0 40px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  transform: translateX(460px); transition: transform .25s ease;
}
.lcl-detail-drawer.visible { transform: translateX(0); }
.lcl-detail-drawer .task-drawer-header { background: #ecfdf5; border-bottom: 1px solid #6ee7b7; }
.planner-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }
.planner-left {
  width: 210px; flex-shrink: 0; background: var(--white);
  border-right: 1px solid var(--border); overflow-y: auto; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.planner-panel-title {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px; padding: 0 4px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.planner-order-card {
  padding: 8px 10px; border-radius: 6px; background: var(--page-bg); border: 1px solid var(--border);
}
.planner-order-card-id     { font-size: 11px; font-weight: 700; color: var(--text); }
.planner-order-card-meta   { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.planner-order-card-counts { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.planner-mini-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.planner-mini-bar div { height: 100%; border-radius: 2px; transition: width .3s; }
.planner-center {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 16px; background: var(--page-bg);
}
.planner-hint {
  font-size: 11px; color: var(--text-muted); padding: 6px 10px;
  background: var(--white); border-radius: 5px; border: 1px solid var(--border); flex-shrink: 0;
}
.planner-group-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.planner-group-id { font-size: 12px; font-weight: 700; color: var(--text); }
.planner-cards-row { display: flex; flex-wrap: wrap; gap: 8px; }
.planner-cntr-card {
  width: 155px; padding: 10px; border-radius: 8px;
  background: var(--white); border: 2px solid var(--border);
  cursor: grab; transition: all .15s; flex-shrink: 0; user-select: none;
}
.planner-cntr-card:hover    { border-color: #9ca3af; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.planner-cntr-card.dragging { opacity: .35; cursor: grabbing; }
.planner-cntr-card.drag-over{ border-color: #d97706 !important; background: #fffbeb; }
.planner-cntr-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.planner-cntr-id  { font-size: 10px; font-weight: 700; color: var(--text-muted); }
.planner-cntr-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.planner-item-tile {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px; margin-top: 4px; border-radius: 4px;
  background: var(--page-bg); border: 1px solid var(--border); cursor: grab; transition: border-color .12s;
}
.planner-item-tile:hover    { border-color: #d97706; }
.planner-item-tile.dragging { opacity: .3; }
.planner-item-sku { font-size: 10px; font-weight: 600; color: var(--text); }
.planner-item-qty { font-size: 10px; color: var(--text-muted); }
.planner-right {
  width: 290px; flex-shrink: 0; background: #f8fafc;
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
}
.planner-chat-msgs {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.planner-msg { display: flex; gap: 8px; align-items: flex-start; }
.planner-msg.user { flex-direction: row-reverse; }
.planner-msg-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff; font-size: 8px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.planner-msg-bubble { max-width: 210px; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.55; }
.planner-msg.agent .planner-msg-bubble { background: var(--white); color: var(--text); border: 1px solid var(--border); border-radius: 2px 8px 8px 8px; }
.planner-msg.user  .planner-msg-bubble { background: var(--primary); color: #fff; border-radius: 8px 2px 8px 8px; }
.planner-chat-row {
  display: flex; gap: 6px; padding: 10px 12px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.planner-chat-input {
  flex: 1; background: var(--white); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; font-size: 12px; color: var(--text); outline: none; font-family: inherit;
}
.planner-chat-input:focus { border-color: var(--primary); }
.planner-chat-input::placeholder { color: var(--text-muted); }
.planner-chat-send {
  width: 32px; height: 32px; background: var(--primary); border: none;
  border-radius: 6px; color: #fff; font-size: 14px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.planner-chat-send:hover { background: var(--primary-dark); }

/* Existing-orders separator in planner center */
.planner-existing-sep {
  display: flex; align-items: center; gap: 10px; margin: 4px 0;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0;
}
.planner-existing-sep::before, .planner-existing-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Step 3 summary when planner was used */
.planner-step3-summary { display: flex; flex-direction: column; gap: 6px; }

/* ── ORDER DETAIL — PHASE ACCORDION ── */
.od-phase {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.od-phase-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; cursor: pointer; user-select: none;
  transition: background .15s;
}
.od-phase-header:hover { background: #fafafa; }
.od-phase.active .od-phase-header { background: var(--page-bg); border-bottom: 1px solid var(--border); }
.od-phase-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.od-phase-num.done    { background: var(--success);  color: var(--white); }
.od-phase-num.active  { background: var(--primary);  color: var(--white); }
.od-phase-num.pending { background: var(--border);   color: var(--text-muted); }
.od-phase-title {
  font-size: 13px; font-weight: 600; color: var(--text); min-width: 170px;
}
.od-phase-summary {
  flex: 1; font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.od-phase.active .od-phase-summary { display: none; }
.od-phase-chip {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 9999px; flex-shrink: 0;
}
.od-phase-chip.done    { background: var(--success-bg); color: var(--success-dark); }
.od-phase-chip.active  { background: var(--primary-bg); color: var(--primary-dark); }
.od-phase-chip.pending { background: #f3f4f6;           color: var(--text-muted); }
.od-phase-chevron {
  font-size: 16px; color: var(--text-light); margin-left: 4px;
  transition: transform .2s; flex-shrink: 0;
}
.od-phase.active .od-phase-chevron { transform: rotate(90deg); }
.od-phase-body { display: none; }
.od-phase.active .od-phase-body { display: block; }

/* ── CHECKPOINT NODES ── */
.cp-track {
  display: flex; align-items: flex-start;
  padding: 16px 20px 8px; gap: 0; overflow-x: auto;
}
.cp-node {
  display: flex; flex-direction: column; align-items: center;
  min-width: 88px; flex: 1; position: relative;
}
.cp-node::before {
  content: ''; position: absolute; top: 14px;
  left: calc(-50% + 14px); right: calc(50% + 14px);
  height: 2px; background: var(--border); z-index: 0;
}
.cp-node:first-child::before { display: none; }
.cp-node.done::before    { background: var(--success); }
.cp-node.overdue::before { background: var(--danger); }
.cp-node.current::before { background: var(--primary); }
.cp-dot {
  width: 28px; height: 28px; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; border: 2px solid var(--border); background: var(--white);
}
.cp-node.done    .cp-dot { background: var(--success); border-color: var(--success); color: var(--white); }
.cp-node.current .cp-dot { background: var(--primary); border-color: var(--primary); color: var(--white); }
.cp-node.overdue .cp-dot { background: var(--danger);  border-color: var(--danger);  color: var(--white); }
.cp-node.pending .cp-dot { background: var(--white);   border-color: var(--border);  color: var(--text-light); }
.cp-label { font-size: 11px; font-weight: 600; text-align: center; margin-top: 6px; max-width: 84px; line-height: 1.3; }
.cp-node.done    .cp-label { color: var(--success-dark); }
.cp-node.current .cp-label { color: var(--primary-dark); }
.cp-node.overdue .cp-label { color: var(--danger-dark);  font-weight: 700; }
.cp-node.pending .cp-label { color: var(--text-light); }
.cp-date { font-size: 10px; color: var(--text-light); text-align: center; margin-top: 2px; }
.cp-node.done    .cp-date { color: var(--text-muted); }
.cp-node.current .cp-date { color: var(--primary); }
.cp-node.overdue .cp-date { color: var(--danger-dark); }

/* ── COMMUNICATION TAB ── */
.comm-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 260px; }
.comm-col { padding: 16px; display: flex; flex-direction: column; gap: 0; overflow-y: auto; max-height: 380px; }
.comm-col:first-child { border-right: 1px solid var(--border); }
.comm-col-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px;
}
.comm-event {
  display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f3f4f6;
}
.comm-event:last-child { border-bottom: none; }
.comm-event-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.comm-event-dot.system  { background: var(--info); }
.comm-event-dot.warning { background: var(--primary); }
.comm-event-dot.danger  { background: var(--danger); }
.comm-event-time { font-size: 11px; color: var(--text-light); white-space: nowrap; flex-shrink: 0; padding-top: 1px; }
.comm-event-text { font-size: 12px; color: var(--text); line-height: 1.5; }
.comm-msg { border-radius: 7px; padding: 9px 12px; font-size: 12px; line-height: 1.6; margin-bottom: 8px; }
.comm-msg:last-child { margin-bottom: 0; }
.comm-msg.inbound  { background: var(--page-bg); border: 1px solid var(--border); }
.comm-msg.outbound { background: var(--info-bg);  border: 1px solid #bfdbfe; }
.comm-msg.draft    { background: linear-gradient(135deg,#fffbeb,#fef3c7); border: 1px solid #fcd34d; }
.comm-msg-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.comm-msg-from { font-weight: 600; color: var(--text); }
.comm-msg-body { white-space: pre-line; }
.comm-draft-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ── INLINE MAP ── */
.od-map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

/* ── PHASE SWITCHER ────────────────────────────────────────────────────────── */
.phase-switcher-wrap {
  background: var(--white); border-bottom: 1px solid var(--border); padding: 14px 24px 0;
}
.phase-switcher { display: flex; align-items: flex-start; }
.phase-step {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: pointer; min-width: 108px;
  transition: opacity .15s;
}
.phase-step:hover { opacity: .8; }
.phase-step:hover .phase-circle { transform: scale(1.07); }
.phase-circle {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border: 2px solid var(--border); background: var(--white); color: var(--text-muted);
  transition: background .2s, border-color .2s, box-shadow .2s, transform .15s;
}
.phase-step.done .phase-circle    { background: var(--success); border-color: var(--success); color: #fff; }
.phase-step.active .phase-circle  { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(59,130,246,.14); }
.phase-step.pending .phase-circle { background: var(--white); border-color: var(--border); color: var(--text-muted); }
.phase-label {
  font-size: 11px; font-weight: 500; color: var(--text-muted); text-align: center;
  white-space: nowrap; margin-bottom: 14px; transition: color .2s;
}
.phase-step.active .phase-label  { color: var(--primary); font-weight: 600; }
.phase-step.done   .phase-label  { color: var(--success-dark, #065f46); }
.phase-connector {
  width: 56px; height: 2px; background: var(--border);
  margin-top: 17px; flex-shrink: 0; transition: background .3s;
}
.phase-connector.done { background: var(--success); }

/* ── PHASE BODY (switcher — show one at a time) ────────────────────────────── */
.od-phase-body.active {
  display: block;
  animation: odFadeIn .18s ease;
}
@keyframes odFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MILESTONE TABLE ───────────────────────────────────────────────────────── */
.ms-table { border-bottom: 1px solid var(--border); }
.ms-header, .ms-row {
  display: grid;
  grid-template-columns: 30px 1fr 108px 108px 100px 110px;
  align-items: center; padding: 0 16px; gap: 0;
}
.ms-header {
  padding-top: 8px; padding-bottom: 8px;
  background: var(--page-bg); border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.ms-row {
  padding-top: 9px; padding-bottom: 9px;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.ms-row:last-child { border-bottom: none; }
.ms-row:hover { background: var(--page-bg); }
.ms-row.done    { opacity: .72; }
.ms-row.current { background: #eff6ff; }
.ms-row.overdue { background: #fff8f8; }
.ms-icon-cell { font-size: 13px; font-weight: 700; text-align: center; }
.ms-icon-cell.done    { color: var(--success); }
.ms-icon-cell.current { color: var(--primary); }
.ms-icon-cell.overdue { color: var(--danger); }
.ms-icon-cell.pending { color: #d1d5db; }
.ms-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.ms-row.done .ms-name { color: var(--text-muted); }
.ms-resp  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.ms-date-cell { font-size: 12px; color: var(--text-muted); }
.ms-row.current .ms-date-cell { color: var(--primary); font-weight: 500; }
.ms-row.overdue .ms-date-cell { color: var(--danger-dark); font-weight: 500; }
.ms-delta-cell { }
.ms-action-cell { text-align: right; }

/* ── ORDER DETAIL 2-COLUMN SPLIT ───────────────────────────────────────────── */
.od-split {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 600px;
  background: var(--white);
}
.od-left-panel {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  position: sticky;
  top: var(--nav-h);
  max-height: calc(100vh - var(--nav-h));
  background: var(--white);
}
.od-right-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ── LEFT PANEL — phase groups ───────────────────────────────────────────── */
.odl-group { border-bottom: 1px solid var(--border); }
.odl-group:last-of-type { border-bottom: none; }
.odl-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 12px;
  cursor: pointer; user-select: none;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
  transition: background .12s;
}
.odl-header:hover { background: var(--page-bg); }
.odl-header.active  { color: var(--primary); background: #fffbeb; }
.odl-header.done    { color: var(--success-dark); }
.odl-header.pending { color: var(--text-light); }
.odl-phase-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
  border: 2px solid currentColor;
}
.odl-header.done   .odl-phase-dot { background: var(--success); border-color: var(--success); color: #fff; }
.odl-header.active .odl-phase-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.odl-phase-badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 10px;
}
.odl-header.done   .odl-phase-badge { background: #d1fae5; color: var(--success-dark); }
.odl-header.active .odl-phase-badge { background: #fef3c7; color: var(--primary-dark); }
.odl-header.pending .odl-phase-badge { background: #f3f4f6; color: var(--text-light); }

.odl-rows { padding: 4px 0 6px; }
.odl-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center; gap: 0;
  padding: 5px 14px 5px 10px;
  transition: background .1s;
}
.odl-row:hover { background: var(--page-bg); }
.odl-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; margin-left: 2px;
}
.odl-row.done    .odl-dot { background: var(--success-bg); color: var(--success-dark); }
.odl-row.current .odl-dot { background: #dbeafe; color: #1d4ed8; }
.odl-row.overdue .odl-dot { background: var(--danger-bg); color: var(--danger-dark); }
.odl-row.pending .odl-dot { background: #f3f4f6; color: var(--text-light); }
.odl-label {
  font-size: 12px; padding-left: 8px;
}
.odl-row.done    .odl-label { color: var(--text-muted); }
.odl-row.current .odl-label { color: var(--text); font-weight: 600; }
.odl-row.overdue .odl-label { color: var(--danger-dark); font-weight: 600; }
.odl-row.pending .odl-label { color: var(--text-light); }
.odl-date { font-size: 11px; color: var(--text-light); white-space: nowrap; }
.odl-row.current .odl-date { color: var(--primary); font-weight: 500; }
.odl-row.done    .odl-date { color: var(--text-muted); }
.odl-row.overdue .odl-date { color: var(--danger-dark); }

.odl-hint-area { padding: 10px 12px 12px; border-top: 1px solid var(--border); }

/* ── RIGHT PANEL — tab strip ─────────────────────────────────────────────── */
.od-right-tabs {
  display: flex; align-items: center; gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  overflow-x: auto;
  flex-shrink: 0;
}
.od-right-tabs .detail-tab { white-space: nowrap; }
.od-tab-content { flex: 1; overflow-y: auto; }
.od-tab-panel { display: none; }
.od-tab-panel.active { display: block; animation: odFadeIn .15s ease; }

/* ── LOGISTICS TAB ───────────────────────────────────────────────────────── */
.transport-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border);
}
.transport-col {
  background: var(--page-bg); border-radius: var(--radius); padding: 12px 14px;
  border: 1px solid var(--border);
}
.transport-col-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin-bottom: 8px;
}
.transport-col.ai-col { border-color: #fcd34d; background: linear-gradient(135deg,#fffbeb,#fefce8); }
.transport-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 12px; }
.transport-label { color: var(--text-muted); }
.transport-val { font-weight: 600; color: var(--text); }
.transport-val.muted { color: var(--text-light); font-weight: 400; }
.discrepancy-alert {
  margin: 0 16px 12px; padding: 8px 12px; border-radius: var(--radius);
  background: #fff8f8; border: 1px solid #fca5a5; font-size: 12px; color: var(--danger-dark);
  display: flex; align-items: center; gap: 8px;
}
.route-detail {
  padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px;
}
.route-detail-row {
  display: grid; grid-template-columns: 140px 1fr; gap: 6px; padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
}
.route-detail-row:last-child { border-bottom: none; }
.route-key { color: var(--text-muted); font-size: 11px; padding-top: 2px; }
.route-val { color: var(--text); font-weight: 500; }
.route-val .muted { font-weight: 400; color: var(--text-muted); }
.map-controls {
  display: flex; gap: 6px; padding: 8px 16px 0; align-items: center;
}
.map-ctrl-btn {
  font-size: 11px; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--white); color: var(--text-muted); cursor: pointer; font-family: inherit;
  transition: all .12s;
}
.map-ctrl-btn.active, .map-ctrl-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── PARTIES TAB ─────────────────────────────────────────────────────────── */
.party-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); padding: 12px 16px 6px;
}
.party-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 10px; padding: 0 16px 12px; }
.party-card {
  background: var(--page-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 4px;
}
.party-card-role { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.party-card-name { font-size: 13px; font-weight: 600; color: var(--text); }
.party-card-sub  { font-size: 11px; color: var(--text-muted); }
.party-card-actions { display: flex; gap: 5px; margin-top: 6px; }
.party-card.tbd { opacity: .6; border-style: dashed; }

/* ── CONTAINERS TAB ──────────────────────────────────────────────────────── */
.ctr-planned-header {
  padding: 12px 16px; font-size: 12px; color: var(--text-muted);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
}
.ctr-planned-card {
  border-bottom: 1px solid var(--border); padding: 12px 16px;
}
.ctr-planned-card:last-child { border-bottom: none; }
.ctr-planned-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.ctr-planned-skus { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.ctr-fill-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

/* ── SKU TABLE ───────────────────────────────────────────────────────────── */
.sku-table { width: 100%; font-size: 12px; }
.sku-table th { text-align: left; padding: 6px 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--page-bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.sku-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.sku-table tr:last-child td { border-bottom: none; }
.sku-table tr:hover td { background: var(--page-bg); }
.sku-table .right { text-align: right; }
.sku-table tfoot td { font-weight: 700; color: var(--text); background: var(--page-bg); border-top: 2px solid var(--border); }
.sku-dim { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── DOCUMENTS TAB ───────────────────────────────────────────────────────── */
.docs-phase-group { border-bottom: 1px solid var(--border); }
.docs-phase-group:last-child { border-bottom: none; }
.docs-phase-header {
  padding: 8px 16px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); background: var(--page-bg);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px;
}
.docs-gob-bar {
  padding: 7px 16px; font-size: 11px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; background: #f0fdf4; color: var(--success-dark);
}
.doc-row-v2 {
  padding: 10px 16px; border-bottom: 1px solid #f3f4f6; transition: background .1s;
}
.doc-row-v2:last-child { border-bottom: none; }
.doc-row-v2:hover { background: var(--page-bg); }
.doc-row-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.doc-row-name { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.doc-row-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.doc-ocr-result { font-size: 11px; padding: 5px 10px; border-radius: 5px; margin-top: 4px; }
.doc-ocr-result.ok  { background: #f0fdf4; color: var(--success-dark); border: 1px solid #bbf7d0; }
.doc-ocr-result.warn { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.doc-ocr-result.missing { background: var(--page-bg); color: var(--text-light); border: 1px dashed var(--border); }
.doc-row-actions { display: flex; gap: 5px; margin-top: 5px; }

/* ── COMMUNICATION SUB-TABS ──────────────────────────────────────────────── */
.comm-sub-nav {
  display: flex; align-items: center; gap: 0;
  padding: 8px 16px 0; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.comm-sub-tab {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  padding: 5px 12px; border-bottom: 2px solid transparent; cursor: pointer;
  transition: color .12s, border-color .12s; background: none; border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}
.comm-sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.comm-sub-tab:hover  { color: var(--text); }
.comm-view-toggle {
  margin-left: auto; display: flex; gap: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.comm-view-btn {
  font-size: 11px; padding: 4px 10px; background: var(--white); color: var(--text-muted);
  border: none; cursor: pointer; font-family: inherit; transition: background .12s, color .12s;
}
.comm-view-btn.active { background: var(--primary); color: #fff; }
.comm-stream { padding: 10px 16px; display: flex; flex-direction: column; gap: 0; }
.comm-stream-event {
  display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f3f4f6; font-size: 12px;
}
.comm-stream-event:last-child { border-bottom: none; }
.comm-evt-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.comm-evt-dot.system  { background: var(--info); }
.comm-evt-dot.warning { background: var(--primary); }
.comm-evt-dot.danger  { background: var(--danger); }
.comm-evt-time { font-size: 11px; color: var(--text-light); white-space: nowrap; flex-shrink: 0; min-width: 90px; }
.comm-evt-text { color: var(--text); line-height: 1.5; }
.comm-thread { padding: 0 16px 12px; }
.comm-bubble {
  border-radius: 8px; padding: 9px 12px; font-size: 12px; line-height: 1.6;
  margin-bottom: 8px; max-width: 88%;
}
.comm-bubble:last-child { margin-bottom: 0; }
.comm-bubble.inbound  { background: var(--page-bg); border: 1px solid var(--border); align-self: flex-start; }
.comm-bubble.outbound { background: var(--info-bg); border: 1px solid #bfdbfe; margin-left: auto; }
.comm-bubble.draft    { background: linear-gradient(135deg,#fffbeb,#fef3c7); border: 1px solid #fcd34d; }
.comm-bubble-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.comm-bubble-from { font-weight: 600; color: var(--text); }
.comm-bubble-body { white-space: pre-line; }
.comm-draft-acts { display: flex; gap: 6px; margin-top: 8px; }
.comm-section { display: flex; flex-direction: column; }

/* ── FINANCIALS TAB ──────────────────────────────────────────────────────── */
.fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.fin-card { background: var(--page-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.fin-card-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 10px; }
.fin-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; border-bottom: 1px solid #f3f4f6; }
.fin-row:last-child { border-bottom: none; }
.fin-key { color: var(--text-muted); }
.fin-val { font-weight: 600; color: var(--text); }
.fin-val.ok    { color: var(--success-dark); }
.fin-val.warn  { color: #92400e; }
.fin-val.danger{ color: var(--danger-dark); }
.fin-discrepancy {
  margin: 0 16px 14px; padding: 10px 14px; border-radius: var(--radius);
  background: #fffbeb; border: 1px solid #fcd34d; font-size: 12px;
}
.fin-discrepancy-title { font-weight: 700; color: #92400e; margin-bottom: 4px; }
.fin-discrepancy-actions { display: flex; gap: 6px; margin-top: 8px; }
