/* ============================================================
   Pondok Pesantren Al-Hikmah — Admin Panel Stylesheet
   ============================================================ */

:root {
    --green-950: #062e22;
    --green-900: #0b3d2e;
    --green-800: #0f5132;
    --green-700: #146c46;
    --green-600: #1b8a5a;
    --gold-600: #b68a1e;
    --gold-500: #c9a227;
    --gold-400: #e0bd55;
    --gold-100: #f6ecc9;
    --cream: #f8f5ee;
    --cream-2: #f2ede1;
    --ink: #122019;
    --ink-soft: #35463d;
    --muted: #68786f;
    --line: #e5dfd2;
    --white: #ffffff;
    --red: #b42318;
    --red-soft: #fee4e2;
    --blue: #1d5fbf;
    --blue-soft: #e6effd;
    --violet: #6b46c1;
    --violet-soft: #efe9fb;
    --green-soft: #e3f4ec;
    --gold-soft: #fbf1d3;
    --shadow-sm: 0 4px 14px rgba(9, 45, 34, .06);
    --shadow-md: 0 18px 45px rgba(9, 45, 34, .10);
    --shadow-lg: 0 34px 80px rgba(9, 45, 34, .16);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --ease: cubic-bezier(.22, .72, .22, 1);
    --sidebar-w: 268px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

::selection { background: var(--gold-400); color: var(--green-950); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
    cursor: pointer;
    transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
    white-space: nowrap;
}
.btn svg { flex: 0 0 auto; }
.btn--primary { background: var(--green-800); color: #fff; box-shadow: 0 10px 24px rgba(15, 81, 50, .22); }
.btn--primary:hover { background: var(--green-900); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15, 81, 50, .28); }
.btn--gold { background: var(--gold-500); color: var(--green-950); box-shadow: 0 10px 24px rgba(201, 162, 39, .28); }
.btn--gold:hover { background: var(--gold-400); transform: translateY(-1px); }
.btn--outline { background: var(--white); border-color: var(--line); color: var(--ink-soft); }
.btn--outline:hover { border-color: var(--green-600); color: var(--green-800); background: #fff; }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #931c13; }
.btn--sm { padding: 9px 15px; font-size: .78rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink-soft);
    transition: all .2s var(--ease);
}
.icon-btn:hover { border-color: var(--green-600); color: var(--green-800); background: var(--green-soft); }
.icon-btn--danger:hover { border-color: #f3b4ad; color: var(--red); background: var(--red-soft); }
.inline-form { display: inline-flex; margin: 0; }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert svg { flex: 0 0 auto; margin-top: 1px; }
.alert--success { background: var(--green-soft); color: #12653f; border-color: #bfe6d2; }
.alert--error { background: var(--red-soft); color: #912018; border-color: #f6c9c4; }
.alert--warning { background: var(--gold-soft); color: #7a5a10; border-color: #eeda9f; }
.alert--info { background: var(--blue-soft); color: #1a4f9c; border-color: #c7dbf7; }

/* ============================================================
   Layout shell
   ============================================================ */
.admin-body { background: var(--cream); }

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

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 22px 16px 18px;
    background: linear-gradient(180deg, var(--green-950) 0%, var(--green-900) 55%, #073527 100%);
    color: rgba(255, 255, 255, .72);
    z-index: 60;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.admin-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .05) 1px, transparent 0);
    background-size: 22px 22px;
    opacity: .5;
    pointer-events: none;
}

.admin-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    margin-bottom: 16px;
    color: #fff;
}
.admin-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 13px;
    background: rgba(224, 189, 85, .14);
    border: 1px solid rgba(224, 189, 85, .3);
    color: var(--gold-400);
}
.admin-brand__mark.has-logo {
    background: #fff;
    border-color: rgba(15, 81, 50, .14);
}
.admin-brand__mark img {
    width: 100%;
    height: 100%;
    padding: 4px;
    border-radius: inherit;
    object-fit: contain;
}
.admin-brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.admin-brand__text strong { font-family: var(--font-display); font-size: 1.18rem; letter-spacing: .01em; }
.admin-brand__text small { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-400); margin-top: 3px; }

.admin-nav { position: relative; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.admin-nav__section {
    display: block;
    padding: 16px 12px 6px;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(224, 189, 85, .7);
}
.admin-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .72);
    transition: background .2s var(--ease), color .2s var(--ease);
}
.admin-nav__link svg { flex: 0 0 auto; opacity: .85; }
.admin-nav__link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-nav__link.is-active {
    background: linear-gradient(100deg, rgba(224, 189, 85, .2), rgba(224, 189, 85, .06));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--gold-400);
}
.admin-nav__link.is-active svg { color: var(--gold-400); opacity: 1; }
.admin-nav__badge {
    margin-left: auto;
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--gold-500);
    color: var(--green-950);
    font-size: .66rem;
    font-weight: 800;
    font-style: normal;
    text-align: center;
}

