/* admin/assets/admin.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-bg: #0f1f2e;
  --sidebar-text: rgba(255,255,255,.75);
  --sidebar-active: #f59e0b;
  --sidebar-hover: rgba(255,255,255,.08);
  --sidebar-w: 240px;
  --header-h: 60px;
  --primary: #2563a8;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 8px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  margin: 0;
}

/* ── LAYOUT ── */
.admin-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .3s;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-brand {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-brand .brand-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #0f1f2e;
}
.sidebar-brand .brand-text {
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  line-height: 1.2;
}
.sidebar-brand .brand-sub { font-size: .7rem; color: rgba(255,255,255,.4); font-weight: 400; }

.sidebar-section {
  padding: 1rem 0;
}
.sidebar-section-title {
  padding: .4rem 1.5rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.25);
  margin-bottom: .2rem;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .18s;
  white-space: nowrap;
}
.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-nav a.active {
  background: rgba(245,158,11,.12);
  color: var(--accent);
  border-left-color: var(--accent);
}
.sidebar-nav a i { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-nav a .badge {
  margin-left: auto;
  background: var(--accent);
  color: #0f1f2e;
  font-size: .65rem;
  padding: .15em .5em;
  border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: color .2s;
}
.sidebar-footer a:hover { color: #fff; }

/* ── MAIN CONTENT ── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOP BAR ── */
.admin-topbar {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.topbar-user { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.topbar-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: .8rem;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .5rem;
  cursor: pointer;
}

/* ── PAGE BODY ── */
.admin-body { padding: 1.5rem; flex: 1; }

/* ── STATS CARDS ── */
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(37,99,168,.12); color: var(--primary); }
.stat-icon.amber  { background: rgba(245,158,11,.12); color: var(--accent); }
.stat-icon.green  { background: rgba(22,163,74,.12);  color: var(--success); }
.stat-icon.red    { background: rgba(220,38,38,.12);  color: var(--danger); }
.stat-info h3 { font-size: 1.6rem; font-weight: 700; margin: 0; line-height: 1; color: var(--text); }
.stat-info p  { margin: .2rem 0 0; font-size: .8rem; color: var(--text-muted); }

/* ── CARDS ── */
.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.admin-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.admin-card-header h5 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
}
.admin-card-body { padding: 1.25rem; }

/* ── TABLES ── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: var(--bg);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: .88rem;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafbfc; }
.admin-table .actions { display: flex; gap: .4rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.1rem; }
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .35rem; display: block; color: var(--text); }
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: .55rem .85rem;
  font-size: .9rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,168,.12);
  outline: none;
}
textarea.form-control { min-height: 100px; resize: vertical; }

/* ── BUTTONS ── */
.btn { border-radius: 7px; font-size: .85rem; font-weight: 500; padding: .45rem .95rem; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; gap: .35rem; transition: all .18s; }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #1d4f8a; }
.btn-danger    { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover  { background: #b91c1c; }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-warning   { background: var(--accent);  color: #0f1f2e; border-color: var(--accent); }
.btn-secondary { background: #e2e8f0; color: var(--text); border-color: #e2e8f0; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: .3rem .65rem; font-size: .78rem; }
.btn-lg { padding: .65rem 1.4rem; font-size: .95rem; }

/* ── BADGES ── */
.badge { font-size: .7rem; font-weight: 600; padding: .25em .6em; border-radius: 20px; }
.badge-success { background: rgba(22,163,74,.12); color: var(--success); }
.badge-danger  { background: rgba(220,38,38,.12);  color: var(--danger); }
.badge-warning { background: rgba(245,158,11,.12); color: var(--accent); }
.badge-info    { background: rgba(37,99,168,.12);  color: var(--primary); }

/* ── ALERTS ── */
.alert { border-radius: 8px; padding: .75rem 1rem; font-size: .88rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: rgba(22,163,74,.1);  border-color: rgba(22,163,74,.25);  color: #15803d; }
.alert-danger  { background: rgba(220,38,38,.1);  border-color: rgba(220,38,38,.25);  color: #b91c1c; }
.alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); color: #b45309; }
.alert-info    { background: rgba(37,99,168,.1);  border-color: rgba(37,99,168,.25);  color: #1d4f8a; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0; }
.pagination .page-link { padding: .4rem .75rem; border: 1px solid var(--border); border-radius: 7px; color: var(--primary); font-size: .85rem; text-decoration: none; transition: all .15s; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page-item.disabled .page-link { color: var(--text-muted); pointer-events: none; }

/* ── TOGGLE SWITCH ── */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track {
  width: 42px; height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background .2s;
}
.toggle-switch input:checked ~ .toggle-track { background: var(--success); }
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked ~ .toggle-track::after { transform: translateX(20px); }

/* ── RICH EDITOR PLACEHOLDER ── */
#description { min-height: 300px; }

/* ── RESPONSIVE ── */
@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 576px) {
  .admin-body { padding: 1rem; }
  .stat-card { padding: 1rem; }
}

/* ── UTILITY ── */
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.flex-wrap { flex-wrap: wrap; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.ms-auto { margin-left: auto; }
.w-100 { width: 100%; }
.mt-3 { margin-top: .75rem; }
.mb-3 { margin-bottom: .75rem; }
.p-0 { padding: 0; }
.text-muted { color: var(--text-muted); }
.fw-600 { font-weight: 600; }
