/* ============================================================
   Mindset AI — Roadmap Dashboard
   Theme: Dark, Hebrew RTL, Brand palette 21
   ============================================================ */

:root {
  /* Brand colors (palette 21) */
  --night-blue: #142238;
  --deep-blue: #0A2E4A;
  --dark-blue: #1B3A5C;
  --gold: #C5A55A;
  --light-gold: #D4BA7A;
  --amber: #F0B030;

  /* Surface tones */
  --bg-0: #0A1320;
  --bg-1: #0F1B2D;
  --bg-2: #142238;
  --bg-3: #1B3A5C;
  --surface: #16263F;
  --surface-2: #1E3553;
  --border: rgba(197, 165, 90, 0.18);
  --border-strong: rgba(197, 165, 90, 0.36);
  --divider: rgba(255, 255, 255, 0.08);

  /* Text */
  --text-1: #E9EEF6;
  --text-2: #A8B5C8;
  --text-3: #6F7F95;
  --text-on-gold: #142238;

  /* Status */
  --status-pending: #6F7F95;
  --status-progress: #4A90D9;
  --status-completed: #4FC18B;
  --status-blocked: #E66B6B;
  --status-cancelled: #555;

  /* Typography */
  --font-he: 'Assistant', 'Segoe UI', system-ui, sans-serif;
  --font-en: 'Raleway', 'Inter', sans-serif;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* Shadows */
  --shadow-1: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 0 1px rgba(197,165,90,0.4), 0 0 32px rgba(197,165,90,0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-0); color: var(--text-1); font-family: var(--font-he); font-size: 14px; line-height: 1.5; }
body { min-height: 100vh; }

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--dark-blue); }

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 30%, var(--deep-blue) 0%, var(--bg-0) 70%);
}
.auth-shell { width: 100%; max-width: 420px; padding: var(--s-5); }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-2), var(--shadow-glow);
}
.brand {
  text-align: center;
  margin-bottom: var(--s-6);
}
.brand-mark {
  width: 64px; height: 64px;
  margin: 0 auto var(--s-4);
  background: linear-gradient(135deg, var(--gold), var(--light-gold));
  color: var(--text-on-gold);
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 32px;
  border-radius: 16px;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(197,165,90,0.35);
}
.brand h1 { font-family: var(--font-en); font-size: 32px; font-weight: 700; margin: 0; letter-spacing: 0.5px; }
.brand .accent { color: var(--gold); }
.brand-sub { color: var(--text-2); margin-top: var(--s-2); font-weight: 500; }

#loginForm fieldset { border: none; padding: 0; margin: 0 0 var(--s-4); }
#loginForm legend { color: var(--text-2); font-size: 13px; margin-bottom: var(--s-2); }
.user-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.user-btn {
  padding: var(--s-3) var(--s-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-weight: 600;
  transition: all 0.15s ease;
}
.user-btn:hover { background: var(--bg-3); color: var(--text-1); }
.user-btn.active { background: linear-gradient(135deg, var(--gold), var(--light-gold)); color: var(--text-on-gold); border-color: var(--gold); }

.pin-label { display: block; margin-bottom: var(--s-4); }
.pin-label span { display: block; color: var(--text-2); font-size: 13px; margin-bottom: var(--s-2); }
.pin-label input {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 18px;
  letter-spacing: 4px;
  text-align: center;
  direction: ltr;
}
.pin-label input:focus { outline: none; border-color: var(--gold); box-shadow: var(--shadow-glow); }

#submitBtn {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  background: linear-gradient(135deg, var(--gold), var(--light-gold));
  color: var(--text-on-gold);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--r-md);
  margin-top: var(--s-2);
}
#submitBtn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(197,165,90,0.4); }
#submitBtn:disabled { opacity: 0.5; cursor: not-allowed; }

.err { color: var(--status-blocked); text-align: center; margin: var(--s-3) 0 0; min-height: 1.5em; font-size: 13px; }
.auth-footer { text-align: center; color: var(--text-3); font-size: 12px; margin-top: var(--s-5); }

