/**
 * Criah Conecte - Modern Dark Theme
 * Premium Data Intelligence Platform Design
 */

/* ============================================
   FONTS - Google Fonts
   ============================================ */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Base Colors */
  --bg-base: #050507;
  --bg-surface: #0d0d12;
  --bg-elevated: #13131a;
  --bg-hover: #1a1a24;
  --bg-active: #22222e;

  /* Text Colors */
  --text-primary: #f4f4f6;
  --text-secondary: #a0a0ab;
  --text-muted: #6b6b78;
  --text-disabled: #4a4a55;

  /* Accent Colors */
  --accent-primary: #ff0071;
  --accent-primary-rgb: 0, 212, 255;
  --accent-secondary: #8b5cf6;
  --accent-secondary-rgb: 139, 92, 246;
  --accent-tertiary: #10b981;

  /* Status Colors */
  --success: #10b981;
  --success-rgb: 16, 185, 129;
  --warning: #f59e0b;
  --warning-rgb: 245, 158, 11;
  --danger: #ef4444;
  --danger-rgb: 239, 68, 68;
  --info: #3b82f6;
  --info-rgb: 59, 130, 246;

  /* Meta Brand */
  --meta-blue: #0866ff;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(var(--accent-primary-rgb), 0.15);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 80px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.125rem;
}

h5 {
  font-size: 1rem;
}

h6 {
  font-size: 0.875rem;
}

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

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

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

