:root {
  --color-primary: #0F172A;
  --color-secondary: #2563EB;
  --color-secondary-hover: #1D4ED8;
  --color-accent: #F59E0B;
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-text: #1E293B;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  --color-success: #16A34A;
  --color-danger: #DC2626;
  --font-display: 'Poppins', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --sidebar-width: 240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
}

a { color: inherit; text-decoration: none; }

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-primary);
  color: #fff;
  flex-shrink: 0;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
  line-height: 1.3;
}

.sidebar__brand span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: #94A3B8;
  margin-top: 4px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #CBD5E1;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 150ms;
}

.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: var(--color-secondary); color: #fff; }

.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0;
}

.content { padding: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary { background: var(--color-secondary); color: #fff; }
.btn-primary:hover { background: var(--color-secondary-hover); }
.btn-outline { background: #fff; border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover { background: var(--color-bg); }
.btn-danger { background: #fff; border-color: var(--color-danger); color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 20px; }
.card__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card__header h2 { margin: 0; font-size: 1rem; font-family: var(--font-display); }
.card__body { padding: 22px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card__label { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 500; }
.stat-card__value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-top: 6px; }
.stat-card__value.danger { color: var(--color-danger); }

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
th { color: var(--color-text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: var(--color-bg); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-neutral { background: #E2E8F0; color: #334155; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-group .hint { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=file], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}
textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 18px;
}
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 180px; }

.pagination-wrap { margin-top: 18px; }
.admin-pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-pagination__pages { display: flex; align-items: center; flex-wrap: wrap; }
.admin-pagination a,
.admin-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.65rem;
  margin-left: -1px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.admin-pagination a:hover { position: relative; z-index: 1; background: var(--color-bg); color: var(--color-primary); }
.admin-pagination .pagination-current { position: relative; z-index: 1; background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.admin-pagination .pagination-nav { min-width: auto; margin-left: 0; border-radius: var(--radius-sm); }
.admin-pagination .pagination-next { margin-left: 0; }
.admin-pagination .pagination-disabled { color: var(--color-text-muted); background: var(--color-bg); cursor: not-allowed; }
.admin-pagination .pagination-ellipsis { min-width: 2rem; border-color: transparent; background: transparent; }
.admin-pagination__pages > :first-child > * { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.admin-pagination__pages > :last-child > * { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

@media (max-width: 640px) {
  .admin-pagination { gap: 6px; }
  .admin-pagination a,
  .admin-pagination span { min-width: 2rem; height: 2rem; padding: 0 0.5rem; }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.login-card h1 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 4px; }
.login-card p.sub { color: var(--color-text-muted); font-size: 0.875rem; margin: 0 0 24px; }

.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--color-bg); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.gallery-item { position: relative; display: block; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; }
.gallery-thumb { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--color-bg); }
.gallery-item__remove { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 0.75rem; background: rgba(0,0,0,0.55); color: #fff; }
.gallery-item__remove input { width: auto; margin: 0; }
.gallery-item:has(input:checked) { outline: 2px solid var(--color-danger, #dc2626); }
.gallery-item:has(input:checked) .gallery-thumb { opacity: 0.5; }
.text-muted { color: var(--color-text-muted); }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Premium visual refresh ------------------------------------------------ */
:root {
  --color-primary: #0A1726;
  --color-secondary: #087F78;
  --color-secondary-hover: #066861;
  --color-accent: #D5A23D;
  --color-bg: #F4F7FA;
  --color-text: #172638;
  --color-border: #DFE7EE;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 2px rgba(10, 23, 38, .05), 0 5px 16px rgba(10, 23, 38, .035);
  --shadow-md: 0 14px 34px rgba(10, 23, 38, .09), 0 3px 8px rgba(10, 23, 38, .04);
}

body {
  background:
    radial-gradient(circle at 100% 0, rgba(8, 127, 120, .075), transparent 32rem),
    radial-gradient(circle at 25% 100%, rgba(213, 162, 61, .06), transparent 28rem),
    var(--color-bg);
}

.sidebar {
  background: linear-gradient(180deg, #0A1726 0%, #102D42 100%);
  padding: 28px 16px;
  box-shadow: 12px 0 32px rgba(10, 23, 38, .08);
}
.sidebar__brand {
  font-size: 1.15rem;
  letter-spacing: -.035em;
  padding-bottom: 26px;
}
.sidebar__brand span { color: #91A7BA; letter-spacing: .02em; }
.sidebar nav a {
  padding: 11px 13px;
  border: 1px solid transparent;
  margin-bottom: 5px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); transform: translateX(2px); }
.sidebar nav a.active {
  background: linear-gradient(135deg, var(--color-secondary), #0B958C);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  padding: 16px 36px;
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.topbar h1 { font-size: 1.35rem; letter-spacing: -.035em; }
.content { padding: 34px 36px 48px; }

.btn {
  border-radius: 999px;
  padding: 10px 17px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--color-secondary), #0B958C);
  box-shadow: 0 8px 18px rgba(8,127,120,.2);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--color-secondary-hover), var(--color-secondary)); box-shadow: 0 12px 24px rgba(8,127,120,.26); }
.btn-outline { background: rgba(255,255,255,.75); }
.btn-danger { background: #fff; }

.card, .stat-card {
  border-color: rgba(223,231,238,.9);
  box-shadow: var(--shadow-sm);
}
.card { overflow: hidden; }
.card__header { padding: 20px 24px; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(248,250,252,.58)); }
.card__header h2 { font-size: 1.02rem; letter-spacing: -.02em; }
.card__body { padding: 24px; }
.stat-grid { gap: 18px; }
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--color-secondary); }
.stat-card:nth-child(2)::before, .stat-card:nth-child(5)::before { background: var(--color-accent); }
.stat-card:nth-child(3)::before { background: #5B6EE1; }
.stat-card:nth-child(4)::before { background: #3A9B67; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card__label { text-transform: uppercase; letter-spacing: .07em; font-size: .72rem; }
.stat-card__value { font-size: 1.8rem; letter-spacing: -.045em; }

table { font-size: .875rem; }
th, td { padding: 14px 16px; }
th { background: #F8FAFC; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(8,127,120,.045); }
.badge { padding: 4px 10px; letter-spacing: .01em; }

input[type=text], input[type=email], input[type=number], input[type=password], input[type=file], select, textarea {
  padding: 11px 13px;
  border-color: var(--color-border);
  box-shadow: inset 0 1px 1px rgba(10,23,38,.02);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 4px rgba(8,127,120,.12); }
.filters { gap: 12px; }

.login-page { background: radial-gradient(circle at 15% 15%, rgba(213,162,61,.16), transparent 26rem), linear-gradient(135deg, #0A1726, #123A50); }
.login-card { border: 1px solid rgba(255,255,255,.7); box-shadow: 0 26px 70px rgba(0,0,0,.25); }

@media (max-width: 900px) {
  .sidebar { width: 210px; }
  .topbar, .content { padding-left: 24px; padding-right: 24px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .admin-shell { display: block; }
  .sidebar { width: auto; height: auto; position: static; padding: 18px; }
  .sidebar__brand { padding-bottom: 14px; margin-bottom: 10px; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 6px; }
  .sidebar nav a { white-space: nowrap; margin: 0; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .content { padding-top: 22px; }
  .topbar { min-height: 64px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .flex-between { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .card { overflow-x: auto; }
}

/* Notification bell */
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -6px; right: -8px;
  background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 320px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12); z-index: 40;
  max-height: 360px; overflow-y: auto;
}
.notif-item form, .notif-item { border-bottom: 1px solid #f1f5f9; }
.notif-item:last-child { border-bottom: none; }
.notif-item__link {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 12px 14px; cursor: pointer; font: inherit; color: inherit;
}
.notif-item__link:hover { background: #f8fafc; }
.notif-item__link span { display: block; color: #64748b; font-size: 12.5px; margin-top: 2px; }
.notif-empty { padding: 16px; color: #94a3b8; font-size: 13px; text-align: center; }
