:root {
  --bg: #eef5fc;
  --surface: rgba(255, 255, 255, .86);
  --surface-strong: #ffffff;
  --navy: #16385f;
  --ink: #1a2b3d;
  --muted: #748499;
  --line: rgba(109, 139, 170, .18);
  --blue: #1677ff;
  --blue-soft: #e8f2ff;
  --green: #25835b;
  --amber: #a46813;
  --red: #a04444;
  --shadow: 0 22px 64px rgba(55, 99, 145, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; color: var(--ink); background: var(--bg); }
body { min-height: 100vh; background-color: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.glass-card { border: 1px solid rgba(255,255,255,.92); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.login-shell { min-height: 100vh; padding: 40px; display: grid; place-items: center; }
.login-card { width: min(440px, 100%); padding: 42px; border-radius: 32px; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--blue); color: white; font-weight: 800; letter-spacing: .04em; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 13px; }
.eyebrow { margin: 24px 0 6px; color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; color: var(--navy); font-size: 34px; letter-spacing: -.03em; }
.login-copy { margin-bottom: 28px; color: var(--muted); line-height: 1.6; }
label { display: grid; gap: 8px; color: #455c74; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; outline: none; color: var(--ink); background: rgba(255,255,255,.94); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 120px; padding: 13px 14px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: rgba(22,119,255,.55); box-shadow: 0 0 0 4px rgba(22,119,255,.09); }
#login-form { display: grid; gap: 18px; }
.primary-button, .secondary-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 13px; font-weight: 720; }
.primary-button { color: white; background: var(--blue); }
.secondary-button { border: 1px solid rgba(22,119,255,.23); color: var(--blue); background: white; }
.primary-button.compact, .secondary-button.compact { min-height: 40px; }
.form-error { min-height: 18px; margin: 0; color: var(--red); font-size: 13px; }
.admin-shell { min-height: 100vh; padding: 18px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; }
.sidebar { position: sticky; top: 18px; height: calc(100vh - 36px); padding: 20px 14px; display: flex; flex-direction: column; border-radius: 28px; overflow: auto; }
.sidebar-brand { padding: 4px 8px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.sidebar-brand strong, .sidebar-brand span { display: block; }.sidebar-brand strong { color: var(--navy); }.sidebar-brand span { margin-top: 3px; color: var(--muted); font-size: 11px; }
#sidebar-nav { padding-top: 14px; display: grid; gap: 4px; }
#sidebar-nav button { width: 100%; padding: 11px 13px; border: 0; border-radius: 12px; text-align: left; color: #587087; background: transparent; font-size: 13px; font-weight: 620; }
#sidebar-nav button:hover { background: rgba(232,242,255,.7); color: var(--navy); }
#sidebar-nav button.active { color: var(--blue); background: var(--blue-soft); }
.nav-label { margin: 18px 12px 7px; color: #9aa7b5; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.sidebar-foot { margin-top: auto; padding: 16px 10px 4px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.preview-entry { margin: 14px 4px 8px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; border-radius: 13px; color: white; background: linear-gradient(135deg,#1769e8,#5aa9ff); text-decoration: none; font-size: 12px; font-weight: 700; box-shadow: 0 10px 24px rgba(23,105,232,.18); }.preview-entry b { font-size: 16px; }
.sidebar-foot button, .text-button { border: 0; color: var(--blue); background: transparent; }
.account-actions { display: flex; gap: 8px; }.field-hint { margin-top: 14px; color: var(--muted); font-size: 12px; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 18px; z-index: 10; min-height: 92px; padding: 20px 26px; display: flex; justify-content: space-between; align-items: center; border-radius: 26px; }
.topbar .eyebrow { margin: 0 0 5px; }.topbar h2 { margin: 0; color: var(--navy); font-size: 25px; }.freshness { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(37,131,91,.1); }
.page-section { padding: 24px 4px 40px; }
.toolbar { margin-bottom: 18px; display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; }.toolbar h3 { margin-bottom: 6px; color: var(--navy); font-size: 19px; }.toolbar p { margin: 0; color: var(--muted); font-size: 12px; }.toolbar select { width: auto; min-width: 110px; }.toolbar-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }.toolbar-actions input { width: 220px; }.toolbar-actions select { width: 130px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; }
.metric-card { min-height: 132px; padding: 19px; border-radius: 22px; background: var(--surface); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 16px 44px rgba(55,99,145,.09); }.metric-label { color: var(--muted); font-size: 12px; }.metric-value { display: block; margin-top: 16px; color: var(--navy); font-size: 30px; font-weight: 780; letter-spacing: -.04em; }.metric-note { display: block; margin-top: 9px; color: #8090a2; font-size: 11px; line-height: 1.4; }
.dashboard-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }.panel { min-height: 320px; padding: 20px; border-radius: 24px; }.panel.span-2 { grid-column: 1 / -1; }.panel-head { display: flex; justify-content: space-between; }.panel h3 { margin-bottom: 5px; color: var(--navy); font-size: 16px; }.panel p { color: var(--muted); font-size: 11px; }.chart-wrap { position: relative; height: 255px; }.compact-table { display: grid; gap: 8px; }.compact-row { padding: 11px 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; border-bottom: 1px solid var(--line); font-size: 12px; }.compact-row strong { color: var(--navy); }.compact-row span { color: var(--muted); }.inventory-grid { display: grid; grid-template-columns: repeat(4, minmax(120px,1fr)); gap: 10px; }.inventory-item { padding: 14px; border-radius: 15px; background: #f4f8fd; }.inventory-item strong, .inventory-item span { display: block; }.inventory-item strong { color: var(--navy); font-size: 13px; }.inventory-item span { margin-top: 8px; color: var(--muted); font-size: 12px; }
.empty-panel { margin-top: 16px; padding: 20px; border-radius: 17px; color: #6d7f91; background: #e9f3fe; font-size: 13px; }
.table-card { border-radius: 24px; overflow: hidden; }table { width: 100%; border-collapse: collapse; }th,td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }th { color: #7b8c9f; background: rgba(244,248,253,.72); font-size: 11px; font-weight: 720; }td { color: #405870; font-size: 12px; line-height: 1.5; }tr:last-child td { border-bottom: 0; }.cell-title { display: block; color: var(--navy); font-weight: 700; }.cell-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #eef4fa; color: #63778c; font-size: 10px; font-weight: 700; }.status-badge.published,.status-badge.approved { color: var(--green); background: #e9f7f0; }.status-badge.review,.status-badge.pending_review { color: var(--amber); background: #fff5e5; }.status-badge.archived,.status-badge.rejected { color: var(--red); background: #fceeee; }.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }.row-actions button,.link-button { padding: 5px 8px; border: 0; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 11px; text-decoration: none; }.row-actions button.danger { color: var(--red); background: #fceeee; }
.upload-card { margin-bottom: 18px; padding: 22px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; border-radius: 24px; }.file-drop { min-height: 170px; padding: 24px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed rgba(22,119,255,.35); border-radius: 19px; background: #f3f8ff; }.file-drop input { width: auto; min-height: 0; margin-bottom: 15px; }.file-drop strong { color: var(--navy); }.file-drop span { margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 500; }.upload-fields { display: grid; gap: 13px; align-content: center; }.upload-progress { grid-column: 1/-1; height: 6px; border-radius: 999px; background: #e6edf5; overflow: hidden; }.upload-progress span { display: block; width: 45%; height: 100%; background: var(--blue); animation: progress 1.2s ease-in-out infinite alternate; }@keyframes progress { to { transform: translateX(110%); } }
.ai-settings-card { padding: 24px; border-radius: 24px; }.ai-status-row { margin-bottom: 22px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-radius: 16px; background: var(--blue-soft); }.ai-status-row strong,.ai-status-row span { display: block; }.ai-status-row strong { color: var(--navy); }.ai-status-row span { margin-top: 4px; color: var(--muted); font-size: 11px; }.ai-status-row .usage-pill { margin: 0; padding: 8px 12px; border-radius: 999px; background: #fff; color: var(--blue); font-weight: 700; }.checkbox-line { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }.checkbox-line input { width: auto; min-height: 0; }.ai-test-result { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.9); color: #445e78; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.summary-banner { margin-bottom: 16px; padding: 15px 18px; display: flex; gap: 16px; border-radius: 16px; background: var(--blue-soft); color: #55718e; font-size: 12px; }.summary-banner strong { color: var(--blue); }.secondary-toolbar { margin-top: 26px; }
.editor-dialog { width: min(860px, calc(100vw - 40px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 26px; overflow: auto; background: rgba(250,253,255,.97); box-shadow: 0 30px 100px rgba(24,57,91,.28); }.editor-dialog.rich-dialog { width: min(1180px, calc(100vw - 32px)); }.editor-dialog::backdrop { background: rgba(18,36,56,.34); backdrop-filter: blur(8px); }.editor-dialog form { padding: 26px; }.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; }.dialog-head .eyebrow { margin: 0 0 5px; }.dialog-head h3 { color: var(--navy); font-size: 23px; }.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.editor-fields .full { grid-column: 1/-1; }.editor-dialog details { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; }.editor-dialog summary { color: var(--blue); font-size: 12px; cursor: pointer; }.editor-dialog details textarea { margin-top: 12px; min-height: 230px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }.dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }.dialog-actions select { width: 150px; }.small-dialog { width: min(680px, calc(100vw - 40px)); }
.rich-editor { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }.rich-editor-intro { margin-bottom: 16px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }.rich-editor-intro strong,.rich-editor-intro span { display: block; }.rich-editor-intro strong { color: var(--navy); font-size: 16px; }.rich-editor-intro div span { margin-top: 5px; color: var(--muted); font-size: 11px; }.upload-state { padding: 7px 10px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 10px; white-space: nowrap; }.rich-editor-grid { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 18px; align-items: start; }.rich-compose { min-width: 0; display: grid; gap: 16px; }.cover-editor,.blocks-editor { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }.section-label { margin-bottom: 12px; display: flex; justify-content: space-between; gap: 12px; }.section-label strong { color: var(--navy); font-size: 13px; }.section-label span { color: var(--muted); font-size: 10px; }.cover-preview { height: 190px; display: grid; place-items: center; overflow: hidden; border: 1px dashed rgba(22,119,255,.28); border-radius: 15px; color: var(--muted); background: #f2f7fc; font-size: 11px; }.cover-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }.cover-preview img + span { position: absolute; padding: 6px 9px; border-radius: 9px; color: white; background: rgba(20,50,80,.72); }.inline-actions { margin-top: 11px; display: flex; align-items: center; gap: 8px; }.block-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }.block-toolbar button,.content-block-head button { min-height: 32px; padding: 0 10px; border: 1px solid rgba(22,119,255,.18); border-radius: 9px; color: var(--blue); background: #fff; font-size: 11px; }.content-block-list { margin-top: 13px; display: grid; gap: 10px; }.content-block-card { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbff; }.content-block-head { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }.content-block-head strong { color: var(--navy); font-size: 11px; }.content-block-head div { display: flex; gap: 5px; }.content-block-head button.danger { color: var(--red); border-color: rgba(160,68,68,.18); }.content-block-card textarea { min-height: 92px; }.block-image-preview { width: 100%; max-height: 260px; margin-bottom: 12px; display: block; object-fit: cover; border-radius: 12px; background: #eef4fa; }.content-block-card label + label { margin-top: 10px; }.empty-blocks { padding: 24px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: 11px; }.article-preview-shell { position: sticky; top: 0; padding: 12px; border-radius: 24px; background: #dfe8f2; }.preview-label { margin: 3px 0 10px; color: #697d91; font-size: 10px; text-align: center; }.article-phone-preview { height: 620px; overflow-y: auto; border-radius: 19px; background: #f7faff; box-shadow: 0 12px 32px rgba(29,69,108,.14); }.phone-cover { width: 100%; height: 178px; display: block; object-fit: cover; }.phone-cover.placeholder { display: grid; place-items: center; color: #90a1b3; background: linear-gradient(135deg,#dcecff,#f5f9fe); font-size: 11px; }.phone-copy { padding: 20px; }.phone-kicker { color: var(--blue); font-size: 10px; font-weight: 750; }.phone-copy h3 { margin: 8px 0 7px; color: var(--navy); font-size: 21px; line-height: 1.35; }.phone-summary { color: #6c8095; font-size: 11px; line-height: 1.65; }.phone-copy h4 { margin: 22px 0 8px; color: var(--navy); font-size: 15px; }.phone-copy p { color: #4d647b; font-size: 12px; line-height: 1.8; white-space: pre-wrap; }.phone-copy figure { margin: 18px 0; }.phone-copy figure img { width: 100%; display: block; border-radius: 11px; }.phone-copy figcaption { margin-top: 7px; color: #8494a6; font-size: 9px; line-height: 1.5; }.phone-copy blockquote { margin: 18px 0; padding: 12px; border-left: 3px solid var(--blue); border-radius: 0 9px 9px 0; color: #587087; background: var(--blue-soft); font-size: 11px; line-height: 1.7; }.phone-empty { color: #9aa9b8 !important; }.editor-dialog.rich-dialog details { opacity: .72; }
.block-toolbar>span { align-self: center; color: var(--muted); font-size: 10px; }.block-insert-row { min-height: 38px; padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px dashed rgba(22,119,255,.22); border-radius: 11px; color: #6f879f; background: rgba(234,244,255,.48); font-size: 9px; transition: .18s; }.block-insert-row:hover { border-color: rgba(22,119,255,.48); background: #eaf4ff; }.block-insert-row>div { display: flex; gap: 5px; flex-wrap: wrap; }.block-insert-row button { min-height: 26px; padding: 0 8px; border: 0; border-radius: 8px; color: #3970ab; background: rgba(255,255,255,.9); font-size: 9px; }.block-insert-row button.image-insert { color: #fff; background: var(--blue); }.block-order { width: 22px; height: 22px; margin-right: 7px; display: inline-grid; place-items: center; border-radius: 7px; color: #fff; background: #7eaee8; font-size: 9px; }.image-content-block { border-color: rgba(22,119,255,.26); background: #f3f8ff; }.image-block-actions { margin: -4px 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }.image-block-actions button { min-height: 30px; padding: 0 10px; border: 1px solid rgba(22,119,255,.22); border-radius: 9px; color: var(--blue); background: #fff; font-size: 10px; }.image-block-actions span { color: var(--muted); font-size: 9px; }.content-block-list { gap: 8px; }
.snapshot-dialog-body { padding: 26px; }.snapshot-description { margin: 12px 0 20px; color: var(--muted); line-height: 1.7; }.snapshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.snapshot-grid section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); }.snapshot-grid h4 { margin-bottom: 12px; color: var(--navy); font-size: 13px; }.snapshot-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }.snapshot-list span,.snapshot-list a { padding: 8px 10px; border-radius: 10px; background: var(--blue-soft); color: #4d6680; font-size: 11px; line-height: 1.45; text-decoration: none; }.snapshot-list a { color: var(--blue); }.snapshot-list .muted-line { background: #f4f7fa; color: var(--muted); }
.snapshot-grid .snapshot-wide { grid-column: 1 / -1; }.candidate-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; max-height: 520px; overflow-y: auto; }.candidate-image { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }.candidate-image img { width: 100%; height: 130px; display: block; object-fit: cover; background: #eef3f8; }.candidate-image div { padding: 10px; display: grid; gap: 6px; }.candidate-image strong { overflow: hidden; color: var(--navy); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.candidate-image a,.candidate-image button,.candidate-image span { color: var(--blue); font-size: 10px; text-decoration: none; }.candidate-image button { padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }.candidate-image span { color: var(--muted); }
.toast { position: fixed; right: 28px; bottom: 28px; z-index: 100; max-width: 360px; padding: 13px 17px; border-radius: 14px; color: white; background: #1b3f66; box-shadow: 0 15px 45px rgba(20,50,80,.25); font-size: 12px; }
.cover-preview { position: relative; }
@media (max-width: 1180px) { .metric-grid { grid-template-columns: repeat(3,1fr); }.inventory-grid { grid-template-columns: repeat(3,1fr); }.rich-editor-grid { grid-template-columns: 1fr 290px; } }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; }.sidebar { position: relative; top: 0; height: auto; }.workspace { min-width: 760px; }.admin-shell { overflow-x: auto; }.metric-grid { grid-template-columns: repeat(2,1fr); }.snapshot-grid { grid-template-columns: 1fr; }.candidate-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
