/* ==========================================================================
   Due Diligence Control Tower - Sabellico S.r.l.
   Design System & Theme Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
  /* Color Palette - Dark Mode Default */
  --bg-app: #090d16;
  --bg-sidebar: #0d121f;
  --bg-card: #131b2e;
  --bg-card-hover: #18223a;
  --bg-card-glass: rgba(19, 27, 46, 0.75);
  --bg-modal: #111827;
  --bg-input: #0b1120;
  --bg-hover: #1e293b;
  
  --border-color: #1e293b;
  --border-subtle: #172033;
  --border-highlight: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #38bdf8;
  
  /* Brand Accents - Sabellico Green / Industrial Circular Tech */
  --accent-primary: #10b981;
  --accent-primary-hover: #059669;
  --accent-primary-light: rgba(16, 185, 129, 0.15);
  --accent-cyan: #06b6d4;
  --accent-cyan-light: rgba(6, 182, 212, 0.15);
  --accent-indigo: #6366f1;
  --accent-indigo-light: rgba(99, 102, 241, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-light: rgba(245, 158, 11, 0.15);
  --accent-rose: #f43f5e;
  --accent-rose-light: rgba(244, 63, 94, 0.15);
  --accent-purple: #a855f7;
  --accent-purple-light: rgba(168, 85, 247, 0.15);
  
  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.25);
  --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.25);
  
  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  /* Metrics */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 74px;
  --header-height: 68px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-glass: rgba(255, 255, 255, 0.85);
  --bg-modal: #ffffff;
  --bg-input: #f8fafc;
  --bg-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-highlight: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-link: #0284c7;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --shadow-glow-green: 0 0 15px rgba(16, 185, 129, 0.15);
  --shadow-glow-cyan: 0 0 15px rgba(6, 182, 212, 0.15);
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-app);
}

/* Sidebar */
.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: 50;
  transition: width 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: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: var(--shadow-glow-green);
}

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

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 12px 10px 6px 10px;
}

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

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item:hover i {
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.08));
  color: var(--accent-primary);
  border-left: 3px solid var(--accent-primary);
}

.nav-item.active i {
  color: var(--accent-primary);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.nav-badge.danger {
  background-color: var(--accent-rose-light);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

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

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  background-color: var(--bg-app);
  overflow-x: hidden;
}

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

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

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  width: 320px;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  width: 380px;
}

.search-box i {
  color: var(--text-muted);
  font-size: 14px;
  margin-right: 10px;
}

.search-box input {
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}

.search-shortcut {
  font-size: 10px;
  font-family: var(--font-mono);
  background-color: var(--bg-card);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

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

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

.header-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.notif-badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--accent-rose);
  box-shadow: 0 0 6px var(--accent-rose);
}

.header-badge-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
  animation: pulseAnim 1.8s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Content Body */
.content-body {
  flex: 1;
  padding: 28px;
  min-width: 0;
  max-width: 100%;
}

/* Views Management */
.view-container {
  display: none;
  min-width: 0;
  max-width: 100%;
  animation: fadeIn 0.25s ease;
}

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

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

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-group h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.page-title-group p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

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

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.metric-card.accent-cyan::before { background: linear-gradient(90deg, var(--accent-cyan), transparent); }
.metric-card.accent-amber::before { background: linear-gradient(90deg, var(--accent-amber), transparent); }
.metric-card.accent-rose::before { background: linear-gradient(90deg, var(--accent-rose), transparent); }
.metric-card.accent-indigo::before { background: linear-gradient(90deg, var(--accent-indigo), transparent); }

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metric-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.metric-icon-wrap.green { background-color: var(--accent-primary-light); color: var(--accent-primary); }
.metric-icon-wrap.cyan { background-color: var(--accent-cyan-light); color: var(--accent-cyan); }
.metric-icon-wrap.amber { background-color: var(--accent-amber-light); color: var(--accent-amber); }
.metric-icon-wrap.rose { background-color: var(--accent-rose-light); color: var(--accent-rose); }
.metric-icon-wrap.indigo { background-color: var(--accent-indigo-light); color: var(--accent-indigo); }

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1.1;
}

.metric-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Dashboard Sections Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

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

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

