/* 🏢 ergon Corporate Design System - Optimized */

:root {
  /* Colors */
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --secondary: #64748b;
  --accent: #0ea5e9;
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --info: #0284c7;
  --white: #fff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Theme Variables */
  --bg-primary: var(--white);
  --bg-secondary: var(--gray-50);
  --bg-tertiary: var(--gray-100);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-inverse: var(--white);
  --border-color: var(--gray-200);
  --bg-hover: #f1f5f9;

  /* Layout */
  --sidebar-width: 260px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s ease-in-out;
  --transition-fast: all 0.15s ease-in-out;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Typography */
  --font-family: 'Inter', -apple-system, blinkmacsystemfont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.6875rem;
  --font-size-sm: 0.75rem;
  --font-size-base: 0.875rem;
  --font-size-lg: 0.9375rem;
  --font-size-xl: 1rem;
  --font-size-2xl: 1.125rem;
  --font-size-3xl: 1.25rem;
}

/* Dark Theme */
[data-theme='dark'] {
  --bg-primary: var(--gray-900);
  --bg-secondary: var(--gray-800);
  --bg-tertiary: var(--gray-700);
  --text-primary: var(--white);
  --text-secondary: var(--gray-300);
  --text-muted: var(--gray-400);
  --text-inverse: var(--gray-900);
  --border-color: var(--gray-700);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global Layout */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
}

.container,
.container-fluid,
.row,
.col {
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

table td,
table th {
  overflow-wrap: break-word;
  max-width: 0;
}

.form-control,
input,
select,
textarea {
  max-width: 100%;
  box-sizing: border-box;
}

.card,
.card-body {
  max-width: 100%;
  overflow-x: auto;
}

pre,
code {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* Sidebar - Hidden on desktop, visible on mobile */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  color: white;
  z-index: 999;
  display: none;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}

.sidebar__header {
  padding: 1rem 1rem 0.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  text-align: justify;
}

.sidebar__controls-section {
  padding: 0.5rem 1rem 0.75rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.02) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__header-controls {
  display: flex;
  gap: 0.375rem;
  justify-content: center;
  padding: 0.2rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar__header-controls .sidebar__control-btn {
  background: transparent;
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.25s ease;
  border: none;
  font-size: 0.9rem;
  width: 32px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar__header-controls .sidebar__control-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  transform: scale(1.05);
}

.sidebar__profile-toggle {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.75rem;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.25s ease;
}

.sidebar__profile-toggle:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
  transform: translateY(-1px);
}

.sidebar__brand {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.5rem;
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.sidebar__menu {
  padding: 1rem 0;
  overflow: hidden auto;
  height: calc(100vh - 140px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar__menu::-webkit-scrollbar {
  width: 2px;
}

.sidebar__menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar__menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 300;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.sidebar__link:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  color: white;
  transform: translateX(4px);
}

.sidebar__link--active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  font-weight: 400;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.sidebar__icon {
  font-size: 1rem;
  margin-right: 0.75rem;
  width: 18px;
  text-align: center;
}

.sidebar__divider {
  font-size: 0.65rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem;
  padding: 0.5rem 0;
  position: relative;
}

.sidebar__divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin: 110px 0 0 0;
  padding: 24px 24px 24px 0;
  background: #f8fafc;
  min-height: calc(100vh - 110px);
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.main-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Header System */
.main-header {
  background: #000080;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  width: 100%;
  transition: var(--transition);
  pointer-events: auto;
}

/* Finance Dashboard Enhancements */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--bg-primary); border-radius: var(--border-radius); box-shadow: var(--shadow); padding: 16px; color: var(--text-primary); }
.card__header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.card__title { font-size: var(--font-size-2xl); font-weight:600; color:var(--text-primary); }
.kpi-card { padding: 14px; border-radius: 10px; display:flex; flex-direction:column; justify-content:space-between; gap:8px; min-height:110px; }
.kpi-card__value { font-size: 1.25rem; font-weight:700; }
.kpi-card__label { font-size: 0.775rem; color: var(--text-muted); }
.header-actions { display:flex; gap:8px; align-items:center; margin-bottom:16px; }
.header-actions .form-control { height:36px; padding:6px 8px; }

/* Funnel and list improvements */
.funnel-container { gap: 12px; }
.funnel-stage { padding: 12px; }
.funnel-number { font-size: 1.25rem; }

/* Tables and lists */
.table { background: transparent; }
.table thead th { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; }

/* Dropdown sizing for customer filter */
#customerFilter { min-width: 260px; max-width: 420px; }

/* Chart container responsive tweaks */
canvas { width: 100% !important; height: auto !important; }

/* Stat-card component (moved from finance dashboard view) */
.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.stat-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(0,0,0,0.01), transparent);
}
.stat-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.stat-card__controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.stat-card__body {
  padding: 1rem;
}
.btn-icon {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
}
.btn-icon[title] { position: relative; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Small loading spinner for async actions */
.mini-spinner { display:inline-block; width:18px; height:18px; border-radius:50%; border:2px solid rgba(0,0,0,0.08); border-top-color:var(--primary); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Small cards for highlight values */
.highlight-card { margin-top:10px; padding:10px; background:var(--bg-secondary); border-radius:8px; display:inline-block; }

/* Responsive adjustments */
@media (max-width: 768px) {
  #customerFilter { min-width: 140px; }
  /* dashboard-grid: 2-col minimum enforced in responsive-mobile.css */
  .kpi-card { min-height: 90px; }
}

/* Unified stat-card used for finance charts */
.stat-card { background: var(--bg-primary); border-radius: var(--border-radius); box-shadow: var(--shadow); padding: 12px; color: var(--text-primary); display:flex; flex-direction:column; }
.stat-card__header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.stat-card__title { display:flex; align-items:center; gap:10px; }
.stat-card__icon { font-size:1.375rem; }
.stat-card__label { font-weight:600; font-size:0.95rem; }
.stat-card__sub { font-size:0.75rem; color:var(--text-muted); }
.stat-card__actions button { font-size:0.8rem; padding:6px 8px; }
.stat-card__body { display:flex; flex-direction:column; gap:10px; margin-top:8px; }
.stat-card__meta { display:flex; gap:16px; align-items:center; }
.stat-card__meta small { display:block; color:var(--text-muted); font-size:0.72rem; }
.stat-card__meta-value { font-weight:700; font-size:1rem; margin-top:4px; }
.stat-card__chart { width:100%; min-height:180px; display:flex; align-items:center; }
.stat-card__chart canvas { width:100% !important; height:180px !important; }

@media (min-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
}


.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  pointer-events: auto;
  position: relative;
  overflow: visible;
}

.header__nav-container {
  padding: 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  /*border-top: 1px solid rgba(255, 255, 255, 0.1);*/
}

@media (width <= 1024px) {
  .header__nav-container {
    display: none;
  }
  
  .main-header {
    height: 60px;
  }
  
  .main-content {
    margin-top: 60px;
  }
}

.header__nav-container::-webkit-scrollbar {
  display: none;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f1f5f9;
  font-weight: 600;
  font-size: 18px;
  /* Allow brand to shrink so controls always stay visible */
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}

.brand-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
}

