/* ==========================================================================
   CHOBE TMS PHASE 2 - ADVANCED TASK HIERARCHY & TASK CREATION SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Palette - Premium Slate & Indigo Corporate Theme */
  --bg-main: #0b0f19;
  --bg-sidebar: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-header: #111827;
  --bg-input: #0f172a;
  
  --border-color: #1e293b;
  --border-light: #334155;
  --border-highlight: #475569;

  /* Primary & Accent Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  
  --secondary: #0ea5e9;
  --accent: #8b5cf6;
  
  /* Status Colors */
  --status-not-started: #64748b;
  --status-in-progress: #3b82f6;
  --status-pending: #f59e0b;
  --status-completed: #10b981;
  --status-escalated: #ef4444;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  
  --glass-bg: rgba(30, 41, 59, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Spacing & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --sidebar-width: 260px;
  --header-height: 70px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Reset & Global Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', monospace;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-main);
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Project Context Switcher */
.project-switcher {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.project-select-btn {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--transition-fast);
}

.project-select-btn:hover, .project-select-btn:focus {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

/* Navigation List */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 700;
  padding: 0 12px 6px 12px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--text-main);
  background: linear-gradient(90deg, var(--primary-light) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-link-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

.nav-item.active .nav-icon {
  color: var(--primary);
  opacity: 1;
}

.nav-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header Bar */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.search-bar {
  position: relative;
  width: 280px;
}

.search-bar input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-bar input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.action-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.action-btn.secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.action-btn.secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.action-btn.success {
  background-color: var(--status-completed);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-highlight);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--status-escalated);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* Form Groups for Modals */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 650px;
  max-width: 90vw;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Page Views Container */
.content-body {
  padding: 28px;
  flex: 1;
}

.page-view {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Report Selector */
.report-template-selector {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.report-tab-pill {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.report-tab-pill:hover {
  border-color: var(--border-highlight);
  color: var(--text-main);
}

.report-tab-pill.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.report-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.report-summary-card {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-summary-title { font-size: 11.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.report-summary-value { font-size: 22px; font-weight: 800; color: var(--text-main); }

.chart-bar-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-input);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.chart-bar-item { display: flex; align-items: center; gap: 14px; }
.chart-label { width: 180px; font-size: 12.5px; font-weight: 600; color: var(--text-main); }
.chart-track { flex: 1; height: 12px; background: var(--bg-card); border-radius: 6px; overflow: hidden; }
.chart-fill { height: 100%; background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%); border-radius: 6px; transition: width 0.5s ease-out; }

.report-export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--bg-header);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

/* Dynamic Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
}

.status-pill.not-started { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.3); }
.status-pill.in-progress { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.status-pill.pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-pill.completed { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-pill.escalated { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.status-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill.not-started .status-dot { background-color: #cbd5e1; }
.status-pill.in-progress .status-dot { background-color: #60a5fa; }
.status-pill.pending .status-dot { background-color: #fbbf24; }
.status-pill.completed .status-dot { background-color: #34d399; }
.status-pill.escalated .status-dot { background-color: #f87171; }

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.metric-card:hover { transform: translateY(-2px); border-color: var(--border-highlight); }
.metric-header { display: flex; align-items: center; justify-content: space-between; }
.metric-title { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.metric-icon-box { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.metric-value { font-size: 26px; font-weight: 800; color: var(--text-main); letter-spacing: -0.5px; }
.metric-footer { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.trend-up { color: var(--status-completed); font-weight: 700; }
.trend-down { color: var(--status-escalated); font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 28px; }
.panel-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; }
.panel-title-box { display: flex; flex-direction: column; }
.panel-title { font-size: 16px; font-weight: 700; color: var(--text-main); }
.panel-subtitle { font-size: 12px; color: var(--text-muted); }

.filter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; background: var(--bg-card); padding: 14px 18px; border-radius: var(--radius-lg); border: 1px solid var(--border-color); flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-select, .filter-input { background-color: var(--bg-input); border: 1px solid var(--border-light); color: var(--text-main); padding: 8px 12px; border-radius: var(--radius-md); font-size: 13px; outline: none; font-family: inherit; }
.filter-select:focus, .filter-input:focus { border-color: var(--primary); }

.view-toggle { display: flex; background: var(--bg-input); padding: 4px; border-radius: var(--radius-md); border: 1px solid var(--border-light); }
.toggle-btn { padding: 6px 14px; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all var(--transition-fast); }
.toggle-btn.active { background-color: var(--primary); color: white; }

.table-responsive { width: 100%; overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-color); background: var(--bg-card); }
.custom-table { width: 100%; border-collapse: collapse; text-align: left; }
.custom-table th { background-color: rgba(15, 23, 42, 0.6); color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 14px 18px; border-bottom: 1px solid var(--border-color); }
.custom-table td { padding: 14px 18px; border-bottom: 1px solid var(--border-color); color: var(--text-main); font-size: 13.5px; vertical-align: middle; }
.custom-table tr:last-child td { border-bottom: none; }
.custom-table tr:hover td { background-color: rgba(255, 255, 255, 0.02); }

.kanban-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: start; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: 75vh; }
.kanban-column-header { padding: 16px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.column-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.column-count { background: var(--bg-input); color: var(--text-muted); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.kanban-cards { padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.kanban-card { background: var(--bg-input); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 14px; cursor: pointer; transition: all var(--transition-fast); }
.kanban-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-project-tag { font-size: 11px; font-weight: 700; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.card-title { font-weight: 600; font-size: 13.5px; color: var(--text-main); margin-bottom: 8px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.card-assignee { display: flex; align-items: center; gap: 6px; }
.avatar-mini { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: white; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.task-tabs { display: flex; gap: 12px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 16px; }
.task-tab-btn { background: transparent; border: none; color: var(--text-muted); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 12px; border-radius: var(--radius-sm); transition: all var(--transition-fast); }
.task-tab-btn.active { background: var(--primary-light); color: var(--text-main); border-bottom: 2px solid var(--primary); }
.subtask-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border-light); border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }
.subtask-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.subtask-item.completed span { text-decoration: line-through; color: var(--text-dim); }

.builder-container { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
.master-list-sidebar { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.master-item-btn { padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-light); background: var(--bg-input); color: var(--text-muted); text-align: left; font-weight: 600; font-size: 13.5px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: all var(--transition-fast); }
.master-item-btn:hover { border-color: var(--border-highlight); color: var(--text-main); }
.master-item-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--text-main); }
.field-cards-grid { display: flex; flex-direction: column; gap: 12px; }
.field-row-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.field-info { display: flex; align-items: center; gap: 14px; }
.field-type-badge { background: rgba(14, 165, 233, 0.15); color: #38bdf8; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }

.hierarchy-canvas { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 32px; min-height: 380px; display: flex; align-items: center; justify-content: center; position: relative; }
.hierarchy-flow { display: flex; align-items: center; gap: 40px; }
.flow-node { background: var(--bg-input); border: 2px solid var(--primary); border-radius: var(--radius-lg); padding: 20px; width: 200px; box-shadow: 0 0 20px rgba(99, 102, 241, 0.2); text-align: center; cursor: pointer; transition: all var(--transition-fast); }
.flow-node:hover { transform: scale(1.03); border-color: var(--accent); }
.node-title { font-weight: 700; font-size: 15px; color: var(--text-main); margin-bottom: 4px; }
.node-sub { font-size: 11.5px; color: var(--text-muted); }
.flow-arrow { display: flex; align-items: center; color: var(--primary); font-size: 24px; position: relative; }
.flow-arrow::after { content: 'Per Project Binding'; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-muted); white-space: nowrap; font-weight: 600; }

.drawer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(5px); z-index: 200; display: none; opacity: 0; transition: opacity var(--transition-normal); }
.drawer-overlay.active { display: flex; align-items: center; justify-content: center; opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 620px; background: var(--bg-sidebar); border-left: 1px solid var(--border-color); z-index: 210; display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--transition-normal); box-shadow: var(--shadow-xl); }
.drawer-overlay.active .drawer { transform: translateX(0); }
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { padding: 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 20px; }
.drawer-footer { padding: 20px 24px; border-top: 1px solid var(--border-color); display: flex; align-items: center; justify-content: flex-end; gap: 12px; }

.rule-sequence-box { background: var(--bg-input); border: 1px dashed var(--border-highlight); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sequence-step { display: flex; align-items: center; gap: 16px; background: var(--bg-card); border: 1px solid var(--border-color); padding: 14px 18px; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast); }
.sequence-step:hover { border-color: var(--primary); transform: translateX(4px); }
.step-number { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: white; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--bg-card); border: 1px solid var(--primary); border-radius: var(--radius-md); padding: 12px 18px; color: var(--text-main); font-weight: 600; font-size: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: slideToast 0.3s ease-out; }
@keyframes slideToast { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .builder-container { grid-template-columns: 1fr; }
  .kanban-grid { grid-template-columns: repeat(2, 1fr); }
  .report-summary-bar { grid-template-columns: repeat(2, 1fr); }
  .form-grid-2 { grid-template-columns: 1fr; }
}