code,
pre {
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

code {
  font-size: 0.85em;
  padding: 0.2em 0.4em;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
}

/* ============================================
   LAYOUT - APP WRAPPER
   ============================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.125rem;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  position: relative;
  margin-bottom: 4px;
}

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

.nav-item.active {
  background: rgba(var(--accent-primary-rgb), 0.1);
  color: var(--accent-primary);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: 0 3px 3px 0;
}

.nav-item i {
  font-size: 1.125rem;
  width: 20px;
  text-align: center;
}

.nav-item .badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-secondary);
  color: white;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 101;
}

.sidebar-footer .dropdown {
  position: relative;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-menu:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: white;
}

.user-info {
  flex: 1;
  min-width: 0;
}

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

.user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.page-title .subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

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

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

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

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}

.card-header h3,
.card-header h5 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

/* Glass Card Variant */
.card-glass {
  background: rgba(13, 13, 18, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Stat Cards */
.stat-card {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.primary {
  background: rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-primary);
}

.stat-icon.secondary {
  background: rgba(var(--accent-secondary-rgb), 0.15);
  color: var(--accent-secondary);
}

.stat-icon.success {
  background: rgba(var(--success-rgb), 0.15);
  color: var(--success);
}

.stat-icon.warning {
  background: rgba(var(--warning-rgb), 0.15);
  color: var(--warning);
}

.stat-icon.danger {
  background: rgba(var(--danger-rgb), 0.15);
  color: var(--danger);
}

.stat-icon.info {
  background: rgba(var(--info-rgb), 0.15);
  color: var(--info);
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 20px;
}

.stat-trend.up {
  background: rgba(var(--success-rgb), 0.15);
  color: var(--success);
}

.stat-trend.down {
  background: rgba(var(--danger-rgb), 0.15);
  color: var(--danger);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-primary);
  color: #000;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--accent-primary-rgb), 0.4);
}

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

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

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

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-outline-primary {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

.btn-outline-primary:hover:not(:disabled) {
  background: rgba(var(--accent-primary-rgb), 0.1);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-outline-danger:hover:not(:disabled) {
  background: rgba(var(--danger-rgb), 0.1);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-outline-success {
  background: transparent;
  color: var(--success);
  border: 1px solid var(--success);
}

.btn-outline-success:hover:not(:disabled) {
  background: rgba(var(--success-rgb), 0.1);
}

.btn-warning {
  background: var(--warning);
  color: #000;
}

.btn-outline-warning {
  background: transparent;
  color: var(--warning);
  border: 1px solid var(--warning);
}

.btn-outline-warning:hover:not(:disabled) {
  background: rgba(var(--warning-rgb), 0.1);
}

.btn-outline-info {
  background: transparent;
  color: var(--info);
  border: 1px solid var(--info);
}

.btn-outline-info:hover:not(:disabled) {
  background: rgba(var(--info-rgb), 0.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

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

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

/* Meta Button */
.btn-meta {
  background: var(--meta-blue);
  color: white;
}

.btn-meta:hover:not(:disabled) {
  background: #0756d6;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control,
.form-select {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15);
}

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

.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.input-group {
  display: flex;
  position: relative;
}

.input-group .form-control {
  flex: 1;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg-active);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-size: 1rem;
}

.input-group-text:first-child {
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group-text:last-child {
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group .form-control:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .form-control:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group .form-control:not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* Floating label variant */
.form-floating {
  position: relative;
}

.form-floating .form-control {
  padding-top: 26px;
  padding-bottom: 10px;
}

.form-floating label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  pointer-events: none;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
  top: 14px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 14px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  text-align: left;
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

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

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

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-success,
.bg-success {
  background: rgba(var(--success-rgb), 0.15) !important;
  color: var(--success) !important;
}

.badge-warning,
.bg-warning {
  background: rgba(var(--warning-rgb), 0.15) !important;
  color: var(--warning) !important;
}

.badge-danger,
.bg-danger {
  background: rgba(var(--danger-rgb), 0.15) !important;
  color: var(--danger) !important;
}

.badge-info,
.bg-info {
  background: rgba(var(--info-rgb), 0.15) !important;
  color: var(--info) !important;
}

.badge-primary,
.bg-primary {
  background: rgba(var(--accent-primary-rgb), 0.15) !important;
  color: var(--accent-primary) !important;
}

.badge-secondary {
  background: var(--bg-active);
  color: var(--text-secondary);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.alert i {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-success {
  background: rgba(var(--success-rgb), 0.1);
  border: 1px solid rgba(var(--success-rgb), 0.3);
  color: var(--success);
}

.alert-warning {
  background: rgba(var(--warning-rgb), 0.1);
  border: 1px solid rgba(var(--warning-rgb), 0.3);
  color: var(--warning);
}

.alert-danger {
  background: rgba(var(--danger-rgb), 0.1);
  border: 1px solid rgba(var(--danger-rgb), 0.3);
  color: var(--danger);
}

.alert-info {
  background: rgba(var(--info-rgb), 0.1);
  border: 1px solid rgba(var(--info-rgb), 0.3);
  color: var(--info);
}

/* ============================================
   MODALS
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  width: 100%;
  max-width: 500px;
  margin: 20px;
  transform: translateY(-20px) scale(0.95);
  transition: transform var(--transition-base);
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
}

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

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

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 24px;
}

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

.btn-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

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

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-top: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 100;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown that opens upward (for sidebar footer) */
.sidebar-footer .dropdown-menu {
  position: absolute;
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  margin-top: 0;
  margin-bottom: 0;
  transform: translateY(10px);
  min-width: 100%;
  z-index: 200;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
}

.sidebar-footer .dropdown-menu.show {
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

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

.dropdown-item.text-danger {
  color: var(--danger);
}

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

.dropdown-item-text {
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   AUTH PAGES - LOGIN/REGISTER
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(var(--accent-primary-rgb), 0.35);
}

.auth-logo h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-card h2 {
  font-size: 1.25rem;
  text-align: center;
  margin-bottom: 32px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-footer a {
  color: var(--accent-primary);
  font-weight: 500;
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
  display: grid;
  gap: 24px;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

.grid-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1400px) {
  .grid-cols-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1200px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-5 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   QUICK START / STEPS
   ============================================ */
.steps-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-item {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.step-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #000;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

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

/* ============================================
   STATUS INDICATOR
   ============================================ */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-dot.active::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 16px;
  height: 16px;
  background: var(--success);
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse-ring 1.5s infinite;
}

.status-dot.inactive {
  background: var(--danger);
}

.status-dot.pending {
  background: var(--warning);
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }

  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
  position: relative;
  height: 300px;
  padding: 16px;
}

.chart-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}

.chart-placeholder i {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

/* ============================================
   METRIC TOGGLES
   ============================================ */
.metric-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-btn {
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.metric-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.metric-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #000;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 7, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Spin utility for refresh buttons */
.spin {
  animation: spin 0.8s linear infinite;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-hover) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toastify {
  font-family: "Plus Jakarta Sans", sans-serif !important;
  border-radius: var(--radius-md) !important;
  padding: 16px 20px !important;
  box-shadow: var(--shadow-lg) !important;
}

/* ============================================
   SWEETALERT2 CUSTOMIZATION
   ============================================ */
.swal2-popup {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--text-primary) !important;
}

.swal2-title {
  color: var(--text-primary) !important;
}

.swal2-html-container {
  color: var(--text-secondary) !important;
}

.swal2-confirm {
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    #00a8cc
  ) !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  color: #000 !important;
}

.swal2-cancel {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
}

.swal2-input {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
}

.swal2-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15) !important;
}

/* ============================================
   DATATABLES CUSTOMIZATION (dark theme)
   ============================================ */

/* Reset base DataTables styles */
table.dataTable {
  border-collapse: collapse !important;
  width: 100% !important;
  margin: 0 !important;
}

table.dataTable thead th,
table.dataTable thead td {
  padding: 14px 16px !important;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted) !important;
  background: var(--bg-elevated) !important;
  border-bottom: 1px solid var(--border-default) !important;
  border-top: none !important;
}

table.dataTable tbody td {
  padding: 16px !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  border-top: none !important;
  color: var(--text-secondary) !important;
  font-size: 0.875rem;
  background: transparent !important;
}

table.dataTable tbody tr {
  background: transparent !important;
  transition: background var(--transition-fast);
}

table.dataTable tbody tr:hover {
  background: var(--bg-hover) !important;
}

table.dataTable tbody tr:last-child td {
  border-bottom: none !important;
}

/* Odd/even stripe override */
table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
  background: transparent !important;
}

table.dataTable.stripe tbody tr.even,
table.dataTable.display tbody tr.even {
  background: transparent !important;
}

table.dataTable.stripe tbody tr.odd:hover,
table.dataTable.display tbody tr.odd:hover,
table.dataTable.stripe tbody tr.even:hover,
table.dataTable.display tbody tr.even:hover {
  background: var(--bg-hover) !important;
}

/* Sorting icons */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
  background-image: none !important;
  position: relative;
  cursor: pointer;
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  opacity: 0.4;
}

table.dataTable thead .sorting::after {
  content: "\2195";
}

table.dataTable thead .sorting_asc::after {
  content: "\2191";
  opacity: 1;
  color: var(--accent-primary);
}

table.dataTable thead .sorting_desc::after {
  content: "\2193";
  opacity: 1;
  color: var(--accent-primary);
}

/* Wrapper layout */
.dataTables_wrapper {
  color: var(--text-secondary);
  padding: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 16px;
  padding: 0 4px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dataTables_length select,
.dataTables_filter input {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  padding: 8px 12px !important;
  font-family: inherit;
  font-size: 0.85rem;
}

.dataTables_length select:focus,
.dataTables_filter input:focus {
  border-color: var(--accent-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15) !important;
}

.dataTables_filter input {
  margin-left: 8px;
  min-width: 200px;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate {
  margin-top: 16px;
  padding: 0 4px;
}

.dataTables_paginate .paginate_button {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-secondary) !important;
  margin: 0 2px !important;
  padding: 6px 12px !important;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dataTables_paginate .paginate_button:hover {
  background: var(--bg-hover) !important;
  border-color: var(--border-strong) !important;
  color: var(--text-primary) !important;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
  background: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: #000 !important;
  font-weight: 600;
}

.dataTables_paginate .paginate_button.disabled,
.dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.35 !important;
  cursor: default !important;
  background: var(--bg-elevated) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-muted) !important;
}

/* Info text */
.dataTables_info {
  color: var(--text-muted) !important;
  font-size: 0.8rem !important;
  margin-top: 16px;
  padding: 0 4px;
}

/* Empty table */
.dataTables_empty {
  color: var(--text-muted) !important;
  text-align: center;
  padding: 32px 16px !important;
}

/* Scrollable tables */
.dataTables_scrollHead,
.dataTables_scrollBody {
  overflow: visible !important;
}

.dataTables_scrollHeadInner {
  width: 100% !important;
}

.dataTables_scrollHeadInner table {
  width: 100% !important;
}

/* Processing indicator */
.dataTables_processing {
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md);
  padding: 16px !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary {
  color: var(--accent-primary) !important;
}

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

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

.text-success {
  color: var(--success) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-info {
  color: var(--info) !important;
}

.bg-primary-soft {
  background: rgba(var(--accent-primary-rgb), 0.1) !important;
}

.bg-success-soft {
  background: rgba(var(--success-rgb), 0.1) !important;
}

.bg-warning-soft {
  background: rgba(var(--warning-rgb), 0.1) !important;
}

.bg-danger-soft {
  background: rgba(var(--danger-rgb), 0.1) !important;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.d-flex {
  display: flex;
}

.d-inline-flex {
  display: inline-flex;
}

.d-block {
  display: block;
}

.d-inline-block {
  display: inline-block;
}

.d-none {
  display: none;
}

.flex-column {
  flex-direction: column;
}

.align-items-center {
  align-items: center;
}

.align-items-start {
  align-items: flex-start;
}

.justify-content-center {
  justify-content: center;
}

.justify-content-between {
  justify-content: space-between;
}

.justify-content-end {
  justify-content: flex-end;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-grow-1 {
  flex-grow: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-5 {
  gap: 24px;
}

.w-100 {
  width: 100%;
}

.h-100 {
  height: 100%;
}

.m-0 {
  margin: 0 !important;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 16px;
}

.mt-4 {
  margin-top: 24px;
}

.mt-5 {
  margin-top: 32px;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 16px;
}

.mb-4 {
  margin-bottom: 24px;
}

.mb-5 {
  margin-bottom: 32px;
}

.me-1 {
  margin-right: 4px;
}

.me-2 {
  margin-right: 8px;
}

.me-3 {
  margin-right: 12px;
}

.ms-1 {
  margin-left: 4px;
}

.ms-2 {
  margin-left: 8px;
}

.ms-3 {
  margin-left: 12px;
}

.ms-auto {
  margin-left: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.p-0 {
  padding: 0 !important;
}

.p-3 {
  padding: 16px;
}

.p-4 {
  padding: 24px;
}

.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.py-3 {
  padding-top: 16px;
  padding-bottom: 16px;
}

.py-4 {
  padding-top: 24px;
  padding-bottom: 24px;
}

.px-3 {
  padding-left: 16px;
  padding-right: 16px;
}

.px-4 {
  padding-left: 24px;
  padding-right: 24px;
}

.rounded {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-full {
  border-radius: 9999px;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.font-mono {
  font-family: "JetBrains Mono", monospace;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-75 {
  opacity: 0.75;
}

.cursor-pointer {
  cursor: pointer;
}

.list-unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

.visible {
  visibility: visible;
}

.invisible {
  visibility: hidden;
}

.shadow {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-glow {
  box-shadow: var(--shadow-glow);
}

/* ============================================
   RESPONSIVE - MOBILE SIDEBAR
   ============================================ */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
  }

  .content-body {
    padding: 20px;
  }

  .mobile-menu-toggle {
    display: flex !important;
  }
}

.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.show {
  display: block;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .sidebar,
  .btn,
  .no-print,
  .content-header {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Staggered animations for lists */
.stagger-1 {
  animation-delay: 0.05s;
}

.stagger-2 {
  animation-delay: 0.1s;
}

.stagger-3 {
  animation-delay: 0.15s;
}

.stagger-4 {
  animation-delay: 0.2s;
}

.stagger-5 {
  animation-delay: 0.25s;
}

/* Bootstrap compatibility - Bootstrap still loaded but dark overrides */
.bg-light {
  background: var(--bg-elevated) !important;
}

.bg-white {
  background: var(--bg-surface) !important;
}

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

.border {
  border-color: var(--border-default) !important;
}

/* Fix Bootstrap navbar override */
.navbar-dark,
.bg-primary {
  background: var(--bg-surface) !important;
}

/* Row/Col Bootstrap Grid - keep using bootstrap grid */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: -12px;
}

.row > * {
  padding: 12px;
}

.col-12 {
  width: 100%;
}

.col-md-4 {
  width: 100%;
}

.col-md-5 {
  width: 100%;
}

.col-md-6 {
  width: 100%;
}

.col-lg-4 {
  width: 100%;
}

.col-lg-8 {
  width: 100%;
}

@media (min-width: 768px) {
  .col-md-4 {
    width: 33.333%;
  }

  .col-md-5 {
    width: 41.666%;
  }

  .col-md-6 {
    width: 50%;
  }
}

@media (min-width: 992px) {
  .col-lg-4 {
    width: 33.333%;
  }

  .col-lg-8 {
    width: 66.666%;
  }
}

/* h-100 card height fix */
.h-100 {
  height: 100%;
}

.card.h-100 {
  display: flex;
  flex-direction: column;
}

.card.h-100 .card-body {
  flex: 1;
}

/* g-4 gap class from Bootstrap */
.g-4 {
  gap: 24px;
}

.row.g-4 {
  margin: -12px;
}

.row.g-4 > * {
  padding: 12px;
}

/* Table responsive */
.table-responsive {
  overflow-x: auto;
}

.table-striped tbody tr:nth-child(odd) {
  background: var(--bg-elevated);
}

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

/* ============================================
   FLATPICKR CUSTOM STYLES
   ============================================ */
.flatpickr-calendar {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
  border-bottom-color: var(--bg-card) !important;
}

.flatpickr-months {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.flatpickr-months .flatpickr-month {
  background: transparent !important;
  color: var(--text-primary) !important;
}

.flatpickr-current-month {
  color: var(--text-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.flatpickr-current-month input.cur-year {
  color: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: var(--text-secondary) !important;
  fill: var(--text-secondary) !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: var(--primary) !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--primary) !important;
}

.flatpickr-innerContainer {
  background: var(--bg-card);
}

.flatpickr-weekdays {
  background: var(--bg-card) !important;
}

span.flatpickr-weekday {
  color: var(--text-muted) !important;
  font-weight: 600;
}

.flatpickr-days {
  border: none !important;
}

.flatpickr-day {
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
}

.flatpickr-day:hover {
  background: var(--bg-hover) !important;
  border-color: var(--bg-hover) !important;
}

.flatpickr-day.today {
  border-color: var(--primary) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--bg-dark) !important;
}

.flatpickr-day.inRange {
  background: rgba(0, 212, 170, 0.2) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: var(--text-muted) !important;
  opacity: 0.5;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--text-muted) !important;
  opacity: 0.5;
}

/* Flatpickr input styling */
.datepicker {
  cursor: pointer;
}

.datepicker + .flatpickr-input {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* ============================================
   CLIENT CARDS
   ============================================ */
.client-card .card-body {
  padding: 24px;
}

.client-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.client-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   CHECKBOX GRID (Ad Account Selection)
   ============================================ */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-item:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-item input[type="checkbox"]:checked + input + .checkbox-label {
  color: var(--text-primary);
}

.checkbox-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* Campaign Link in Table */
.campaign-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.campaign-link:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* ============================================
   CAMPAIGN DETAILS PAGE
   ============================================ */

/* Campaign Header */
.campaign-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.campaign-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.campaign-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Campaign Info Grid */
.campaign-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.campaign-info-grid .info-item {
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.campaign-info-grid .info-item-full {
  grid-column: 1 / -1;
}

.campaign-info-grid .info-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.campaign-info-grid .info-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Budget Cards */
.budget-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.budget-card {
  background: var(--bg-elevated);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.budget-card .budget-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.budget-card .budget-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.budget-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  color: var(--warning);
  font-size: 0.875rem;
}

.budget-warning i {
  font-size: 1.1rem;
}

/* Campaign Metrics Grid */
.campaign-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card {
  background: var(--bg-elevated);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.metric-card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
}

.metric-card .metric-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.metric-card .metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Conversions Grid */
.conversions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.conversion-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(139, 92, 246, 0.1));
  padding: 24px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.conversion-card .conversion-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--success);
  line-height: 1.2;
}

.conversion-card .conversion-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 8px;
}

/* Summary sections (leads, ads) */
.leads-summary,
.ads-summary {
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Performance Chart */
.chart-container {
  position: relative;
  height: 350px;
  padding: 16px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-placeholder,
.chart-empty {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-surface);
}

.chart-placeholder i,
.chart-empty i {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 12px;
}

.chart-placeholder p,
.chart-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* Chart Controls Container */
.chart-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Chart Type Toggle (Line / Pie) */
.chart-type-toggles {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.chart-type-btn {
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.chart-type-btn.active {
  background: var(--accent-secondary);
  color: white;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

/* Chart Metric Toggle */
.chart-metric-toggles {
  display: flex;
  gap: 8px;
}

.chart-metric-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chart-metric-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.chart-metric-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* Section Info Alerts */
.section-info-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 0;
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.section-info-alert i {
  flex-shrink: 0;
  margin-top: 2px;
}

.section-info-alert span {
  line-height: 1.5;
}

/* Warning variant for section info alert */
.section-info-alert.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.section-info-alert.alert-warning strong {
  color: var(--warning);
}

/* Ads Library Button in Table */
.btn-ads-library {
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--primary);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-ads-library:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-ads-library i {
  font-size: 0.75rem;
}

/* Ads Library unavailable state */
.ads-library-unavailable {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
  cursor: help;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(107, 107, 120, 0.1);
  border-radius: var(--radius-sm);
}

.ads-library-unavailable i {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Ad Name Cell Styling */
.ad-name-cell {
  min-width: 200px;
}

.ad-name-cell .ad-name {
  display: block;
  line-height: 1.4;
  color: var(--text-primary);
}

.ad-name-cell .ad-id {
  font-size: 0.75rem;
  margin-top: 2px;
}

/* Responsive - Campaign Page */
@media (max-width: 992px) {
  .campaign-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .campaign-header {
    padding: 16px;
  }

  .campaign-header .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px;
  }

  .campaign-info-grid {
    grid-template-columns: 1fr;
  }

  .budget-cards {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 576px) {
  .campaign-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .campaign-header h2 {
    font-size: 1.25rem;
  }

  .metric-card .metric-value {
    font-size: 1.1rem;
  }

  .conversion-card .conversion-value {
    font-size: 1.5rem;
  }
}