.role-badge {
  background: #475569;
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #64748b;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
  padding-left: 24px;
}

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  z-index: 10001;
  position: relative;
}

.nav-dropdown-btn:hover {
  background: #475569;
  border-color: #64748b;
  color: #f1f5f9;
}

.nav-dropdown-menu {
  display: none;
  position: fixed;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 10px 10px -5px rgba(0, 0, 0, 0.2);
  margin-top: 8px;
  overflow: hidden;
  min-width: 200px;
  z-index: 99999;
  backdrop-filter: blur(20px);
}

.nav-dropdown-menu.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: dropdownFadeIn 0.2s ease-out;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-dropdown-item:hover {
  background: #334155;
  color: #f1f5f9;
  border-left-color: #64748b;
  transform: translateX(4px);
}

.nav-dropdown-item--active {
  background: #475569;
  color: #f1f5f9;
  border-left-color: #94a3b8;
  font-weight: 600;
}

.header__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 10002;
  pointer-events: auto;
  flex-shrink: 0;
  min-width: 0;
  overflow: visible;
}

.control-btn,
.profile-btn {
  background: #334155;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 10001;
}

.control-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-btn {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none;
  position: relative;
  z-index: 10005 !important;
}

.control-btn:hover,
.profile-btn:hover {
  background: #475569;
  border-color: #64748b;
  color: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-avatar {
  width: 26px;
  height: 26px;
  background: #64748b;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  color: #f1f5f9;
}

.profile-name {
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e2e8f0;
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  color: #94a3b8;
}

.profile-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 10px 10px -5px rgba(0, 0, 0, 0.2);
  margin-top: 8px;
  overflow: hidden;
  min-width: 200px;
  z-index: 10003 !important;
  pointer-events: auto;
}

.profile-menu.show {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  animation: slideDown 0.3s ease;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.profile-menu-item:hover {
  background: #334155;
  color: #f1f5f9;
  border-left-color: #64748b;
  transform: translateX(4px);
}

.profile-menu-item--danger {
  color: #f87171;
}

.profile-menu-item--danger:hover {
  background: #450a0a;
  color: #fca5a5;
  border-left-color: #dc2626;
}

.profile-menu-divider {
  height: 1px;
  background: #475569;
  margin: 8px 0;
}

.menu-icon {
  margin-right: 12px;
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  border: 1px solid #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Notification System */
.notification-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 350px;
  max-width: calc(100vw - 40px);
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 10010;
  max-height: 400px;
  overflow: hidden;
  display: none;
  box-sizing: border-box;
}

.notification-header {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  position: relative;
  z-index: 10001;
}

.notification-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.view-all-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
}