.card-title i {
  color: var(--accent-primary);
  font-size: 15px;
}

/* Area Cards Progress */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.area-progress-card {
  background-color: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.area-progress-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.area-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.area-tag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.area-color-pip {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.area-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.area-pct {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.progress-bar-wrap {
  width: 100%;
  height: 7px;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.area-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Table Controls & Filters */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--accent-primary);
}

/* Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background-color: var(--bg-sidebar);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: var(--bg-hover);
}

.req-code-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
  display: inline-block;
}

.req-title-cell {
  max-width: 380px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.req-title-cell:hover {
  color: var(--accent-primary);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-da_assegnare { background-color: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.badge-assegnata { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-in_raccolta_dati { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-in_revisione_interna { background-color: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-caricata { background-color: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-validata { background-color: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-chiusa { background-color: rgba(16, 185, 129, 0.25); color: #10b981; border: 1px solid #10b981; }

.priority-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.priority-critica { background-color: var(--accent-rose-light); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.priority-alta { background-color: var(--accent-amber-light); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.priority-media { background-color: var(--accent-cyan-light); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.priority-bassa { background-color: rgba(100, 116, 139, 0.15); color: #94a3b8; }

/* View Mode Toggle Switcher */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
}

[data-theme="light"] .view-mode-toggle {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

/* Kanban Board View */
.kanban-board {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 18px;
  margin-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-highlight) var(--bg-card);
}

.kanban-board::-webkit-scrollbar {
  height: 12px;
}

.kanban-board::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.kanban-board::-webkit-scrollbar-thumb {
  background: var(--border-highlight);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card);
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

[data-theme="light"] .kanban-board::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

[data-theme="light"] .kanban-board::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-color: #e2e8f0;
}

[data-theme="light"] .kanban-board::-webkit-scrollbar-thumb:hover {
  background: #059669;
}

