/* ============================================================
   Indigonix CX & Delivery Operations Platform
   Dark, dense, professional. Inspired by Linear/Notion/Hex.
   ============================================================ */

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

:root {
  --bg-0: #0b0e14;        /* page background */
  --bg-1: #11151d;        /* sidebar / cards */
  --bg-2: #161b25;        /* raised surface */
  --bg-3: #1d2330;        /* hover / active */
  --bg-4: #252c3b;        /* input bg */
  --line: #232a38;
  --line-2: #2c3445;
  --text-0: #e6ebf2;
  --text-1: #b6bfcd;
  --text-2: #8089a0;
  --text-3: #5b6478;

  --brand: #5b8def;       /* Indigonix blue */
  --brand-2: #6ea8ff;
  --brand-soft: rgba(91, 141, 239, 0.12);
  --brand-border: rgba(91, 141, 239, 0.35);

  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.14);
  --pink: #f472b6;
  --pink-soft: rgba(244, 114, 182, 0.14);

  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "SF Pro Display", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

html, body { height: 100%; }
body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  display: grid;
  grid-template-columns: 256px 1fr;
  height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  border-radius: 9px;
  font-size: 22px;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(91, 141, 239, 0.3);
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-2); margin-top: 1px; }

.sidebar-section { padding: 14px 10px 4px; }
.sidebar-section-title {
  font-size: 10px; text-transform: uppercase;
  color: var(--text-3); letter-spacing: 0.08em;
  padding: 0 10px 8px; font-weight: 600;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-1);
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 1px;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-0); }
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-2);
  font-weight: 500;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px;
  width: 3px; background: var(--brand); border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 14px; width: 16px; text-align: center; opacity: 0.8; }
.nav-badge {
  margin-left: auto;
  background: var(--bg-3);
  color: var(--text-1);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px; text-align: center;
}
.nav-badge.red { background: var(--danger-soft); color: var(--danger); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-2);
  cursor: pointer;
  user-select: none;
}
.user-chip:hover { background: var(--bg-3); }
.user-chip-logout {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.user-chip-logout:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.user-chip-logout[title]:hover::after {
  content: attr(title);
  position: absolute;
  background: var(--bg-3);
  color: var(--text-0);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 36px;
  white-space: nowrap;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  display: grid; place-items: center; color: white; font-weight: 600; font-size: 12px;
}
.user-name { font-size: 12px; font-weight: 500; }
.user-role { font-size: 10px; color: var(--text-2); }

/* ============ MAIN / TOPBAR ============ */
.main {
  display: flex; flex-direction: column;
  background: var(--bg-0);
  overflow: hidden;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-0);
  flex-shrink: 0;
}
.page-title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.page-subtitle { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.ai-sov-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ok, #16a34a);
  background: color-mix(in srgb, var(--ok, #16a34a) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok, #16a34a) 40%, transparent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok, #16a34a) 50%, transparent);
  animation: ai-sov-pulse 2.6s ease-in-out infinite;
}
@keyframes ai-sov-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok, #16a34a) 45%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok, #16a34a) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .ai-sov-badge { animation: none; } }

.ai-chart-card { width: 100%; }
.ai-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ai-chart-title { font-weight: 700; font-size: 13px; }
.ai-chart-badge {
  font-size: 11px; font-weight: 600; white-space: nowrap;
  color: var(--brand, #4f7cff);
  background: color-mix(in srgb, var(--brand, #4f7cff) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand, #4f7cff) 40%, transparent);
  padding: 3px 9px; border-radius: 999px;
}
.ai-chart-foot { margin-top: 8px; font-size: 12px; opacity: 0.75; }
.ai-chart-syncing {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; padding: 18px 4px;
  color: var(--brand, #4f7cff);
}
.ai-chart-syncing::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: ai-spin 0.7s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.topbar-search input {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text-0);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  width: 280px;
  outline: none;
  transition: border 0.1s;
  font-family: var(--font);
}
.topbar-search input:focus { border-color: var(--brand); }
.topbar-search input::placeholder { color: var(--text-3); }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 60px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-3) transparent;
}
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }

/* ============ LOGIN SCREEN ============ */
.login-shell {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(91,141,239,0.15), transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(139,92,246,0.15), transparent 50%),
              var(--bg-0);
  display: grid; place-items: center;
  padding: 24px;
  overflow-y: auto;
}
.login-card {
  width: 100%; max-width: 480px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.login-card::before {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 3px;
  background: linear-gradient(90deg, var(--brand), #8b5cf6);
  border-radius: 16px 16px 0 0;
}
.login-brand {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
}
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.login-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.login-form { display: flex; flex-direction: column; gap: 4px; }
.login-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  margin: 8px 0;
}
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 16px;
  color: var(--text-3); font-size: 11px;
}
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.login-demo {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 280px; overflow-y: auto;
  padding: 4px;
  margin: 0 -4px;
}
.login-demo-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.login-demo-role { flex-shrink: 0; }
.login-demo-select {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text-0);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
}
.login-demo-select:focus { border-color: var(--brand); }

