/* Self-hosted Plus Jakarta Sans (variable font) */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../../../assets/fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../../../assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  /* Ink sidebar palette */
  --ink:           #13131a;
  --ink-2:         #1c1c26;
  --ink-3:         #252535;
  --ink-border:    #2e2e42;
  --ink-muted:     #6b6b85;
  --ink-text:      #b0b0c8;
  --ink-text-2:    #e0e0ee;

  /* Accent — emerald (sustainability) */
  --accent:        #10b981;
  --accent-dark:   #059669;
  --accent-light:  #d1fae5;
  --accent-glow:   rgba(16,185,129,.18);

  /* Status */
  --green:         #10b981;
  --green-light:   #d1fae5;
  --red:           #ef4444;
  --red-light:     #fee2e2;
  --amber:         #f59e0b;
  --amber-light:   #fef3c7;
  --blue:          #3b82f6;
  --blue-light:    #eff6ff;

  /* Content area */
  --surface:   #ffffff;
  --bg:        #f4f4f0;
  --bg-2:      #f9f9f7;
  --border:    #e6e5e0;
  --border-2:  #d4d3ce;
  --text:      #1a1a16;
  --text-2:    #3d3d38;
  --muted:     #7a7a72;
  --muted-2:   #a8a8a0;

  --radius:    12px;
  --radius-sm: 7px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 4px rgba(26,26,22,.06), 0 1px 2px rgba(26,26,22,.04);
  --shadow-md: 0 4px 20px rgba(26,26,22,.08), 0 1px 4px rgba(26,26,22,.04);
  --shadow-lg: 0 12px 40px rgba(26,26,22,.14), 0 2px 8px rgba(26,26,22,.06);

  --purple:    #8b5cf6;

  --sidebar-w: 252px;
  --topbar-h:  58px;
  --tr:        .16s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.fw-600 { font-weight: 600; }
.flex-1 { flex: 1; }

/* ── Topbar ─────────────────────────────────────────────────────────────────── */
.admin-topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.5rem;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 991px) { .admin-topbar { left: 0; } }
.topbar-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: .4rem; border-radius: var(--radius-sm);
  color: var(--text); font-size: 1.3rem; line-height: 1; align-items: center;
}
.topbar-hamburger:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (max-width: 991px) { .topbar-hamburger { display: flex; } }
.topbar-brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: .95rem; color: var(--ink-text-2);
}
.topbar-brand:hover { text-decoration: none; }
.brand-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-glow);
  flex-shrink: 0;
}
.topbar-search { flex: 1; max-width: 320px; margin-left: .25rem; position: relative; }
.topbar-search input {
  width: 100%; padding: .42rem .85rem .42rem 2.1rem;
  border: 1px solid var(--border); border-radius: 99px;
  font-size: .82rem; background: var(--bg); color: var(--text);
  font-family: inherit;
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
}
.topbar-search input:focus {
  outline: none; border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.topbar-search-icon {
  position: absolute; left: .72rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .82rem; pointer-events: none;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.topbar-logout-mobile { display: none; }
@media (max-width: 991px) { .topbar-logout-mobile { display: flex; } }
.topbar-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 1.05rem;
  transition: background var(--tr), color var(--tr);
}
.topbar-btn:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.topbar-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; cursor: default; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem 0 1.15rem;
  height: var(--topbar-h);
  background: var(--ink-2);
  border-bottom: 1px solid var(--ink-border);
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 2;
}
.sidebar-brand-link {
  display: flex; align-items: center; gap: .7rem;
  text-decoration: none;
}
.sidebar-brand-link:hover { text-decoration: none; }
.sidebar-brand-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
  border-radius: 9px;
  box-shadow: 0 0 16px var(--accent-glow);
}
.sidebar-brand-name {
  font-size: .92rem; font-weight: 800; color: var(--ink-text-2);
  letter-spacing: -.02em; line-height: 1.2;
}
.sidebar-brand-sub {
  font-size: .66rem; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.admin-sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--ink);
  overflow-y: auto;
  padding: 0 0 2rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: transform var(--tr);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-3) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 99px; }