/* ============================================================
   APP SHELL
   ============================================================ */
#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--bg-1);
  border-inline-start: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  padding: var(--s-4);
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: var(--s-3); padding-bottom: var(--s-5); border-bottom: 1px solid var(--divider); }
.sidebar-brand .brand-mark { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; box-shadow: 0 3px 10px rgba(197,165,90,0.3); }
.brand-name { font-family: var(--font-en); font-size: 16px; font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding-top: var(--s-4); }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.12s ease;
  position: relative;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-1); }
.nav-item.active { background: linear-gradient(90deg, rgba(197,165,90,0.2), rgba(197,165,90,0.05)); color: var(--gold); border-inline-start: 3px solid var(--gold); padding-inline-start: 9px; }
.nav-icon { width: 22px; text-align: center; color: var(--gold); font-weight: 700; }
.nav-count {
  margin-inline-start: auto;
  background: var(--bg-3);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  min-width: 22px;
  text-align: center;
}
.nav-item.active .nav-count { background: var(--gold); color: var(--text-on-gold); }

.sidebar-footer { padding-top: var(--s-4); border-top: 1px solid var(--divider); }
.user-chip { display: flex; align-items: center; gap: var(--s-3); }
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--dark-blue), var(--deep-blue));
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--border);
}
.user-name { font-size: 13px; font-weight: 600; }
.logout-btn { font-size: 11px; color: var(--text-3); padding: 0; }
.logout-btn:hover { color: var(--gold); }

/* Content */
.content { padding: 0; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  background: var(--bg-1);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
.page-title {
  flex: 1;
  font-family: var(--font-he);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text-1);
}
.topbar-actions { display: flex; gap: var(--s-2); }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 16px;
}
.icon-btn:hover { color: var(--gold); border-color: var(--border-strong); }
#menuToggle { display: none; }

.primary-btn {
  padding: var(--s-2) var(--s-4);
  background: linear-gradient(135deg, var(--gold), var(--light-gold));
  color: var(--text-on-gold);
  font-weight: 700;
  border-radius: var(--r-md);
  font-size: 13px;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(197,165,90,0.3); }