/* === NEW: Login demo cards (one-click sign in) === */
.login-demo-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  max-height: 320px; overflow-y: auto;
  padding: 4px; margin: 0 -4px;
}
.login-demo-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line);
  cursor: pointer; transition: all .12s;
  user-select: none;
}
.login-demo-card:hover {
  background: var(--bg-3); border-color: var(--brand);
  transform: translateY(-1px);
}
.login-demo-card:active { transform: translateY(0); }
.login-demo-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px; color: white;
  flex-shrink: 0;
}
.login-demo-avatar[data-role="indigonix_admin"],
.login-demo-avatar[data-role="support_manager"],
.login-demo-avatar[data-role="product_manager"] { background: linear-gradient(135deg, #5b8def, #a78bfa); }
.login-demo-avatar[data-role="project_manager"],
.login-demo-avatar[data-role="compliance_owner"] { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.login-demo-avatar[data-role="support_agent"],
.login-demo-avatar[data-role="developer"] { background: linear-gradient(135deg, #10b981, #06b6d4); }
.login-demo-avatar[data-role="customer_admin"],
.login-demo-avatar[data-role="customer_user"],
.login-demo-avatar[data-role="technical_contact"] { background: linear-gradient(135deg, #f472b6, #c084fc); }
.login-demo-avatar[data-role="billing_contact"],
.login-demo-avatar[data-role="seller"] { background: linear-gradient(135deg, #94a3b8, #64748b); }
.login-demo-info { flex: 1; min-width: 0; }
.login-demo-name { font-size: 12px; font-weight: 600; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-demo-email { font-size: 10px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-demo-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.login-demo-meta .badge { font-size: 9px; padding: 1px 5px; }
.login-demo-count { font-size: 9px; color: var(--text-2); }
.login-demo-action { color: var(--text-2); font-size: 16px; }
.login-demo-card:hover .login-demo-action { color: var(--brand); }
.login-demo-card-sm { padding: 6px 10px; }
.login-demo-card-sm .login-demo-name { font-size: 11px; }
.login-demo-extra {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
  max-height: 400px; overflow-y: auto;
}
.login-demo-extra-title { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.login-demo-role-group { margin-bottom: 12px; }
.login-demo-role-title { margin-bottom: 4px; }
.login-demo-role-title .badge { font-size: 10px; }
.login-demo-toggle { margin-top: 10px; text-align: center; }
.login-demo-toggle .btn { font-size: 11px; padding: 4px 12px; }
@media (max-width: 480px) {
  .login-demo-cards { grid-template-columns: 1fr; }
}

.login-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fw-600 { font-weight: 600; }

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 11px; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  font-family: var(--font);
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-2); }
.btn-secondary { background: var(--bg-3); color: var(--text-0); border-color: var(--line-2); }
.btn-secondary:hover { background: var(--bg-4); }
.btn-ghost { background: transparent; color: var(--text-1); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,0.3); }
.btn-success { background: var(--ok-soft); color: var(--ok); border-color: rgba(74,222,128,0.3); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-icon { padding: 6px 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-3);
  color: var(--text-1);
  white-space: nowrap;
}
.badge.brand { background: var(--brand-soft); color: var(--brand-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.pink { background: var(--pink-soft); color: var(--pink); }
.badge.outline { background: transparent; border: 1px solid var(--line-2); }
.badge-dot { padding-left: 12px; position: relative; }
.badge-dot::before {
  content: ""; position: absolute; left: 5px; top: 50%;
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; transform: translateY(-50%);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--brand);
  opacity: 0.5;
}
.stat-card.danger::before { background: var(--danger); }
.stat-card.warn::before { background: var(--warn); }
.stat-card.ok::before { background: var(--ok); }
.stat-card.purple::before { background: var(--purple); }

.stat-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.stat-delta { font-size: 11px; color: var(--text-2); margin-top: 4px; }
.stat-delta.up { color: var(--ok); }
.stat-delta.down { color: var(--danger); }
.stat-icon {
  position: absolute; top: 18px; right: 18px;
  font-size: 18px; opacity: 0.4;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data thead th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
table.data tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
  vertical-align: middle;
}
table.data tbody tr:hover { background: var(--bg-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .id-cell { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
table.data .title-cell { color: var(--text-0); font-weight: 500; }
table.data .muted { color: var(--text-2); font-size: 11px; }
table.data .actions-cell { text-align: right; white-space: nowrap; }
table.data .actions-cell .btn { margin-left: 4px; }

/* Layout helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* Filter bar */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 18px;
  flex-wrap: wrap;
}
.filter-bar select, .filter-bar input {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  color: var(--text-0);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font);
  outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--brand); }
.filter-label { font-size: 11px; color: var(--text-2); font-weight: 500; }

/* Section header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 16px; font-weight: 600; }
.section-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-col {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  min-height: 400px;
  max-height: 75vh;
}
.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.kanban-col-header .col-count {
  background: var(--bg-3);
  padding: 1px 8px; border-radius: 10px;
  font-size: 10px; color: var(--text-1);
}
.kanban-col-body {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.kanban-card {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: grab;
  transition: all 0.1s;
}
.kanban-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-col.drag-over { background: var(--brand-soft); }
.kanban-card-title { font-size: 12.5px; font-weight: 500; color: var(--text-0); margin-bottom: 6px; line-height: 1.35; }
.kanban-card-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* Modules status board (4 build-status columns) */
.kanban.mod-board { grid-template-columns: repeat(4, minmax(250px, 1fr)); }
.kanban-col-header .col-head-txt { display: flex; flex-direction: column; gap: 2px; }
.kanban-col-header .col-sub { font-size: 10px; font-weight: 400; color: var(--text-2);
  letter-spacing: .1px; text-transform: none; }
.kanban-col.st-planned { border-top: 3px solid var(--text-3); }
.kanban-col.st-dev { border-top: 3px solid var(--warn); }
.kanban-col.st-sim { border-top: 3px solid var(--info, var(--brand)); }
.kanban-col.st-live { border-top: 3px solid var(--ok); }
.mod-card-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.45; margin: 7px 0; }
.mod-card-outcome { font-size: 11px; color: var(--text-2); line-height: 1.4; }
.mod-card-outcome b { color: var(--ok); font-weight: 600; }

/* SLA */
.sla-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.sla-bar-fill { height: 100%; background: var(--ok); border-radius: 3px; transition: width 0.3s; }
.sla-bar-fill.warn { background: var(--warn); }
.sla-bar-fill.danger { background: var(--danger); }

.sla-cell { min-width: 130px; }
.sla-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600;
}
.sla-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.sla-pill.ok { background: var(--ok-soft); color: var(--ok); }
.sla-pill.ok .dot { background: var(--ok); }
.sla-pill.warn { background: var(--warn-soft); color: var(--warn); }
.sla-pill.warn .dot { background: var(--warn); }
.sla-pill.danger { background: var(--danger-soft); color: var(--danger); }
.sla-pill.danger .dot { background: var(--danger); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: grid; place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 640px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal.modal-lg { max-width: 880px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  background: transparent; border: none; color: var(--text-2);
  font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text-0); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* Form */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 11px; color: var(--text-2); font-weight: 500; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text-0);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--brand); }
.form-row textarea { resize: vertical; min-height: 80px; }
.form-row .helper { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Toast */
#toast-root {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--brand);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  min-width: 240px; max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease-out;
}
.toast.success { border-left-color: var(--ok); }
.toast.danger { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Customer 360 */
.customer-header {
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.customer-avatar-lg {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  color: white; font-size: 24px; font-weight: 700;
  flex-shrink: 0;
}
.customer-meta h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.customer-meta .row { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.customer-meta .row span { display: flex; align-items: center; gap: 4px; }

/* Detail panels */
.detail-section { margin-bottom: 20px; }
.detail-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); font-weight: 600; margin-bottom: 8px; }
.detail-section .body { font-size: 13px; color: var(--text-1); line-height: 1.6; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
.detail-row { display: flex; flex-direction: column; gap: 2px; }
.detail-row .label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.detail-row .value { font-size: 13px; color: var(--text-0); }

/* Activity */
.activity-feed { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
  display: flex; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-3);
  display: grid; place-items: center;
  font-size: 12px; flex-shrink: 0;
}
.activity-body { flex: 1; }
.activity-line { font-size: 12.5px; color: var(--text-0); }
.activity-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.activity-line .actor { color: var(--brand-2); font-weight: 500; }

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.empty-icon { font-size: 36px; opacity: 0.4; margin-bottom: 12px; }
.empty-title { font-size: 14px; font-weight: 500; color: var(--text-1); margin-bottom: 4px; }
.empty-sub { font-size: 12px; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 18px; gap: 4px; }
.tab {
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.1s;
  font-weight: 500;
}
.tab:hover { color: var(--text-0); }
.tab.active { color: var(--brand-2); border-bottom-color: var(--brand); }

/* Event log items (GitHub) */
.event-row {
  display: grid;
  grid-template-columns: 130px 90px 1fr 100px;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  align-items: center;
}
.event-row:hover { background: var(--bg-2); }
.event-row .ts { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.event-row .dir { font-size: 10px; }
.event-row .desc { color: var(--text-0); }
.event-row .desc code { background: var(--bg-3); padding: 1px 5px; border-radius: 3px; font-family: var(--mono); font-size: 11px; }

/* AI ideas */
.ai-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--purple), var(--brand));
}
.ai-id { font-family: var(--mono); font-size: 11px; color: var(--purple); }
.ai-title { font-size: 14px; font-weight: 600; margin: 6px 0 8px; }
.ai-section { font-size: 11.5px; color: var(--text-2); margin-top: 8px; }
.ai-section .label { text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; color: var(--text-3); }
.ai-section .body { color: var(--text-1); margin-top: 2px; }

/* AI chat modal ("AI'a Yaz") */
.ai-chat-thread {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 360px; overflow-y: auto; padding: 4px 2px 8px;
}
.ai-msg {
  max-width: 80%; padding: 10px 12px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.45; white-space: pre-wrap;
}
.ai-msg.staff {
  align-self: flex-end; background: var(--brand-soft); border: 1px solid var(--brand-border); color: var(--text-0);
}
.ai-msg.ai {
  align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1);
}
.ai-msg.ai-ticket-summary { max-width: 100%; width: 100%; }
.ai-chat-input-row {
  display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.ai-chat-input-row input {
  flex: 1; background: var(--bg-4); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--text-0); padding: 8px 10px; font-size: 13px;
}
.ai-chat-input-row input:focus { outline: none; border-color: var(--brand-border); }

/* Modules / Epics */
.module-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all 0.15s;
  cursor: pointer;
}
.module-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.module-id { font-family: var(--mono); font-size: 11px; color: var(--brand-2); }
.module-name { font-size: 15px; font-weight: 600; margin: 6px 0 8px; }
.module-desc { font-size: 12.5px; color: var(--text-1); line-height: 1.5; margin-bottom: 10px; }
.module-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.criticality-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.criticality-dot.High { background: var(--danger); }
.criticality-dot.Medium { background: var(--warn); }
.criticality-dot.Low { background: var(--ok); }

/* Story row */
.story-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.story-row:last-child { border-bottom: none; }
.story-id { font-family: var(--mono); font-size: 11px; color: var(--brand-2); }
.story-text { font-size: 13px; color: var(--text-0); margin: 4px 0; line-height: 1.5; }
.story-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--text-2); align-items: center; }

/* Hero for vision */
.vision-hero {
  background: linear-gradient(135deg, rgba(91,141,239,0.15), rgba(139,92,246,0.15));
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.vision-hero::after {
  content: ""; position: absolute; top: -50%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(91,141,239,0.2), transparent 70%);
  pointer-events: none;
}
.vision-hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.vision-hero p { font-size: 14px; color: var(--text-1); max-width: 720px; line-height: 1.6; }
.vision-hero .tagline { font-size: 12px; color: var(--brand-2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }

/* Checkbox toggle */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--bg-3); border-radius: 20px; transition: 0.2s; }
.slider::before { content: ""; position: absolute; height: 14px; width: 14px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* Progress bars */
.progress { background: var(--bg-3); border-radius: 4px; overflow: hidden; height: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--purple)); transition: width 0.4s; }

/* Misc */
.text-muted { color: var(--text-2); }
.text-brand { color: var(--brand-2); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fw-600 { font-weight: 600; }