.notification-list {
  max-height: 300px;
  overflow-y: auto;
  background: white;
}

.notification-loading {
  padding: 16px;
  text-align: center;
  color: #6b7280;
}

.notification-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
}

.notification-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  color: #1f2937;
}

.notification-message {
  font-size: 12px;
  color: #6b7280;
}

.notification-time {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

/* Cards */
.card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: visible; /* was: hidden — clips fixed-position modal overlays */
  transition: var(--transition);
}

.card:hover {
  /* Removed transform:translateY(-1px) — a transform creates a stacking
     context that traps position:fixed descendants (modal overlays) inside
     the card instead of the viewport. Use box-shadow lift instead. */
  box-shadow: var(--shadow);
}

.card__header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card__title {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.card__body {
  padding: var(--space-3) var(--space-4);
}

.card__footer {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

/* KPI Cards */
.kpi-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  padding: var(--space-2) var(--space-3);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.kpi-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.kpi-card__value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  text-align: center;
}

.kpi-card__label {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  text-align: center;
  margin-bottom: var(--space-2);
}

.kpi-card__status {
  text-align: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: 16px;
}

.kpi-card__status--pending {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  gap: var(--space-2);
}

.btn--primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.btn--primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.btn--secondary {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--text-primary);
  border: 1px solid rgba(226, 232, 240, 0.5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn--secondary:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn--danger {
  background: #f3f4f6;
  color: #dc2626;
  border-color: #e5e7eb;
}

.btn--danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn--warning {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.btn--warning:hover {
  background: #b45309;
  border-color: #b45309;
}

.btn--sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn--block {
  width: 100%;
  margin-bottom: 0.5rem;
}

.btn-group {
  display: flex;
  gap: 0.25rem;
}

/* Action Buttons */
.ab-container {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  outline: none;
  position: relative;
}

.ab-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.05);
}

.ab-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

.ab-btn--view {
  color: #3b82f6;
}

.ab-btn--view:hover {
  background: #3b82f6;
  color: white;
}

.ab-btn--edit {
  color: #f59e0b;
}

.ab-btn--edit:hover {
  background: #f59e0b;
  color: white;
}

.ab-btn--delete {
  color: #dc2626 !important;
}

.ab-btn--delete:hover {
  background: #dc2626 !important;
  color: white !important;
}

.ab-btn--progress {
  color: #8b5cf6;
}

.ab-btn--progress:hover {
  background: #8b5cf6;
  color: white;
}

.ab-btn--warning {
  color: #f59e0b;
}

.ab-btn--warning:hover {
  background: #f59e0b;
  color: white;
}

.ab-btn--success {
  color: #10b981;
}

.ab-btn--success:hover {
  background: #10b981;
  color: white;
}

.ab-btn--approve {
  color: #10b981;
}

.ab-btn--approve:hover {
  background: #10b981;
  color: white;
}

.ab-btn--reject {
  color: #f43f5e;
}

.ab-btn--reject:hover {
  background: #f43f5e;
  color: white;
}

.ab-btn--reset {
  color: #6366f1;
}

.ab-btn--reset:hover {
  background: #6366f1;
  color: white;
}

.ab-btn--info {
  color: #3b82f6;
}

.ab-btn--info:hover {
  background: #3b82f6;
  color: white;
}



/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .ab-container {
    gap: 4px;
  }
  .ab-btn {
    width: 28px;
    height: 28px;
  }
  .ab-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* Badges */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge--success {
  /*background: #d1fae5;*/
  color: #059669;
}

.badge--warning {
  /*background: #fef3c7;*/
  color: #d97706;
}

.badge--danger {
  /*background: #fee2e2;*/
  color: #dc2626;
}

.badge--info {
  /*background: #dbeafe;*/
  color: #1d4ed8;
}

.badge--pending {
  /*background: #fce7f3;*/
  color: #be185d;
}

.badge--inactive {
  /*background: #dbeafe !important;*/
  color: #1d4ed8 !important;
}

.badge--suspended {
  /*background: #fef3c7 !important;*/
  color: #92400e !important;
}

.badge--terminated {
  /*background: #fee2e2 !important;*/
  color: #dc2626 !important;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

.table tbody tr:hover {
  background: var(--bg-secondary);
}

/* Table Header Filter & Sort */
.table-header__cell {
  position: relative;
  cursor: pointer;
  user-select: none;
  padding: 12px 8px;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.table-header__cell:hover {
  background: var(--bg-hover);
}

.table-header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.table-header__text {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
}

.table-header__controls {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 1;
  transition: all 0.2s ease;
}

.table-header__cell:not(:hover, .table-header__cell--active) .table-header__controls {
  opacity: 0.3;
}

.table-header__sort {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border-radius: 3px;
  cursor: pointer;
}

.table-header__sort:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

.table-header__sort--active {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.table-header__filter {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 3px;
}

.table-header__filter:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

.table-header__filter--active {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}

.table-filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 12px;
  min-width: 200px;
  display: none;
}

.table-filter-dropdown--show {
  display: block;
  animation: filterDropdownFadeIn 0.2s ease-out;
}

.filter-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.filter-btn {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-btn--primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-btn--primary:hover {
  background: #1d4ed8;
}

.filter-btn:hover {
  background: var(--bg-hover);
}

.filter-options {
  max-height: 200px;
  overflow-y: auto;
  margin: 8px 0;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.filter-option:hover {
  background: var(--bg-hover);
  border-radius: 4px;
  padding-left: 4px;
  padding-right: 4px;
}

.table-header__cell--filtered {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.12));
  border-bottom: 2px solid var(--primary);
  position: relative;
}

.table-header__cell--filtered::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.table-header__cell--sorted {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.12));
  border-bottom: 2px solid #22c55e;
  position: relative;
}

.table-header__cell--sorted::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: #22c55e;
  border-radius: 0 2px 2px 0;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.form-control {
  width: 100%;
  padding: var(--space-3);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: var(--bg-primary);
  margin: 5% auto;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 100000;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
  padding: var(--space-4);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
  font-size: var(--font-size-base);
  display: block;
  visibility: visible;
  opacity: 1;
}

.alert--success {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.2);
}

