/* Global app UI tweaks */
:root { --brand: #2563eb; }
body.font-app { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji'; }

/* Buttons (harmonize existing .btn classes) */
.btn { display:inline-flex; align-items:center; gap:.5rem; padding:.5rem .9rem; border-radius:.5rem; border:1px solid transparent; font-weight:600; transition:all .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: .35rem .6rem; font-size:.875rem; }
.btn-primary { background: var(--brand); color:#fff; }
.btn-primary:hover { filter: brightness(0.95); }
.btn-secondary { background: #e5e7eb; color:#111827; }
.btn-secondary:hover { background:#d1d5db; }
.btn-danger { background:#ef4444; color:#fff; }
.btn-danger:hover { filter: brightness(0.95); }
.btn-outline-primary { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: rgba(37,99,235,0.1); }
.btn-outline-secondary { background: transparent; color:#0f172a; border-color:#cbd5e1; }
.btn-outline-secondary:hover { background:#f1f5f9; }
.btn-outline-danger { background: transparent; color:#ef4444; border-color:#ef4444; }
.btn-outline-danger:hover { background: rgba(239,68,68,0.08); }

/* Dark mode overrides for common containers */
.dark body { color: #e5e7eb; }
.dark p, .dark li, .dark td, .dark th, .dark div, .dark span, .dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 { color: inherit; }
.dark .bg-white { background-color:#1f2937 !important; color:#e5e7eb; }
.dark .text-gray-500 { color:#cbd5e1 !important; }
.dark .text-gray-600 { color:#d1d5db !important; }
.dark .text-gray-700 { color:#e2e8f0 !important; }
.dark .text-gray-800 { color:#f1f5f9 !important; }
.dark .text-gray-900 { color:#f8fafc !important; }
.dark .text-green-600 { color:#86efac !important; }
.dark .text-red-600 { color:#fca5a5 !important; }
.dark .text-blue-600 { color:#93c5fd !important; }
.dark table thead th { background:#111827 !important; color:#e5e7eb; }
.dark td, .dark th { border-color:#374151 !important; }
.dark .border { border-color:#374151 !important; }
.dark .border-b { border-color:#374151 !important; }
.dark .border-t { border-color:#374151 !important; }
.dark a { color:#93c5fd; }
.dark .btn-secondary { background:#334155; color:#e5e7eb; border-color:#475569; }
.dark .btn-secondary:hover { background:#475569; }
.dark .btn-outline-secondary { color:#e5e7eb; border-color:#475569; }
.dark .btn-outline-secondary:hover { background:#1f2937; }
.dark .btn-outline-primary { color:#93c5fd; border-color:#60a5fa; }
.dark .btn-outline-primary:hover { background: rgba(96,165,250,0.15); }
.dark .btn-outline-danger { color:#fca5a5; border-color:#ef4444; }
.dark .btn-outline-danger:hover { background: rgba(239,68,68,0.12); }

/* Dark-mode adjustments for light alert/badge colors */
.dark .bg-blue-50 { background-color: #0b1220 !important; }
.dark .text-blue-900 { color: #bfdbfe !important; }
.dark .bg-blue-100 { background-color: rgba(59,130,246,0.18) !important; }
.dark .text-blue-800 { color: #bfdbfe !important; }
.dark .bg-green-100 { background-color: rgba(34,197,94,0.15) !important; }
.dark .text-green-800 { color: #86efac !important; }
.dark .bg-green-50 { background-color: rgba(34,197,94,0.10) !important; }
.dark .text-green-900 { color: #86efac !important; }
.dark .border-green-200 { border-color: #166534 !important; }
.dark .bg-purple-100 { background-color: rgba(168,85,247,0.18) !important; }
.dark .text-purple-800 { color: #d8b4fe !important; }
.dark .bg-yellow-100 { background-color: rgba(250,204,21,0.18) !important; }
.dark .text-yellow-800 { color: #fde68a !important; }
.dark .bg-red-100 { background-color: rgba(239,68,68,0.12) !important; }
.dark .text-red-800 { color: #fca5a5 !important; }

/* Cards */
.card { background:#ffffff; border:1px solid #e5e7eb; border-radius: .75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.card-header { display:flex; align-items:center; justify-content:space-between; padding: .9rem 1rem; border-bottom:1px solid #e5e7eb; background: linear-gradient(180deg, #f8fafc, #f1f5f9); border-top-left-radius:.75rem; border-top-right-radius:.75rem; }
.card-title { font-weight: 700; font-size: 1.125rem; color:#0b1220; }
.card-body { padding: 1rem; }

.dark .card { background:#111827; border-color:#374151; }
.dark .card-header { background: #0b1220; border-color:#374151; color:#e5e7eb; }
.dark .card-title { color:#e5e7eb; }

/* Tables */
.table-standard thead th { background:#eff6ff; color:#0b1220; font-weight:600; }
.table-standard tbody tr { border-top:1px solid #e5e7eb; }
.table-standard tbody tr:hover { background:#f8fafc; }
.dark .table-standard thead th { background:#0b1220; color:#e5e7eb; }
.dark .table-standard tbody tr { border-color:#374151; }
.dark .table-standard tbody tr:hover { background:#1f2937; }

/* Sidebar nav links */
.nav-link { display:flex; align-items:center; gap:.75rem; padding:.5rem .75rem; border-radius:.5rem; color:#e5e7eb; border-left:3px solid transparent; }
.nav-link:hover { background:#1f2937; color:#ffffff; }
.nav-link.active { background: rgba(37,99,235,0.18); color:#ffffff; border-left-color: var(--brand); }

/* Toggle button group (filters) */
.toggle-btn { background:#ffffff; color:#0f172a; border-color:#cbd5e1; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.toggle-btn:hover { background:#f1f5f9; }
.toggle-active { background:#0f172a; color:#ffffff; border-color:#0f172a; }
.dark .toggle-btn { background:#111827; color:#e5e7eb; border-color:#374151; }
.dark .toggle-btn:hover { background:#1f2937; }
.dark .toggle-active { background:#e5e7eb; color:#0f172a; border-color:#e5e7eb; }

/* Smooth theme toggle transitions */
.theme-animating, .theme-animating * { transition: background-color .25s ease, color .25s ease, border-color .25s ease !important; }

/* Form elements in dark mode */
.dark .form-control,
.dark .form-select,
.dark input[type="text"],
.dark input[type="number"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="search"],
.dark input[type="url"],
.dark input[type="tel"],
.dark select,
.dark textarea {
  background-color: #0f172a !important; /* slate-900 */
  color: #e5e7eb !important;            /* slate-200 */
  border-color: #334155 !important;      /* slate-700 */
}
.dark .form-control::placeholder,
.dark textarea::placeholder,
.dark input::placeholder { color: #94a3b8 !important; } /* slate-400 */
.dark .form-control:focus,
.dark .form-select:focus,
.dark input:focus,
.dark select:focus,
.dark textarea:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.35) !important; /* brand-ish focus ring */
  border-color: #60a5fa !important; /* blue-400 */
}
.dark .form-control:disabled,
.dark .form-select:disabled,
.dark input:disabled,
.dark select:disabled,
.dark textarea:disabled {
  background-color: #1f2937 !important; /* slate-800 */
  color: #94a3b8 !important;            /* slate-400 */
  border-color: #334155 !important;     /* slate-700 */
}

/* Native select arrow contrast (best-effort) */
.dark select { color-scheme: dark; }