.kanban-column {
  flex: 0 0 290px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

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

.kanban-title {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-cards-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kanban-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.35;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
}

/* Gantt Chart */
.gantt-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gantt-header-row {
  display: flex;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
}

.gantt-tree-col {
  width: 320px;
  flex-shrink: 0;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
}

.gantt-timeline-col {
  flex: 1;
  overflow-x: auto;
  display: flex;
}

.gantt-month-cell {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 12px 6px;
  font-size: 12px;
  font-weight: 600;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

.gantt-row:hover {
  background-color: var(--bg-hover);
}

.gantt-row-label {
  width: 320px;
  flex-shrink: 0;
  padding: 10px 16px;
  font-size: 13px;
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-row-label.level-1 {
  font-weight: 700;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
}

.gantt-row-label.level-2 {
  padding-left: 32px;
  font-weight: 600;
  color: var(--text-secondary);
}

.gantt-row-label.level-3 {
  padding-left: 48px;
  font-weight: 400;
  color: var(--text-muted);
}

.gantt-bars-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
}

.gantt-bar {
  position: absolute;
  height: 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* VDR Virtual Data Room */
.vdr-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .vdr-container {
    grid-template-columns: 1fr;
  }
}

.vdr-tree {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: 75vh;
  overflow-y: auto;
}

.vdr-tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.vdr-tree-item:hover, .vdr-tree-item.active {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.vdr-tree-item.active {
  border-left: 3px solid var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

.vdr-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.vdr-dropzone {
  border: 2px dashed var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  background-color: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 20px;
}

.vdr-dropzone:hover {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary-light);
}

.vdr-dropzone i {
  font-size: 32px;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

/* ========================================================================= */
/* VIEW: RACI MATRIX & WORKLOAD BALANCING */
/* ========================================================================= */
#raciWorkloadCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.raci-workload-card,
#raciWorkloadCards > div {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.raci-workload-card:hover,
#raciWorkloadCards > div:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.raci-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.raci-table th, .raci-table td {
  text-align: center;
  padding: 10px 8px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
}

.raci-table th:first-child, .raci-table td:first-child {
  text-align: left;
  padding-left: 16px;
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 2;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.15);
}

.raci-table tr:hover td:first-child {
  background: var(--bg-card-hover);
}

.raci-pill {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  transition: all var(--transition-fast);
  letter-spacing: 0;
}

.raci-pill.R { background-color: rgba(244, 63, 94, 0.18); color: #fb7185; border: 1.5px solid #f43f5e; box-shadow: 0 0 8px rgba(244, 63, 94, 0.25); }
.raci-pill.A { background-color: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1.5px solid #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.25); }
.raci-pill.S { background-color: rgba(16, 185, 129, 0.18); color: #34d399; border: 1.5px solid #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.25); }
.raci-pill.C { background-color: rgba(129, 140, 248, 0.18); color: #a5b4fc; border: 1.5px solid #6366f1; box-shadow: 0 0 8px rgba(99, 102, 241, 0.25); }
.raci-pill.I { background-color: rgba(148, 163, 184, 0.18); color: #cbd5e1; border: 1.5px solid #64748b; }

.raci-cell-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 4px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 36px;
  transition: all var(--transition-fast);
}

.raci-cell-btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-highlight);
  transform: scale(1.12);
}

.raci-cell-btn:disabled {
  cursor: default;
}

.raci-cell-empty {
  color: var(--text-muted);
  opacity: 0.35;
  font-size: 13px;
  display: inline-block;
  transition: all var(--transition-fast);
}

.raci-cell-btn:hover .raci-cell-empty {
  opacity: 1;
  color: var(--accent-primary);
  transform: scale(1.2);
}

.raci-legend-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
}

.raci-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.raci-legend-item:hover {
  border-color: var(--border-highlight);
  background-color: var(--bg-hover);
}

.raci-legend-text {
  display: flex;
  flex-direction: column;
}

.raci-legend-text strong {
  font-size: 12px;
  color: var(--text-primary);
}

.raci-legend-text span {
  font-size: 11px;
  color: var(--text-muted);
}

/* ========================================================================= */
/* VIEW: EXECUTIVE STATUS REPORT */
/* ========================================================================= */
#printableReportArea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-width: 1200px;
  margin: 0 auto;
}

[data-theme="light"] #printableReportArea {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#printableReportArea h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

#printableReportArea .report-summary-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

[data-theme="light"] #printableReportArea .report-summary-box {
  background: #f8fafc;
  border-color: #e2e8f0;
  border-left-color: #0284c7;
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
  }
  
  .app-sidebar,
  .top-header,
  .page-actions,
  .sidebar-backdrop,
  .notif-dropdown-menu,
  .user-dropdown-menu {
    display: none !important;
  }
  
  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  
  .content-body {
    padding: 0 !important;
  }
  
  .view-container {
    display: none !important;
  }
  
  .view-container#view_reports {
    display: block !important;
  }
  
  #printableReportArea {
    background: #ffffff !important;
    color: #0f172a !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  
  #printableReportArea * {
    color: #0f172a !important;
    text-shadow: none !important;
  }
  
  #printableReportArea .text-emerald-400 { color: #059669 !important; }
  #printableReportArea .text-cyan-400 { color: #0284c7 !important; }
  #printableReportArea .text-rose-400 { color: #dc2626 !important; }
  #printableReportArea .text-amber-400 { color: #d97706 !important; }
  
  .data-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 2px solid #cbd5e1 !important;
  }
  
  .data-table td {
    border-bottom: 1px solid #e2e8f0 !important;
  }
}

/* ========================================================================= */
/* VIEW: AI DUE DILIGENCE COPILOT */
/* ========================================================================= */
#view_ai .dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  #view_ai .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

#aiChatHistory {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
  max-height: 380px;
}

[data-theme="light"] #aiChatHistory {
  background: #f8fafc;
  border-color: #e2e8f0;
}

#aiRecommendationsList li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  transition: var(--transition-fast);
}

#aiRecommendationsList li:hover {
  background: var(--bg-hover);
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

#aiRecommendationsList li i {
  color: var(--accent-primary);
  margin-top: 3px;
  flex-shrink: 0;
}

/* ========================================================================= */
/* DRAWER / SLIDE-OVER MODAL (THEME-ADAPTIVE) */
/* ========================================================================= */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 780px;
  max-width: 95vw;
  background-color: var(--bg-modal);
  border-left: 1px solid var(--border-highlight);
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.45);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-panel.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 24px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.drawer-meta-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px 24px;
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-color);
}

