/* ==========================================================================
   TSCG Follow-Up CRM - Comprehensive Production SaaS Design System
   Support for Light & Dark Modes, Glassmorphism, Responsive UI
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties & Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Light Mode */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-translucent: rgba(255, 255, 255, 0.85);
  --bg-sidebar: #0f172a;
  --bg-header: #ffffff;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  /* Brand Accent Colors */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  
  --emerald: #10b981;
  --emerald-light: #d1fae5;
  
  --indigo: #6366f1;
  --indigo-light: #e0e7ff;
  
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  
  --danger: #ef4444;
  --danger-light: #fee2e2;
  
  --info: #06b6d4;
  --info-light: #cffaff;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.4);
  --glass-blur: blur(12px);

  /* Dimensions & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --sidebar-width: 260px;
  --header-height: 70px;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-surface: #1e293b;
  --bg-surface-translucent: rgba(30, 41, 59, 0.85);
  --bg-sidebar: #090d16;
  --bg-header: #1e293b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border-color: #334155;
  --border-subtle: #1e293b;

  --glass-bg: rgba(30, 41, 59, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);

  --primary-light: rgba(2, 132, 199, 0.2);
  --emerald-light: rgba(16, 185, 129, 0.2);
  --indigo-light: rgba(99, 102, 241, 0.2);
  --warning-light: rgba(245, 158, 11, 0.2);
  --danger-light: rgba(239, 68, 68, 0.2);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Layout Containers */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
}

.content-body {
  padding: 24px 32px;
  flex: 1;
}

/* --------------------------------------------------------------------------
   3. Sidebar Navigation
   -------------------------------------------------------------------------- */
.sidebar-navigation {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: #94a3b8;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand-icon-box {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), #38bdf8);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
}

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

.brand-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-menu .menu-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  margin: 18px 12px 8px 12px;
  font-weight: 700;
}

.sidebar-menu ul {
  list-style: none;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.sidebar-menu li a:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar-menu li a.active {
  background: linear-gradient(90deg, var(--primary), #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.sidebar-menu li a .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ef4444;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.2s ease;
}

.logout-link:hover {
  opacity: 0.8;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

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

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

.mobile-menu-toggle {
  display: none;
}

.header-search {
  position: relative;
  width: 320px;
}

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

.header-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 13px;
  transition: all 0.2s ease;
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--border-subtle);
  color: var(--primary);
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.theme-toggle-btn .light-icon { display: none; }
.theme-toggle-btn .dark-icon { display: inline-block; }

[data-theme="dark"] .theme-toggle-btn .light-icon { display: inline-block; color: #f59e0b; }
[data-theme="dark"] .theme-toggle-btn .dark-icon { display: none; }

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  height: 18px;
  min-width: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-surface);
}

/* User Profile Button */
.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  transition: background-color 0.2s ease;
}

.profile-btn:hover {
  background-color: var(--border-subtle);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-large { width: 64px; height: 64px; font-size: 24px; margin: 0 auto; }

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

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

.user-role-badge {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.role-admin { background-color: var(--indigo-light); color: var(--indigo); }
.role-employee { background-color: var(--primary-light); color: var(--primary); }

/* Dropdown Menus */
.dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 280px;
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

.dropdown-menu.active {
  display: block;
}

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

.notification-menu {
  width: 320px;
}

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

.dropdown-header h3 {
  font-size: 14px;
}

.notification-list {
  max-height: 300px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.2s ease;
}

.notification-item:hover {
  background-color: var(--border-subtle);
}

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

.notify-info .notify-icon { background-color: var(--primary-light); color: var(--primary); }
.notify-warning .notify-icon { background-color: var(--warning-light); color: var(--warning); }

.notify-text strong { font-size: 13px; color: var(--text-main); display: block; }
.notify-text p { font-size: 12px; color: var(--text-muted); }

.profile-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-main);
  font-size: 13px;
}

