/* ============================================================
   YAMEE CLUSTER — Admin Panel CSS
   Light Theme · Same colour system as the main website
   ============================================================ */

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

/* ======================================================
   DESIGN TOKENS — Identical to global.css (home page)
   ====================================================== */
:root {
  /* Blues */
  --blue-1: #005DFF;
  --blue-2: #007DFF;
  --blue-3: #009BFF;
  --blue-4: #1AB8FF;
  --blue-5: #5FD7FF;

  /* Backgrounds */
  --bg-0: #FFFFFF;
  --bg-1: #FBFDFF;
  --bg-2: #F7FAFF;
  --bg-3: #F2F8FF;
  --bg-4: #EDF5FF;

  /* Glass */
  --glass-1: rgba(255,255,255,0.82);
  --glass-2: rgba(247,250,255,0.88);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #005DFF, #1AB8FF);
  --grad-deep:    linear-gradient(135deg, #005DFF, #007DFF, #009BFF);
  --grad-soft:    linear-gradient(135deg, rgba(0,93,255,0.1), rgba(90,215,255,0.07));

  /* Text */
  --text-primary:   #0A0F1E;
  --text-secondary: #1E2D40;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;

  /* Borders */
  --border-light:  rgba(0,93,255,0.10);
  --border-medium: rgba(0,93,255,0.18);

  /* Shadows */
  --shadow-sm: 0 2px 16px rgba(0,93,255,0.07);
  --shadow-md: 0 8px 40px rgba(0,93,255,0.10);
  --shadow-lg: 0 20px 70px rgba(0,93,255,0.14);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Fonts */
  --font:         'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;

  /* Ease */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --nav-width: 252px;
}

/* ======================================================
   RESET & BASE
   ====================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-2);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; }

/* ======================================================
   SIDEBAR NAVIGATION
   ====================================================== */
.admin-nav {
  width: var(--nav-width);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0;
  background: var(--bg-0);
  border-right: 1px solid var(--border-light);
  box-shadow: 2px 0 28px rgba(0,93,255,0.07);
  z-index: 200;
  display: flex;
  flex-direction: column;
}

/* Brand */
.admin-brand {
  padding: 1.3rem 1.4rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--bg-0);
}

.admin-brand a {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
}

.admin-brand img {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
}

.admin-brand-wordmark {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.025em;
  line-height: 1.1;
  display: block;
}

.admin-brand-sub {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-top: .15rem;
}

/* Nav label */
.admin-nav-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: .9rem 1.4rem .35rem;
}

/* Nav list */
.admin-nav ul {
  flex: 1;
  overflow-y: auto;
  padding: .35rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

/* Nav link */
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .72rem;
  padding: .6rem .95rem;
  border-radius: var(--radius-sm);
  font-size: .835rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .18s var(--ease);
  position: relative;
}

.admin-nav-link:hover {
  background: var(--bg-3);
  color: var(--blue-1);
}

.admin-nav-link.active {
  background: linear-gradient(135deg, rgba(0,93,255,0.09), rgba(26,184,255,0.05));
  color: var(--blue-1);
  font-weight: 600;
}

.admin-nav-link.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 18%; bottom: 18%;
  width: 3px;
  background: var(--grad-primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 17px; height: 17px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: .55;
  transition: opacity .18s;
}

.admin-nav-link:hover .nav-icon,
.admin-nav-link.active .nav-icon { opacity: 1; }

/* Nav footer */
.admin-nav-footer {
  padding: .9rem 1.4rem 1.2rem;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  flex-shrink: 0;
  background: var(--bg-1);
}

.admin-logout {
  font-size: .78rem;
  color: var(--text-muted);
  transition: color .18s;
  display: block;
  padding: .22rem 0;
}

.admin-logout:hover { color: var(--blue-1); }

/* Mobile toggle */
.admin-nav-toggle {
  display: none;
  position: fixed; top: 1rem; left: 1rem; z-index: 300;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--grad-primary);
  align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,93,255,0.35);
  border: none;
}

.admin-nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,15,30,0.35);
  z-index: 190;
  backdrop-filter: blur(3px);
}

/* ======================================================
   MAIN CONTENT
   ====================================================== */
.admin-main {
  margin-left: var(--nav-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
}

/* Header */
.admin-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  padding: .85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.admin-header-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.015em;
}

.admin-header-actions { display: flex; align-items: center; gap: .75rem; }

.admin-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(0,93,255,0.28);
}

.admin-content { padding: 1.8rem 2rem; flex: 1; }

/* ======================================================
   STAT CARDS
   ====================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-0);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(0,93,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-medium);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .2rem;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.stat-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ======================================================
   TABLE
   ====================================================== */
.admin-table-wrap {
  background: var(--bg-0);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-table-header {
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-1);
}

.admin-table-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .92rem;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

thead th {
  background: var(--bg-2);
  padding: .7rem 1.1rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

tbody td {
  padding: .85rem 1.1rem;
  font-size: .84rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

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

tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--bg-2); }

/* ======================================================
   BADGES
   ====================================================== */
