/* ========================================
   PeaceConnect - Global Styles
   Light / Dark Mode + Modern Design
======================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* === CSS Variables === */
:root {
    /* Dark Mode (default) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-input: rgba(15, 23, 42, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    
    /* Accent Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Layout + motion */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 6px 18px rgba(0,0,0,0.22);
    --shadow-md: 0 14px 40px rgba(0,0,0,0.28);
    --shadow-lg: 0 24px 70px rgba(0,0,0,0.35);
    --ring: 0 0 0 4px rgba(99,102,241,0.18);
    --ring-danger: 0 0 0 4px rgba(239,68,68,0.18);
    --transition: 160ms cubic-bezier(.2,.8,.2,1);
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #f0f4f8 100%);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .navbar-brand {
    color: #1a202c;
}

[data-theme="light"] .navbar-links a {
    color: #4a5568;
}

[data-theme="light"] .navbar-links a:hover {
    color: #1a202c;
    background: #edf2f7;
}

[data-theme="light"] .navbar-links a.active {
    color: #fff;
}

[data-theme="light"] .hero h1 {
    background: linear-gradient(135deg, #1a202c, #4a5568);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .stat-card,
[data-theme="light"] .card,
[data-theme="light"] .action-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .stat-card:hover,
[data-theme="light"] .card:hover,
[data-theme="light"] .action-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

[data-theme="light"] .stat-card.danger {
    background: linear-gradient(135deg, #fff5f5, #fed7d7);
    border-color: #feb2b2;
}

[data-theme="light"] .stat-value {
    color: #1a202c;
}

[data-theme="light"] .stat-label,
[data-theme="light"] .hero p {
    color: #718096;
}

[data-theme="light"] .section-title {
    color: #1a202c;
}

[data-theme="light"] .action-title {
    color: #1a202c;
}

[data-theme="light"] .table th {
    background: #f7fafc;
    color: #4a5568;
}

[data-theme="light"] .table td {
    color: #1a202c;
    border-bottom: 1px solid #edf2f7;
}

[data-theme="light"] .table tr:hover {
    background: #f7fafc;
}

[data-theme="light"] .card-header {
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .card-title {
    color: #1a202c;
}

[data-theme="light"] .form-control {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1a202c;
}

[data-theme="light"] .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .form-control::placeholder {
    color: #a0aec0;
}

[data-theme="light"] select.form-control option {
    background: #ffffff;
    color: #1a202c;
}

[data-theme="light"] .btn-secondary {
    background: #edf2f7;
    color: #1a202c;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .btn-secondary:hover {
    background: #e2e8f0;
}

[data-theme="light"] .empty-state {
    color: #718096;
}

[data-theme="light"] .theme-toggle {
    background: #edf2f7;
    border-color: #e2e8f0;
    color: #1a202c;
}

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: auto; }

body {
    font-family: 'Plus Jakarta Sans', 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 15% 10%, rgba(99,102,241,0.18), transparent 60%),
        radial-gradient(900px 500px at 80% 15%, rgba(14,165,233,0.14), transparent 60%),
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 55%, var(--bg-primary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: auto;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* === Background Animation === */
.bg-animation {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.bg-animation span {
    position: absolute;
    width: 20px; height: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(14, 165, 233, 0.04));
    border-radius: 50%;
    animation: float 25s infinite;
}
.bg-animation span:nth-child(1) { left: 10%; animation-delay: 0s; width: 30px; height: 30px; }
.bg-animation span:nth-child(2) { left: 25%; animation-delay: 5s; width: 20px; height: 20px; }
.bg-animation span:nth-child(3) { left: 40%; animation-delay: 10s; width: 25px; height: 25px; }
.bg-animation span:nth-child(4) { left: 55%; animation-delay: 15s; width: 18px; height: 18px; }
.bg-animation span:nth-child(5) { left: 70%; animation-delay: 20s; width: 22px; height: 22px; }
.bg-animation span:nth-child(6) { left: 85%; animation-delay: 3s; width: 28px; height: 28px; }

[data-theme="light"] .bg-animation span {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(14, 165, 233, 0.02));
}

[data-theme="light"] .bg-animation {
    opacity: 0.4;
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* === Navbar === */
.navbar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}
[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.9);
}
.navbar-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 95%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    user-select: none;
    letter-spacing: -0.02em;
}
.brand-text {
    /* Super vibrant gradient: White -> Cyan -> Purple */
    background: linear-gradient(to right, #ffffff 20%, #22d3ee 50%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
}
[data-theme="light"] .brand-text {
    background: linear-gradient(to right, #4f46e5 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}
.navbar-brand .logo {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.navbar-brand .logo.has-img {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(14,165,233,0.15));
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    width: 56px; height: 56px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    padding: 6px;
}
[data-theme="light"] .navbar-brand .logo.has-img {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(14,165,233,0.08));
    border: 2px solid rgba(99, 102, 241, 0.2);
}
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
.navbar-brand:hover .logo {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 10px 28px rgba(99,102,241,0.25);
    filter: saturate(1.05);
}
.navbar-brand:active .logo {
    transform: translateY(0px) scale(0.99);
    box-shadow: 0 6px 18px rgba(99,102,241,0.18);
}
.navbar-brand:focus-visible .logo {
    box-shadow: var(--ring);
}
.navbar-links { display: flex; gap: 0.4rem; align-items: center; }
.navbar-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    line-height: 1;
}
.nav-ico {
    width: 1.3rem;
    text-align: center;
    font-size: 1rem;
    opacity: 0.95;
}
.brand-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #fff;
}
.brand-tag .nav-ico { width: auto; }
.navbar-links a {
    padding: 0.55rem 1.1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
}
.navbar-links a:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}
.navbar-links a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* Theme Toggle */
.theme-toggle {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
    margin-left: 0.5rem;
}
.theme-toggle:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

