/* ==========================================================================
   AdGenerator - Professional Admin Design System
   ========================================================================== */

:root {
  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Brand & Theme Colors */
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-primary-subtle: rgba(79, 70, 229, 0.08);
  --color-primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --color-primary-glow: rgba(99, 102, 241, 0.25);

  /* Functional Accents */
  --color-success: #10b981;
  --color-success-subtle: #dcfce7;
  --color-success-text: #065f46;

  --color-warning: #f59e0b;
  --color-warning-subtle: #fef3c7;
  --color-warning-text: #92400e;

  --color-danger: #ef4444;
  --color-danger-subtle: #fee2e2;
  --color-danger-text: #991b1b;

  --color-info: #0ea5e9;
  --color-info-subtle: #e0f2fe;
  --color-info-text: #0369a1;

  /* Surfaces & Layout */
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-card-muted: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;

  /* Typography Colors */
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;

  /* Sidebar Dark Surface */
  --sidebar-bg: #0b0f19;
  --sidebar-surface: #111827;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f8fafc;
  --sidebar-active-bg: rgba(99, 102, 241, 0.12);
  --sidebar-active-text: #ffffff;

  /* Border Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Elevations & Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 4px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -1px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -3px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 30px -6px rgba(15, 23, 42, 0.12), 0 8px 12px -4px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 6px 20px -2px var(--color-primary-glow);
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .brand {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

/* ==========================================================================
   Application Shell & Layout
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex: 0 0 260px;
  border-right: 1px solid var(--sidebar-border);
  z-index: 40;
}

.app-sidebar-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-border) transparent;
}

.app-sidebar-inner::-webkit-scrollbar {
  width: 4px;
}
.app-sidebar-inner::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
  border-radius: var(--radius-pill);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 24px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-primary-gradient);
  color: #ffffff;
  font-size: 17px;
  box-shadow: 0 4px 14px var(--color-primary-glow);
  transition: transform 0.2s ease;
}

.brand:hover .brand-mark {
  transform: scale(1.05);
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(165, 180, 252, 0.2);
  margin-left: auto;
}

/* Sidebar Navigation */
.nav-section {
  margin: 18px 10px 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.app-nav-link .nav-icon-wrap {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 15px;
  transition: all 0.15s ease;
}

.app-nav-link:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-surface);
  transform: translateX(2px);
}

.app-nav-link:hover .nav-icon-wrap {
  color: #ffffff;
}

.app-nav-link.active {
  color: #ffffff;
  background: var(--sidebar-active-bg);
  font-weight: 600;
}

.app-nav-link.active .nav-icon-wrap {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.16);
}

.app-nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: #6366f1;
  box-shadow: 0 0 10px #6366f1;
}

/* Sidebar Footer User Card */
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}

.sidebar-user-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-user-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-gradient);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: var(--color-success);
  border: 2px solid var(--sidebar-bg);
  border-radius: 50%;
}

.sidebar-user-meta {
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.sidebar-user-role {
  font-size: 11px;
  color: #64748b;
  line-height: 1.2;
}

.sidebar-logout-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  background: transparent;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-logout-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   Main Shell & Topbar
   ========================================================================== */

.app-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Topbar */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

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

.breadcrumb-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
}

.breadcrumb-label .breadcrumb-home {
  color: var(--color-text-light);
  display: inline-flex;
  align-items: center;
}

.breadcrumb-label .breadcrumb-separator {
  color: var(--color-border);
  font-size: 12px;
}

.breadcrumb-label strong {
  color: var(--color-text);
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* API Status Chip */
.api-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.api-status-chip:hover {
  background: #dcfce7;
  color: #14532d;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulseGreen 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Topbar Notification & Buttons */
.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--color-text-secondary);
  transition: all 0.15s ease;
}

.icon-button:hover {
  background: var(--color-bg);
  border-color: #cbd5e1;
  color: var(--color-text);
}

.icon-button .notification-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #ffffff;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
}

.profile-chip:hover {
  border-color: #cbd5e1;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
}

/* Main Content Area */
.app-content {
  flex: 1;
  max-width: 1480px;
  width: 100%;
  padding: 32px 40px 56px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  margin-bottom: 4px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-header p {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0;
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */

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

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

/* ==========================================================================
   Metric Stat Cards (Fixed & Redesigned)
   ========================================================================== */

.stat-card-modern {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* Remove legacy broken pseudo-elements */
.stat-card:after {
  display: none !important;
}

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

.stat-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.stat-icon-wrap {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  font-size: 19px;
  flex-shrink: 0;
}

/* Stat Card Color Variants */
.stat-primary .stat-icon-wrap {
  background: rgba(79, 70, 229, 0.1);
  color: var(--color-primary);
}
.stat-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary-gradient);
}

.stat-success .stat-icon-wrap {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}
.stat-success::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-warning .stat-icon-wrap {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}
.stat-warning::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-info .stat-icon-wrap {
  background: rgba(14, 165, 233, 0.1);
  color: var(--color-info);
}
.stat-info::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: 8px;
}

.stat-subtext {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Secondary Stat Tiles (Impressions, Clicks, CTR) */
.metric-summary-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
}

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

.metric-summary-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  font-size: 22px;
  flex-shrink: 0;
}

/* ==========================================================================
   Workspace Shortcuts & Actions
   ========================================================================== */

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13.5px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.quick-action-btn:hover {
  transform: translateY(-1px);
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-primary-gradient);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-glow);
  color: #ffffff;
}

.btn-outline-primary {
  color: var(--color-primary);
  background: #ffffff;
  border-color: #c7d2fe;
}

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

