:root {
    --admin-navy: #111827;
    --admin-navy-soft: #1f2937;
    --admin-indigo: #6366f1;
    --admin-indigo-dark: #4f46e5;
    --admin-cyan: #22d3ee;
    --admin-canvas: #f3f5f9;
    --admin-border: #e5e7eb;
    --admin-muted: #6b7280;
    --admin-sidebar-width: 270px;
}

* { box-sizing: border-box; }
body.admin-body { margin: 0; min-height: 100vh; background: var(--admin-canvas); color: #1f2937; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.admin-shell { min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1040; width: var(--admin-sidebar-width); padding: 1.5rem 1rem; color: #fff; background: radial-gradient(circle at 20% 0%, #312e81 0, transparent 35%), linear-gradient(180deg, #111827 0%, #0b1220 100%); box-shadow: 18px 0 50px rgba(15, 23, 42, .12); transition: transform .25s ease; }
.brand { display: flex; align-items: center; gap: .8rem; padding: 0 .65rem 1.7rem; color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg, var(--admin-indigo), var(--admin-cyan)); box-shadow: 0 9px 22px rgba(99, 102, 241, .38); font-size: 1.2rem; font-weight: 800; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { letter-spacing: -.02em; }
.brand-copy small { color: #9ca3af; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.nav-caption { margin: 1.1rem .8rem .55rem; color: #6b7280; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-link { display: flex; align-items: center; gap: .8rem; margin-bottom: .35rem; padding: .78rem .85rem; border-radius: 12px; color: #aeb6c4; text-decoration: none; font-size: .92rem; font-weight: 600; transition: .18s ease; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.sidebar-link.active { color: #fff; background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(99,102,241,.1)); box-shadow: inset 3px 0 var(--admin-indigo); }
.nav-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #c7d2fe; background: rgba(255,255,255,.06); }
.admin-main { min-height: 100vh; margin-left: var(--admin-sidebar-width); }
.admin-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 clamp(1rem, 3vw, 2.3rem); border-bottom: 1px solid rgba(229,231,235,.8); background: rgba(255,255,255,.86); backdrop-filter: blur(18px); }
.topbar-title { margin: 0; color: #111827; font-size: 1rem; font-weight: 700; }
.topbar-subtitle { color: var(--admin-muted); font-size: .76rem; }
.topbar-user { display: flex; align-items: center; gap: .75rem; }
.topbar-profile-button { display: flex; align-items: center; gap: .7rem; padding: .35rem .45rem .35rem .75rem; border: 1px solid transparent; border-radius: 14px; background: transparent; transition: background .18s ease, border-color .18s ease; }
.topbar-profile-button:hover, .topbar-profile-button[aria-expanded="true"] { border-color: #e5e7eb; background: #f9fafb; }
.user-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--admin-indigo), #8b5cf6); font-weight: 700; }
.profile-dropdown { width: 290px; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 18px 45px rgba(15,23,42,.14); }
.profile-dropdown-header { display: flex; align-items: center; gap: .8rem; padding: 1rem; background: #f9fafb; }
.profile-last-login { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; color: #6b7280; }
.profile-last-login > i { color: var(--admin-indigo); font-size: 1.15rem; }
.profile-last-login span, .profile-last-login strong { display: block; }
.profile-last-login span { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.profile-last-login strong { margin-top: .15rem; color: #374151; font-size: .8rem; }
.admin-content { width: 100%; max-width: 1600px; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.3rem); }
.page-heading { margin-bottom: 1.6rem; }
.page-heading h1 { margin: 0 0 .35rem; color: #111827; font-size: clamp(1.65rem, 3vw, 2.15rem); font-weight: 750; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--admin-muted); }
.premium-card { border: 1px solid rgba(229,231,235,.9); border-radius: 18px; background: #fff; box-shadow: 0 12px 34px rgba(15,23,42,.055); }
.premium-card .card-header { padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--admin-border); background: transparent; }
.metric-card { position: relative; height: 100%; padding: 1.45rem; overflow: hidden; }
.metric-card::after { position: absolute; top: -35px; right: -35px; width: 110px; height: 110px; border-radius: 50%; background: var(--metric-glow, #eef2ff); content: ""; }
.metric-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 1.3rem; border-radius: 14px; color: var(--metric-color, var(--admin-indigo)); background: var(--metric-bg, #eef2ff); font-size: 1.3rem; }
.metric-label { color: var(--admin-muted); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric-value { margin-top: .2rem; color: #111827; font-size: 1.7rem; font-weight: 750; letter-spacing: -.04em; }
.metric-trend { display: inline-flex; align-items: center; gap: .3rem; margin-top: .6rem; padding: .25rem .5rem; border-radius: 999px; color: #047857; background: #ecfdf5; font-size: .7rem; font-weight: 700; }
.chart-card { height: 100%; padding: 1.35rem; }
.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.chart-heading h2 { margin: 0; color: #111827; font-size: 1rem; font-weight: 750; }
.chart-heading p { margin: .25rem 0 0; color: var(--admin-muted); font-size: .78rem; }
.chart-wrap { position: relative; width: 100%; height: 310px; }
.chart-wrap.chart-donut { height: 250px; }
.rank-number { display: grid; flex: 0 0 34px; place-items: center; height: 34px; border-radius: 10px; color: #4f46e5; background: #eef2ff; font-size: .75rem; font-weight: 800; }
.rank-row { display: flex; align-items: center; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid #eef0f4; }
.rank-row:last-child { border-bottom: 0; }
.rank-bar { height: 5px; margin-top: .45rem; overflow: hidden; border-radius: 99px; background: #eef0f4; }
.rank-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--admin-indigo), var(--admin-cyan)); }
.quick-action { display: flex; align-items: center; gap: 1rem; height: 100%; padding: 1.25rem; color: inherit; text-decoration: none; transition: .2s ease; }
.quick-action:hover { color: inherit; border-color: #c7d2fe; transform: translateY(-3px); box-shadow: 0 18px 40px rgba(79,70,229,.1); }
.quick-action-icon { display: grid; flex: 0 0 48px; place-items: center; height: 48px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--admin-indigo), #8b5cf6); font-size: 1.35rem; }
.btn-premium { border: 0; color: #fff; background: linear-gradient(135deg, var(--admin-indigo), var(--admin-indigo-dark)); box-shadow: 0 8px 20px rgba(79,70,229,.24); }
.btn-premium:hover { color: #fff; background: linear-gradient(135deg, #5558e8, #4338ca); transform: translateY(-1px); }
.btn-soft { border-color: #e0e7ff; color: var(--admin-indigo-dark); background: #eef2ff; }
.btn-soft:hover { border-color: #c7d2fe; color: #3730a3; background: #e0e7ff; }
.btn-trash { border-color: #e5e7eb; color: #64748b; background: #fff; box-shadow: 0 5px 14px rgba(15,23,42,.05); }
.btn-trash:hover { border-color: #fecaca; color: #b91c1c; background: #fff7f7; transform: translateY(-1px); }
.premium-table { margin: 0; }
.premium-table thead th { padding: .9rem 1.15rem; border: 0; color: #6b7280; background: #f9fafb; font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.premium-table tbody td { padding: 1.05rem 1.15rem; border-color: #eef0f4; vertical-align: middle; }
.premium-table tbody tr { transition: background .16s ease; }
.premium-table tbody tr:hover { background: #fafaff; }
.content-manage-list { overflow: hidden; }
.content-manage-item + .content-manage-item { border-top: 1px solid #eef0f4; }
.content-manage-summary { display: grid; align-items: center; min-height: 78px; padding: .9rem 1.15rem; grid-template-columns: 44px 62px minmax(0, 1fr) auto auto; gap: .8rem; transition: background .16s ease; }
.content-manage-summary:hover { background: #fafaff; }
.content-manage-toggle { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .75rem; border: 0; border-radius: 11px; color: #111827; background: transparent; text-align: left; }
.content-manage-toggle:hover { color: var(--admin-indigo-dark); background: #f5f7ff; }
.content-manage-toggle .toggle-chevron { transition: transform .2s ease; }
.content-manage-toggle[aria-expanded="true"] .toggle-chevron { transform: rotate(180deg); }
.content-manage-panel { border-top: 1px solid #e7e9f2; background: #fbfcff; box-shadow: inset 0 8px 18px rgba(15,23,42,.025); }
.content-manage-panel form { background: #fff; }
.content-add-wrap { display: grid; padding: 1.35rem; border-top: 1px solid #eef0f4; place-items: center; background: #fafbfe; }
.content-add-button { display: grid; width: 54px; height: 54px; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--admin-indigo), var(--admin-indigo-dark)); box-shadow: 0 12px 28px rgba(79,70,229,.3); place-items: center; font-size: 1.4rem; transition: transform .18s ease, box-shadow .18s ease; }
.content-add-button:hover { color: #fff; transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 34px rgba(79,70,229,.38); }
.content-create-panel { margin-top: 1rem; border: 1px solid #dfe3f3; border-radius: 16px; background: #fff; box-shadow: 0 18px 45px rgba(15,23,42,.08); }
.issue-avatar { display: grid; flex: 0 0 42px; place-items: center; height: 42px; border-radius: 12px; color: #4338ca; background: linear-gradient(135deg, #eef2ff, #e0e7ff); font-weight: 800; }
.status-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .7rem; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.status-pill::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.status-published, .status-enabled { color: #047857; background: #ecfdf5; }
.status-draft { color: #6b7280; background: #f3f4f6; }
.status-inactive, .status-disabled { color: #b45309; background: #fffbeb; }
.form-section { padding: 1.45rem; }
.form-section + .form-section { border-top: 1px solid var(--admin-border); }
.section-title { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.25rem; color: #111827; font-size: .95rem; font-weight: 750; }
.section-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #4f46e5; background: #eef2ff; font-size: .75rem; }
.form-label { margin-bottom: .45rem; color: #374151; font-size: .8rem; font-weight: 700; }
.form-control, .form-select { min-height: 46px; border-color: #dfe3ea; border-radius: 11px; background-color: #fbfcfe; }
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus { border-color: #818cf8; background: #fff; box-shadow: 0 0 0 .22rem rgba(99,102,241,.12); }
.form-switch .form-check-input { width: 2.6em; height: 1.35em; }
.form-check-input:checked { border-color: var(--admin-indigo); background-color: var(--admin-indigo); }
.empty-state { padding: 4rem 1rem; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 20px; color: #6366f1; background: #eef2ff; font-size: 1.8rem; }
.alert { border: 0; border-radius: 13px; }
.swal2-popup { border-radius: 20px; font-family: Inter, system-ui, sans-serif; }
.swal2-title { color: #111827; letter-spacing: -.025em; }
.swal2-html-container { color: #596273; }
.swal2-actions { gap: .5rem; }
.swal2-styled { border-radius: 10px; box-shadow: none !important; font-weight: 700; }
.mobile-menu { display: none; }
.sidebar-backdrop { display: none; }

.login-page { min-height: 100vh; background: #f6f7fb; }
.login-visual { position: relative; display: flex; min-height: 100vh; padding: 4rem; overflow: hidden; color: #fff; background: radial-gradient(circle at 20% 10%, rgba(99,102,241,.75), transparent 35%), radial-gradient(circle at 90% 80%, rgba(34,211,238,.28), transparent 35%), #111827; }
.login-visual::after { position: absolute; right: -10%; bottom: -20%; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); content: ""; }
.login-message { position: relative; z-index: 1; align-self: center; max-width: 540px; }
.login-message h1 { margin: 1.4rem 0 1rem; font-size: clamp(2.5rem, 5vw, 4.6rem); font-weight: 780; letter-spacing: -.06em; line-height: .98; }
.login-message p { max-width: 460px; color: #cbd5e1; font-size: 1.05rem; }
.login-form-side { display: grid; min-height: 100vh; place-items: center; padding: 2rem; }
.login-card { width: min(430px, 100%); padding: clamp(1.5rem, 5vw, 2.6rem); border: 1px solid rgba(229,231,235,.8); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 28px 70px rgba(15,23,42,.12); }
.login-card h2 { color: #111827; font-weight: 760; letter-spacing: -.04em; }

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-102%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .mobile-menu { display: inline-flex; }
    .sidebar-backdrop.show { position: fixed; inset: 0; z-index: 1030; display: block; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); }
    .login-visual { display: none; }
}

@media (max-width: 575.98px) {
    .admin-topbar { height: 66px; }
    .topbar-user-copy { display: none; }
    .admin-content { padding: 1rem; }
    .page-actions { display: grid; width: 100%; margin-top: 1rem; grid-template-columns: 1fr; }
    .page-actions .btn { width: 100%; }
    .premium-table thead { display: none; }
    .premium-table, .premium-table tbody, .premium-table tr, .premium-table td { display: block; width: 100%; }
    .premium-table tr { padding: .7rem 1rem; border-bottom: 1px solid var(--admin-border); }
    .premium-table tbody td { padding: .35rem 0; border: 0; }
    .premium-table td[data-label]::before { margin-right: .4rem; color: var(--admin-muted); content: attr(data-label) ": "; font-size: .75rem; font-weight: 700; }
    .content-manage-summary { padding: .8rem; grid-template-columns: 32px 1fr auto; gap: .5rem; }
    .content-manage-summary .content-order { display: none; }
    .content-manage-summary .content-status { grid-column: 2; }
    .content-manage-summary .content-actions { grid-column: 3; grid-row: 1 / span 2; }
    .content-manage-toggle { padding: .5rem; }
}