.meta-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 11.5px;
}

.meta-chip-label {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  display: block;
}

.meta-chip-value {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Workflow Stepper in Drawer */
.workflow-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  gap: 6px;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  opacity: 0.55;
  transition: all var(--transition-fast);
  min-width: 75px;
}

.stepper-step:hover {
  opacity: 0.9;
}

.stepper-step.active {
  opacity: 1;
}

.stepper-dot {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background-color: var(--bg-input);
  border: 2px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}

.stepper-step.completed .stepper-dot {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.stepper-step.active .stepper-dot {
  background-color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.stepper-label {
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  white-space: nowrap;
}

.stepper-step.active .stepper-label {
  color: var(--accent-cyan);
  font-weight: 700;
}

.stepper-step.completed .stepper-label {
  color: var(--accent-primary);
}

/* Drawer Navigation Tabs */
.drawer-tabs-bar {
  display: flex;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  gap: 8px;
}

.drawer-tab-btn {
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.drawer-tab-btn:hover {
  color: var(--text-primary);
}

.drawer-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.drawer-tab-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.drawer-tab-btn.active .drawer-tab-badge {
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Drawer Body & Card Architecture */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background-color: var(--bg-app);
}

.drawer-tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.drawer-tab-content.active {
  display: block;
}

.drawer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.drawer-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.drawer-card-header {
  padding: 14px 18px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
}

.drawer-header-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.drawer-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
  letter-spacing: 0.2px;
}

.drawer-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.drawer-card-body {
  padding: 18px 20px;
}

/* Typography & Box Containers */
.drawer-desc-box {
  background-color: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-primary);
  font-weight: 400;
  white-space: pre-line;
  word-break: break-word;
}

.drawer-details-subbox {
  background-color: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-primary);
  font-family: inherit;
  white-space: pre-line;
}

/* Form Grid & Input Fields */
.drawer-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.drawer-field-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.drawer-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: none;
}

.drawer-field-input,
.drawer-field-select {
  width: 100%;
  height: 42px;
  padding: 9px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.drawer-field-input:focus,
.drawer-field-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-light);
  background-color: var(--bg-card);
}

.drawer-field-select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
  padding: 6px;
}

.drawer-field-textarea {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.55;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
  resize: vertical;
  min-height: 68px;
  box-sizing: border-box;
}

.drawer-field-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-light);
  background-color: var(--bg-card);
}

.drawer-field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.35;
}

/* Progress Slider Card */
.drawer-progress-box {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.drawer-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.drawer-progress-badge {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-primary);
}

.drawer-progress-range {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  margin-bottom: 12px;
}

.drawer-preset-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-preset-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  background-color: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.drawer-preset-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background-color: var(--accent-primary-light);
}

/* Upload Dropzone */
.drawer-upload-zone {
  background-color: var(--bg-input);
  border: 2px dashed var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  transition: border-color var(--transition-fast);
}

.drawer-upload-zone:hover {
  border-color: var(--accent-primary);
}

.drawer-upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: var(--radius-md);
  background-color: var(--accent-primary-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.drawer-upload-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.drawer-upload-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.drawer-upload-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}

.drawer-file-input {
  font-size: 11.5px;
  color: var(--text-secondary);
  flex: 1;
}

.drawer-chat-box {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.drawer-footer {
  padding: 16px 24px;
  background-color: var(--bg-sidebar);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Document Items in Drawer */
.drawer-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.drawer-doc-item:hover {
  border-color: var(--border-highlight);
  background-color: var(--bg-card-hover);
}

.badge-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.badge-version {
  display: inline-block;
  padding: 2px 6px;
  background: var(--accent-primary-light);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.bg-cyan-light {
  background-color: var(--accent-cyan-light);
}

.text-rose {
  color: var(--accent-rose);
}

.text-emerald {
  color: var(--accent-primary);
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

/* Chat Bubbles & Timeline */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.chat-bubble {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  font-size: 13px;
  color: var(--text-primary);
}

.chat-bubble.clarification {
  border-left: 3px solid var(--accent-amber);
  background: linear-gradient(90deg, var(--accent-amber-light), var(--bg-card));
}

.chat-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}

.chat-author {
  font-weight: 700;
  color: var(--text-primary);
}

.chat-role {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 6px;
}

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

.audit-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 24px;
}

.audit-timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background-color: var(--border-highlight);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background-color: var(--accent-cyan);
  border: 3px solid var(--bg-modal);
}

.timeline-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-primary);
}