.admin-sidebar__foot {
    position: relative;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-sidebar__site,
.admin-sidebar__logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .7);
    transition: background .2s var(--ease), color .2s var(--ease);
}
.admin-sidebar__site:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-sidebar__logout:hover { background: rgba(180, 35, 24, .22); color: #ffb4ad; }

.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 30, 22, .55);
    backdrop-filter: blur(2px);
    z-index: 55;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--ease), visibility .3s var(--ease);
}

.admin-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 30px;
    background: rgba(248, 245, 238, .9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.admin-topbar__left { display: flex; align-items: center; gap: 14px; }
.admin-topbar__left h1 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.2; color: var(--green-900); }
.admin-topbar__left p { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.admin-topbar__right { display: flex; align-items: center; gap: 14px; }

.admin-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--green-900);
}
.admin-burger:hover { background: var(--green-soft); }

.admin-topbar__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-soft);
    transition: all .2s var(--ease);
}
.admin-topbar__icon:hover { color: var(--green-800); border-color: var(--green-600); }
.admin-topbar__icon .dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    border: 2px solid #fff;
}

.admin-user { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.admin-user__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--green-800);
    color: var(--gold-400);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .04em;
}
.admin-user__meta { display: flex; flex-direction: column; line-height: 1.25; }
.admin-user__meta strong { font-size: .82rem; font-weight: 700; }
.admin-user__meta small { font-size: .68rem; color: var(--muted); text-transform: capitalize; }

.admin-content { flex: 1; padding: 28px 30px 40px; }
.admin-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 30px;
    border-top: 1px solid var(--line);
    font-size: .72rem;
    color: var(--muted);
}

/* ============================================================
   Page head
   ============================================================ */
.admin-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.admin-page-head h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--green-900); line-height: 1.25; }
.admin-page-head p { font-size: .84rem; color: var(--muted); margin-top: 4px; max-width: 640px; }
.admin-page-head__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    font-weight: 700;
    color: var(--green-700);
    margin-bottom: 6px;
    transition: gap .2s var(--ease), color .2s var(--ease);
}
.back-link:hover { gap: 9px; color: var(--green-900); }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    font-weight: 700;
    color: var(--green-700);
    white-space: nowrap;
}
.link-arrow:hover { color: var(--gold-600); }

/* ============================================================
   Stat cards
   ============================================================ */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.admin-stat {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.admin-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.admin-stat__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 14px;
}
.admin-stat__icon--green { background: var(--green-soft); color: var(--green-700); }
.admin-stat__icon--blue { background: var(--blue-soft); color: var(--blue); }
.admin-stat__icon--gold { background: var(--gold-soft); color: var(--gold-600); }
.admin-stat__icon--violet { background: var(--violet-soft); color: var(--violet); }
.admin-stat__label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.admin-stat__value { display: block; font-family: var(--font-display); font-size: 1.8rem; line-height: 1.15; color: var(--green-900); margin: 4px 0 2px; }
.admin-stat__hint { font-size: .72rem; color: var(--muted); }

/* ============================================================
   Mini stats / filter pills
   ============================================================ */
.mini-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.mini-stat {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: all .2s var(--ease);
}
.mini-stat:hover { border-color: var(--green-600); transform: translateY(-2px); }
.mini-stat span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mini-stat strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--green-900); }
.mini-stat--green { border-left: 3px solid var(--green-600); }
.mini-stat--gold { border-left: 3px solid var(--gold-500); }
.mini-stat--blue { border-left: 3px solid var(--blue); }
.mini-stat--red { border-left: 3px solid var(--red); }

.pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pill-link {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--cream-2);
    border: 1px solid transparent;
    transition: all .2s var(--ease);
}
.pill-link:hover { background: #eae3d3; }
.pill-link.is-active { background: var(--green-800); color: #fff; }

/* ============================================================
   Cards
   ============================================================ */
.admin-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.admin-card--sticky { position: sticky; top: 92px; }
.admin-card--highlight { border-color: #cfe6da; background: linear-gradient(180deg, #fbfdfc, #fff); box-shadow: 0 12px 34px rgba(15, 81, 50, .08); }
.admin-card--danger { border-color: #f3c9c5; background: #fffafa; }
.admin-card--danger .admin-card__head h2 { color: var(--red); }
.admin-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.admin-card__head h2 { font-family: var(--font-display); font-size: 1.08rem; color: var(--green-900); line-height: 1.3; }
.admin-card__head p { font-size: .76rem; color: var(--muted); margin-top: 3px; }

.admin-grid { display: grid; gap: 20px; margin-bottom: 4px; }
.admin-grid--dashboard { grid-template-columns: 1.55fr 1fr; }
.admin-grid--dashboard2 { grid-template-columns: 1.55fr 1fr; }
.admin-grid--dashboard3 { grid-template-columns: 1fr 1fr; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 620px; }
.admin-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.admin-table th:first-child { border-radius: 9px 0 0 9px; }
.admin-table th:last-child { border-radius: 0 9px 9px 0; }
.admin-table td { padding: 13px 12px; border-bottom: 1px solid #f0ebe0; vertical-align: middle; color: var(--ink-soft); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background .18s var(--ease); }
.admin-table tbody tr:hover { background: #fcfaf4; }
.admin-table tbody tr.row-unread { background: #fffdf5; }
.admin-table tbody tr.row-unread td:first-child { box-shadow: inset 3px 0 0 var(--gold-500); }
.admin-table strong { color: var(--ink); font-weight: 700; }
.admin-table small { display: block; font-size: .71rem; color: var(--muted); margin-top: 1px; }
.th-actions, .td-actions { text-align: right; white-space: nowrap; }
.td-actions { display: flex; justify-content: flex-end; gap: 6px; }
.table-empty { text-align: center; padding: 34px 16px; color: var(--muted); font-size: .84rem; }
.table-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 16px;
    margin-top: 6px;
    border-top: 1px solid #f0ebe0;
    font-size: .74rem;
    color: var(--muted);
}
.table-media { display: flex; align-items: center; gap: 11px; min-width: 0; }
.table-thumb {
    display: inline-flex;
    width: 52px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 9px;
    overflow: hidden;
    background: var(--cream-2);
}
.table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--green-soft);
    color: var(--green-700);
}
.table-person { display: flex; align-items: center; gap: 10px; }
.table-person__avatar,
.message-list__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green-800);
    font-size: .76rem;
    font-weight: 800;
}
.code-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--cream-2);
    color: var(--ink-soft);
    font-size: .72rem;
    font-family: 'Consolas', 'Courier New', monospace;
}

