@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --dark: #050D1A; --dark2: #0A1628; --dark3: #0D1F3C;
  --blue: #1565C0; --accent: #00B4FF;
  --white: #FFFFFF; --gray: #94A3B8; --gray2: #64748B;
  --border: rgba(0,180,255,0.15); --glow: 0 0 20px rgba(0,180,255,0.3);
  --success: #10B981; --danger: #EF4444; --warning: #F59E0B;
  --font: 'Outfit', sans-serif; --sidebar: 260px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--dark); color: var(--white); display: flex; min-height: 100vh; }

/* SIDEBAR */
.admin-sidebar {
  width: var(--sidebar); min-height: 100vh; background: var(--dark2);
  border-right: 1px solid var(--border); position: fixed; top: 0; left: 0;
  display: flex; flex-direction: column; z-index: 100; transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px; background: linear-gradient(135deg, var(--blue), var(--accent));
  border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.sidebar-logo span { font-size: 1.1rem; font-weight: 800; }
.sidebar-logo span em { color: var(--accent); font-style: normal; }
.sidebar-nav { flex: 1; padding: 20px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gray2); padding: 16px 8px 8px; font-weight: 600;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: 8px; color: var(--gray); font-size: 0.9rem; font-weight: 500;
  text-decoration: none; transition: all 0.2s ease; margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(0,180,255,0.08); color: var(--white); }
.sidebar-link.active { background: rgba(0,180,255,0.15); color: var(--accent); border: 1px solid rgba(0,180,255,0.2); }
.sidebar-link .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: rgba(0,180,255,0.05); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem;
}
.user-name { font-size: 0.9rem; font-weight: 600; }
.user-role { font-size: 0.75rem; color: var(--gray); }
.logout-btn {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; width: 100%;
  padding: 10px 12px; border-radius: 8px; background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2); color: var(--danger);
  cursor: pointer; font-family: var(--font); font-size: 0.85rem; font-weight: 500; transition: all 0.2s;
}
.logout-btn:hover { background: rgba(239,68,68,0.2); }

/* MAIN CONTENT */
.admin-main { margin-left: var(--sidebar); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-header {
  position: sticky; top: 0; z-index: 50; background: rgba(5,13,26,0.95);
  backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
  padding: 16px 28px; display: flex; align-items: center; justify-content: space-between;
}
.admin-header h1 { font-size: 1.3rem; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.admin-body { padding: 28px; flex: 1; }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--dark2); border: 1px solid var(--border); border-radius: 12px; padding: 22px;
  display: flex; align-items: center; gap: 16px; transition: all 0.3s;
}
.stat-card:hover { border-color: rgba(0,180,255,0.3); box-shadow: var(--glow); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0;
}
.stat-icon.blue { background: rgba(21,101,192,0.2); }
.stat-icon.cyan { background: rgba(0,180,255,0.15); }
.stat-icon.green { background: rgba(16,185,129,0.15); }
.stat-icon.orange { background: rgba(245,158,11,0.15); }
.stat-val { font-size: 1.8rem; font-weight: 800; }
.stat-lbl { font-size: 0.8rem; color: var(--gray); }
@media(max-width:900px){ .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:500px){ .stats-grid { grid-template-columns: 1fr; } }

/* TABLES */
.admin-table-wrap { background: var(--dark2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.table-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.table-head h3 { font-size: 1rem; }
table { width: 100%; border-collapse: collapse; }
thead th { background: rgba(0,180,255,0.05); padding: 12px 16px; text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); border-bottom: 1px solid var(--border); }
tbody td { padding: 14px 16px; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* BADGES */
.badge-pill { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(0,180,255,0.15); color: var(--accent); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 8px; font-family: var(--font); font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--accent)); color: var(--white); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--gray); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-success { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }

/* FORMS */
.form-card { background: var(--dark2); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; font-size: 0.85rem; font-weight: 500; color: var(--gray); }
.form-control { width: 100%; background: var(--dark); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; color: var(--white); font-family: var(--font); font-size: 0.9rem; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--accent); }
select.form-control option { background: var(--dark2); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-section-title { font-size: 1rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
@media(max-width:600px){ .form-grid { grid-template-columns: 1fr; } }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 500; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--dark2); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 90%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h3 { font-size: 1.2rem; }
.modal-close { background: none; border: none; color: var(--gray); font-size: 1.5rem; cursor: pointer; line-height: 1; }

/* RESPONSIVE */
@media(max-width:768px){
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-header { padding: 14px 16px; }
  .admin-body { padding: 16px; }
}

/* TOAST */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--dark2); border: 1px solid var(--accent); color: var(--white); padding: 14px 20px; border-radius: 10px; font-size: 0.9rem; z-index: 9999; transform: translateX(200%); transition: transform 0.4s ease; box-shadow: var(--glow); }
.toast.show { transform: translateX(0); }

/* LOGIN PAGE */
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%); }
.login-card { background: rgba(13,31,60,0.8); border: 1px solid var(--border); border-radius: 20px; padding: 48px 40px; width: 100%; max-width: 420px; backdrop-filter: blur(20px); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon { width: 64px; height: 64px; background: linear-gradient(135deg, var(--blue), var(--accent)); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto 12px; }
.login-logo h1 { font-size: 1.4rem; }
.login-logo p { color: var(--gray); font-size: 0.85rem; margin-top: 4px; }
