:root { --navy:#181944; --cyan:#00adef; --ink:#293044; --muted:#6c7488; --line:#dbe2e8; --page:#f3f6f8; --white:#fff; --red:#b02a3d; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font-family: Inter, sans-serif; line-height: 1.5; }
a { color: inherit; }
.admin-topbar { position: sticky; top: 0; z-index: 20; min-height: 76px; padding: 10px clamp(20px,5vw,70px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: white; border-bottom: 1px solid var(--line); }
.admin-brand { display: flex; align-items: center; gap: 14px; color: var(--navy); text-decoration: none; }
.admin-brand img { width: 58px; height: 46px; object-fit: contain; }
.admin-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.admin-brand strong { font-size: 1rem; }
.admin-brand small { margin-top: 4px; color: var(--muted); font-size: .7rem; }
.admin-nav { display: flex; gap: 24px; }
.admin-nav a { color: var(--navy); font-size: .84rem; font-weight: 700; text-decoration: none; }
.admin-main { min-height: calc(100vh - 76px); }
.admin-container { max-width: 1400px; margin: auto; padding: 52px clamp(20px,5vw,70px) 80px; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 34px; }
.dashboard-heading h1, .editor-heading h1 { margin: 3px 0 4px; color: var(--navy); font-size: clamp(2rem,4vw,3.3rem); letter-spacing: -.045em; }
.dashboard-heading p { margin: 0; color: var(--muted); }
.admin-eyebrow { margin: 0; color: #007fae; font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.admin-button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 11px 18px; border: 0; border-radius: 7px; font: 700 .88rem Inter,sans-serif; text-decoration: none; cursor: pointer; }
.admin-button.primary { color: white; background: var(--navy); }
.admin-button.primary:hover { background: #007fac; }
.admin-button.secondary { min-height:36px; padding:8px 13px; color:var(--navy); background:white; border:1px solid #b9c8d0; }
.admin-button.secondary:hover { border-color:var(--cyan); }
.admin-button.full { width: 100%; }
.status-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 15px; margin-bottom: 28px; }
.status-card { min-height: 112px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.status-card span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.status-card strong { color: var(--navy); font-size: 2rem; }
.status-card.active { border-color: var(--cyan); box-shadow: inset 0 4px 0 var(--cyan); }
.content-panel { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 12px; }
.panel-heading { padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; color: var(--navy); font-size: 1.15rem; }
.panel-heading span { color: var(--muted); font-size: .78rem; }
.posts-table-wrap { overflow-x: auto; }
.posts-table { width: 100%; border-collapse: collapse; }
.posts-table th { padding: 12px 18px; color: var(--muted); background: #fafcfd; font-size: .7rem; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
.posts-table td { padding: 16px 18px; border-top: 1px solid var(--line); font-size: .82rem; vertical-align: middle; }
.story-cell { min-width: 300px; display: flex; align-items: center; gap: 14px; }
.story-cell img { width: 72px; height: 54px; object-fit: cover; border-radius: 5px; background: #e4eaee; }
.story-cell div { display: flex; flex-direction: column; }
.story-cell strong { max-width: 390px; color: var(--navy); }
.story-cell small, .email { display: block; max-width: 360px; margin-top: 4px; color: var(--muted); }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-pill.pending { color:#875d00; background:#fff3ce; }
.status-pill.draft { color:#53606d; background:#e9eef1; }
.status-pill.published { color:#126343; background:#dff5eb; }
.row-actions { display:flex; justify-content:flex-end; align-items:center; gap:10px; white-space:nowrap; }
.row-actions a, .row-actions button { padding:0; color:#087da5; background:none; border:0; font:700 .75rem Inter,sans-serif; cursor:pointer; text-decoration:none; }
.row-actions .danger-link { color:var(--red); }
.admin-empty { padding:70px 20px; text-align:center; }
.admin-empty strong { color:var(--navy); }
.admin-empty p { color:var(--muted); }
.admin-alert { margin: 0 0 24px; padding: 14px 17px; border-radius: 7px; font-size: .86rem; }
.admin-alert.error { color:#8d2634; background:#fff0f2; border:1px solid #efbdc4; }
.admin-alert.success { color:#145c45; background:#e5f7ef; border:1px solid #a8dec8; }
.admin-alert ul { margin:7px 0 0 18px; }

.category-manager {
    margin-bottom: 28px;
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: end;
    gap: 30px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.category-manager h2 {
    margin: 3px 0 16px;
    color: var(--navy);
    font-size: 1.25rem;
}

.admin-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-category-list > span {
    padding: 8px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--navy);
    background: #eef7fa;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.admin-category-list small {
    color: var(--muted);
    font-size: .66rem;
    font-weight: 600;
}

.category-add-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--navy);
    font-size: .76rem;
    font-weight: 700;
}

.category-add-form > div {
    display: flex;
    gap: 8px;
}

.category-add-form input {
    min-width: 0;
    flex: 1;
    padding: 11px 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #bcc9d0;
    border-radius: 6px;
    font: inherit;
}

.admin-category-badge {
    align-self: flex-start;
    margin-bottom: 4px;
    color: #007da7;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.login-shell { min-height: calc(100vh - 76px); display:grid; grid-template-columns:1fr 1fr; }
.login-story { padding: clamp(50px,9vw,130px); display:flex; flex-direction:column; justify-content:center; color:white; background:var(--navy); }
.login-story .admin-eyebrow { color:#73d9ff; }
.login-story h1 { max-width:600px; margin:18px 0; font-size:clamp(2.7rem,5vw,5.2rem); line-height:.94; letter-spacing:-.06em; }
.login-story p:last-child { max-width:540px; color:#cbd0e7; }
.login-card { width:min(440px,calc(100% - 40px)); margin:auto; padding:38px; background:white; border:1px solid var(--line); border-radius:13px; box-shadow:0 20px 60px rgba(24,25,68,.1); }
.login-card h2 { margin:0 0 5px; color:var(--navy); }
.login-card > p { margin:0 0 24px; color:var(--muted); font-size:.86rem; }
.admin-form { display:grid; gap:17px; }
.admin-form label, .editor-sidebar label { display:grid; gap:7px; color:var(--navy); font-size:.78rem; font-weight:700; }
.admin-form input, .editor-sidebar input, .editor-sidebar select, .admin-field input { width:100%; padding:12px 13px; color:var(--ink); background:white; border:1px solid #bcc9d0; border-radius:6px; font:inherit; }
.password-input-wrap { position:relative; display:block; }
.password-input-wrap input { padding-right:48px; }
.password-toggle { position:absolute; top:50%; right:9px; width:36px; height:36px; padding:7px; display:grid; place-items:center; transform:translateY(-50%); color:#5f6878; background:transparent; border:0; border-radius:5px; cursor:pointer; }
.password-toggle:hover { color:var(--navy); background:#eef4f7; }
.password-toggle:focus-visible { outline:3px solid rgba(0,173,239,.25); }
.password-toggle svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.password-toggle .eye-closed { display:none; }
.password-toggle[aria-pressed="true"] .eye-open { display:none; }
.password-toggle[aria-pressed="true"] .eye-closed { display:block; }
.admin-form input:focus, .editor-sidebar input:focus, .editor-sidebar select:focus, .admin-field input:focus, .editor-surface:focus { outline:3px solid rgba(0,173,239,.18); border-color:var(--cyan); }
.admin-form small, .editor-sidebar small { color:var(--muted); font-weight:400; }
.setup-link { display:block; margin-top:20px; color:#007da7; font-size:.78rem; font-weight:700; text-align:center; }
.setup-shell { min-height:calc(100vh - 76px); display:grid; place-items:center; padding:50px 20px; }
.setup-card { width:min(600px,100%); padding:42px; background:white; border:1px solid var(--line); border-radius:14px; box-shadow:0 20px 60px rgba(24,25,68,.08); }
.setup-card h1 { margin:6px 0 25px; color:var(--navy); font-size:2.3rem; line-height:1.05; letter-spacing:-.04em; }
.setup-step { margin-bottom:25px; padding:15px; display:grid; grid-template-columns:32px 1fr; gap:12px; background:#e9f7f2; border-radius:7px; }
.setup-step > span { display:grid; place-items:center; width:27px; height:27px; color:white; background:#20825f; border-radius:50%; }
.setup-step p { margin:2px 0 0; color:var(--muted); font-size:.8rem; }
.config-example { padding:18px; display:grid; gap:7px; background:#eef4f7; border-radius:7px; }
.config-example code { color:#52606b; }

.editor-page { max-width:1500px; }
.editor-heading { margin-bottom:28px; display:flex; align-items:end; justify-content:space-between; }
.editor-heading-actions { display:flex; align-items:center; gap:12px; }
.editor-heading a { color:#087da5; font-size:.8rem; font-weight:700; text-decoration:none; }
.admin-editor-form { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:25px; align-items:start; }
.editor-main-column { padding:28px; background:white; border:1px solid var(--line); border-radius:11px; }
.admin-field { margin-bottom:24px; }
.admin-field > label { display:block; margin-bottom:8px; color:var(--navy); font-size:.8rem; font-weight:800; }
.admin-field > input { font-size:1.1rem; font-weight:600; }
.editor-sidebar { display:grid; gap:16px; }
.editor-sidebar section { padding:20px; display:grid; gap:15px; background:white; border:1px solid var(--line); border-radius:10px; }
.editor-sidebar h2 { margin:0; color:var(--navy); font-size:.94rem; }
.current-cover { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:6px; }
.submitter-email { margin:0; color:var(--muted); font-size:.76rem; }
.submitter-email a { color:#087da5; }

.rich-editor { overflow:hidden; border:1px solid #b9cbd2; border-radius:8px; background:white; }
.editor-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:5px; padding:9px; background:#f3f7f9; border-bottom:1px solid #cbd9de; }
.editor-toolbar button, .editor-toolbar select { min-height:34px; padding:6px 9px; color:var(--navy); background:white; border:1px solid #c2d0d5; border-radius:5px; font:600 .75rem Inter,sans-serif; cursor:pointer; }
.toolbar-divider { width:1px; height:24px; margin:0 3px; background:#c2d0d5; }
.editor-surface { min-height:580px; padding:28px; color:#222; font:16px/1.5 'Times New Roman',Times,serif; overflow-wrap:anywhere; }
.editor-surface p { margin-bottom:16px; }
.editor-surface img { max-width:100%; height:auto; }
.field-help { margin:0; padding:7px 12px; color:var(--muted); background:#fafcfd; border-top:1px solid #dbe4e8; font-size:.72rem; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

@media(max-width:1000px){ .admin-editor-form{grid-template-columns:1fr}.editor-sidebar{grid-template-columns:repeat(2,1fr)}.editor-sidebar .admin-button{grid-column:1/-1}.status-cards{grid-template-columns:repeat(2,1fr)}.category-manager{grid-template-columns:1fr;align-items:start} }
@media(max-width:760px){ .login-shell{grid-template-columns:1fr}.login-story{min-height:330px;padding:48px 28px}.login-card{margin:40px auto}.dashboard-heading{align-items:flex-start;flex-direction:column}.status-cards{grid-template-columns:1fr 1fr}.admin-nav{gap:12px}.admin-brand span{display:none}.editor-sidebar{grid-template-columns:1fr}.posts-table th:nth-child(3),.posts-table td:nth-child(3){display:none}.editor-main-column{padding:18px}.editor-surface{min-height:400px;padding:18px}.editor-toolbar{max-height:175px;overflow-y:auto}.row-actions{flex-wrap:wrap}.setup-card{padding:28px 20px} }
@media(max-width:480px){ .status-cards{grid-template-columns:1fr}.admin-topbar{min-height:68px}.admin-container{padding-top:32px}.admin-nav a:first-child{display:none}.dashboard-heading .admin-button{width:100%}.category-add-form>div{flex-direction:column}.category-add-form .admin-button{width:100%} }