.alert--warning {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.2);
}

.alert--error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--error);
  border-color: rgba(220, 38, 38, 0.2);
}

.alert--info {
  background: rgba(2, 132, 199, 0.1);
  color: var(--info);
  border-color: rgba(2, 132, 199, 0.2);
}

/* Alert icons visibility */
.alert i,
.alert .bi,
.alert svg {
  color: inherit;
  opacity: 1;
  visibility: visible;
}

/* Layout Components */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
}

.page-title h1 {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
}

.page-title p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

.page-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
  align-items: center;
}

.view-options {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-1);
  margin-right: var(--space-3);
}

.view-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: calc(var(--border-radius) - 2px);
  transition: var(--transition);
  cursor: pointer;
}

.view-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.view-btn--active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.view-btn--active:hover {
  background: var(--primary-dark);
  color: white;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  margin-top: var(--space-6);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2);
}

/* User Components */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* Empty State Components - Replacing inline styles */
.empty-state-actions {
  margin-top: 15px;
}

.empty-state-list {
  text-align: left;
  display: inline-block;
  margin: 10px 0;
}

.btn-spaced {
  margin-right: 10px;
}

/* Utility Classes */
.view--active {
  display: block;
}

.view--hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.text-primary {
  color: var(--primary);
  text-decoration: none;
}

.text-primary:hover {
  text-decoration: underline;
}

/* Animations */
@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes filterDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* Mobile Card View for Tables */
@media (width <= 768px) {
  .table-responsive {
      display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .mobile-card-container {
    display: block;
  }
  
  .table {
    min-width: 600px;
    font-size: 14px;
  }
  
  .mobile-card-container {
    display: block;
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .task-card, .item-card {
    background: white;
    border-radius: 25px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    position: relative;
    max-height: none;
    overflow: visible;
  }
  
  .task-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
  }
  
  .task-card__title {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.3;
  }
  
  .task-card__priority {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
  }
  
  .task-card__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    max-height: 200px;
    overflow-y: auto;
  }
  
  .task-card__field {
    display: flex;
    flex-direction: column;
  }
  
  .task-card__label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
  }
  
  .task-card__value {
    color: #1f2937;
    font-weight: 500;
  }
  
  .task-card__status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
  }
  
  .task-card__progress {
    margin: 12px 0;
  }
  
  .progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
  }
  
  .progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s ease;
  }
  
  .progress-text {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
  }
  
  /*.task-card__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
  }*/
  
  .card-action-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  .card-action-btn--view {
    background: #dbeafe;
    color: #1d4ed8;
  }
  
  .card-action-btn--edit {
    background: #fef3c7;
    color: #d97706;
  }
  
  .card-action-btn--delete {
    background: #fee2e2;
    color: #dc2626;
  }
  
  .status-pending { background: #fef3c7; color: #d97706; }
  .status-in-progress { background: #dbeafe; color: #1d4ed8; }
  .status-completed { background: #d1fae5; color: #059669; }
  .status-overdue { background: #fee2e2; color: #dc2626; }
  
  .priority-high { }
  .priority-medium { }
  .priority-low { }
  
  .mobile-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
  }
  
  .mobile-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
  }
  
  .mobile-card__title {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    margin: 0;
  }
  
  .mobile-card__status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
  }
  
  .mobile-card__body {
    margin-bottom: 12px;
  }
  
  .mobile-card__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
  }
  
  .mobile-card__label {
    color: #6b7280;
    font-weight: 500;
  }
  
  .mobile-card__value {
    color: #1f2937;
    text-align: right;
  }
  
  .mobile-card__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
  }
  
  .mobile-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
  }
  
  .mobile-btn--primary {
    background: #3b82f6;
    color: white;
  }
  
  .mobile-btn--secondary {
    background: #f3f4f6;
    color: #374151;
  }
  
  .mobile-btn--danger {
    background: #ef4444;
    color: white;
  }
  
  .kanban-view,
  .view-btn[href*="kanban"],
  .nav-dropdown-item[href*="kanban"],
  [data-view="kanban"],
  .kanban-board,
  .kanban-container {
    display: none !important;
  }
}