.badge {
  display: inline-flex;
  padding: .22rem .62rem;
  border-radius: 20px;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.badge-success { background: rgba(56,161,105,.1);  color: #276749; border: 1px solid rgba(56,161,105,.2); }
.badge-warning { background: rgba(237,137,54,.1);  color: #c05621; border: 1px solid rgba(237,137,54,.2); }
.badge-info    { background: rgba(0,93,255,.08);   color: var(--blue-1); border: 1px solid rgba(0,93,255,.18); }
.badge-danger  { background: rgba(229,62,62,.08);  color: #c53030; border: 1px solid rgba(229,62,62,.18); }

/* ======================================================
   BUTTONS
   ====================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .58rem 1.2rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  transition: all .2s var(--ease);
  white-space: nowrap;
  cursor: pointer;
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .25s;
}
.btn:hover::before { opacity: 1; }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,93,255,0.3);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,93,255,0.42);
}

.btn-secondary {
  background: var(--glass-1);
  color: var(--blue-1);
  border: 1.5px solid var(--border-medium);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--bg-4);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background: rgba(229,62,62,.07);
  color: #c53030;
  border: 1px solid rgba(229,62,62,.2);
  border-radius: var(--radius-sm);
}

.btn-danger:hover { background: rgba(229,62,62,.14); }

.btn-sm { padding: .38rem .95rem; font-size: .75rem; }

/* ======================================================
   FORMS
   ====================================================== */
.admin-form {
  background: var(--bg-0);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.8rem 2rem;
  box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 1.15rem; }

.form-label {
  display: block;
  font-size: .73rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: .38rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: .68rem 1rem;
  background: var(--bg-2);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: .87rem;
  color: var(--text-primary);
  transition: all .2s var(--ease);
  outline: none;
  font-family: inherit;
}

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

.form-control:focus {
  border-color: var(--blue-3);
  background: var(--bg-0);
  box-shadow: 0 0 0 3px rgba(0,155,255,.1);
}

textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control { cursor: pointer; }

/* ======================================================
   PANELS
   ====================================================== */
.panel {
  background: var(--bg-0);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-1);
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .88rem;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.panel-body { padding: 1.4rem 1.5rem; }

/* ======================================================
   ALERTS
   ====================================================== */
.alert {
  padding: .85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-size: .84rem;
  font-weight: 500;
}

.alert-success { background: rgba(56,161,105,.08); border: 1px solid rgba(56,161,105,.22); color: #276749; }
.alert-error   { background: rgba(229,62,62,.07);  border: 1px solid rgba(229,62,62,.22);  color: #c53030; }

/* ======================================================
   CHARTS
   ====================================================== */
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }

/* ======================================================
   PAGINATION
   ====================================================== */
.pagination {
  display: flex; align-items: center; gap: .35rem;
  padding: .9rem 1.5rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.page-btn {
  min-width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 600;
  color: var(--text-muted);
  transition: all .18s;
  padding: 0 .3rem;
}

.page-btn:hover { background: var(--bg-3); color: var(--blue-1); }
.page-btn.active { background: var(--grad-primary); color: #fff; box-shadow: 0 3px 10px rgba(0,93,255,.28); }

/* ======================================================
   FILTER BAR
   ====================================================== */
.filter-bar {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap; margin-bottom: 1.5rem;
}

/* ======================================================
   MODAL
   ====================================================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,15,30,0.45);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: fadeIn .2s ease;
}

.modal-box {
  background: var(--bg-0);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px;
  max-height: 88vh; overflow-y: auto;
  padding: 2rem;
  animation: slideUp .25s var(--ease);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.4rem;
}

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

/* ======================================================
   SCROLLBAR
   ====================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,93,255,.18); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,93,255,.32); }

/* ======================================================
   DASHBOARD-SPECIFIC EXTRAS
   ====================================================== */

/* Welcome banner */
.dash-welcome {
  background: linear-gradient(135deg, var(--bg-0) 0%, var(--bg-3) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.6rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dash-welcome::before {
  content: '';
  position: absolute; top: -40px; right: -50px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(0,93,255,0.07) 0%, transparent 65%);
  pointer-events: none;
}

.dash-welcome::after {
  content: '';
  position: absolute; bottom: -30px; left: 40%;
  width: 130px; height: 130px;
  background: radial-gradient(circle, rgba(26,184,255,0.05) 0%, transparent 65%);
  pointer-events: none;
}

.dash-welcome-greeting {
  font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -.03em; margin-bottom: .3rem; line-height: 1.2;
}

.dash-welcome-sub {
  font-size: .83rem; color: var(--text-muted); letter-spacing: .03em;
}

.dash-welcome-sub strong { color: var(--blue-1); font-weight: 600; }

/* Section dividers */
.section-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 2rem 0 1.1rem;
}

.section-divider-label {
  font-family: var(--font-display);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue-1); white-space: nowrap;
}

.section-divider-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-medium), transparent);
}

/* System info rows */
.sys-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem 0; border-bottom: 1px solid var(--border-light);
}
.sys-row:last-child { border-bottom: none; }
.sys-row-key { font-size: .8rem; color: var(--text-muted); }
.sys-row-val { font-size: .8rem; font-weight: 600; color: var(--blue-1); }

/* Stat card icon */
.stat-card-icon { font-size: 1.4rem; margin-bottom: .5rem; display: block; }

/* Quick action links */
.quick-action-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .95rem;
  border-radius: var(--radius-sm);
  font-size: .83rem; font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  background: var(--bg-1);
  transition: all .2s var(--ease);
  cursor: pointer;
}

.quick-action-link:hover {
  color: var(--blue-1);
  border-color: var(--border-medium);
  background: var(--bg-3);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.quick-action-icon {
  font-size: .95rem; flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,93,255,0.07);
  border-radius: 7px;
}

/* ======================================================
   LOGIN PAGE
   ====================================================== */
/* Used in login.php only */
.login-wrap {
  width: 100%; max-width: 440px;
  position: relative; z-index: 1; padding: 1rem;
}

/* ======================================================
   MOBILE RESPONSIVE
   ====================================================== */
@media (max-width: 1100px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .chart-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-nav {
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
    box-shadow: none;
  }
  .admin-nav.open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,0.12); }
  .admin-nav-overlay.open { display: block; }
  .admin-nav-toggle { display: flex; }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 1.2rem 1rem; }
  .admin-header { padding: .75rem 1rem .75rem 4rem; }
  .admin-form { padding: 1.2rem 1rem; }
}

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