/* ===========================
   CSS DESIGN SYSTEM — NoteDeFrais
   Dark mode + Glassmorphism + Premium
   =========================== */

/* ---- TOKENS ---- */
:root {
  --bg-base: #f4f7f9;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 155, 214, 0.15);
  --glass-hover: rgba(0, 155, 214, 0.05);

  --accent-purple: #009BD6;
  --accent-purple-light: #007ba8;
  --accent-blue: #009BD6;
  --accent-blue-light: #4dbbe3;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;

  --gradient-primary: linear-gradient(135deg, #009BD6, #007ba8);
  --gradient-hero: linear-gradient(135deg, #f4f7f9 0%, #e0ebf1 50%, #f4f7f9 100%);

  --text-primary: #333333;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --sidebar-width: 240px;
  --topbar-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-glow-purple: 0 4px 14px rgba(0, 155, 214, 0.2);
  --shadow-glow-blue: 0 4px 14px rgba(0, 155, 214, 0.2);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- RESET & BASE ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
}

.logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-purple-light);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--glass-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.main-content.sidebar-collapsed {
  margin-left: 0;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- VIEWS ---- */
.view {
  display: none;
  flex-direction: column;
  padding: 28px 32px;
  flex: 1;
  animation: fadeInUp 0.3s ease;
}

.view.active {
  display: flex;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  margin-bottom: 28px;
}

.view-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.view-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* ---- GLASS CARD ---- */
.card,
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.card {
  padding: 20px;
}

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.purple {
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent-purple-light);
}

.stat-icon.blue {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue-light);
}

.stat-icon.green {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.stat-icon.orange {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

/* ---- SECTION GRID ---- */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
}

/* ---- CATEGORY LIST ---- */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-name {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 110px;
}

.cat-bar-wrap {
  flex: 1;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.cat-bar {
  height: 6px;
  background: var(--gradient-primary);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.cat-amount {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 60px;
  text-align: right;
}

/* ---- RECENT LIST / DASHBOARD ---- */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}

.recent-item:hover {
  background: var(--glass-hover);
}

.recent-info {
  display: flex;
  flex-direction: column;
}

.recent-merchant {
  font-size: 13px;
  font-weight: 500;
}

.recent-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.recent-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-purple-light);
}

/* ---- FILTERS ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ---- EXPENSE LIST ---- */
.expenses-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expense-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
  cursor: pointer;
}

.expense-item:hover {
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.05);
  transform: translateX(2px);
}

.expense-cat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(124, 58, 237, 0.1);
  flex-shrink: 0;
}

.expense-main {
  flex: 1;
}

.expense-merchant {
  font-size: 14px;
  font-weight: 600;
}

.expense-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.expense-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.expense-amount {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

.expense-ht {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.expense-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}

.expense-item:hover .expense-actions {
  opacity: 1;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}

.empty-state-small {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
}

/* ---- STATUS BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-brouillon {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.badge-soumis {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-valide {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-rembourse {
  background: rgba(124, 58, 237, 0.15);
  color: #a855f7;
}

.badge-refuse {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ---- REPORTS ---- */
.reports-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.report-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.report-icon {
  width: 52px;
  height: 52px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow-purple);
}

.report-icon svg {
  width: 24px;
  height: 24px;
}

.report-card h3 {
  font-size: 17px;
  font-weight: 700;
}

.report-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.report-form {
  width: 100%;
}

/* ---- SETTINGS ---- */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section h3 svg {
  width: 16px;
  height: 16px;
  color: var(--accent-purple-light);
}

.settings-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.settings-status {
  font-size: 12px;
  margin-top: 8px;
  min-height: 16px;
}