/* ========================================================================= */
/* LIGHT THEME SPECIFIC OVERRIDES FOR DRAWER */
/* ========================================================================= */
[data-theme="light"] .drawer-panel {
  background-color: #ffffff;
  border-left: 1px solid #cbd5e1;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .drawer-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .drawer-meta-banner {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .meta-chip {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .workflow-stepper {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .stepper-dot {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .stepper-label {
  color: #64748b;
}

[data-theme="light"] .drawer-tabs-bar {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .drawer-body {
  background-color: #f1f5f9;
}

[data-theme="light"] .drawer-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .drawer-card-header {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.06) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .drawer-header-icon-badge {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: #0284c7;
}

[data-theme="light"] .drawer-desc-box {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .drawer-details-subbox {
  background-color: rgba(2, 132, 199, 0.06);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-left: 4px solid #0284c7;
  color: #0369a1;
}

[data-theme="light"] .drawer-field-label {
  color: #334155;
}

[data-theme="light"] .drawer-field-input,
[data-theme="light"] .drawer-field-select {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .drawer-field-input:focus,
[data-theme="light"] .drawer-field-select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  background-color: #ffffff;
}

[data-theme="light"] .drawer-field-select option {
  background-color: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .drawer-field-textarea {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .drawer-field-textarea:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  background-color: #ffffff;
}

[data-theme="light"] .drawer-progress-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .drawer-preset-btn {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
}

[data-theme="light"] .drawer-preset-btn:hover {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #059669;
}

[data-theme="light"] .drawer-upload-zone {
  background-color: #f8fafc;
  border: 2px dashed #cbd5e1;
}

[data-theme="light"] .drawer-upload-zone:hover {
  border-color: #059669;
}

[data-theme="light"] .drawer-chat-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .chat-bubble {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .chat-bubble.clarification {
  border-left: 3px solid #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), #ffffff);
}

[data-theme="light"] .timeline-content {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .drawer-footer {
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

.toast.success { border-left: 4px solid var(--accent-primary); }
.toast.error { border-left: 4px solid var(--accent-rose); }
.toast.info { border-left: 4px solid var(--accent-cyan); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-highlight);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========================================================================= */
/* SABELLICO S.R.L. LOGIN OVERLAY & CARD STYLING */
/* ========================================================================= */
.login-screen-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #1e3a6c 0%, #0d1b2a 60%, #070d14 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-screen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: loginFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(77, 148, 204, 0.25);
  backdrop-filter: blur(10px);
}

.login-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-fallback-icon {
  font-size: 36px;
  color: #38bdf8;
}

.login-title {
  font-family: 'Poppins', 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  margin: 0 0 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.login-subtitle {
  font-size: 13px;
  color: #93c5fd;
  margin: 0 0 12px;
  font-weight: 400;
}

.login-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
}

.login-card {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(77, 148, 204, 0.25);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 40px rgba(47, 75, 126, 0.2);
  backdrop-filter: blur(16px);
}

.login-hint-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 11.5px;
  color: #fde68a;
  line-height: 1.45;
  margin-bottom: 20px;
}

.login-error-alert {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* Form Components */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  width: 100%;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 7px;
  text-align: left;
}

.form-input, .form-select {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  background-color: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(77, 148, 204, 0.35);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  background-color: rgba(15, 23, 42, 0.95);
}

.form-select option {
  background-color: #0f172a;
  color: #ffffff;
  padding: 8px;
}

.btn-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-lg {
  height: 46px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: var(--radius-md);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap .form-input {
  padding-right: 42px;
}

.btn-toggle-pwd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
  z-index: 2;
}

.btn-toggle-pwd:hover {
  color: var(--text-primary);
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
}

/* Sidebar & Header Logo */
.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* Header User Profile Menu */
.header-user-wrapper {
  position: relative;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-user-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-highlight);
}

.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
}

.header-user-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.header-user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.header-user-badge {
  font-size: 10px;
  color: var(--text-muted);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 1000;
  animation: dropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: 4px 6px 10px;
}

.user-dropdown-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 8px 0;
}

.user-dropdown-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 6px 6px;
}