@media (max-width: 991px) {
  .admin-sidebar { box-shadow: var(--shadow-lg); transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
}


.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 998;
}
.sidebar-overlay.open { display: block; }
.sidebar-close {
  display: none; background: none; border: none;
  padding: .6rem 1rem; color: var(--ink-muted); cursor: pointer; font-size: 1.1rem;
}
.sidebar-close:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
@media (max-width: 991px) { .sidebar-close { display: flex; align-items: center; } }
.sidebar-section-label {
  font-size: .64rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-muted);
  padding: 1.25rem 1.25rem .3rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem 1rem; margin: .08rem .65rem;
  border-radius: var(--radius-sm);
  color: var(--ink-text); font-size: .845rem; font-weight: 500;
  transition: background var(--tr), color var(--tr); text-decoration: none;
}
.sidebar-link:hover {
  background: var(--ink-3); color: var(--ink-text-2); text-decoration: none;
}
.sidebar-link.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar-link i { font-size: .95rem; width: 1.1rem; text-align: center; flex-shrink: 0; }
.sidebar-divider { height: 1px; background: var(--ink-border); margin: .5rem 1.25rem; }
.sidebar-footer {
  padding: 1rem 1.1rem; border-top: 1px solid var(--ink-border); margin-top: auto;
  display: flex; align-items: center; gap: .65rem;
  background: var(--ink-2);
  position: sticky; bottom: 0;
}
.sidebar-footer-name { font-size: .82rem; font-weight: 600; color: var(--ink-text-2); }
.sidebar-footer-role {
  font-size: .7rem; color: var(--ink-muted);
  display: block; text-transform: capitalize;
}
.sidebar-footer .topbar-btn { color: var(--ink-muted); }
.sidebar-footer .topbar-btn:hover { background: var(--ink-3); color: var(--ink-text-2); }