@media (width > 768px) {
  .mobile-card-view {
    display: none;
  }
}

/* Mobile and Tablet Responsive Design */

/* Tablet Landscape (1024px and below) */
@media (width <= 1024px) {
  .main-content {
    margin: 110px 0 0 0;
    padding: 16px 16px 16px 0;
    width: 100%;
  }

  .sidebar {
    display: flex;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .header__nav {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .header__nav::-webkit-scrollbar {
    display: none;
  }

  .nav-dropdown-btn {
    white-space: nowrap;
    min-width: max-content;
  }
}

/* ── Header mobile responsive fixes ───────────────────────────────────────
   Priority order (always visible): menu-toggle → brand-icon → [controls]
   Hidden progressively: role-badge → brand-text (already hidden ≤768px)
   Attendance button: collapses to icon-only on small screens
   ──────────────────────────────────────────────────────────────────────── */

/* Tablet portrait and below (≤768px) */
@media (max-width: 768px) {
  .header__top {
    padding: 0 10px;
    height: 60px;
    gap: 6px;
  }

  .header__controls {
    gap: 5px;
  }

  /* Hide role badge — saves ~60px */
  .role-badge {
    display: none;
  }

  /* Attendance button: keep icon, hide text label */
  .btn--attendance-toggle .btn-text {
    display: none;
  }
  .btn--attendance-toggle {
    padding: 6px 8px !important;
    min-height: 36px !important;
    min-width: 36px;
    gap: 0;
  }

  /* Icon-only control buttons */
  .control-btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    min-width: 34px;
    flex-shrink: 0;
  }

  /* Profile button: avatar only, no name or arrow */
  .profile-btn {
    padding: 5px 7px;
    gap: 0;
    flex-shrink: 0;
  }
  .profile-btn .dropdown-arrow {
    display: none;
  }

  /* Notification badge stays visible */
  .notification-btn,
  #notificationBtn {
    display: flex !important;
    visibility: visible !important;
    flex-shrink: 0;
  }

  /* Profile button always visible */
  #profileButton {
    display: flex !important;
    visibility: visible !important;
    flex-shrink: 0;
  }

  /* PWA install button: hide on mobile to save space */
  #pwa-install-btn {
    display: none !important;
  }

  /* Attendance controls wrapper: no extra padding */
  .attendance-controls {
    flex-shrink: 0;
  }
}

/* Small mobile (≤480px) — tightest layout */
@media (max-width: 480px) {
  .header__top {
    padding: 0 8px;
    gap: 4px;
  }

  .header__controls {
    gap: 4px;
  }

  /* Slightly smaller icon buttons */
  .control-btn {
    width: 32px;
    height: 32px;
    min-height: 32px;
    min-width: 32px;
  }

  .profile-btn {
    padding: 4px 6px;
  }

  .profile-avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .btn--attendance-toggle {
    padding: 5px 7px !important;
    min-height: 32px !important;
    min-width: 32px;
  }

  /* Brand icon only — no gap needed */
  .header__brand {
    gap: 6px;
  }

  .brand-icon {
    font-size: 20px;
  }

  .mobile-menu-toggle {
    padding: 6px;
    font-size: 1.25rem;
  }
}
/* ── End header mobile fixes ─────────────────────────────────────────────── */

/* Tablet Portrait (768px and below) */
@media (width <= 768px) {
  .main-content {
    margin-top: 140px;
    padding: 12px;
  }

  .header__top {
    padding: 8px 12px;
  }

  .header__brand .brand-text {
    display: none;
  }

  .header__nav-container {
    padding: 4px 0;
  }

  .nav-dropdown-btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .nav-dropdown-menu {
    min-width: 180px;
    right: 0;
    left: auto;
  }

  .profile-btn .profile-name {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .page-actions {
    flex-direction: column;
    gap: var(--space-2);
  }

  .view-options {
    order: 2;
    justify-content: center;
  }

  /* dashboard-grid: 2-col minimum enforced in responsive-mobile.css */
  .admin-grid,
  .user-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .kpi-card {
    padding: var(--space-3);
  }

  .kpi-card__value {
    font-size: 1.5rem;
  }

  .card__header {
    padding: var(--space-3);
  }

  .card__body {
    padding: var(--space-3);
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 600px;
  }

  .table th,
  .table td {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
  }

  .ab-container {
    gap: 2px;
    flex-wrap: nowrap;
  }

  .ab-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .ab-btn svg {
    width: 14px;
    height: 14px;
  }

  .table-header__controls {
    opacity: 1;
  }

  .table-filter-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 300px;
    z-index: 10001;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    justify-content: center;
    text-align: center;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--space-3);
  }

  .followup-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .followup-meta {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .followup-actions {
    flex-direction: column;
    gap: var(--space-2);
  }
}

