/* ==========================================================================
   AI ADMIN ASSISTANT - DESIGN SYSTEM & STYLESHEET
   Dark Glassmorphic Executive Theme with Rich Micro-Interactions
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & CSS VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Core Dark Surfaces */
  --bg-darkest: #07090e;
  --bg-dark: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f293d;
  --bg-surface-hover: #26334d;
  
  /* Glassmorphism Surface Tokens */
  --glass-bg: rgba(17, 24, 39, 0.65);
  --glass-bg-hover: rgba(31, 41, 61, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-light: rgba(255, 255, 255, 0.15);
  --glass-blur: blur(16px);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  /* Primary Brand & Accent Gradients */
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --amber-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --rose-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --glow-indigo: 0 0 20px rgba(99, 102, 241, 0.4);
  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.4);

  /* Typography Colors */
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-inverse: #0b0f19;

  /* Font Families */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing & Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Animation Timings */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(139, 92, 246, 0.10) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Links & Focus Outline */
a {
  color: inherit;
  text-decoration: none;
}
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--accent-indigo);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. LAYOUT STRUCTURE
   -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition-normal);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 1.5rem 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--glow-indigo);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Navigation Links */
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem 0.25rem 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.2);
}

.nav-link.active svg {
  color: var(--accent-indigo);
}

.nav-link .badge-counter {
  margin-left: auto;
}

/* Sidebar Footer Profile & AI Status */
.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.ai-status-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

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

.ai-status-text {
  font-size: 0.8rem;
  line-height: 1.2;
}

.ai-status-text strong {
  display: block;
  color: var(--text-primary);
}

.ai-status-text span {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Main Content Layout */
.main-wrapper {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.header-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.25rem;
  width: 380px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.header-search:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.header-search svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.header-search input {
  background: transparent;
  width: 100%;
  font-size: 0.85rem;
  cursor: pointer;
}

.kbd-shortcut {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--glass-border);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Page View Sections Container */
.content-body {
  padding: 2rem;
  flex: 1;
}

.page-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* Section Titles */
.page-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.page-title h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   4. UI COMPONENTS (BUTTONS, BADGES, CARDS, FORMS)
   -------------------------------------------------------------------------- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-cyan {
  background: var(--cyan-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
}

.btn-cyan:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border-light);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Badges & Status Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Cards & Glass Containers */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition-normal);
}

.card-glass:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Metric KPI Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
}

.metric-card.emerald::before { background: var(--emerald-gradient); }
.metric-card.cyan::before { background: var(--cyan-gradient); }
.metric-card.amber::before { background: var(--amber-gradient); }

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.metric-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-indigo);
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  font-family: var(--font-main);
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metric-trend {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.metric-trend.up { color: var(--accent-emerald); }
.metric-trend.down { color: var(--accent-rose); }

/* --------------------------------------------------------------------------
   5. DASHBOARD LAYOUT & AI ASSISTANT CHAT
   -------------------------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

/* AI Command & Chat Widget */
.ai-assistant-widget {
  display: flex;
  flex-direction: column;
  height: 580px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  display: flex;
  gap: 0.75rem;
  max-width: 88%;
}

.chat-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-bubble.user .chat-avatar {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.chat-content {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.chat-bubble.user .chat-content {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
}

.chat-content code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

.macro-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--glass-border);
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.prompt-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
}

.chat-input-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.chat-input-field:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* Dashboard Filters & Quick Control Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-btn {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

/* Dashboard Analytics Grid & SVG Charts */
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.chart-card-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
}

.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-dasharray: 4 4;
}

.chart-path-area {
  fill: url(#indigoGradient);
  opacity: 0.4;
}

.chart-path-line {
  fill: none;
  stroke: var(--accent-indigo);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0px 4px 10px rgba(99, 102, 241, 0.5));
}

.chart-dot {
  fill: #fff;
  stroke: var(--accent-indigo);
  stroke-width: 3;
  r: 5;
  transition: var(--transition-fast);
  cursor: pointer;
}

.chart-dot:hover {
  r: 8;
  stroke: var(--accent-cyan);
}

/* Donut Chart Legend */
.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-color-pill {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

/* Live AI Activity Stream */
.activity-stream {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.activity-details strong {
  display: block;
  font-size: 0.875rem;
}

.activity-details span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.activity-time {
  margin-left: auto;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. TASK AUTOMATION QUEUE TABLE & LISTS
   -------------------------------------------------------------------------- */
.task-table-container {
  overflow-x: auto;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.task-table th {
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
}

.task-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
  vertical-align: middle;
}

.task-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.task-name-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.task-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-info strong {
  display: block;
  font-weight: 600;
}

.task-info span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.progress-bar-wrap {
  width: 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

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

/* --------------------------------------------------------------------------
   7. MODAL COMMAND PALETTE & TOAST SYSTEM
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.command-modal {
  width: 100%;
  max-width: 640px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .command-modal {
  transform: translateY(0);
}

.modal-search-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.modal-search-header svg {
  width: 22px;
  height: 22px;
  color: var(--accent-indigo);
}

.modal-search-header input {
  flex: 1;
  background: transparent;
  font-size: 1.1rem;
}

.command-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.75rem;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.command-item:hover, .command-item.selected {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
}

.command-item svg {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
}

.command-item-info strong {
  display: block;
  font-size: 0.9rem;
}

.command-item-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border-light);
  border-left: 4px solid var(--accent-emerald);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  animation: slideInRight 0.3s ease;
}

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

/* --------------------------------------------------------------------------
   8. DESIGN SYSTEM SHOWCASE GALLERY
   -------------------------------------------------------------------------- */
.ds-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2rem 0 1rem 0;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.swatch-card {
  border-radius: var(--radius-md);
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.swatch-color {
  height: 50px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.swatch-name {
  font-size: 0.78rem;
  font-weight: 600;
}

.swatch-hex {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Form Controls Demo */
.form-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* --------------------------------------------------------------------------
   KANBAN BOARD & TASK MANAGEMENT STYLES
   -------------------------------------------------------------------------- */
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
  align-items: start;
}

.kanban-column {
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
}

.kanban-column-title {
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.kanban-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: var(--transition-fast);
  cursor: grab;
  position: relative;
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.kanban-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.kanban-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
}

.agent-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   AUTHENTICATION, LOCK SCREEN, & EXECUTIVE PROFILE MENU
   -------------------------------------------------------------------------- */
.auth-page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-darkest);
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 40%);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.auth-page-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  animation: floatUp 0.4s ease;
}

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

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 auto 1rem auto;
  box-shadow: var(--glow-indigo);
}

.auth-logo svg {
  width: 30px;
  height: 30px;
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.sso-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sso-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.divider-line {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.5rem 0;
}

.divider-line::before, .divider-line::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--glass-border);
}

.divider-line span {
  padding: 0 0.75rem;
}

/* Security PIN Input Group */
.pin-input-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.25rem 0;
}

