/* ============================================================
   CHARITY ORGANIZATION — ADMIN PANEL STYLES
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --ab: #07090E; --as: #0F1520; --as2: #162030; --as3: #1D2A3A;
  --abr: rgba(255,255,255,0.07); --abr2: rgba(255,255,255,0.13);
  --ag: #00C48C; --agd: rgba(0,196,140,0.12);
  --ab2: #3B8FFF; --ab2d: rgba(59,143,255,0.12);
  --ao: #E8A020; --aod: rgba(232,160,32,0.12);
  --ar: #F04444; --ard: rgba(240,68,68,0.12);
  --ap: #9F7AEA; --apd: rgba(159,122,234,0.12);
  --at: #DFE6EF; --am: #5A6A7E; --am2: #8A9AB0;
  --afont: 'Sora', system-ui, sans-serif;
  --amono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--afont); background: var(--ab); color: var(--at); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--afont); }
input, select, textarea { font-family: var(--afont); }

/* ── LAYOUT ───────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.admin-content { padding: 26px; overflow-y: auto; flex: 1; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar { width: 232px; background: var(--as); border-right: 1px solid var(--abr); display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; overflow-y: auto; flex-shrink: 0; }
.sb-logo { padding: 20px 16px 16px; border-bottom: 1px solid var(--abr); display: flex; align-items: center; gap: 10px; }
.sb-logo-icon { width: 36px; height: 36px; background: var(--ag); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.sb-logo-name { font-size: 14px; font-weight: 700; color: var(--at); }
.sb-logo-sub { font-size: 10px; color: var(--am); }
.sb-section { padding: 16px 14px 6px; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--am); }
.sb-link { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px; margin: 1px 6px; font-size: 13px; font-weight: 500; color: var(--am2); transition: all 0.15s; border-left: 2px solid transparent; cursor: pointer; }
.sb-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }
.sb-link:hover { color: var(--at); background: rgba(255,255,255,0.04); }
.sb-link.active { color: var(--ag); background: var(--agd); border-left-color: var(--ag); }
.sb-link.active svg { opacity: 1; }
.sb-bottom { margin-top: auto; padding: 14px; border-top: 1px solid var(--abr); }
.sb-user { display: flex; align-items: center; gap: 9px; }
.sb-av { width: 34px; height: 34px; background: linear-gradient(135deg, var(--ab2), var(--ag)); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.sb-uname { font-size: 13px; font-weight: 600; color: var(--at); }
.sb-urole { font-size: 11px; color: var(--am); }

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar { background: var(--as); border-bottom: 1px solid var(--abr); height: 62px; padding: 0 26px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 100; }
.topbar-title { font-size: 15px; font-weight: 700; color: var(--at); flex: 1; }
.topbar-search { display: flex; align-items: center; gap: 8px; background: var(--as2); border: 1px solid var(--abr2); border-radius: 8px; padding: 7px 12px; width: 200px; }
.topbar-search input { background: none; border: none; outline: none; color: var(--at); font-family: var(--afont); font-size: 13px; width: 100%; }
.topbar-search input::placeholder { color: var(--am); }

/* ── BUTTONS ──────────────────────────────────────────────── */
.abtn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.15s; font-family: var(--afont); border: none; }
.abtn-green { background: var(--ag); color: #000; }
.abtn-green:hover { background: #00e0a2; }
.abtn-ghost { background: transparent; color: var(--am2); border: 1px solid var(--abr2); }
.abtn-ghost:hover { color: var(--at); background: var(--as2); }
.abtn-red { background: var(--ard); color: var(--ar); border: 1px solid rgba(240,68,68,0.2); }
.abtn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }

/* ── FORMS ────────────────────────────────────────────────── */
.a-label { display: block; font-size: 11px; font-weight: 700; color: var(--am2); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.a-input, .a-select, .a-textarea { width: 100%; background: var(--as2); border: 1px solid var(--abr2); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: var(--afont); color: var(--at); outline: none; transition: border-color 0.15s; }
.a-input:focus, .a-select:focus, .a-textarea:focus { border-color: var(--ag); }
.a-input::placeholder { color: var(--am); }
.a-textarea { resize: vertical; min-height: 90px; }
.a-select { cursor: pointer; appearance: none; 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 d='M1 1l5 5 5-5' stroke='%235A6A7E' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.a-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.a-form-group { margin-bottom: 16px; }
.a-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.a-checkbox input { width: 15px; height: 15px; accent-color: var(--ag); cursor: pointer; }
.a-checkbox span { font-size: 13px; color: var(--am2); }

/* ── PANELS ───────────────────────────────────────────────── */
.a-panel { background: var(--as); border: 1px solid var(--abr); border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.a-panel-head { padding: 14px 20px; border-bottom: 1px solid var(--abr); display: flex; align-items: center; gap: 10px; }
.a-panel-title { font-size: 13px; font-weight: 700; color: var(--at); flex: 1; }
.a-panel-body { padding: 20px; }

/* ── STAT CARDS ───────────────────────────────────────────── */
.a-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 22px; }
.a-stat { background: var(--as); border: 1px solid var(--abr); border-radius: 14px; padding: 18px; position: relative; overflow: hidden; }
.a-stat::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.a-stat.g::after { background: var(--ag); }
.a-stat.b::after { background: var(--ab2); }
.a-stat.o::after { background: var(--ao); }
.a-stat.p::after { background: var(--ap); }
.a-stat.r::after { background: var(--ar); }
.a-stat-lbl { font-size: 10px; color: var(--am); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 9px; }
.a-stat-val { font-family: var(--amono); font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 5px; }
.a-stat-sub { font-size: 11px; color: var(--am); }

/* ── TABLES ───────────────────────────────────────────────── */
.a-tbl-wrap { overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.a-table thead th { padding: 10px 16px; font-size: 10px; font-weight: 700; color: var(--am); text-transform: uppercase; letter-spacing: 0.8px; text-align: left; border-bottom: 1px solid var(--abr); background: rgba(0,0,0,0.15); }
.a-table tbody tr { border-bottom: 1px solid var(--abr); transition: background 0.1s; }
.a-table tbody tr:last-child { border-bottom: none; }
.a-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.a-table td { padding: 13px 16px; font-size: 13px; vertical-align: middle; }

/* ── BADGES ───────────────────────────────────────────────── */
.a-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.a-badge-dot { width: 5px; height: 5px; border-radius: 50%; }
.ab-success { background: var(--agd); color: var(--ag); }
.ab-success .a-badge-dot { background: var(--ag); }
.ab-pending { background: var(--aod); color: var(--ao); }
.ab-pending .a-badge-dot { background: var(--ao); }
.ab-failed { background: var(--ard); color: var(--ar); }
.ab-failed .a-badge-dot { background: var(--ar); }
.ab-active { background: var(--ab2d); color: var(--ab2); }
.ab-active .a-badge-dot { background: var(--ab2); }
.ab-draft { background: rgba(255,255,255,0.06); color: var(--am2); }

/* ── PAGINATION ───────────────────────────────────────────── */
.a-pagination { padding: 12px 20px; border-top: 1px solid var(--abr); display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--am); }
.a-pg-btns { display: flex; gap: 3px; }
.a-pg-btn { width: 28px; height: 28px; border-radius: 6px; background: transparent; border: 1px solid var(--abr2); color: var(--am2); cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; font-family: var(--afont); }
.a-pg-btn.active { background: var(--ag); color: #000; border-color: var(--ag); font-weight: 700; }
.a-pg-btn:hover:not(.active) { color: var(--at); border-color: var(--abr2); background: var(--as2); }

/* ── FILTERS ──────────────────────────────────────────────── */
.a-filters { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--abr); flex-wrap: wrap; }

/* ── TOAST ────────────────────────────────────────────────── */
.a-toast { position: fixed; bottom: 22px; right: 22px; background: var(--as); border: 1px solid var(--ag); color: var(--at); padding: 13px 18px; border-radius: 11px; font-size: 13px; font-weight: 600; z-index: 9999; transform: translateY(80px); opacity: 0; transition: all 0.3s; display: flex; align-items: center; gap: 8px; }
.a-toast.show { transform: translateY(0); opacity: 1; }

/* ── MODAL ────────────────────────────────────────────────── */
.a-modal-back { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 500; align-items: center; justify-content: center; padding: 20px; }
.a-modal-back.open { display: flex; }
.a-modal { background: var(--as); border: 1px solid var(--abr2); border-radius: 16px; padding: 28px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.a-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.a-modal-title { font-size: 16px; font-weight: 700; }
.a-modal-x { color: var(--am); font-size: 22px; line-height: 1; }

/* ── SEO PREVIEW ──────────────────────────────────────────── */
.seo-preview { background: #fff; border-radius: 10px; padding: 16px; margin-top: 14px; }
.seo-prev-url { font-size: 12px; color: #1a0dab; }
.seo-prev-title { font-size: 18px; color: #1a0dab; font-weight: 400; margin: 3px 0; cursor: pointer; font-family: Arial, sans-serif; }
.seo-prev-title:hover { text-decoration: underline; }
.seo-prev-desc { font-size: 13px; color: #3c4043; font-family: Arial, sans-serif; line-height: 1.5; }
.seo-char-count { font-size: 11px; color: var(--am); text-align: right; margin-top: 3px; }
.seo-char-count.over { color: var(--ar); }

/* ── GRID LAYOUTS ─────────────────────────────────────────── */
.a-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.a-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.a-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.a-cols { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }

/* ── PERMISSIONS TABLE ────────────────────────────────────── */
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th { padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--am); text-transform: uppercase; letter-spacing: 0.6px; border-bottom: 1px solid var(--abr); text-align: center; }
.perm-table th:first-child { text-align: left; }
.perm-table td { padding: 10px 14px; border-bottom: 1px solid var(--abr); font-size: 13px; text-align: center; color: var(--am2); }
.perm-table td:first-child { text-align: left; font-weight: 600; color: var(--at); }
.perm-table tr:last-child td { border-bottom: none; }
.perm-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--ag); cursor: pointer; }
.perm-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── PROG BAR ─────────────────────────────────────────────── */
.a-prog { height: 4px; background: var(--abr); border-radius: 4px; overflow: hidden; }
.a-prog-fill { height: 100%; border-radius: 4px; background: var(--ag); }

/* ── ALERTS ───────────────────────────────────────────────── */
.a-alert { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-size: 13px; }
.a-alert-success { background: var(--agd); color: var(--ag); border: 1px solid rgba(0,196,140,0.2); }
.a-alert-error { background: var(--ard); color: var(--ar); border: 1px solid rgba(240,68,68,0.2); }

/* ── IMAGE UPLOAD ─────────────────────────────────────────── */
.img-upload-box { border: 2px dashed var(--abr2); border-radius: 10px; padding: 28px; text-align: center; cursor: pointer; transition: border-color 0.15s; }
.img-upload-box:hover { border-color: var(--ag); }
.img-upload-box input { display: none; }
.img-preview { max-width: 100%; max-height: 180px; border-radius: 8px; margin-top: 12px; object-fit: cover; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .a-stats-grid { grid-template-columns: 1fr 1fr; }
  .a-grid-2, .a-cols { grid-template-columns: 1fr; }
  .a-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .a-stats-grid { grid-template-columns: 1fr; }
  .a-grid-3 { grid-template-columns: 1fr; }
  .a-form-row { grid-template-columns: 1fr; }
}