.btn-outline-secondary {
  color: var(--color-text-secondary);
  background: #ffffff;
  border-color: var(--color-border);
}

.btn-outline-secondary:hover {
  background: var(--color-bg);
  border-color: #cbd5e1;
  color: var(--color-text);
}

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

.btn-outline-danger:hover {
  background: #fff1f2;
  color: #be123c;
  border-color: #fda4af;
}

.btn-sm {
  min-height: 32px;
  padding: 4px 11px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

/* Form Controls */
.form-control, .form-select {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--color-text);
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

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

.form-text {
  color: var(--color-text-muted);
  font-size: 12px;
  margin-top: 5px;
}

/* ==========================================================================
   Modern Tables & Lists
   ========================================================================== */

.table-responsive {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  overflow: hidden;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background: #f8fafc;
  color: #64748b;
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 13px 18px;
  white-space: nowrap;
}

.table td {
  border-color: #f1f5f9;
  color: #334155;
  font-size: 13.5px;
  padding: 14px 18px;
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Ad Thumbnail Styling */
.table-ad-thumb {
  width: 76px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Modern Status Badges with Pulsing / Solid Dots
   ========================================================================== */

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-status-active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.badge-status-active .badge-dot {
  background: #16a34a;
}

.badge-status-scheduled {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.badge-status-scheduled .badge-dot {
  background: #0284c7;
}

.badge-status-paused {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-status-paused .badge-dot {
  background: #d97706;
}

.badge-status-draft {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.badge-status-draft .badge-dot {
  background: #64748b;
}

.badge-status-expired {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.badge-status-expired .badge-dot {
  background: #dc2626;
}

.badge-status-completed {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.badge-status-completed .badge-dot {
  background: #4f46e5;
}

/* General Bootstrap Badges */
.badge {
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
}

.badge.text-bg-secondary {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0;
}

.badge.text-bg-info {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd;
}

.badge.text-bg-success {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */

.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  margin-bottom: 20px;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.alert-info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #075985;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */

.modal-content {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--color-border);
  padding: 16px 24px;
}

.modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ==========================================================================
   Mobile & Responsive Adjustments
   ========================================================================== */

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

@media (max-width: 991.98px) {
  .app-sidebar {
    display: none;
  }

  .mobile-menu-button {
    display: grid;
  }

  .app-topbar {
    height: 62px;
    padding: 0 20px;
  }

  .app-content {
    padding: 24px 20px 40px;
  }

  .topbar-right .profile-chip span:not(.profile-avatar) {
    display: none;
  }

  .page-header h2 {
    font-size: 22px;
  }
}

@media (min-width: 992px) {
  .mobile-drawer {
    display: none !important;
  }
}

/* ==========================================================================
   Login Page Styling
   ========================================================================== */

.login-page-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0b0f19;
  background-image: 
    radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.22) 0px, transparent 55%),
    radial-gradient(at 85% 85%, rgba(14, 165, 233, 0.18) 0px, transparent 55%),
    radial-gradient(at 50% 50%, rgba(79, 70, 229, 0.1) 0px, transparent 70%);
  font-family: var(--font-sans);
  padding: 24px;
}

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

.login-card {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

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

.login-logo-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--color-primary-gradient);
  color: #ffffff;
  font-size: 24px;
  box-shadow: 0 10px 25px -3px var(--color-primary-glow);
  margin-bottom: 16px;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-bottom: 6px;
}

.login-subtitle {
  color: #64748b;
  font-size: 14px;
  margin: 0;
}

.login-input-group {
  position: relative;
}

.login-input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
}

.login-input-group .form-control {
  padding-left: 42px;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
}

.password-toggle-btn:hover {
  color: #475569;
}

.login-demo-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 12px;
  color: #475569;
  margin-bottom: 20px;
}

.login-demo-pill code {
  color: var(--color-primary);
  font-weight: 600;
}

/* ==========================================================================
   Modals & Popups
   ========================================================================== */

.modal-dialog {
  margin: 1.75rem auto;
}

.modal-dialog-scrollable {
  display: flex;
  max-height: calc(100% - 3.5rem);
}

.modal-dialog-scrollable form.modal-content,
.modal-dialog-scrollable .modal-content {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  background: #ffffff;
}

/* Support both form.modal-content and nested .modal-content > form */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.modal-dialog-scrollable .modal-header,
.modal-dialog-scrollable .modal-footer {
  flex-shrink: 0;
}

.modal-dialog-scrollable .modal-body,
.modal-dialog-scrollable .modal-content > form > .modal-body {
  overflow-y: auto !important;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 24px;
}

/* Sleek custom scrollbars for modal-body */
.modal-dialog-scrollable .modal-body::-webkit-scrollbar,
.modal-dialog-scrollable .modal-content > form > .modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-track,
.modal-dialog-scrollable .modal-content > form > .modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb,
.modal-dialog-scrollable .modal-content > form > .modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-pill);
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb:hover,
.modal-dialog-scrollable .modal-content > form > .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.6);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  background-color: #ffffff;
}

.modal-header .modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* ==========================================================================
   Filter Panel & Filter Badges
   ========================================================================== */

.filter-panel-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.filter-header-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(79, 70, 229, 0.08);
}

.filter-preset-group .btn {
  font-weight: 600;
  font-size: 12px;
  padding: 5px 12px;
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

.filter-preset-group .btn:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--color-text);
}

.filter-preset-group .btn.active {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-xs);
}

.badge-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.badge-filter-chip:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}

.badge-filter-chip i {
  font-size: 13px;
  opacity: 0.75;
}

.badge-filter-chip:hover i {
  opacity: 1;
}