/* === Main Content === */
.main { position: relative; z-index: 1; padding: 1.75rem 2rem; }
.container { max-width: 1600px; margin: 0 auto; padding: 0 2rem; width: 95%; }
.container-sm { max-width: 700px; margin: 0 auto; padding: 0 1.5rem; }

/* === Hero === */
.hero {
    text-align: center;
    padding: 2rem 0 2.5rem;
    animation: fadeInDown 0.6s ease;
}
.hero h1 {
    font-size: clamp(2rem, 2.2vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p { color: var(--text-muted); font-size: 1rem; }

/* === Cards === */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header.danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    border-bottom: none;
}
.card-header.danger * { color: #fff !important; }
.card-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}
.card-body { padding: 1.5rem; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Better small-screen navbar */
@media (max-width: 980px) {
  .navbar-container { padding: 0 1rem; gap: 0.75rem; }
  .navbar-links { overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
  .navbar-links::-webkit-scrollbar { height: 6px; }
  .navbar-links::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 999px; }
  .navbar-links a { white-space: nowrap; }
  .main { padding: 1.5rem 1rem; }
}

/* The old mobile rule that hid nav links makes the site feel broken on smaller screens */
@media (max-width: 768px) {
  .navbar-links a:not(.active) { display: inline-flex; }
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.5rem;
    transition: all 0.4s ease;
    animation: fadeInUp 0.6s ease backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }
.stat-card:nth-child(5) { animation-delay: 0.3s; }

.stat-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.15);
}
.stat-card.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-icon.yellow { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.25rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.stat-value.danger { color: var(--danger); }

/* === Table === */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 14px;
}
.table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .table th { background: rgba(0, 0, 0, 0.03); }
.table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
}
.table tr { transition: background var(--transition); }
.table tbody tr:nth-child(odd) { background: rgba(255,255,255,0.02); }
[data-theme="light"] .table tbody tr:nth-child(odd) { background: rgba(15,23,42,0.03); }
.table tr:hover { background: rgba(99, 102, 241, 0.06); }