/* Pagination */
.pagination { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: .78rem;
    font-weight: 700;
    color: var(--ink-soft);
    transition: all .2s var(--ease);
}
.pagination a:hover { border-color: var(--green-600); color: var(--green-800); }
.pagination a.is-active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.pagination a.is-disabled { opacity: .4; pointer-events: none; }
.pagination span { padding: 0 4px; color: var(--muted); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
}
.badge--pending, .badge--baru { background: var(--gold-soft); color: #7a5a10; }
.badge--diterima, .badge--aktif, .badge--publish { background: var(--green-soft); color: #12653f; }
.badge--ditolak, .badge--nonaktif { background: var(--red-soft); color: #912018; }
.badge--alumni { background: var(--blue-soft); color: #1a4f9c; }
.badge--draft, .badge--dibaca { background: #eceae4; color: #5c665f; }

/* ============================================================
   Toolbar / forms
   ============================================================ */
.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.admin-toolbar__search {
    position: relative;
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--cream);
    color: var(--muted);
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.admin-toolbar__search:focus-within { border-color: var(--green-600); background: #fff; }
.admin-toolbar__search svg { flex: 0 0 auto; }
.admin-toolbar__search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: .84rem;
    color: var(--ink);
    height: 100%;
}
.admin-select {
    height: 42px;
    padding: 0 34px 0 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2368786f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center;
    appearance: none;
    font-size: .82rem;
    color: var(--ink-soft);
}

.admin-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 20px;
    align-items: start;
}
.admin-form-aside { position: relative; }
.admin-form-aside .admin-card:last-child { margin-bottom: 0; }
.settings-stack { display: flex; flex-direction: column; }
.settings-stack .admin-card { scroll-margin-top: 92px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-grid .field { margin-bottom: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .76rem; font-weight: 700; color: var(--ink-soft); }
.field .req { color: var(--red); }
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: .85rem;
    color: var(--ink);
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(27, 138, 90, .12);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input[type="file"] { padding: 9px 11px; background: var(--cream); font-size: .78rem; }
.field small { font-size: .71rem; color: var(--muted); }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--red); background: #fffafa; }
.field__error { color: var(--red) !important; font-weight: 600; }
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f0ebe0;
}
.form-hint { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--muted); margin-top: 12px; }
.check-inline { display: flex; align-items: center; gap: 9px; font-size: .78rem; color: var(--ink-soft); margin: 12px 0 4px; cursor: pointer; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--green-700); }

.image-preview {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--cream-2);
    margin-bottom: 12px;
    aspect-ratio: 16 / 10;
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }

.banner-text-group {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--cream);
    overflow: hidden;
}
.banner-text-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--green-900);
    cursor: pointer;
    list-style: none;
}
.banner-text-group summary::-webkit-details-marker { display: none; }
.banner-text-group summary::after {
    content: '+';
    font-size: 1.1rem;
    line-height: 1;
    color: var(--muted);
}
.banner-text-group[open] summary::after { content: '\2212'; }
.banner-text-group > .form-grid {
    padding: 16px;
    border-top: 1px solid var(--line);
    background: #fff;
}

/* Tips & detail lists */
.tip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.tip-list li { display: flex; align-items: flex-start; gap: 9px; font-size: .78rem; color: var(--ink-soft); line-height: 1.5; }
.tip-list svg { flex: 0 0 auto; color: var(--green-600); margin-top: 2px; }