.ghost-btn {
  padding: var(--s-2) var(--s-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
}
.ghost-btn:hover { color: var(--text-1); border-color: var(--border-strong); }

/* Views */
.view { display: none; padding: var(--s-5); }
.view.active { display: block; }

/* ============================================================
   ROADMAP VIEW: Kanban + List + Gantt
   ============================================================ */
.view-tabs { display: inline-flex; gap: 2px; background: var(--bg-2); padding: 4px; border-radius: var(--r-md); margin-bottom: var(--s-4); }
.view-tab { padding: var(--s-2) var(--s-4); border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.view-tab.active { background: var(--surface); color: var(--gold); }

/* Kanban */
.kanban-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-4); }
.kanban-col {
  background: var(--bg-1);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: var(--s-3);
  min-height: 200px;
}
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: var(--s-2); border-bottom: 1px solid var(--divider); margin-bottom: var(--s-3); }
.kanban-col-title { font-weight: 700; font-size: 13px; color: var(--text-1); }
.kanban-col-count { background: var(--bg-3); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--status-pending);
  border-radius: var(--r-md);
  padding: var(--s-3);
  margin-bottom: var(--s-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.task-card:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.task-card[data-status="in_progress"] { border-inline-start-color: var(--status-progress); }
.task-card[data-status="completed"] { border-inline-start-color: var(--status-completed); opacity: 0.75; }
.task-card[data-status="blocked"] { border-inline-start-color: var(--status-blocked); }
.task-card[data-status="cancelled"] { border-inline-start-color: var(--status-cancelled); opacity: 0.5; text-decoration: line-through; }
.task-title { font-weight: 600; font-size: 13px; margin-bottom: var(--s-1); }
.task-meta { display: flex; gap: var(--s-3); color: var(--text-3); font-size: 11px; }
.task-meta span { display: inline-flex; gap: 4px; align-items: center; }
.priority-10 { color: var(--status-blocked); font-weight: 700; }
.priority-7 { color: var(--amber); font-weight: 600; }
.priority-3 { color: var(--text-3); }

/* List view */
.task-list { background: var(--bg-1); border: 1px solid var(--divider); border-radius: var(--r-md); overflow: hidden; }
.task-row {
  display: grid;
  grid-template-columns: 4px 1fr 130px 100px 100px 80px 80px;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
}
.task-row:hover { background: var(--bg-2); }
.task-row .status-bar { width: 4px; height: 28px; background: var(--status-pending); border-radius: 2px; }
.task-row[data-status="in_progress"] .status-bar { background: var(--status-progress); }
.task-row[data-status="completed"] .status-bar { background: var(--status-completed); }
.task-row[data-status="blocked"] .status-bar { background: var(--status-blocked); }
.task-row-title { font-weight: 600; }
.task-row-phase { font-size: 11px; color: var(--text-3); }
.task-row-meta { font-size: 12px; color: var(--text-2); }
.list-header {
  display: grid;
  grid-template-columns: 4px 1fr 130px 100px 100px 80px 80px;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--bg-2);
  font-size: 11px;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Gantt */
.gantt-wrap { background: var(--bg-1); border: 1px solid var(--divider); border-radius: var(--r-md); padding: var(--s-4); overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px dashed var(--divider); }
.gantt-label { font-weight: 600; font-size: 13px; }
.gantt-bar-track { position: relative; height: 22px; background: var(--bg-2); border-radius: 4px; }
.gantt-bar { position: absolute; height: 100%; background: linear-gradient(90deg, var(--dark-blue), var(--gold)); border-radius: 4px; }
.gantt-bar.in_progress { background: linear-gradient(90deg, var(--status-progress), var(--gold)); }
.gantt-bar.completed { background: var(--status-completed); }
.gantt-bar.blocked { background: var(--status-blocked); }
.gantt-month-row { display: grid; grid-template-columns: 220px 1fr; gap: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--border); margin-bottom: var(--s-3); }
.gantt-months { display: grid; grid-template-columns: repeat(12, 1fr); }
.gantt-month { font-size: 11px; color: var(--text-3); text-align: center; border-inline-start: 1px dashed var(--divider); padding: 2px; }

/* ============================================================
   PROJECTS GRID
   ============================================================ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-3); }
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.project-card:hover { border-color: var(--border-strong); }
.project-card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.project-card .domain { color: var(--gold); font-size: 12px; font-family: var(--font-en); direction: ltr; text-align: right; }
.project-card .desc { color: var(--text-2); font-size: 12px; line-height: 1.4; }
.project-card .meta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: auto; }
.badge { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.badge.active { background: rgba(79, 193, 139, 0.15); color: var(--status-completed); border-color: rgba(79, 193, 139, 0.3); }
.badge.high { background: rgba(230, 107, 107, 0.15); color: var(--status-blocked); border-color: rgba(230, 107, 107, 0.3); }
.badge.medium { background: rgba(240, 176, 48, 0.15); color: var(--amber); border-color: rgba(240, 176, 48, 0.3); }
.badge.low { background: rgba(74, 144, 217, 0.15); color: var(--status-progress); border-color: rgba(74, 144, 217, 0.3); }
.badge.customer { background: rgba(197, 165, 90, 0.18); color: var(--gold); border-color: rgba(197, 165, 90, 0.4); }
.badge.requests { background: var(--bg-2); color: var(--text-1); }

/* ============================================================
   REQUESTS TABLE
   ============================================================ */
