:root {
    --ink: #14213d;
    --muted: #68738a;
    --line: #dfe5ef;
    --surface: #ffffff;
    --canvas: #f3f6fb;
    --navy: #071a3d;
    --blue: #1463ff;
    --cyan: #18b7cf;
    --green: #138a58;
    --red: #c43d4f;
    --amber: #b26a00;
    --shadow: 0 18px 50px rgba(15, 35, 70, 0.09);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.55 Manrope, sans-serif; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 18px; color: #d9e5ff; background: radial-gradient(circle at 10% 0, #153d80 0, transparent 35%), var(--navy); }
.admin-brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 34px; color: white; text-decoration: none; font-family: "Space Grotesk", sans-serif; }
.admin-brand span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--navy); background: linear-gradient(135deg, #80e6f2, #fff); font-weight: 800; }
.admin-nav { display: grid; gap: 6px; }
.admin-nav a { padding: 11px 14px; border-radius: 10px; color: #b9cae8; text-decoration: none; font-weight: 700; }
.admin-nav a:hover, .admin-nav a.active { color: white; background: rgba(255,255,255,.1); }
.admin-nav a.active { box-shadow: inset 3px 0 var(--cyan); }
.admin-sidebar-footer { display: grid; gap: 12px; margin-top: auto; padding: 18px 12px 0; border-top: 1px solid rgba(255,255,255,.12); }
.admin-sidebar-footer a, .link-button { border: 0; padding: 0; color: #b9cae8; background: none; text-decoration: none; font-weight: 700; text-align: left; }
.admin-sidebar-footer a:hover, .link-button:hover { color: white; }
.admin-main { min-width: 0; }
.admin-topbar { min-height: 104px; display: flex; align-items: center; gap: 18px; padding: 22px clamp(20px,4vw,52px); background: rgba(255,255,255,.85); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.admin-topbar h1 { margin: 1px 0 0; font: 700 clamp(24px,3vw,34px)/1.1 "Space Grotesk", sans-serif; }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.admin-profile { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.admin-profile > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--blue), var(--cyan)); font-weight: 800; }
.admin-profile div { display: grid; }
.admin-profile small { color: var(--muted); }
.menu-toggle { display: none; border: 1px solid var(--line); padding: 8px 11px; border-radius: 8px; background: white; }
.admin-content { padding: clamp(22px,4vw,52px); }
.notice { margin-bottom: 20px; padding: 13px 16px; border-radius: 10px; border-left: 4px solid var(--blue); background: #edf4ff; }
.notice-success { border-color: var(--green); background: #eaf8f1; }
.notice-error { border-color: var(--red); background: #fff0f2; }
.notice-warning { border-color: var(--amber); background: #fff7e8; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.toolbar form { display: flex; gap: 8px; flex: 1; max-width: 580px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 0; border-radius: 9px; color: white; background: var(--blue); text-decoration: none; font-weight: 800; }
.button:hover { filter: brightness(.94); }
.button-secondary { color: var(--ink); background: white; border: 1px solid var(--line); }
.button-danger { background: var(--red); }
.button-small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card { position: relative; overflow: hidden; padding: 22px; }
.stat-card::after { content: ""; position: absolute; width: 70px; height: 70px; right: -20px; top: -20px; border-radius: 50%; background: var(--accent, #dce7ff); }
.stat-card small { color: var(--muted); font-weight: 700; }
.stat-card strong { display: block; margin-top: 8px; font: 700 34px "Space Grotesk", sans-serif; }
.panel { overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font: 700 20px "Space Grotesk", sans-serif; }
.panel-body { padding: 22px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.75fr); gap: 18px; }
.quick-actions { display: grid; gap: 10px; }
.quick-actions a { display: flex; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 800; }
.quick-actions a:hover { border-color: var(--blue); color: var(--blue); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f8faff; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.table-title { font-weight: 800; text-decoration: none; }
.table-title:hover { color: var(--blue); }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-form { display: inline; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: capitalize; }
.status-published { color: #07653d; background: #dff5e9; }
.status-draft { color: #895800; background: #fff0c9; }
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 18px; align-items: start; }
.form-stack, .form-sidebar { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 800; }
.field small, .helper { color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], textarea, select { width: 100%; padding: 11px 12px; border: 1px solid #cdd6e5; border-radius: 9px; color: var(--ink); background: white; outline: none; }
textarea { min-height: 110px; resize: vertical; }
textarea.editor { min-height: 410px; font-family: Consolas, monospace; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,99,255,.12); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.empty-state { padding: 46px 22px; text-align: center; color: var(--muted); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 16px; }
.media-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.media-card img { width: 100%; height: 145px; display: block; object-fit: cover; background: #eef2f8; }
.media-card-body { padding: 13px; }
.media-card-body strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-actions { display: flex; gap: 7px; margin-top: 10px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 20% 20%, rgba(24,183,207,.25), transparent 32%), linear-gradient(135deg, #061735, #102e64); }
.auth-card { width: min(100%, 480px); padding: clamp(25px,5vw,42px); border-radius: 22px; background: white; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.auth-card h1 { margin: 18px 0 7px; font: 700 32px/1.1 "Space Grotesk", sans-serif; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); }
.auth-card form { display: grid; gap: 16px; }
.auth-mark { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; color: white; background: linear-gradient(135deg, var(--blue), var(--cyan)); font: 700 18px "Space Grotesk", sans-serif; }
.auth-note { margin-top: 18px; padding: 12px; border-radius: 9px; color: var(--muted); background: #f3f6fb; font-size: 13px; }

@media (max-width: 980px) {
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .dashboard-grid, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .admin-shell { display: block; }
    .admin-sidebar { position: fixed; z-index: 20; width: 252px; transform: translateX(-105%); transition: transform .2s ease; }
    .admin-sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,.25); }
    .menu-toggle { display: inline-flex; }
    .admin-topbar { min-height: 86px; padding: 16px; }
    .admin-profile div { display: none; }
    .admin-content { padding: 18px 14px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar form { max-width: none; }
    .panel-header { padding: 15px; }
    th, td { padding: 11px 10px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card strong { font-size: 27px; }
    .admin-topbar h1 { font-size: 23px; }
    .toolbar form { display: grid; }
}