.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
.detail-list > div { padding: 11px 0; border-bottom: 1px dashed #ece6da; }
.detail-list > div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-list dt { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }
.detail-list dd { margin: 0; font-size: .84rem; font-weight: 600; color: var(--ink); }
.detail-list__full { grid-column: 1 / -1; }
.detail-list--single { grid-template-columns: 1fr; }
.detail-list--single > div:last-child { border-bottom: 0; }

/* Toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px dashed #ece6da; }
.toggle-row strong { display: block; font-size: .82rem; color: var(--ink); }
.toggle-row small { font-size: .71rem; color: var(--muted); }
.switch { position: relative; display: inline-flex; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #d8d2c5;
    transition: background .25s var(--ease);
}
.switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    transition: transform .25s var(--ease);
}
.switch input:checked + .switch__track { background: var(--green-600); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }

.settings-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #f0ebe0; }
.settings-nav a {
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--cream);
    font-size: .72rem;
    font-weight: 600;
    color: var(--ink-soft);
    transition: all .2s var(--ease);
}
.settings-nav a:hover { background: var(--green-800); color: #fff; }

/* Gallery */
.admin-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-gallery__item { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.admin-gallery__media { position: relative; aspect-ratio: 4 / 3; background: var(--cream-2); overflow: hidden; }
.admin-gallery__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.admin-gallery__item:hover .admin-gallery__media img { transform: scale(1.05); }
.admin-gallery__cat {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(6, 46, 34, .78);
    color: var(--gold-400);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    backdrop-filter: blur(4px);
}
.admin-gallery__body { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.admin-gallery__body strong { display: block; font-size: .78rem; line-height: 1.3; }
.admin-gallery__body small { display: block; font-size: .68rem; color: var(--muted); }
.admin-gallery__body form { margin-left: auto; }

/* Dashboard widgets */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    height: 230px;
    padding-top: 10px;
}
.bar-chart__item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; min-width: 0; }
.bar-chart__value { font-size: .7rem; font-weight: 800; color: var(--green-700); }
.bar-chart__track {
    flex: 1;
    width: 100%;
    max-width: 46px;
    display: flex;
    align-items: flex-end;
    background: var(--cream);
    border-radius: 8px 8px 5px 5px;
    overflow: hidden;
}
.bar-chart__bar {
    display: block;
    width: 100%;
    border-radius: 7px 7px 4px 4px;
    background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
    transition: height .8s var(--ease);
}
.bar-chart__item:nth-child(even) .bar-chart__bar { background: linear-gradient(180deg, #38b27c, var(--green-600)); }
.bar-chart__label { font-size: .66rem; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.25; }
.bar-chart__label small { display: block; font-size: .6rem; font-weight: 500; opacity: .8; }

.donut-wrap { display: flex; justify-content: center; padding: 10px 0 16px; }
.donut {
    position: relative;
    width: 168px;
    height: 168px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.donut::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: #fff;
}
.donut__hole {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}
.donut__hole strong { font-family: var(--font-display); font-size: 1.7rem; color: var(--green-900); }
.donut__hole span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--ink-soft); }
.donut-legend strong { margin-left: auto; color: var(--ink); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot--gold { background: var(--gold-500); }
.dot--green { background: var(--green-600); }
.dot--red { background: #c0392b; }

.message-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.message-list li { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px dashed #ece6da; }
.message-list li:first-child { padding-top: 0; }
.message-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.message-list li > div { display: flex; flex-direction: column; min-width: 0; }
.message-list strong { font-size: .8rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.message-list span { font-size: .76rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-list small { font-size: .68rem; color: var(--muted); margin-top: 2px; }
.pill-new {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--gold-500);
    color: var(--green-950);
    font-size: .58rem;
    font-weight: 800;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.progress-list { display: flex; flex-direction: column; gap: 14px; }
.progress-row__label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .78rem; margin-bottom: 6px; }
.progress-row__label span { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-row__label strong { color: var(--green-800); }
.progress-track { height: 9px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green-600), var(--gold-500)); }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-actions a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--cream);
    font-size: .77rem;
    font-weight: 700;
    color: var(--ink-soft);
    transition: all .22s var(--ease);
}
.quick-actions a svg { color: var(--green-700); }
.quick-actions a:hover { background: var(--green-800); color: #fff; border-color: var(--green-800); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-actions a:hover svg { color: var(--gold-400); }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 48px 20px;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--cream);
}
.empty-state svg { color: var(--green-600); opacity: .6; }
.empty-state h3 { font-size: .95rem; color: var(--ink); }
.empty-state p { font-size: .8rem; max-width: 320px; }

/* Profile */
.admin-card--profile { text-align: center; }
.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin: 4px auto 12px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--green-800), var(--green-600));
    color: var(--gold-400);
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(15, 81, 50, .22);
}
.admin-card--profile h3 { font-family: var(--font-display); font-size: 1.15rem; color: var(--green-900); }
.admin-card--profile > p { font-size: .76rem; color: var(--muted); text-transform: capitalize; margin-bottom: 14px; }
.admin-card--profile .detail-list { text-align: left; }

/* Reveal animation */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Login
   ============================================================ */
.login-body { background: var(--green-950); }
.login-wrap { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }

.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px 48px;
    background:
        radial-gradient(circle at 80% 15%, rgba(224, 189, 85, .16), transparent 45%),
        linear-gradient(150deg, var(--green-950) 0%, var(--green-900) 48%, #073527 100%);
    color: #fff;
    overflow: hidden;
}
.login-visual__pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .06) 1px, transparent 0),
        radial-gradient(circle at 70% 80%, rgba(224, 189, 85, .1), transparent 55%);
    background-size: 26px 26px, 100% 100%;
    pointer-events: none;
}
.login-brand { position: relative; display: flex; align-items: center; gap: 13px; color: #fff; }
.login-brand strong { display: block; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; }
.login-brand small { display: block; font-size: .68rem; letter-spacing: .15em; text-transform: uppercase; color: var(--gold-400); margin-top: 2px; }
.login-visual__content { position: relative; max-width: 460px; padding: 40px 0; }
.eyebrow {
    display: inline-block;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.login-visual__content h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.18; margin-bottom: 16px; }
.login-visual__content p { font-size: .92rem; color: rgba(255, 255, 255, .74); line-height: 1.7; max-width: 420px; }
.login-features { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 11px; }
.login-features li { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: rgba(255, 255, 255, .86); }
.login-features svg { color: var(--gold-400); flex: 0 0 auto; }
.login-visual__foot { position: relative; font-size: .72rem; color: rgba(255, 255, 255, .45); }

.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: var(--cream);
}
.login-form-box { width: 100%; max-width: 400px; }
.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 17px;
    background: var(--green-soft);
    color: var(--green-800);
    margin-bottom: 18px;
}
.login-form-box h2 { font-family: var(--font-display); font-size: 1.6rem; color: var(--green-900); }
.login-sub { font-size: .84rem; color: var(--muted); margin: 6px 0 22px; }
.login-form-box .field { margin-bottom: 16px; }
.login-form-box .btn { margin-top: 6px; padding: 14px 20px; }
.login-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: .74rem; font-weight: 600; }
.login-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); transition: color .2s var(--ease); }
.login-links a:hover { color: var(--green-800); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1180px) {
    .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-form-grid { grid-template-columns: minmax(0, 1fr) 290px; }
    .admin-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .32s var(--ease); box-shadow: var(--shadow-lg); }
    .admin-body.sidebar-open .admin-sidebar { transform: translateX(0); }
    .admin-body.sidebar-open .admin-overlay { opacity: 1; visibility: visible; }
    .admin-main { margin-left: 0; }
    .admin-burger { display: inline-flex; }
    .admin-grid--dashboard, .admin-grid--dashboard2, .admin-grid--dashboard3 { grid-template-columns: 1fr; }
    .admin-form-grid { grid-template-columns: 1fr; }
    .admin-card--sticky { position: static; }
    .admin-form-aside { order: -1; }
    .admin-form-aside .admin-card { margin-bottom: 20px; }
    .detail-grid { grid-template-columns: 1fr; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-form-side { min-height: 100vh; }
}

@media (max-width: 720px) {
    .admin-content { padding: 20px 16px 32px; }
    .admin-topbar { padding: 12px 16px; }
    .admin-topbar__left h1 { font-size: 1.1rem; }
    .admin-topbar__left p { display: none; }
    .admin-user__meta { display: none; }
    .admin-user { padding-left: 10px; }
    .admin-footer { padding: 16px; }
    .stat-cards { grid-template-columns: 1fr; gap: 12px; }
    .admin-stat { padding: 16px; }
    .admin-stat__value { font-size: 1.55rem; }
    .admin-card { padding: 17px; border-radius: 15px; }
    .admin-page-head { align-items: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid[style] { grid-template-columns: 1fr !important; }
    .detail-list { grid-template-columns: 1fr; }
    .detail-list > div:nth-last-child(2) { border-bottom: 1px dashed #ece6da; }
    .detail-list > div:last-child { border-bottom: 0; }
    .admin-gallery { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .bar-chart { height: 190px; gap: 6px; }
    .admin-toolbar__search { flex-basis: 100%; }
    .table-foot { flex-direction: column; align-items: flex-start; }
    .login-form-side { padding: 28px 20px; }
    .mini-stat { flex-basis: 100%; }
}

@media (max-width: 420px) {
    .admin-topbar__icon { display: none; }
    .btn { padding: 11px 16px; }
    .td-actions { gap: 4px; }
    .icon-btn { width: 32px; height: 32px; }
}

/* Print */
@media print {
    .admin-sidebar, .admin-topbar, .admin-footer, .admin-page-head__actions, .td-actions, .th-actions, .admin-toolbar { display: none !important; }
    .admin-main { margin-left: 0; }
    .admin-card { box-shadow: none; border-color: #ccc; }
}
