:root {
    --navy: #202f82;
    --navy-dark: #111a4c;
    --blue: #20a6de;
    --ink: #172033;
    --muted: #6b7385;
    --line: #dde2ea;
    --paper: #f4f6f9;
    --white: #fff;
    --red: #cc3b48;
    --green: #17895b;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }

.login-page { min-height: 100vh; background: var(--navy-dark); }
.login-shell { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 100vh; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 60px 7vw; color: #fff; background: linear-gradient(145deg, rgba(14,23,72,.95), rgba(30,48,133,.9)), url("/assets/images/hero-building.jpeg") center/cover; }
.login-brand img { width: 380px; content: url("/assets/images/logo-ca-retina-white.png"); }
.login-brand > div { max-width: 680px; margin-bottom: 7vh; }
.login-brand span, .form-kicker { color: #76d0f4; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.login-brand h1 { margin: 20px 0; font: 700 clamp(42px, 5vw, 68px)/1.08 "Manrope", sans-serif; letter-spacing: -.04em; }
.login-brand p { max-width: 570px; color: rgba(255,255,255,.65); font-size: 17px; }
.login-form-wrap { display: grid; padding: 40px; place-items: center; background: #fff; }
.login-form { width: min(100%, 420px); }
.login-form h2 { margin: 13px 0 7px; font: 700 32px "Manrope", sans-serif; }
.login-form > p { margin: 0 0 35px; color: var(--muted); }
label { display: block; margin-bottom: 20px; color: #344054; font-size: 12px; font-weight: 600; }
input, textarea, select { display: block; width: 100%; margin-top: 7px; padding: 12px 14px; color: var(--ink); border: 1px solid #ccd3dd; border-radius: 3px; outline: 0; background: #fff; font-size: 14px; transition: border .2s, box-shadow .2s; }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(32,166,222,.12); }
label small, .form-panel > small { display: block; margin-top: 7px; color: var(--muted); font-weight: 400; }
.admin-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 0 22px; border: 0; border-radius: 3px; cursor: pointer; font-size: 13px; font-weight: 700; }
.admin-button.primary { color: #fff; background: var(--navy); }
.admin-button.primary:hover { background: #17256d; }
.admin-button.light { color: var(--navy); background: #fff; }
.admin-button.small { min-height: 40px; }
.login-form .admin-button { width: 100%; margin-top: 8px; }
.back-site { display: block; margin-top: 25px; color: var(--muted); text-align: center; font-size: 12px; }
.alert { margin-bottom: 22px; padding: 13px 16px; border-left: 3px solid; border-radius: 2px; font-size: 13px; }
.alert.error { color: #8c2731; border-color: var(--red); background: #fff0f1; }
.alert.success { color: #11623f; border-color: var(--green); background: #ebf8f2; }

.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 250px; flex-direction: column; color: rgba(255,255,255,.65); background: var(--navy-dark); }
.admin-logo { display: grid; height: 92px; padding: 25px 30px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-logo img { width: 190px; content: url("/assets/images/logo-ca-retina-white.png"); }
.admin-sidebar nav { flex: 1; padding: 22px 15px; overflow-y: auto; }
.admin-sidebar nav > span { display: block; margin: 20px 14px 8px; color: rgba(255,255,255,.35); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.admin-sidebar nav > span:first-child { margin-top: 0; }
.admin-sidebar nav a { display: flex; gap: 13px; align-items: center; padding: 11px 14px; border-radius: 3px; font-size: 13px; font-weight: 500; transition: color .2s, background .2s; }
.admin-sidebar nav a i { width: 18px; color: #54bee9; font-style: normal; text-align: center; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: #fff; background: rgba(255,255,255,.09); }
.sidebar-bottom { display: flex; justify-content: space-between; padding: 18px 25px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; }
.sidebar-bottom a:hover { color: #fff; }
.admin-shell { min-height: 100vh; margin-left: 250px; }
.admin-header { display: flex; height: 92px; align-items: center; justify-content: space-between; padding: 0 35px; border-bottom: 1px solid var(--line); background: #fff; }
.admin-header > div:first-of-type span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.admin-header h1 { margin: 2px 0 0; font: 700 22px "Manrope", sans-serif; }
.admin-user { display: flex; gap: 11px; align-items: center; }
.admin-user > span { display: grid; width: 38px; height: 38px; place-items: center; color: #fff; border-radius: 50%; background: var(--navy); font-weight: 700; }
.admin-user strong, .admin-user small { display: block; }
.admin-user strong { font-size: 12px; }
.admin-user small { color: var(--muted); font-size: 10px; }
.sidebar-toggle { display: none; border: 0; background: none; font-size: 22px; }
.admin-content { max-width: 1480px; margin-inline: auto; padding: 35px; }
.panel { border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 2px 7px rgba(26,36,69,.025); }
.welcome-card { display: flex; min-height: 220px; align-items: center; justify-content: space-between; padding: 45px 50px; color: #fff; background: linear-gradient(105deg, var(--navy-dark), var(--navy)); }
.welcome-card span { color: #7fd4f5; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.welcome-card h2 { margin: 10px 0 6px; font: 700 34px "Manrope", sans-serif; }
.welcome-card p { margin: 0; color: rgba(255,255,255,.65); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 25px 0; }
.metric-grid > div { padding: 25px; border: 1px solid var(--line); background: #fff; }
.metric-grid span { color: var(--muted); font-size: 11px; }
.metric-grid strong { display: block; margin: 8px 0 18px; color: var(--navy); font: 700 34px "Manrope", sans-serif; }
.metric-grid a { color: var(--blue); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.panel-head span { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.panel-head h2 { margin: 3px 0 0; font: 700 18px "Manrope", sans-serif; }
.panel-head > a { color: var(--blue); font-size: 11px; font-weight: 700; }
.simple-list > a { display: flex; align-items: center; justify-content: space-between; padding: 17px 26px; border-bottom: 1px solid var(--line); }
.simple-list > a:last-child { border: 0; }
.simple-list strong, .simple-list span { display: block; }
.simple-list strong { font-size: 13px; }
.simple-list span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.simple-list i { color: var(--blue); font-style: normal; }
.quick-panel > a { display: flex; gap: 14px; align-items: center; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.quick-panel > a > i { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; color: var(--navy); background: #edf1fb; font-style: normal; }
.quick-panel strong, .quick-panel span { display: block; }
.quick-panel strong { font-size: 12px; }
.quick-panel span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.table-panel { overflow: hidden; }
.content-table .table-row { display: grid; grid-template-columns: minmax(260px, 2fr) 1fr .6fr .8fr .7fr; gap: 20px; align-items: center; padding: 17px 23px; border-bottom: 1px solid var(--line); font-size: 12px; }
.content-table.pages-table .table-row { grid-template-columns: minmax(280px, 2fr) .7fr 1fr .7fr; }
.content-table .table-row:last-child { border: 0; }
.content-table .table-head { color: var(--muted); background: #fafbfc; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.table-row strong, .table-row small { display: block; }
.table-row strong { font-size: 13px; }
.table-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.status { display: inline-block; padding: 4px 8px; border-radius: 20px; font-size: 9px; font-weight: 700; }
.status.published { color: #126c48; background: #e5f7ef; }
.status.draft { color: #745d19; background: #fff7d9; }
.row-actions { display: flex; gap: 10px; }
.row-actions a, .row-actions button, .category-list button { padding: 0; color: var(--navy); border: 0; cursor: pointer; background: none; font-size: 11px; font-weight: 700; }
.row-actions button, .category-list button { color: var(--red); }
.editor-form { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.editor-main { padding: 28px; }
.title-input { padding: 12px 0; border-width: 0 0 1px; border-radius: 0; font: 600 27px "Manrope", sans-serif; }
.title-input:focus { box-shadow: none; }
.slug-field { display: flex; align-items: center; margin-top: 7px; border: 1px solid #ccd3dd; border-radius: 3px; overflow: hidden; }
.slug-field span { padding-left: 13px; color: var(--muted); font-size: 12px; }
.slug-field input { margin: 0; border: 0; box-shadow: none; }
.content-editor { min-height: 480px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.editor-side { display: grid; gap: 20px; }
.form-panel { padding: 26px; }
.form-panel .panel-head { margin: -26px -26px 24px; }
.form-panel h3 { margin: 0 0 20px; font: 700 15px "Manrope", sans-serif; }
.form-panel .admin-button { width: 100%; }
.image-preview { width: 100%; height: 160px; margin-bottom: 15px; object-fit: cover; }
.file-field input { padding: 8px; font-size: 11px; }
.preview-link { display: block; margin-top: 16px; color: var(--blue); text-align: center; font-size: 11px; font-weight: 700; }
.two-panel-grid, .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.category-list > div { display: flex; align-items: center; justify-content: space-between; padding: 17px 25px; border-bottom: 1px solid var(--line); }
.category-list > div:last-child { border: 0; }
.category-list strong, .category-list span { display: block; }
.category-list strong { font-size: 13px; }
.category-list span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.profile-admin { margin-bottom: 22px; }
.service-admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.service-admin-grid > div { position: relative; padding: 25px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.service-admin-grid > div > span { position: absolute; top: 19px; right: 22px; color: var(--blue); font-size: 10px; }
.leader-admin-card { display: grid; grid-template-columns: 180px 1fr; gap: 25px; padding: 28px; border-bottom: 1px solid var(--line); }
.leader-admin-card > img { width: 180px; height: 180px; object-fit: cover; }
.leader-admin-card:last-child { border: 0; }
.profile-admin > label { padding: 28px; }
.sticky-save { position: sticky; z-index: 5; bottom: 15px; display: flex; justify-content: flex-end; padding: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.95); box-shadow: 0 8px 25px rgba(24,34,70,.12); backdrop-filter: blur(8px); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.logo-preview { max-width: 310px; max-height: 85px; margin: 14px 0; object-fit: contain; object-position: left center; }
.account-card { padding: 45px; text-align: center; }
.avatar-large { display: grid; width: 80px; height: 80px; margin: 0 auto 18px; place-items: center; color: #fff; border-radius: 50%; background: var(--navy); font: 700 30px "Manrope", sans-serif; }
.account-card h2 { margin: 0; font: 700 22px "Manrope", sans-serif; }
.account-card p, .account-card small { color: var(--muted); }
.account-card hr { margin: 30px 0; border: 0; border-top: 1px solid var(--line); }
.empty-admin { padding: 60px; text-align: center; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .content-table .table-row { grid-template-columns: 2fr 1fr .7fr .7fr; }
    .content-table .table-row > *:nth-child(4) { display: none; }
    .content-table.pages-table .table-row { grid-template-columns: 2fr .7fr .7fr; }
    .content-table.pages-table .table-row > *:nth-child(3) { display: none; }
    .editor-form { grid-template-columns: 1fr; }
    .editor-side { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 800px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-form-wrap { min-height: 100vh; padding: 25px; }
    .admin-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .admin-sidebar.open { transform: none; }
    .admin-shell { margin-left: 0; }
    .admin-header { height: 78px; padding: 0 18px; }
    .sidebar-toggle { display: block; }
    .admin-header > div:first-of-type { flex: 1; margin-left: 15px; }
    .admin-header > div:first-of-type span, .admin-user > div { display: none; }
    .admin-content { padding: 20px 15px; }
    .welcome-card { min-height: 250px; padding: 30px; align-items: flex-start; flex-direction: column; }
    .welcome-card h2 { font-size: 28px; }
    .two-panel-grid, .settings-grid { grid-template-columns: 1fr; }
    .editor-side { grid-template-columns: 1fr; }
    .service-admin-grid { grid-template-columns: 1fr; }
    .leader-admin-card { grid-template-columns: 140px 1fr; }
    .leader-admin-card > img { width: 140px; height: 140px; }
}

@media (max-width: 560px) {
    .metric-grid { grid-template-columns: 1fr; gap: 10px; }
    .content-table { min-width: 650px; }
    .table-panel { overflow-x: auto; }
    .content-table .table-row { grid-template-columns: 2fr 1fr .7fr .7fr; }
    .content-table.pages-table .table-row { grid-template-columns: 2fr .7fr .7fr; }
    .leader-admin-card { grid-template-columns: 1fr; }
    .field-pair { grid-template-columns: 1fr; gap: 0; }
}