.user-dropdown-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast);
}

.user-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.07);
}

.user-dropdown-item.active {
  background-color: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.raci-role-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ========================================================================= */
/* MODAL ARCHITECTURE & FIRST LOGIN STYLING */
/* ========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 20, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 18px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85), 0 0 35px rgba(12, 113, 195, 0.2);
  overflow: hidden;
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.first-login-modal-card {
  max-width: 490px;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(30, 58, 108, 0.7) 0%, rgba(15, 23, 42, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.modal-header-text {
  flex: 1;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 3px;
  line-height: 1.25;
}

.modal-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.modal-security-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(14, 116, 144, 0.12);
  border: 1px solid rgba(14, 116, 144, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 11.5px;
  color: #bae6fd;
  line-height: 1.45;
}

.modal-security-notice i {
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}

.modal-security-text strong {
  color: #38bdf8;
  font-weight: 600;
}

.form-help-text {
  font-size: 11px;
  color: #64748b;
  margin-top: 5px;
  display: block;
  line-height: 1.35;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Responsive Rules for Drawer & Components */
@media (max-width: 768px) {
  .drawer-panel {
    width: 100vw;
    max-width: 100vw;
  }
  .drawer-grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .drawer-body {
    padding: 16px;
  }
  .drawer-card-body {
    padding: 14px;
  }
}

/* ========================================================================= */
/* FULL-PAGE REQUEST DETAIL VIEW */
/* ========================================================================= */
.detail-page-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.detail-page-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.detail-page-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.detail-page-main-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

.detail-page-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.detail-page-stepper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  padding: 16px 24px;
}

.detail-page-tabs-bar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0 20px;
  overflow-x: auto;
}

.detail-tab-content {
  display: none;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
  animation: fadeIn 0.2s ease;
}

.detail-tab-content.active {
  display: block;
}

.detail-page-layout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.detail-page-col-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-page-col-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 1120px) {
  .detail-page-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================= */
/* COLLABORATION: CHANNELS, MENTIONS & NOTIFICATIONS SYSTEM */
/* ========================================================================= */

/* Channel Switcher Pills */
.chat-channel-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
}

.channel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.channel-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.channel-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.advisor-chat-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Mention Autocomplete Popup */
.mention-autocomplete-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 6px;
  animation: fadeIn 0.15s ease;
}

.mention-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.mention-autocomplete-item:hover,
.mention-autocomplete-item.selected {
  background: var(--bg-card-hover);
}

.mention-avatar-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mention-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mention-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Mention Badge Inside Comment Bubbles */
.mention-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11.5px;
  font-weight: 600;
  margin: 0 2px;
}

[data-theme="light"] .mention-tag {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.3);
}

/* Header Notification Dropdown */
.header-notif-wrapper {
  position: relative;
}

.notif-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  animation: modalScaleUp 0.18s ease-out;
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.notif-dropdown-list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.notif-item:hover {
  background: var(--bg-card-hover);
}