/* === Badges === */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}
.badge-high, .badge-critical { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-medium { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-low { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-resolved, .badge-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-pending { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }
.badge-assigned { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.badge-in_mediation, .badge-in-progress { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-closed { background: rgba(100, 116, 139, 0.3); color: #94a3b8; }
.badge-violence { background: var(--danger); color: #fff; }
.badge-urgency { background: var(--warning); color: #1e293b; }
.badge-harassment { background: #f97316; color: #fff; }
.badge-discrimination { background: #eab308; color: #1e293b; }
.badge-critical { background: var(--danger); color: #fff; animation: pulse 2s infinite; }

[data-theme="light"] .badge-high, [data-theme="light"] .badge-critical { background: #fee2e2; color: #991b1b; }
[data-theme="light"] .badge-medium { background: #fef3c7; color: #92400e; }
[data-theme="light"] .badge-low { background: #dbeafe; color: #1e40af; }
[data-theme="light"] .badge-resolved, [data-theme="light"] .badge-success { background: #d1fae5; color: #065f46; }
[data-theme="light"] .badge-pending { background: #f3f4f6; color: #374151; }
[data-theme="light"] .badge-assigned { background: #e0e7ff; color: #3730a3; }
[data-theme="light"] .badge-in_mediation, [data-theme="light"] .badge-in-progress { background: #fef3c7; color: #92400e; }
[data-theme="light"] .badge-closed { background: #e2e8f0; color: #475569; }
[data-theme="light"] .badge-violence { background: #fee2e2; color: #991b1b; }
[data-theme="light"] .badge-urgency { background: #fef3c7; color: #92400e; }
[data-theme="light"] .badge-harassment { background: #ffedd5; color: #9a3412; }
[data-theme="light"] .badge-discrimination { background: #fef9c3; color: #854d0e; }

/* === Forum: Translate + Speech buttons === */
.speech-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  font-weight: 700;
  font-size: 0.82rem;
}
.speech-btn:hover { transform: translateY(-1px); border-color: var(--primary); box-shadow: 0 6px 18px var(--shadow); }
.speech-btn.speaking { border-color: rgba(239,68,68,0.6); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.speech-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.translate-dropdown { position: relative; display: inline-block; }
.translate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(99,102,241,0.45);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  font-weight: 700;
  font-size: 0.82rem;
}
.translate-btn:hover { transform: translateY(-1px); border-color: var(--primary); box-shadow: 0 6px 18px var(--shadow); }

.translate-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--shadow);
  overflow: hidden;
  z-index: 2000;
}
.translate-menu.show { display: block; }
.translate-menu button {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
}
.translate-menu button:hover { background: rgba(99,102,241,0.12); }

.translating { opacity: 0.65; pointer-events: none; }
.translated-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(99,102,241,0.35);
  color: var(--text-primary);
}
.rtl-text { direction: rtl; text-align: right; }

/* === Weather widget === */
.weather-card{
  background: linear-gradient(135deg, rgba(109,213,250,0.25), rgba(41,128,185,0.20));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 18px;
  padding: 1.25rem;
}
.weather-title{ font-weight: 700; margin-bottom: 0.5rem; }
.weather-temp{ font-size: 2.25rem; font-weight: 800; margin: 0.25rem 0 0.75rem; }
.weather-row{ display:flex; justify-content:center; gap: 1.5rem; color: var(--text-muted); }
.weather-loc{ margin-top: 0.75rem; color: var(--text-muted); font-size: 0.9rem; }

/* === Buttons === */
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0px); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.35);
}
.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
}
.btn-success:hover { transform: translateY(-2px); }
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
}
.btn-danger:hover { transform: translateY(-2px); }
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: rgba(99, 102, 241, 0.1); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* === Forms === */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.3s ease;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.form-control.valid { border-color: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,0.14); }
.form-control.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239,68,68,0.14); }
select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-secondary); color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-text { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.35rem; }
.form-error { color: #fca5a5; font-size: 0.8rem; margin-top: 0.35rem; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

/* === Alert === */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* === Empty State === */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { font-size: 1rem; }

/* === Quick Actions === */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.action-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.75rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s ease;
}
.action-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.15);
}
.action-icon {
    width: 60px; height: 60px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transition: transform 0.3s ease;
}
.action-card:hover .action-icon { transform: scale(1.1); }
.action-title { font-weight: 600; font-size: 0.95rem; }

/* === Section Title === */
.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}
.section-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 0.45rem;
    border-radius: 10px;
    font-size: 0.95rem;
}

/* === AI Alert Card === */
.ai-card {
    border-color: rgba(239, 68, 68, 0.3) !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--bg-card)) !important;
}
.ai-alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}
.ai-alert-item:hover { background: rgba(239, 68, 68, 0.05); }
.ai-alert-item:last-child { border-bottom: none; }
.ai-alert-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(239, 68, 68, 0.15);
    flex-shrink: 0;
}
.ai-alert-content { flex: 1; }
.ai-alert-title { font-weight: 600; margin-bottom: 0.25rem; color: var(--text-primary); }
.ai-alert-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.ai-alert-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ai-alert-summary { margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }

[data-theme="light"] .ai-card {
    background: linear-gradient(135deg, #fff5f5, #ffffff) !important;
    border-color: #feb2b2 !important;
}
[data-theme="light"] .ai-alert-item:hover { background: #fff5f5; }
[data-theme="light"] .ai-alert-icon { background: #fed7d7; }

/* === Animations === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-25px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.03); }
}

/* === Responsive === */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .navbar-links a:not(.active) { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.5rem; }
    .main { padding: 1rem; }
    .table { font-size: 0.85rem; }
    .table th, .table td { padding: 0.75rem; }
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 0;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}
.pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination .prev, .pagination .next {
    padding: 0 1rem;
}
@media (max-width: 600px) {
    .pagination a, .pagination span { min-width: 36px; height: 36px; font-size: 0.85rem; }
    .pagination .prev, .pagination .next { padding: 0 0.5rem; }
}