.requests-table { width: 100%; background: var(--bg-1); border: 1px solid var(--divider); border-radius: var(--r-md); border-collapse: collapse; }
.requests-table th, .requests-table td { padding: var(--s-3); text-align: right; border-bottom: 1px solid var(--divider); }
.requests-table th { background: var(--bg-2); font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.requests-table tr:hover td { background: var(--bg-2); }
.repeat-badge { background: var(--status-blocked); color: white; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; }

/* ============================================================
   COSTS / GRAPH
   ============================================================ */
.cost-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-3); margin-bottom: var(--s-5); }
.cost-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); }
.cost-kpi .label { color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.cost-kpi .value { font-family: var(--font-en); font-size: 28px; font-weight: 700; color: var(--gold); margin-top: var(--s-2); }
.cost-kpi .sub { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.cost-table-wrap { background: var(--bg-1); border: 1px solid var(--divider); border-radius: var(--r-md); padding: var(--s-4); }
.cost-bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; }
.cost-bar .label { min-width: 180px; font-size: 13px; }
.cost-bar .track { flex: 1; height: 10px; background: var(--bg-2); border-radius: 5px; overflow: hidden; }
.cost-bar .fill { height: 100%; background: linear-gradient(90deg, var(--dark-blue), var(--gold)); border-radius: 5px; }
.cost-bar .amount { min-width: 80px; text-align: end; font-family: var(--font-en); font-weight: 600; color: var(--gold); }

/* ============================================================
   REBRAND PROGRESS
   ============================================================ */
.rebrand-grid { display: grid; gap: var(--s-3); }
.rebrand-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); }
.rebrand-row h3 { margin: 0 0 var(--s-3); font-size: 15px; }
.rebrand-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-2); }
.rebrand-step { padding: var(--s-2); background: var(--bg-2); border-radius: var(--r-sm); text-align: center; font-size: 11px; color: var(--text-3); border: 1px solid transparent; }
.rebrand-step.completed { background: rgba(79,193,139,0.15); color: var(--status-completed); border-color: rgba(79,193,139,0.3); }
.rebrand-step.in_progress { background: rgba(74,144,217,0.15); color: var(--status-progress); border-color: rgba(74,144,217,0.3); }
.rebrand-step.blocked { background: rgba(230,107,107,0.15); color: var(--status-blocked); border-color: rgba(230,107,107,0.3); }

/* ============================================================
   AGENTS ACTIVITY
   ============================================================ */