.notif-item.unread {
  background: rgba(14, 165, 233, 0.06);
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.notif-item-content {
  flex: 1;
  overflow: hidden;
}

.notif-item-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-item-msg {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 4px;
}

.notif-item-time {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Dashboard User Notifications Panel */
.dashboard-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
}

.dashboard-notif-item:hover {
  border-color: var(--brand-primary);
  transform: translateX(3px);
}

.dashboard-notif-item.unread {
  border-left: 3px solid #38bdf8;
  background: rgba(14, 165, 233, 0.05);
}

/* ========================================================================= */
/* COMPREHENSIVE UTILITY CLASSES (Grid, Flex, Spacing, Typography, Colors)   */
/* ========================================================================= */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.gap-1 { gap: 4px; }
.gap-1\.5 { gap: 6px; }
.gap-2 { gap: 8px; }
.gap-2\.5 { gap: 10px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }

/* Colors & Backgrounds */
.bg-slate-950 { background-color: #020617; }
.bg-slate-900 { background-color: var(--bg-card); }
.bg-slate-800 { background-color: var(--bg-sidebar); }
.bg-slate-800\/60 { background-color: rgba(15, 23, 42, 0.6); }
.bg-slate-800\/80 { background-color: rgba(15, 23, 42, 0.8); }
.bg-emerald-600 { background-color: #059669; }
.bg-emerald-500 { background-color: #10b981; }
.bg-cyan-600 { background-color: #0891b2; }
.bg-cyan-900\/50 { background-color: rgba(22, 78, 99, 0.5); }
.bg-amber-950\/60 { background-color: rgba(69, 26, 3, 0.6); }
.bg-emerald-950\/60 { background-color: rgba(2, 44, 34, 0.6); }
.bg-indigo-950\/60 { background-color: rgba(30, 27, 75, 0.6); }

[data-theme="light"] .bg-slate-950 { background-color: #f8fafc; }
[data-theme="light"] .bg-slate-900 { background-color: #ffffff; }
[data-theme="light"] .bg-slate-800 { background-color: #f1f5f9; }
[data-theme="light"] .bg-slate-800\/60 { background-color: rgba(241, 245, 249, 0.8); }

/* Text Colors */
.text-white { color: #ffffff; }
.text-slate-100 { color: var(--text-primary); }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }

[data-theme="light"] .text-slate-200 { color: #1e293b; }
[data-theme="light"] .text-slate-300 { color: #334155; }
[data-theme="light"] .text-slate-400 { color: #64748b; }

.text-emerald-300 { color: #6ee7b7; }
.text-emerald-400 { color: #34d399; }
.text-cyan-300 { color: #67e8f9; }
.text-cyan-400 { color: #22d3ee; }
.text-rose-400 { color: #fb7185; }
.text-amber-300 { color: #fcd34d; }
.text-amber-400 { color: #fbbf24; }
.text-indigo-300 { color: #a5b4fc; }
.text-indigo-400 { color: #818cf8; }
.text-purple-400 { color: #c084fc; }

/* Borders */
.border { border-width: 1px; border-style: solid; border-color: var(--border-color); }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: var(--border-color); }
.border-t { border-top-width: 1px; border-top-style: solid; border-top-color: var(--border-color); }
.border-l { border-left-width: 1px; border-left-style: solid; border-left-color: var(--border-color); }
.border-r { border-right-width: 1px; border-right-style: solid; border-right-color: var(--border-color); }
.border-slate-600 { border-color: #475569; }
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1e293b; }
.border-slate-800\/80 { border-color: rgba(30, 41, 59, 0.8); }
.border-amber-700 { border-color: #b45309; }
.border-emerald-700 { border-color: #047857; }
.border-indigo-700 { border-color: #4338ca; }
.border-cyan-700 { border-color: #0e7490; }

[data-theme="light"] .border-slate-700,
[data-theme="light"] .border-slate-800 { border-color: #e2e8f0; }

/* Padding & Margin */
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-2\.5 { padding: 10px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-10 { padding-top: 40px; padding-bottom: 40px; }
.pt-2 { padding-top: 8px; }
.pb-6 { padding-bottom: 24px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-2\.5 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.my-6 { margin-top: 24px; margin-bottom: 24px; }
.ml-1 { margin-left: 4px; }
.mr-1 { margin-right: 4px; }

/* Sizing & Rounded */
.w-8 { width: 32px; }
.h-8 { height: 32px; }
.max-w-md { max-width: 448px; }
.max-w-lg { max-width: 512px; }
.max-w-xl { max-width: 576px; }
.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* Typography */
.text-xs { font-size: 11.5px; }
.text-sm { font-size: 13.5px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 26px; }
.text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; }

.font-normal { font-weight: 400; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: var(--font-mono); }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-snug { line-height: 1.35; }
.leading-relaxed { line-height: 1.6; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.cursor-pointer { cursor: pointer; }
.transition { transition: all var(--transition-normal); }
.overflow-y-auto { overflow-y: auto; }