/* ── Main ───────────────────────────────────────────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
  padding: 1.75rem 1.75rem 3rem;
  min-height: calc(100vh - var(--topbar-h));
}
@media (max-width: 991px) { .admin-main { margin-left: 0; padding: 1.25rem 1rem; } }

/* ── Page Header ────────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.75rem; gap: 1rem; flex-wrap: wrap;
}
.page-header h4 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.page-header p { margin: .25rem 0 0; color: var(--muted); font-size: .83rem; }
.page-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */
.admin-breadcrumb {
  display: flex; align-items: center; gap: .4rem;
  font-size: .78rem; color: var(--muted-2); margin-bottom: 1.1rem;
}
.admin-breadcrumb a { color: var(--muted); }
.admin-breadcrumb a:hover { color: var(--accent); }
.admin-breadcrumb .sep { color: var(--border-2); }
.admin-breadcrumb .current { color: var(--text-2); font-weight: 600; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.admin-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.admin-card-header h6 {
  margin: 0; font-size: .845rem; font-weight: 700;
  display: flex; align-items: center; gap: .45rem; color: var(--text-2);
}
.admin-card-header h6 .bi { color: var(--muted); font-size: .9rem; }
.admin-card-body { padding: 1.25rem; }

/* ── Stat Cards ─────────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem 1.25rem;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--tr), transform var(--tr);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
a.stat-card-link { display: block; text-decoration: none; color: inherit; }
a.stat-card-link:hover { text-decoration: none; color: inherit; }
a.stat-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-color, var(--accent)), transparent);
}
.stat-label  { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .65rem; }
.stat-value  {
  font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: .3rem;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat-delta  { font-size: .74rem; color: var(--muted); }
.stat-icon   {
  position: absolute; bottom: .85rem; right: 1.1rem;
  font-size: 2.2rem; opacity: .07;
  color: var(--stat-color, var(--accent));
}
.stat-purple { --stat-color: #8b5cf6; }
.stat-blue   { --stat-color: var(--blue); }
.stat-green  { --stat-color: var(--green); }
.stat-amber  { --stat-color: var(--amber); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn-admin {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-family: inherit; font-size: .845rem; font-weight: 600;
  transition: background var(--tr), box-shadow var(--tr), transform var(--tr), opacity var(--tr);
  text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn-admin:hover { text-decoration: none; transform: translateY(-1px); }
.btn-admin:active { transform: translateY(0); }

.btn-primary-admin {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
.btn-primary-admin:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(16,185,129,.4);
  color: #fff;
}

.btn-secondary-admin {
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary-admin:hover { background: var(--bg); color: var(--text); }

.btn-danger-admin {
  background: var(--red-light); color: var(--red);
  border: 1px solid #fecaca;
}
.btn-danger-admin:hover { background: var(--red); color: #fff; border-color: var(--red); }

.btn-icon-admin {
  padding: .4rem .55rem; font-size: .82rem; gap: .3rem;
}
.btn-sm-admin { padding: .32rem .7rem; font-size: .78rem; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.admin-input, .admin-select, .admin-textarea {
  display: block; width: 100%;
  padding: .52rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: .875rem;
  transition: border-color var(--tr), box-shadow var(--tr);
  appearance: none;
}
.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.admin-input::placeholder, .admin-textarea::placeholder { color: var(--muted-2); }
.admin-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7a72' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
  padding-right: 2.2rem; cursor: pointer;
}
.admin-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.admin-form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: .4rem; }
.admin-form-hint  { font-size: .75rem; color: var(--muted); margin-top: .3rem; }

/* Toggle */
.toggle-wrap { display: flex; align-items: center; gap: .6rem; }
.toggle-track {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0; cursor: pointer;
}
.toggle-track input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-thumb {
  position: absolute; inset: 0;
  background: var(--border-2); border-radius: 99px;
  transition: background var(--tr);
}
.toggle-thumb::after {
  content: ''; position: absolute;
  left: 3px; top: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  transition: transform var(--tr);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle-track input:checked ~ .toggle-thumb { background: var(--accent); }
.toggle-track input:checked ~ .toggle-thumb::after { transform: translateX(18px); }
.toggle-label { font-size: .845rem; font-weight: 500; color: var(--text-2); }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: .855rem; }
.admin-table thead tr {
  background: var(--bg-2);
  border-bottom: 2px solid var(--border);
}
.admin-table thead th {
  padding: .75rem 1rem; text-align: left;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); white-space: nowrap;
}
.admin-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--tr);
}
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg); }
.admin-table td { padding: .9rem 1rem; vertical-align: middle; color: var(--text-2); }
.admin-table td:first-child { color: var(--text); font-weight: 500; }
.admin-table .col-actions { text-align: right; white-space: nowrap; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge-admin {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .6rem; border-radius: 99px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.badge-green  { background: var(--green-light);  color: #065f46; }
.badge-red    { background: var(--red-light);    color: #991b1b; }
.badge-amber  { background: var(--amber-light);  color: #92400e; }
.badge-blue   { background: var(--blue-light);   color: #1e40af; }
.badge-gray   { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-purple { background: #ede9fb; color: #5b21b6; }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.admin-alert {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .85rem 1rem; border-radius: var(--radius-sm);
  font-size: .845rem; line-height: 1.5;
}
.alert-danger  { background: var(--red-light);   color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--green-light);  color: #065f46; border: 1px solid #a7f3d0; }
.alert-info    { background: var(--blue-light);   color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: var(--amber-light);  color: #92400e; border: 1px solid #fde68a; }

/* ── Flash Toast ────────────────────────────────────────────────────────────── */
@keyframes toastIn {
  from { transform: translateY(-16px) translateX(-50%); opacity: 0; }
  to   { transform: translateY(0)     translateX(-50%); opacity: 1; }
}
.flash-container {
  position: fixed; top: calc(var(--topbar-h) + 1rem);
  left: calc(var(--sidebar-w) / 2 + 50%);
  transform: translateX(-50%); z-index: 9999; pointer-events: none;
}
@media (max-width: 991px) { .flash-container { left: 50%; } }
.flash-toast {
  display: inline-flex; align-items: center; gap: .65rem;
  padding: .75rem 1.2rem;
  border-radius: var(--radius);
  font-size: .855rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
  pointer-events: auto;
  max-width: 400px;
}
.flash-toast.success { background: #fff; color: #065f46; border: 1.5px solid #a7f3d0; }
.flash-toast.danger  { background: #fff; color: #991b1b; border: 1.5px solid #fca5a5; }
.flash-close {
  margin-left: .5rem; background: none; border: none; cursor: pointer;
  color: inherit; opacity: .5; font-size: 1rem; padding: 0; line-height: 1;
}
.flash-close:hover { opacity: 1; }

/* ── Upload Dropzone ────────────────────────────────────────────────────────── */
.upload-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; padding: 2rem;
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  cursor: pointer; text-align: center;
  color: var(--muted); font-size: .82rem;
  transition: border-color var(--tr), background var(--tr), color var(--tr);
  background: var(--bg);
}
.upload-dropzone:hover {
  border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark);
}
.upload-dropzone .bi { font-size: 1.6rem; }
.upload-dropzone span { font-weight: 600; color: var(--accent); }
.upload-dropzone p { margin: 0; }

/* ── Media / Gallery Grid ───────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .85rem;
}
.media-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: box-shadow var(--tr), transform var(--tr);
}
.media-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-item-meta {
  padding: .4rem .5rem; font-size: .7rem; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .65rem; margin-top: .75rem;
}
.gallery-item { position: relative; }
.gallery-item img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius-sm); display: block;
  border: 1px solid var(--border);
}
.gallery-item input[type=text] {
  width: 100%; margin-top: .3rem; padding: .25rem .4rem;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: .72rem; font-family: inherit;
}

/* ── Group Toggle (Campus pages) ────────────────────────────────────────────── */
.group-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--text-2);
  margin-bottom: .4rem; user-select: none;
  transition: background var(--tr);
}
.group-toggle:hover { background: var(--accent-light); color: var(--accent-dark); }
.group-body { margin-bottom: .75rem; }

/* ── SDG Admin Grid ─────────────────────────────────────────────────────────── */
.sdg-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}
.sdg-admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--tr), transform var(--tr);
}
.sdg-admin-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sdg-admin-card-top { height: 5px; background: var(--sdg-color, var(--accent)); }
.sdg-admin-card-body { padding: .9rem; }
.sdg-admin-num   { font-size: .68rem; color: var(--muted-2); font-weight: 700; margin-bottom: .2rem; letter-spacing: .06em; text-transform: uppercase; }
.sdg-admin-title { font-size: .8rem; font-weight: 600; line-height: 1.35; margin-bottom: .65rem; }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.admin-pagination { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.admin-pagination a, .admin-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 .55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .82rem; color: var(--text-2);
  transition: background var(--tr), border-color var(--tr);
  font-weight: 500;
}
.admin-pagination a:hover { background: var(--bg); text-decoration: none; border-color: var(--border-2); }
.admin-pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.admin-pagination .disabled { color: var(--muted-2); pointer-events: none; }

/* ── Login Page ─────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(16,185,129,.12) 0%, transparent 70%);
  pointer-events: none;
}
.login-card {
  background: var(--ink-2);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  position: relative; z-index: 1;
}
.login-logo {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: 2rem;
}
.login-logo-dot {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 10px;
  box-shadow: 0 0 20px var(--accent-glow);
  flex-shrink: 0;
}
.login-logo-text { font-weight: 800; font-size: 1.15rem; color: var(--ink-text-2); letter-spacing: -.02em; }
.login-logo-sub { font-size: .75rem; color: var(--ink-muted); display: block; }
.login-title { font-size: 1.4rem; font-weight: 700; color: var(--ink-text-2); margin: 0 0 .35rem; letter-spacing: -.02em; }
.login-sub   { font-size: .84rem; color: var(--ink-muted); margin: 0 0 1.75rem; }
.login-form-label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-text); margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .04em; }
.login-input {
  display: block; width: 100%;
  padding: .65rem .9rem;
  background: var(--ink-3); color: var(--ink-text-2);
  border: 1px solid var(--ink-border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.login-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.login-input::placeholder { color: var(--ink-muted); }
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .72rem;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-size: .9rem; font-weight: 700;
  box-shadow: 0 4px 16px rgba(16,185,129,.35);
  transition: background var(--tr), box-shadow var(--tr), transform var(--tr);
  margin-top: 1.5rem;
}
.login-btn:hover { background: var(--accent-dark); box-shadow: 0 6px 20px rgba(16,185,129,.45); transform: translateY(-1px); }
.login-error {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius-sm); padding: .7rem .9rem;
  color: #fca5a5; font-size: .83rem; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .5rem;
}

/* ── HTML Editor ─────────────────────────────────────────────────────────────── */
.html-editor-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.html-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .5rem .65rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.ed-sep {
  width: 1px; height: 20px;
  background: var(--border-2);
  margin: 0 .1rem;
  flex-shrink: 0;
}
.ed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  height: 30px;
  padding: 0 .55rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
  line-height: 1;
  font-family: inherit;
}
.ed-btn:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent-dark); }
.ed-btn .bi   { font-size: .85rem; }
.ed-btn-bold      { font-weight: 800; font-size: .85rem; }
.ed-btn-italic    { font-style: italic; }
.ed-btn-underline { text-decoration: underline; }
.ed-select {
  height: 30px;
  padding: 0 .45rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  font-size: .78rem;
  color: var(--text);
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.ed-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.html-editor-textarea {
  display: block;
  width: 100%;
  min-height: 440px;
  padding: .9rem 1rem;
  border: none;
  outline: none;
  font-family: 'Courier New', Consolas, monospace;
  font-size: .82rem;
  line-height: 1.75;
  resize: vertical;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
  align-self: stretch;
}
.ed-btn-loading { opacity: .55; pointer-events: none; }

/* ── Misc ────────────────────────────────────────────────────────────────────── */
.mb-3  { margin-bottom: 1rem !important; }
.mt-2  { margin-top: .5rem !important; }
.mt-3  { margin-top: 1rem !important; }
.d-flex { display: flex; }
.w-100  { width: 100% !important; }
.justify-content-center { justify-content: center; }
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red) !important; }
.form-row { display: grid; gap: 1rem; }
.form-row-3 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* ── Upload donut progress ───────────────────────────────────────────────────── */
.upload-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1rem 0;
}
.upload-donut {
  transform: rotate(-90deg);
}
.upload-donut-pct {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
}