/* Mobile Scrolling Fixes */
@media (width <= 768px) {
  html, body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  .main-content {
    padding-bottom: 100px;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Removed: * { -webkit-transform: translate3d(0,0,0) }
     This wildcard transform created a stacking context on every element,
     which trapped position:fixed descendants (modals) inside the scroll
     container instead of the viewport, causing bottom-sticking on mobile. */

/* Mobile Button Optimizations */
  /* Scoped to form/page action contexts only — NOT .action-buttons grid */
  .page-actions .btn,
  .form-actions .btn,
  .btn-group .btn {
    min-height: 48px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
  }
  
  .btn-group {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  
  .page-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    margin: 16px -16px -16px;
  }
  
  .ab-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  
  .control-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
  }
  
  .action-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10000;
  }
  
  .action-sheet.show {
    transform: translateY(0);
  }
  
  .action-sheet__handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 16px;
  }
  
  .action-sheet__item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 16px;
    color: #374151;
    text-decoration: none;
  }
  
  .action-sheet__icon {
    margin-right: 12px;
    font-size: 20px;
  }
}

/* Mobile (480px and below) */
@media (width <= 480px) {
  .main-content {
    margin-top: 120px;
    padding: 8px;
  }

  .header__top {
    padding: 6px 8px;
  }

  .header__controls {
    gap: 4px;
  }

  .control-btn,
  .profile-btn {
    width: 32px;
    height: 32px;
    padding: 4px;
  }

  .profile-avatar {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .nav-dropdown-btn {
    padding: 4px 6px;
    font-size: 11px;
  }

  .nav-dropdown-menu {
    min-width: 160px;
  }

  .page-title h1 {
    font-size: var(--font-size-2xl);
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .kpi-card {
    padding: var(--space-2);
  }

  .kpi-card__value {
    font-size: 1.25rem;
  }

  .kpi-card__label {
    font-size: 10px;
  }

  .card__header,
  .card__body {
    padding: var(--space-2);
  }

  .table {
    min-width: 500px;
  }

  .table th,
  .table td {
    padding: var(--space-1) var(--space-2);
    font-size: 12px;
  }

  .ab-btn {
    width: 24px;
    height: 24px;
  }

  .ab-btn svg {
    width: 12px;
    height: 12px;
  }

  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
  }

  .form-control {
    padding: var(--space-2);
    font-size: var(--font-size-sm);
  }

  .modal-content {
    width: 98%;
    margin: 5% auto;
  }

  .followup-card {
    padding: var(--space-2);
  }

  .followup-title {
    font-size: var(--font-size-sm);
  }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

@media (width <= 1024px) {
  .mobile-menu-toggle {
    display: block;
  }
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.mobile-overlay.active {
  display: block;
}

/* Responsive Tables Enhancement */
@media (width <= 768px) {
  .table-responsive {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
  }

  .table-mobile-scroll {
    position: relative;
  }

  .table-mobile-scroll::after {
    content: '← Scroll to see more →';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
  }

  /* Table column responsive widths */
  .col-title {
    width: 40%;
    min-width: 200px;
  }

  .col-assignment {
    width: 25%;
    min-width: 150px;
  }

  .col-progress {
    width: 20%;
    min-width: 120px;
  }

  .col-date {
    width: 15%;
    min-width: 100px;
  }

  .col-actions {
    width: 80px;
    min-width: 80px;
  }

  .assignment-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .assigned-user {
    font-size: 12px;
    font-weight: 500;
  }

  .priority-badge .badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .progress-container {
    min-width: 100px;
  }

  .progress-bar {
    height: 6px;
    margin-bottom: 4px;
  }

  .progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
  }

  .cell-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .cell-primary {
    font-size: 12px;
    font-weight: 500;
  }

  .cell-secondary {
    font-size: 10px;
    color: var(--text-muted);
  }

  /* Leaves table columns */
  .col-employee {
    width: 25%;
    min-width: 120px;
  }

  .col-type {
    width: 15%;
    min-width: 100px;
  }

  .col-start-date {
    width: 15%;
    min-width: 100px;
  }

  .col-end-date {
    width: 15%;
    min-width: 100px;
  }

  .col-days {
    width: 10%;
    min-width: 60px;
  }

  .col-status {
    width: 12%;
    min-width: 80px;
  }

  /* Expenses table columns */
  .col-description {
    width: 30%;
    min-width: 150px;
  }

  .col-amount {
    width: 15%;
    min-width: 100px;
  }

  .col-date {
    width: 15%;
    min-width: 100px;
  }
}

/* Form Enhancements */
@media (width <= 768px) {
  .form-group {
    margin-bottom: var(--space-4);
  }

  .form-label {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-1);
  }

  select.form-control {
    background-size: 16px;
  }
}

/* Card Stack on Mobile */
@media (width <= 480px) {
  .dashboard-grid.user-grid {
    grid-template-columns: repeat(2, 1fr); /* keep 2-col minimum */
  }

  .card.recent-activities .table-responsive {
    font-size: 12px;
  }

  .header-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
  }

  .header-actions .btn {
    width: 100%;
  }

  .header-actions .btn .btn-text {
    display: none;
  }
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (width <= 480px) {
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr); /* keep 2-col minimum */
    gap: var(--space-2);
  }
}