.settings-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.settings-status-banner.disconnected {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.settings-status-banner.connected {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.settings-status-banner.connected .status-dot {
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

.settings-actions {
  display: flex;
  gap: 12px;
}

.danger-zone {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.04);
}

/* ---- FORMS ---- */
.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.input,
.textarea {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
  width: 100%;
  outline: none;
}

.input:focus,
.textarea:focus {
  border-color: var(--accent-purple);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 155, 214, 0.15);
}

.input::placeholder {
  color: var(--text-muted);
}

.input option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.textarea {
  resize: vertical;
  min-height: 70px;
}

.input-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.input-with-action {
  display: flex;
  gap: 6px;
  align-items: center;
}

.input-with-action .input {
  flex: 1;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-purple-light);
  color: var(--accent-purple-light);
  background: rgba(124, 58, 237, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-icon:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.btn-icon-sm {
  padding: 6px;
}

.btn-icon-sm svg {
  width: 15px;
  height: 15px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 16px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.06);
}

.upload-icon {
  width: 56px;
  height: 56px;
  background: rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent-purple-light);
}

.upload-icon svg {
  width: 28px;
  height: 28px;
}

.upload-text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-formats {
  font-size: 11px;
  color: var(--text-muted);
}

.upload-label {
  cursor: pointer;
}

/* ---- UPLOAD RESULT ---- */
.upload-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.result-preview img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  transition: var(--transition);
}

.result-preview img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.pdf-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--accent-red);
  font-size: 11px;
  cursor: pointer;
}

.pdf-preview:hover svg {
  transform: translateY(-2px);
  color: var(--accent-red);
}

.pdf-thumbnail {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  cursor: zoom-in;
  transition: var(--transition);
}

.pdf-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.pdf-preview svg {
  width: 32px;
  height: 32px;
}

.ai-badge {
  flex: 1;
}

.ai-spinner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.ai-success {
  font-size: 13px;
  color: var(--accent-green);
  font-weight: 600;
}

.ai-error {
  font-size: 13px;
  color: var(--accent-orange);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-purple-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Floating Lightbox Overlay (Non-blocking) */
.lightbox-floating-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-floating-overlay.open {
  opacity: 1;
}

/* Make actual modal clickable and size it for left half of screen */
.lightbox-floating-overlay .lightbox-modal {
  pointer-events: none;
  width: 45vw;
  max-width: 800px;
  height: 90vh;
  margin-left: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: translateX(-20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-floating-overlay.open .lightbox-modal {
  pointer-events: all;
  transform: translateX(0);
}

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-sm {
  max-width: 400px;
}

.modal-lg {
  max-width: 900px;
}

.modal-split-layout {
  display: flex;
  gap: 24px;
  min-height: 400px;
}

.modal-split-left {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.modal-split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Make preview big in split layout */
.modal-split-left .upload-result {
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.modal-split-left .result-preview img,
.modal-split-left .pdf-thumbnail {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}

.lightbox-modal {
  max-width: 90vw;
  width: auto;
}

.lightbox-body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: #000;
  overflow: auto;
}

.lightbox-body img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

/* ---- TOAST NOTIFICATIONS ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 500;
  min-width: 240px;
  max-width: 380px;
  backdrop-filter: blur(12px);
  animation: slideInRight 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
}

.toast-info {
  border-color: rgba(59, 130, 246, 0.4);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ---- LINKS ---- */
a.link,
.link {
  color: var(--accent-purple-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

a.link:hover,
.link:hover {
  color: var(--accent-blue-light);
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1000px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .reports-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    left: -240px;
  }

  .sidebar.mobile-open {
    left: 0;
    width: 240px;
  }

  .main-content {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .view {
    padding: 16px;
  }

  .form-row {
    flex-direction: column;
  }
}
/* ---- LOGIN MIRE ---- */
.login-mire {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-base);
  background-image: var(--gradient-hero);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}

.login-card {
  width: 400px;
  padding: 40px;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.login-logo {
  max-width: 100%;
  height: 64px;
  margin-bottom: 20px;
  object-fit: contain;
}

.login-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-purple-light);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-muted);
}

.btn-block {
  width: 100%;
}

/* ---- ADMIN SECTION ---- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.admin-table th, .admin-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

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

.admin-table td {
  font-size: 14px;
  color: var(--text-primary);
}

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

.admin-table tr:hover {
  background: var(--glass-hover);
}

.table-responsive {
  overflow-x: auto;
}

/* Fix sidebar footer for logout */
.sidebar-footer .user-info {
  width: 100%;
}

#btn-logout:hover {
  color: var(--accent-red) !important;
  background: rgba(239, 68, 68, 0.05);
}

