/* ─── Admin Variables ────────────────────────────────────────────────────── */
:root {
  --adm-sidebar: #0f172a;
  --adm-sidebar-hover: #1e293b;
  --adm-sidebar-active: #1e3a8a;
  --adm-accent: #f97316;
  --adm-blue: #3b82f6;
  --adm-green: #059669;
  --adm-red: #dc2626;
  --adm-yellow: #d97706;
  --adm-bg: #f1f5f9;
  --adm-card: #ffffff;
  --adm-border: #e2e8f0;
  --adm-text: #1e293b;
  --adm-text-m: #64748b;
  --adm-shadow: 0 2px 12px rgba(0,0,0,.07);
  --adm-radius: 10px;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--adm-bg); color: var(--adm-text); font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
h1,h2,h3,h4 { font-family: 'Poppins', sans-serif; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.adm-wrap { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.adm-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--adm-sidebar);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.adm-logo {
  padding: 1.5rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: .6rem;
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.1rem; color: #fff;
}
.adm-logo .logo-icon {
  width: 34px; height: 34px; background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: #fff;
}
.adm-logo span { color: var(--adm-accent); }
.adm-nav { flex: 1; padding: 1rem 0; }
.adm-nav-section { padding: .3rem 1.25rem .5rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.3); margin-top: .5rem; }
.adm-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem 1.25rem; color: rgba(255,255,255,.65);
  font-size: .875rem; font-weight: 500;
  transition: background .2s, color .2s; border-radius: 0;
}
.adm-nav a i { width: 16px; text-align: center; font-size: .9rem; }
.adm-nav a:hover  { background: var(--adm-sidebar-hover); color: #fff; }
.adm-nav a.active { background: var(--adm-sidebar-active); color: #fff; }
.adm-nav a .badge {
  margin-left: auto; background: var(--adm-accent); color: #fff;
  font-size: .68rem; padding: .15rem .5rem; border-radius: 50px; font-weight: 700;
}
.adm-sidebar-footer {
  padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.06);
  font-size: .8rem; color: rgba(255,255,255,.4);
}
.adm-sidebar-footer .admin-name { color: rgba(255,255,255,.8); font-weight: 600; font-size: .875rem; display: block; margin-bottom: .2rem; }

/* ─── Main content ──────────────────────────────────────────────────────── */
.adm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.adm-topbar {
  background: var(--adm-card); border-bottom: 1px solid var(--adm-border);
  padding: 0 2rem; height: 60px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.adm-topbar h1 { font-size: 1.1rem; font-weight: 700; }
.adm-topbar-actions { display: flex; align-items: center; gap: .75rem; }
.adm-topbar-actions a, .adm-topbar-actions button {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem; border-radius: 7px; font-size: .8rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s;
}
.btn-adm-primary { background: var(--adm-sidebar-active); color: #fff; }
.btn-adm-primary:hover { opacity: .88; }
.btn-adm-danger  { background: var(--adm-red); color: #fff; }
.btn-adm-danger:hover { opacity: .88; }
.btn-adm-outline { background: transparent; color: var(--adm-text-m); border: 1.5px solid var(--adm-border) !important; }
.btn-adm-outline:hover { border-color: var(--adm-blue) !important; color: var(--adm-blue); }
.btn-adm-green   { background: var(--adm-green); color: #fff; }
.btn-adm-green:hover { opacity: .88; }
.adm-content { padding: 2rem; flex: 1; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.adm-card { background: var(--adm-card); border-radius: var(--adm-radius); border: 1px solid var(--adm-border); box-shadow: var(--adm-shadow); }
.adm-card-header { padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--adm-border); display: flex; align-items: center; justify-content: space-between; }
.adm-card-header h3 { font-size: .95rem; font-weight: 700; }
.adm-card-body { padding: 1.5rem; }

/* ─── Dashboard stat cards ──────────────────────────────────────────────── */
.adm-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 2rem; }
.adm-stat-card {
  background: var(--adm-card); border-radius: var(--adm-radius); border: 1px solid var(--adm-border);
  padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--adm-shadow);
}
.adm-stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.si-blue   { background: #dbeafe; color: var(--adm-sidebar-active); }
.si-orange { background: #ffedd5; color: var(--adm-accent); }
.si-green  { background: #d1fae5; color: var(--adm-green); }
.si-purple { background: #ede9fe; color: #7c3aed; }
.adm-stat-info strong { display: block; font-size: 1.5rem; font-family:'Poppins',sans-serif; font-weight: 700; line-height: 1; }
.adm-stat-info span   { font-size: .8rem; color: var(--adm-text-m); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.adm-table-wrap { overflow-x: auto; }
table.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th {
  text-align: left; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--adm-text-m); padding: .75rem 1rem;
  border-bottom: 2px solid var(--adm-border); background: #f8fafc;
}
.adm-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--adm-border); font-size: .875rem; vertical-align: middle; }
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: #f8fafc; }
.adm-table .actions { display: flex; gap: .4rem; }
.adm-table .btn-sm {
  padding: .3rem .7rem; border-radius: 6px; font-size: .75rem; font-weight: 600;
  border: none; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; transition: opacity .2s;
}
.adm-table .btn-sm:hover { opacity: .8; }
.btn-sm-blue   { background: #dbeafe; color: var(--adm-sidebar-active); }
.btn-sm-red    { background: #fee2e2; color: var(--adm-red); }
.btn-sm-green  { background: #d1fae5; color: var(--adm-green); }
.btn-sm-yellow { background: #fef3c7; color: var(--adm-yellow); }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.adm-form { display: flex; flex-direction: column; gap: 1.1rem; }
.adm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.adm-field { display: flex; flex-direction: column; gap: .35rem; }
.adm-field label { font-size: .8rem; font-weight: 700; color: var(--adm-text); }
.adm-field input, .adm-field textarea, .adm-field select {
  border: 1.5px solid var(--adm-border); border-radius: 7px;
  padding: .6rem .9rem; color: var(--adm-text); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.adm-field input:focus, .adm-field textarea:focus, .adm-field select:focus {
  outline: none; border-color: var(--adm-blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.adm-field textarea { resize: vertical; min-height: 90px; }
.adm-field .hint { font-size: .75rem; color: var(--adm-text-m); }
.adm-form-section { border-top: 1px solid var(--adm-border); padding-top: 1.25rem; margin-top: .5rem; }
.adm-form-section h4 { font-size: .875rem; color: var(--adm-text-m); margin-bottom: 1rem; }

/* ─── Badges / status ────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 50px; font-size: .7rem; font-weight: 700; }
.badge-green  { background: #d1fae5; color: var(--adm-green); }
.badge-orange { background: #ffedd5; color: var(--adm-accent); }
.badge-blue   { background: #dbeafe; color: var(--adm-sidebar-active); }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-gray   { background: #f1f5f9; color: var(--adm-text-m); }
.badge-red    { background: #fee2e2; color: var(--adm-red); }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.adm-alert { padding: .85rem 1.1rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: .875rem; display: flex; align-items: center; gap: .6rem; }
.adm-alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.adm-alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.adm-alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.adm-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--adm-border); margin-bottom: 1.5rem; }
.adm-tab {
  padding: .65rem 1.25rem; font-size: .875rem; font-weight: 600; color: var(--adm-text-m);
  border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; transition: all .2s;
}
.adm-tab.active { color: var(--adm-sidebar-active); border-bottom-color: var(--adm-sidebar-active); }
.adm-tab-content { display: none; }
.adm-tab-content.active { display: block; }

/* ─── Settings sections ──────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.settings-grid .full { grid-column: 1 / -1; }

/* ─── Login page ─────────────────────────────────────────────────────────── */
.adm-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
}
.adm-login-card {
  background: #fff; border-radius: 16px; padding: 3rem 2.5rem;
  width: 100%; max-width: 400px; box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.adm-login-logo { text-align: center; margin-bottom: 2rem; }
.adm-login-logo .logo-big {
  width: 64px; height: 64px; background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; color: #fff; margin: 0 auto 1rem;
}
.adm-login-logo h2 { font-size: 1.4rem; color: #0f172a; }
.adm-login-logo p  { font-size: .85rem; color: #64748b; }
.adm-login-form .adm-field { margin-bottom: 1rem; }
.adm-login-btn {
  width: 100%; padding: .8rem; background: #1e3a8a; color: #fff;
  border: none; border-radius: 8px; font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: background .2s; margin-top: .5rem;
}
.adm-login-btn:hover { background: #172d6e; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .adm-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .adm-sidebar { width: 200px; }
  .adm-form-row, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .adm-sidebar { display: none; }
  .adm-content { padding: 1rem; }
  .adm-stats-grid { grid-template-columns: 1fr 1fr; }
}
