:root {
    --navy: #062348;
    --blue: #0798f4;
    --blue-dark: #0878c5;
    --soft: #f4f8fb;
    --line: #dce7ef;
    --text: #102844;
    --muted: #68778b;
    --green: #17a866;
    --red: #dc4d5b;
    --sidebar: 245px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--soft); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.admin-sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; width: var(--sidebar); flex-direction: column; padding: 28px 18px; color: #c5d9e9; background: #041c37; }
.admin-brand { display: inline-flex; align-items: baseline; padding: 0 10px 26px; font-size: 23px; font-weight: 850; letter-spacing: -.6px; }
.admin-brand span { color: white; }.admin-brand strong { color: #17adff; }.admin-brand small { margin-left: 8px; color: #8da7bc; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.admin-brand em { margin-left: 4px; color: white; font-style: normal; }
.admin-sidebar nav { display: grid; gap: 5px; }
.admin-sidebar nav a { display: flex; min-height: 46px; align-items: center; gap: 13px; padding: 0 13px; border-radius: 10px; font-size: 13px; font-weight: 700; transition: .2s ease; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: white; background: rgba(13, 157, 245, .16); }
.admin-sidebar nav a.active { box-shadow: inset 3px 0 #14a9ff; }
.admin-sidebar nav a span { display: grid; width: 25px; height: 25px; place-items: center; color: #31b7ff; font-size: 15px; font-weight: 850; }
.sidebar-footer { display: grid; gap: 8px; margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-footer a { font-size: 12px; }
.admin-main { min-height: 100vh; margin-left: var(--sidebar); }
.admin-topbar { display: flex; min-height: 90px; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 34px; background: white; border-bottom: 1px solid var(--line); }
.admin-topbar p { margin: 0; color: var(--blue-dark); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.admin-topbar h1 { margin: 2px 0 0; font-size: 25px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user > span { display: grid; width: 40px; height: 40px; place-items: center; color: white; border-radius: 50%; background: linear-gradient(145deg, #0cb0ff, #0874c5); font-weight: 850; }
.admin-user strong, .admin-user small { display: block; }.admin-user strong { font-size: 12px; }.admin-user small { color: var(--muted); font-size: 10px; }
.admin-content { padding: 31px 34px 50px; }
.admin-menu-toggle { display: none; }
.alert { margin-bottom: 22px; padding: 13px 17px; border: 1px solid; border-radius: 10px; font-size: 13px; font-weight: 650; }
.alert-success { color: #08693f; border-color: #a8e2c7; background: #eaf9f2; }.alert-error { color: #a02331; border-color: #f0bcc3; background: #fff0f2; }
.welcome-panel { display: flex; align-items: center; justify-content: space-between; gap: 35px; margin-bottom: 24px; padding: 31px 34px; color: white; border-radius: 16px; background: radial-gradient(circle at 86% 20%, rgba(14,173,255,.42), transparent 32%), linear-gradient(120deg, #052447, #07528a); box-shadow: 0 17px 42px rgba(5,37,72,.15); }
.welcome-panel span { color: #42c5ff; font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.welcome-panel h2 { margin: 5px 0 5px; font-size: 28px; }.welcome-panel p { margin: 0; color: #bcd2e4; font-size: 13px; }
.admin-button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; padding: 0 18px; border: 0; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 800; }
.admin-button.primary { color: white; background: linear-gradient(135deg, #0ba9ff, #087bdd); box-shadow: 0 9px 20px rgba(7,137,225,.2); }
.admin-button.light { flex: 0 0 auto; color: var(--blue-dark); background: white; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; margin-bottom: 24px; }
.stat-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 9px 25px rgba(8,38,70,.05); transition: transform .2s ease; }
.stat-card:hover { transform: translateY(-3px); }
.stat-icon { display: grid; width: 47px; height: 47px; place-items: center; color: var(--blue-dark); border-radius: 12px; background: #eaf6ff; font-weight: 850; }
.stat-card strong, .stat-card small { display: block; }.stat-card strong { font-size: 24px; }.stat-card small { color: var(--muted); font-size: 11px; }.stat-card b { color: var(--blue); }
.admin-panel { border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 9px 28px rgba(8,38,70,.045); }
.panel-heading { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 17px; }.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }.panel-heading > a { color: var(--blue-dark); font-size: 12px; font-weight: 750; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 17px; border-bottom: 1px solid #edf2f6; text-align: left; vertical-align: middle; font-size: 12px; }
th { color: #728093; background: #fbfcfd; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
td { color: #46566a; }.empty-state { padding: 32px; color: var(--muted); text-align: center; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }.status.active { color: #0a7548; background: #e5f8ef; }.status.inactive { color: #9b3340; background: #fcebee; }
.admin-grid-layout { display: grid; grid-template-columns: minmax(310px, .68fr) minmax(580px, 1.32fr); gap: 23px; align-items: start; }
.form-panel { position: sticky; top: 20px; }.admin-form { display: grid; gap: 15px; padding: 22px; }
.admin-form label { display: grid; gap: 6px; }.admin-form label > span { color: #35465b; font-size: 11px; font-weight: 750; }
.admin-form input:not([type="checkbox"]), .admin-form textarea, .admin-form select { width: 100%; padding: 11px 12px; color: var(--text); border: 1px solid #cedce7; border-radius: 8px; outline: none; background: white; font-size: 13px; transition: border-color .2s ease, box-shadow .2s ease; }
.admin-form input:focus, .admin-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7,152,244,.1); }
.admin-form textarea { resize: vertical; }.admin-form small { color: var(--muted); font-size: 10px; }
.check-field { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; }.check-field input { width: 16px; height: 16px; accent-color: var(--blue); }.check-field span { font-weight: 650 !important; }
.edit-preview { width: 100%; max-height: 170px; object-fit: cover; border-radius: 9px; }
.row-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }.row-actions a, .row-actions button { padding: 0; color: var(--blue-dark); border: 0; background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }.row-actions button { color: var(--red); }
.settings-panel { max-width: 900px; }.settings-form { grid-template-columns: repeat(2, 1fr); }.settings-form .full { grid-column: 1 / -1; }
.character-info { max-width: 900px; margin-top: 22px; }.character-info > p { margin: 0; padding: 20px 22px; color: var(--muted); font-size: 13px; }.character-info code { padding: 2px 5px; color: #075e9b; border-radius: 4px; background: #eaf6ff; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at 75% 20%, rgba(10,169,255,.24), transparent 28%), #041c37; }
.login-card { width: min(440px, 100%); padding: 38px; border-radius: 19px; background: white; box-shadow: 0 25px 70px rgba(0,0,0,.28); }
.login-brand { padding: 0; }.login-brand span, .login-brand em { color: var(--navy); }.login-heading { margin: 30px 0 18px; }.login-heading h1 { margin: 0 0 4px; font-size: 27px; }.login-heading p { margin: 0; color: var(--muted); font-size: 13px; }.login-card .admin-form { padding: 0; }.login-card .admin-button { width: 100%; margin-top: 3px; }.login-note { margin: 20px 0 12px; padding: 11px; color: #78602c; border-radius: 8px; background: #fff8e7; font-size: 10px; }.back-link { color: var(--blue-dark); font-size: 11px; font-weight: 700; }

@media (max-width: 1180px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }.admin-grid-layout { grid-template-columns: 1fr; }.form-panel { position: static; }
}
@media (max-width: 780px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .25s ease; }.admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }.admin-menu-toggle { position: fixed; z-index: 60; top: 19px; left: 16px; display: grid; width: 40px; height: 40px; place-items: center; color: white; border: 0; border-radius: 8px; background: var(--navy); }
    .admin-topbar { padding: 14px 16px 14px 68px; }.admin-user div { display: none; }.admin-content { padding: 22px 16px 40px; }.welcome-panel { display: grid; padding: 25px; }.welcome-panel h2 { font-size: 23px; }.stats-grid { grid-template-columns: 1fr 1fr; }.settings-form { grid-template-columns: 1fr; }.settings-form .full { grid-column: auto; }
}
@media (max-width: 500px) {
    .admin-topbar h1 { font-size: 20px; }.stats-grid { grid-template-columns: 1fr; }.stat-card { padding: 17px; }.login-card { padding: 28px 22px; }.panel-heading { padding-inline: 17px; }.admin-form { padding: 18px; }
}