/* Dark Theme Overrides */
[data-theme='dark'] body {
  background: var(--gray-900);
  color: var(--white);
}

[data-theme='dark'] .main-content {
  background: var(--gray-900);
  color: var(--white);
}

[data-theme='dark'] .card {
  background: var(--gray-800);
  border-color: var(--gray-700);
  color: var(--white);
}

[data-theme='dark'] .card__header {
  background: var(--gray-700);
  border-color: var(--gray-600);
  color: var(--white);
}

[data-theme='dark'] .card__title {
  color: var(--white);
}

[data-theme='dark'] .table {
  background: var(--gray-800);
  color: var(--white);
}

[data-theme='dark'] .table th {
  background: var(--gray-700);
  color: var(--white);
  border-color: var(--gray-600);
}

[data-theme='dark'] .table td {
  color: var(--white);
  border-color: var(--gray-700);
}

[data-theme='dark'] .table tbody tr:hover {
  background: var(--gray-700);
}

[data-theme='dark'] .form-control {
  background: var(--gray-800);
  border-color: var(--gray-600);
  color: var(--white);
}

[data-theme='dark'] .form-control:focus {
  border-color: var(--primary);
  background: var(--gray-700);
}

[data-theme='dark'] .btn--secondary {
  background: var(--gray-700);
  color: var(--white);
  border-color: var(--gray-600);
}

[data-theme='dark'] .btn--secondary:hover {
  background: var(--gray-600);
  border-color: var(--gray-500);
}

[data-theme='dark'] .kpi-card {
  background: var(--gray-800);
  border-color: var(--gray-700);
  color: var(--white);
}

[data-theme='dark'] .modal-content {
  background: var(--gray-800);
  color: var(--white);
}

[data-theme='dark'] .modal-header {
  border-color: var(--gray-700);
}

[data-theme='dark'] .modal-footer {
  border-color: var(--gray-700);
}

[data-theme='dark'] .notification-dropdown {
  background: var(--gray-800);
  border-color: var(--gray-700);
}

[data-theme='dark'] .notification-item {
  background: var(--gray-800);
  border-color: var(--gray-700);
  color: var(--white);
}

[data-theme='dark'] .notification-title {
  color: var(--white);
}

[data-theme='dark'] .notification-message {
  color: var(--gray-300);
}

/* Missing Dark Theme Selectors */
[data-theme='dark'] .main-header {
  background: var(--gray-900);
}

[data-theme='dark'] .header__top {
  background: var(--gray-900);
}

[data-theme='dark'] .header__brand .brand-text {
  color: var(--white);
}

[data-theme='dark'] .role-badge {
  background: var(--gray-700);
  color: var(--gray-300);
  border-color: var(--gray-600);
}

[data-theme='dark'] .control-btn,
[data-theme='dark'] .profile-btn {
  background: var(--gray-700);
  border-color: var(--gray-600);
  color: var(--gray-300);
}

[data-theme='dark'] .control-btn:hover,
[data-theme='dark'] .profile-btn:hover {
  background: var(--gray-600);
  border-color: var(--gray-500);
  color: var(--white);
}

[data-theme='dark'] .nav-dropdown-btn {
  background: var(--gray-700);
  border-color: var(--gray-600);
  color: var(--gray-300);
}

[data-theme='dark'] .nav-dropdown-btn:hover {
  background: var(--gray-600);
  border-color: var(--gray-500);
  color: var(--white);
}

[data-theme='dark'] .nav-dropdown-menu {
  background: var(--gray-800);
  border-color: var(--gray-600);
}

[data-theme='dark'] .nav-dropdown-item {
  color: var(--gray-300);
}

[data-theme='dark'] .nav-dropdown-item:hover {
  background: var(--gray-700);
  color: var(--white);
  border-left-color: var(--gray-500);
}

[data-theme='dark'] .nav-dropdown-item--active {
  background: var(--gray-600);
  color: var(--white);
  border-left-color: var(--gray-400);
}