.pin-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.4rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  color: var(--accent-cyan);
}

.pin-digit:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* User Profile Dropdown Drawer */
.profile-dropdown-container {
  position: relative;
}

.profile-dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 150;
  animation: fadeIn 0.2s ease;
}

.profile-dropdown-menu.active {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--accent-indigo);
}

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 0.35rem 0;
}

/* --------------------------------------------------------------------------
   INTERACTIVE CALENDAR GRID STYLES
   -------------------------------------------------------------------------- */
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.5rem;
}

.calendar-day-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-fast);
}

.calendar-day-cell:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.calendar-day-cell.other-month {
  opacity: 0.3;
}

.calendar-day-cell.today {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.2);
}

.calendar-day-number {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-events-dots {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.cal-event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.cal-event-pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.2rem;
}

/* --------------------------------------------------------------------------
   DOCUMENT INTELLIGENCE & FILE DROPZONE STYLES
   -------------------------------------------------------------------------- */
.file-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.04);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 1.5rem;
}

.file-dropzone:hover, .file-dropzone.dragover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-indigo);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.doc-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.doc-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.doc-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.doc-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.doc-extracted-meta {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin: 0.75rem 0;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.meta-row strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   EMAIL ASSISTANT & SMART TRIAGE STYLES
   -------------------------------------------------------------------------- */
.email-inbox-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  min-height: 600px;
}

.email-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.email-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.email-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
}

.email-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.email-item-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.email-item-snippet {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.triage-card {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   NOTIFICATION CENTER DRAWER STYLES
   -------------------------------------------------------------------------- */
.notifications-drawer {
  position: absolute;
  top: 120%;
  right: 60px;
  width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  z-index: 150;
  animation: fadeIn 0.2s ease;
}

.notifications-drawer.active {
  display: flex;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: var(--transition-fast);
  cursor: pointer;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
  flex-shrink: 0;
  margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   9. COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   -------------------------------------------------------------------------- */

/* Mobile Hamburger Toggle & Backdrop Styling */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Screen <= 1280px */
@media (max-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Screen <= 1024px (Tablet Landscape & Mobile Sidebar Drawer) */
@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    transform: translateX(-100%);
    z-index: 1000;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .brand-text, .nav-link span, .nav-label, .ai-status-text, .badge-counter {
    display: inline-block;
  }
  .brand-header {
    justify-content: flex-start;
  }
  .nav-link {
    justify-content: flex-start;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100%;
  }

  .ai-chat-layout {
    grid-template-columns: 1fr;
  }

  .email-workspace-grid {
    grid-template-columns: 1fr;
  }

  .reminders-notes-grid {
    grid-template-columns: 1fr;
  }

  .documents-grid {
    grid-template-columns: 1fr;
  }
}

/* Screen <= 768px (Mobile Devices & Tablets Portrait) */
@media (max-width: 768px) {
  .top-header {
    padding: 0 0.85rem;
    gap: 0.5rem;
  }

  .header-search {
    flex: 1;
    min-width: 130px;
    max-width: 100%;
    padding: 0.45rem 0.75rem;
  }

  .header-search input {
    font-size: 0.8rem;
  }

  .kbd-shortcut {
    display: none;
  }

  #header-macro-btn span {
    display: none;
  }

  .content-body {
    padding: 1rem 0.85rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .metric-card {
    padding: 1rem;
  }

  .metric-value {
    font-size: 1.35rem;
  }

  .kanban-board {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .calendar-container {
    overflow-x: auto;
  }

  .calendar-header-grid, .calendar-grid {
    min-width: 580px;
  }

  .command-modal, .create-task-modal, .auth-card {
    width: 94vw !important;
    max-width: 100%;
    padding: 1.25rem !important;
  }

  .notifications-drawer {
    width: 92vw;
    right: -10px;
  }
}

/* Screen <= 480px (Small Mobile Phones) */
@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .user-profile #profile-name-display,
  .user-profile #profile-role-display {
    display: none;
  }

  .top-header {
    height: 60px;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .chat-input-bar {
    padding: 0.5rem;
  }

  .prompt-chip {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
  }
}