.agents-grid { display: grid; gap: var(--s-3); }
.agent-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: center; }
.agent-status-dot { width: 10px; height: 10px; border-radius: 50%; }
.agent-status-dot.active { background: var(--status-completed); box-shadow: 0 0 8px rgba(79,193,139,0.6); animation: pulse 2s infinite; }
.agent-status-dot.idle { background: var(--amber); }
.agent-status-dot.completed { background: var(--text-3); }
.agent-status-dot.failed { background: var(--status-blocked); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ============================================================
   DECISIONS / AUDIT
   ============================================================ */
.decisions-list, .audit-list { display: grid; gap: var(--s-3); }
.decision-card, .audit-row {
  background: var(--surface);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.decision-card h3 { margin: 0 0 var(--s-2); font-size: 14px; }
.decision-meta { color: var(--text-3); font-size: 11px; margin-bottom: var(--s-2); }
.decision-card .rationale { color: var(--text-2); font-size: 13px; line-height: 1.5; }

.audit-row { padding: var(--s-3); border-inline-start-width: 2px; }
.audit-row .action-type { font-weight: 700; color: var(--gold); font-size: 12px; }
.audit-row .meta { color: var(--text-3); font-size: 11px; margin-top: 2px; }

/* ============================================================
   DRAWER (task detail)
   ============================================================ */
.drawer {
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  width: 480px;
  max-width: 100%;
  height: 100vh;
  background: var(--bg-1);
  border-inline-start: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 50;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
html[dir="rtl"] .drawer { transform: translateX(-100%); }
html[dir="rtl"] .drawer.open { transform: translateX(0); }
.drawer-content { padding: var(--s-5); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 49;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* Drawer content styles */
.drawer-header { display: flex; align-items: start; justify-content: space-between; margin-bottom: var(--s-5); }
.drawer-header h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.drawer-close { font-size: 24px; color: var(--text-3); padding: 0; line-height: 1; }
.drawer-close:hover { color: var(--gold); }

.drawer-fields { display: grid; grid-template-columns: 110px 1fr; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-5); font-size: 13px; }
.drawer-fields dt { color: var(--text-3); font-weight: 600; }
.drawer-fields dd { margin: 0; color: var(--text-1); }
.drawer-fields select, .drawer-fields input { width: 100%; padding: 4px 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text-1); }

.drawer-section { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--divider); }
.drawer-section h3 { margin: 0 0 var(--s-3); font-size: 13px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.5px; }

.comment { background: var(--bg-2); border-radius: var(--r-sm); padding: var(--s-3); margin-bottom: var(--s-2); }
.comment-header { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-bottom: var(--s-1); }
.comment-author { font-weight: 700; color: var(--gold); }
.comment-bot { color: var(--status-progress); }
.comment-body { white-space: pre-wrap; }

.new-comment { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.new-comment textarea { flex: 1; padding: var(--s-2); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-1); min-height: 60px; resize: vertical; }

/* ============================================================
   MODAL (new task)
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: grid; place-items: center; z-index: 60; padding: var(--s-4); }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-4); }
.modal h2 { margin: 0; font-size: 18px; }
.modal-close { font-size: 24px; color: var(--text-3); padding: 0; line-height: 1; }
.modal form label { display: block; margin-bottom: var(--s-3); font-size: 13px; color: var(--text-2); }
.modal form label span { display: block; margin-bottom: 4px; }
.modal form input, .modal form textarea, .modal form select {
  width: 100%;
  padding: var(--s-2) var(--s-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
}
.modal form .row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-3); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-4); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: var(--s-5);
  inset-inline-start: 50%;
  transform: translateX(50%) translateY(20px);
  padding: var(--s-3) var(--s-5);
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-weight: 600;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }
.toast.error { border-color: var(--status-blocked); }
.toast.success { border-color: var(--status-completed); }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty {
  padding: var(--s-7) var(--s-4);
  text-align: center;
  color: var(--text-3);
}
.empty h3 { color: var(--text-2); margin-bottom: var(--s-2); }

.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-md);
  min-height: 60px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   PHASE TIMELINE (top of roadmap view)
   ============================================================ */
.phase-timeline {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.phase-pill {
  padding: var(--s-3);
  background: var(--bg-1);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  position: relative;
}
.phase-pill:hover { border-color: var(--border-strong); }
.phase-pill.in_progress { border-color: var(--status-progress); box-shadow: 0 0 12px rgba(74,144,217,0.2); }
.phase-pill.completed { border-color: var(--status-completed); }
.phase-pill .num { font-family: var(--font-en); font-size: 11px; color: var(--gold); font-weight: 700; }
.phase-pill .title { font-size: 12px; font-weight: 700; margin: 4px 0; line-height: 1.3; }
.phase-pill .progress { font-size: 11px; color: var(--text-3); }
.phase-progress-bar { height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden; margin-top: var(--s-2); }
.phase-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--light-gold)); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .cost-grid { grid-template-columns: 1fr 1fr; }
  .modal form .row { grid-template-columns: 1fr; }
  .phase-timeline { grid-template-columns: repeat(3, 1fr); }
  .task-row, .list-header { grid-template-columns: 4px 1fr 100px 80px 80px; }
  .task-row > *:nth-child(6), .list-header > *:nth-child(6),
  .task-row > *:nth-child(7), .list-header > *:nth-child(7) { display: none; }
}

@media (max-width: 768px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 240px;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 40;
    box-shadow: var(--shadow-2);
  }
  html[dir="rtl"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  #menuToggle { display: grid; }
  .kanban-board { grid-template-columns: 1fr; }
  .cost-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .phase-timeline { grid-template-columns: repeat(2, 1fr); }
}