[data-theme='dark'] .admin-card,
[data-theme='dark'] .user-card {
  background: var(--gray-800);
  border-color: var(--gray-700);
  color: var(--white);
}

[data-theme='dark'] .view-options {
  background: var(--gray-800);
  border-color: var(--gray-700);
}

[data-theme='dark'] .view-btn {
  color: var(--gray-300);
}

[data-theme='dark'] .view-btn:hover {
  background: var(--gray-700);
  color: var(--white);
}

[data-theme='dark'] .view-btn--active {
  background: var(--primary);
  color: white;
}

[data-theme='dark'] .view-btn--active:hover {
  background: var(--primary-dark);
  color: white;
}

/* Global Navigation Buttons */
.global-back-btn {
  position: fixed;
  top: 120px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.global-forward-btn {
  position: fixed;
  top: 120px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.global-back-btn:hover,
.global-forward-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.global-back-btn svg,
.global-forward-btn svg {
  color: #374151;
  transition: color 0.2s ease;
}

.global-back-btn:hover svg,
.global-forward-btn:hover svg {
  color: #1f2937;
}

/* Desktop only - hide on mobile/tablet */
@media (max-width: 1024px) {
  .global-back-btn.desktop-only,
  .global-forward-btn.desktop-only {
    display: none;
  }
}

/* Z-index fixes */
.modal {
  z-index: 99999 !important;
}

/* Removed: .modal-content { z-index: 100000 !important }
   .modal-content must NOT have a higher z-index than its overlay parent.
   Doing so forces a separate stacking context, causing a two-step paint
   (overlay first, content on top) which appears as a flicker on open.
   The overlay's z-index is sufficient for the entire modal stack. */

.modal-backdrop {
  z-index: 99998 !important;
}

#followupModal,
#rescheduleModal,
#historyModal {
  z-index: 100001 !important;
}

#followupModal .modal-content,
#rescheduleModal .modal-content,
#historyModal .modal-content {
  z-index: 100002 !important;
}

/* Follow-ups Timeline */
.followups-timeline {
  max-width: 1000px;
  margin: 0 auto;
}

.followups-modern {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.followup-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-4);
  transition: var(--transition);
  position: relative;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.followup-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.followup-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.followup-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.followup-icon.task-linked {
  background: #3b82f6;
  color: white;
}

.followup-icon.standalone {
  background: #10b981;
  color: white;
}

.followup-title-section {
  flex: 1;
  min-width: 0;
}

.followup-title {
  margin: 0 0 var(--space-1) 0;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1.3;
}

.followup-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.followup-date {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.followup-date svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.overdue-date {
  color: #dc2626 !important;
}

.overdue-label {
  background: #dc2626;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  margin-left: var(--space-2);
}

.followup-badges {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.badge--modern {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.badge--outline {
  background: transparent;
  border: 1px solid currentcolor;
  color: var(--text-secondary);
}

.followup-description {
  margin: var(--space-3) 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.linked-task {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  border-radius: var(--border-radius);
  margin: var(--space-3) 0;
  font-size: var(--font-size-sm);
  color: #0c4a6e;
}

.linked-task__icon {
  width: 20px;
  height: 20px;
  background: #0ea5e9;
  color: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.followup-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
}

.btn--modern {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 12px;
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs);
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn--modern svg {
  width: 12px;
  height: 12px;
}

.btn--modern:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn--modern.btn--outline {
  background: transparent;
  border: 1px solid currentcolor;
}

.btn--modern.btn--outline:hover {
  background: currentcolor;
  color: white;
}

.btn--danger {
  background: #dc2626;
  color: white;
}

.btn--danger {
  background: #ef4444 !important;
  color: white !important;
  border: 1px solid #dc2626 !important;
}

.btn--danger:hover {
  background: #dc2626 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

.btn--info {
  background: #3b82f6 !important;
  color: white !important;
  border: 1px solid #2563eb !important;
}

.btn--info:hover {
  background: #2563eb !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

.btn--info.btn--outline {
  background: transparent !important;
  color: #3b82f6 !important;
  border: 2px solid #3b82f6 !important;
}

.btn--info.btn--outline:hover {
  background: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
}

.btn--success {
  background: #10b981 !important;
  color: white !important;
  border: 1px solid #059669 !important;
}

.btn--success:hover {
  background: #059669 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
}

.btn--warning {
  background: #f59e0b !important;
  color: white !important;
  border: 1px solid #d97706 !important;
}

.btn--warning:hover {
  background: #d97706 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

.followup-card:nth-child(1)::after {
  content: '⭐ Priority';
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 12px;
}

@media (width <= 768px) {
  .followup-card__header {
    flex-wrap: wrap;
  }

  .followup-badges {
    flex-wrap: wrap;
  }

  .followup-actions {
    flex-direction: column;
  }
}