.profile-menu a:hover {
  background-color: var(--border-subtle);
}

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

.profile-header-info {
  padding: 12px 16px;
  background-color: var(--border-subtle);
}

.profile-header-info .p-name { font-weight: 700; font-size: 14px; }
.profile-header-info .p-email { font-size: 12px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   5. Cards & Glassmorphism Layout
   -------------------------------------------------------------------------- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
}

.card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2, .card-header h3 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 24px;
}

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

.grid-4-col {
  grid-template-columns: repeat(4, 1fr);
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.border-top-primary { border-top: 4px solid var(--primary); }
.border-top-warning { border-top: 4px solid var(--warning); }
.border-top-info { border-top: 4px solid var(--info); }
.border-top-success { border-top: 4px solid var(--emerald); }
.border-top-indigo { border-top: 4px solid var(--indigo); }
.border-top-emerald { border-top: 4px solid #059669; }
.border-top-slate { border-top: 4px solid #64748b; }
.border-top-dark { border-top: 4px solid #334155; }

.metric-card .card-body {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.metric-value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 4px;
}

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

.icon-blue { background-color: var(--primary-light); color: var(--primary); }
.icon-orange { background-color: var(--warning-light); color: var(--warning); }
.icon-teal { background-color: var(--info-light); color: var(--info); }
.icon-green { background-color: var(--emerald-light); color: var(--emerald); }
.icon-indigo { background-color: var(--indigo-light); color: var(--indigo); }
.icon-emerald { background-color: rgba(5, 150, 105, 0.15); color: #059669; }
.icon-slate { background-color: rgba(100, 116, 139, 0.15); color: #64748b; }
.icon-dark { background-color: rgba(51, 65, 85, 0.15); color: #334155; }

.card-footer-link {
  background-color: var(--border-subtle);
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  border-top: 1px solid var(--border-color);
}

.card-footer-link a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
}

.card-footer-link a:hover {
  color: var(--primary);
}

/* Banner Alert */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  margin-bottom: 24px;
  border-left: 5px solid var(--primary);
}

.alert-banner-icon {
  font-size: 24px;
}

.alert-banner-text {
  flex: 1;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   6. Data Tables & Badges
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.custom-table th {
  background-color: var(--border-subtle);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-main);
}

.custom-table tbody tr {
  transition: background-color 0.15s ease;
}

.custom-table tbody tr:hover {
  background-color: var(--border-subtle);
}

.client-name-link {
  font-weight: 600;
  color: var(--text-main);
}

.client-name-link:hover {
  color: var(--primary);
}

/* Action Circle Buttons */
.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-call { background-color: var(--primary-light); color: var(--primary); border: none; }
.btn-call:hover { background-color: var(--primary); color: #ffffff; }

.btn-whatsapp { background-color: #dcfce7; color: #16a34a; border: none; }
.btn-whatsapp:hover { background-color: #16a34a; color: #ffffff; }

.btn-copy:hover { background-color: var(--border-subtle); color: var(--primary); }

/* Badges System */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-lg { padding: 6px 14px; font-size: 13px; }

.badge-blue { background-color: #e0f2fe; color: #0284c7; }
.badge-indigo { background-color: #e0e7ff; color: #4338ca; }
.badge-yellow { background-color: #fef3c7; color: #b45309; }
.badge-orange { background-color: #ffedd5; color: #c2410c; }
.badge-purple { background-color: #f3e8ff; color: #6b21a8; }
.badge-teal { background-color: #ccfbf1; color: #0f766e; }
.badge-slate { background-color: #f1f5f9; color: #475569; }
.badge-red { background-color: #fee2e2; color: #b91c1c; }
.badge-gray { background-color: #e2e8f0; color: #64748b; }
.badge-emerald { background-color: #d1fae5; color: #047857; }

.badge-primary { background-color: var(--primary); color: #ffffff; }
.badge-warning { background-color: var(--warning); color: #ffffff; }
.badge-success { background-color: var(--emerald); color: #ffffff; }
.badge-secondary { background-color: var(--text-muted); color: #ffffff; }

/* Priority Pills */
.priority-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.priority-high { background-color: #fee2e2; color: #dc2626; }
.priority-medium { background-color: #fef3c7; color: #d97706; }
.priority-low { background-color: #f1f5f9; color: #64748b; }

.employee-pill {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   7. Form Controls & Buttons
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.required { color: var(--danger); }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control-sm {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-icon-wrapper .form-control {
  padding-left: 38px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs { padding: 4px 8px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 16px; border-radius: var(--radius-md); }
.btn-block { width: 100%; display: flex; }

.btn-primary { background-color: var(--primary); color: #ffffff; }
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-secondary { background-color: var(--border-subtle); color: var(--text-main); border-color: var(--border-color); }
.btn-secondary:hover { background-color: var(--border-color); }

.btn-success { background-color: var(--emerald); color: #ffffff; }
.btn-success:hover { background-color: #059669; }

.btn-outline { background-color: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background-color: var(--border-subtle); }

.btn-outline-warning { background-color: transparent; border-color: var(--warning); color: var(--warning); }
.btn-outline-warning:hover { background-color: var(--warning); color: #ffffff; }

.btn-outline-danger { background-color: transparent; border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background-color: var(--danger); color: #ffffff; }

.btn-link { background: none; border: none; color: var(--primary); padding: 0; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }

/* Filter Bar Form */
.filter-form {
  padding: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.filter-actions-group {
  display: flex;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   8. Timeline Component (Client Details)
   -------------------------------------------------------------------------- */
.grid-layout {
  display: grid;
  gap: 24px;
}

.grid-layout-2 { grid-template-columns: 1fr 1fr; }
.grid-layout-2-1 { grid-template-columns: 2fr 1fr; }
.grid-layout-3-1 { grid-template-columns: 3fr 1.2fr; }
.grid-3-col { grid-template-columns: repeat(3, 1fr); }

.timeline-container {
  position: relative;
  padding-left: 32px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-badge {
  position: absolute;
  left: -32px;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid var(--bg-surface);
  z-index: 2;
}

.timeline-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.timeline-card-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.action-type-tag {
  font-size: 11px;
  background-color: var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-feedback-box {
  background-color: var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 10px;
}

/* Info List */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

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

/* --------------------------------------------------------------------------
   9. Modals & Toast Notifications
   -------------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  animation: modalZoom 0.25s ease;
}

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

.modal-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

.modal-header h3 { font-size: 16px; }

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

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

.client-mini-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background-color: var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.client-mini-card .c-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

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

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  font-size: 14px;
  animation: slideInRight 0.3s ease;
}

.toast-success { border-left-color: var(--emerald); }
.toast-error { border-left-color: var(--danger); }

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

/* --------------------------------------------------------------------------
   10. Helper Utilities & Responsive Media Queries
   -------------------------------------------------------------------------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-align { display: flex; align-items: center; }
.flex-gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--emerald); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-emerald { color: #059669; }
.text-indigo { color: var(--indigo); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Login Page Styling */
.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 440px;
}

.login-card {
  padding: 36px;
}

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

.brand-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), #38bdf8);
  color: #fff;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.4);
}

.demo-accounts-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.demo-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.demo-btn-group {
  display: flex;
  gap: 10px;
}

.btn-outline-sm {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-outline-sm:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .grid-layout-3-1, .grid-layout-2-1, .grid-layout-2, .grid-3-col, .grid-4-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-wrapper { margin-left: 0; }
  .sidebar-navigation {
    transform: translateX(-100%);
  }
  .sidebar-navigation.active {
    transform: translateX(0);
  }
  .sidebar-close-btn { display: block; }
  .mobile-menu-toggle { display: flex; }
  .header-search { display: none; }
  .top-navbar { padding: 0 16px; }
  .content-body { padding: 16px; }
}
