:root {
    --cms-red: #a71930;
    --cms-red-dark: #7e1024;
    --cms-blue: #123b66;
    --cms-ink: #17202b;
    --cms-muted: #667085;
    --cms-line: #e4e8ee;
    --cms-bg: #f4f6f9;
}

.cms-page { width: min(1240px, calc(100% - 32px)); margin: 30px auto 70px; color: var(--cms-ink); }
.cms-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; border-radius: 16px; color: #fff; background: linear-gradient(125deg, #102f50, #174f80 68%, #a71930); box-shadow: 0 14px 36px rgba(18,59,102,.18); }
.cms-heading-compact { margin-top: 12px; }
.cms-heading h1 { margin: 5px 0 7px; color: #fff; font-size: clamp(1.65rem, 3vw, 2.3rem); }
.cms-heading p { margin: 0; color: rgba(255,255,255,.78); }
.cms-kicker { color: #ffd7de; font-size: .74rem; font-weight: 850; letter-spacing: .1em; }
.cms-heading-actions { display: flex; gap: 10px; }
.cms-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.cms-button:disabled { opacity: .48; cursor: not-allowed; }
.cms-button-primary { color: #fff; background: var(--cms-red); }
.cms-button-danger { color: #fff; background: var(--cms-red); }
.cms-button-light { border-color: #d8dee8; color: var(--cms-blue); background: #fff; }
.cms-heading .cms-button-light { border-color: rgba(255,255,255,.35); color: #fff; background: rgba(255,255,255,.12); }
.cms-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 24px 0; }
.cms-stat { padding: 20px; border: 1px solid var(--cms-line); border-left: 5px solid var(--cms-blue); border-radius: 12px; background: #fff; box-shadow: 0 7px 22px rgba(22,34,52,.055); }
.cms-stat span, .cms-stat strong { display: block; }
.cms-stat span { color: var(--cms-muted); font-size: .88rem; }
.cms-stat strong { margin-top: 7px; color: var(--cms-ink); font-size: 1.9rem; }
.cms-stat-draft { border-left-color: #6b7280; }
.cms-stat-review { border-left-color: #d97706; }
.cms-stat-published { border-left-color: #138a57; }
.cms-section { margin-top: 28px; }
.cms-section-title h2 { margin: 0 0 5px; }
.cms-section-title p { margin: 0; color: var(--cms-muted); }
.cms-modules { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.cms-module { display: flex; min-height: 96px; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--cms-line); border-radius: 12px; color: inherit; background: #fff; text-decoration: none; }
.cms-module > span:nth-child(2) { flex: 1; }
.cms-module strong, .cms-module small { display: block; }
.cms-module strong { color: var(--cms-blue); font-size: 1.05rem; }
.cms-module small { margin-top: 5px; color: var(--cms-muted); line-height: 1.4; }
.cms-module-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #fff; background: var(--cms-blue); font-size: .76rem; font-weight: 850; }
.cms-module-active:hover { border-color: var(--cms-red); box-shadow: 0 10px 24px rgba(25,42,66,.08); transform: translateY(-2px); }
.cms-module-disabled { opacity: .55; }
.cms-state, .cms-empty, .cms-alert { margin: 24px 0; padding: 22px; border-radius: 10px; }
.cms-state, .cms-empty { border: 1px solid var(--cms-line); color: var(--cms-muted); background: #fff; }
.cms-empty { display: grid; gap: 5px; text-align: center; }
.cms-alert { border: 1px solid #f1b4ad; color: #912018; background: #fff1ef; }
.cms-breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--cms-muted); font-size: .9rem; }
.cms-breadcrumb a { color: var(--cms-blue); text-decoration: none; }
.cms-toolbar { display: grid; grid-template-columns: minmax(240px,1fr) 190px auto auto; gap: 10px; margin: 22px 0 16px; padding: 14px; border: 1px solid var(--cms-line); border-radius: 11px; background: #fff; }
.cms-input, .cms-select { min-height: 42px; box-sizing: border-box; padding: 9px 12px; border: 1px solid #ccd3dd; border-radius: 8px; font: inherit; background: #fff; }
.cms-input:focus, .cms-select:focus { border-color: var(--cms-blue); outline: 3px solid rgba(18,59,102,.1); }
.cms-table-wrap { overflow-x: auto; border: 1px solid var(--cms-line); border-radius: 11px; background: #fff; }
.cms-table { width: 100%; border-collapse: collapse; font-size: .91rem; }
.cms-table th { padding: 12px 14px; color: #475467; background: #f7f8fa; text-align: left; white-space: nowrap; }
.cms-table td { padding: 14px; border-top: 1px solid #edf0f3; vertical-align: top; }
.cms-article-cell { min-width: 310px; }
.cms-article-cell strong, .cms-article-cell small { display: block; }
.cms-article-cell strong { color: var(--cms-blue); }
.cms-article-cell small { max-width: 520px; margin-top: 5px; overflow: hidden; color: var(--cms-muted); text-overflow: ellipsis; white-space: nowrap; }
.cms-article-cell em { display: inline-block; margin: 7px 5px 0 0; padding: 2px 6px; border-radius: 4px; color: var(--cms-red); background: #fff0f2; font-size: .72rem; font-style: normal; font-weight: 750; }
.cms-number { text-align: right !important; }
.cms-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .77rem; font-weight: 750; white-space: nowrap; }
.cms-badge-draft { color: #475467; background: #eef0f3; }
.cms-badge-review { color: #985b06; background: #fff4d9; }
.cms-badge-published { color: #087443; background: #e5f6ee; }
.cms-badge-archived { color: #6941c6; background: #f1ebff; }
.cms-pagination { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; color: var(--cms-muted); font-size: .9rem; }
.cms-pagination > div { display: flex; gap: 8px; }
.cms-link-button { margin-left: 8px; padding: 0; border: 0; color: var(--cms-red); background: none; font: inherit; font-weight: 750; text-decoration: underline; cursor: pointer; }
.cms-button-small { min-height: 34px; padding: 6px 11px; font-size: .83rem; }
.cms-actions-cell { white-space: nowrap; }
.cms-editor-page { max-width: 1360px; }
.cms-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; margin-top: 22px; align-items: start; }
.cms-editor-main, .cms-editor-side { display: grid; gap: 18px; }
.cms-panel { padding: 22px; border: 1px solid var(--cms-line); border-radius: 12px; background: #fff; box-shadow: 0 6px 20px rgba(22,34,52,.045); }
.cms-panel h2 { margin: 0 0 18px; color: var(--cms-blue); font-size: 1.05rem; }
.cms-field { margin-bottom: 18px; }
.cms-field:last-child { margin-bottom: 0; }
.cms-field label, .cms-tag-fieldset legend { display: block; margin-bottom: 7px; color: #344054; font-size: .88rem; font-weight: 750; }
.cms-field label b { color: var(--cms-red); }
.cms-field .cms-input, .cms-field .cms-select, .cms-field .cms-textarea { width: 100%; }
.cms-input-title { min-height: 48px; font-size: 1.08rem; font-weight: 700; }
.cms-textarea { box-sizing: border-box; padding: 11px 12px; border: 1px solid #ccd3dd; border-radius: 8px; font: inherit; line-height: 1.55; resize: vertical; }
.cms-textarea:focus { border-color: var(--cms-blue); outline: 3px solid rgba(18,59,102,.1); }
.cms-summary { min-height: 108px; }
.cms-content-editor { min-height: 460px; font-family: Consolas, "Courier New", monospace; font-size: .9rem; }
.cms-seo-description { min-height: 88px; }
.cms-field-hint { margin: 6px 0 0; color: var(--cms-muted); font-size: .78rem; line-height: 1.45; }
.cms-field-heading, .cms-status-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cms-input-action { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.cms-content-preview { min-height: 420px; margin: 0; padding: 18px; overflow-wrap: anywhere; border: 1px solid var(--cms-line); border-radius: 8px; background: #fbfcfd; font: .9rem/1.65 Consolas, "Courier New", monospace; white-space: pre-wrap; }
.cms-action-stack { display: grid; gap: 9px; margin-top: 18px; }
.cms-button-review { color: #7a4c00; border-color: #edc46a; background: #fff3d5; }
.cms-check { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: #344054; font-size: .9rem; }
.cms-tag-fieldset { margin: 0; padding: 0; border: 0; }
.cms-tag-list { display: flex; max-height: 210px; overflow-y: auto; flex-wrap: wrap; gap: 7px; }
.cms-tag-list label { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 6px 9px; border: 1px solid var(--cms-line); border-radius: 999px; background: #f8fafc; font-size: .8rem; font-weight: 600; cursor: pointer; }
.cms-seo summary { color: var(--cms-blue); font-weight: 800; cursor: pointer; }
.cms-seo[open] summary { margin-bottom: 20px; }
.cms-alert-success { border-color: #9bd6ba; color: #087443; background: #eaf8f1; }
.validation-message { display: block; margin-top: 5px; color: #b42318; font-size: .8rem; }
.invalid { border-color: #d92d20 !important; }

@media (max-width: 900px) {
    .cms-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .cms-modules { grid-template-columns: 1fr; }
    .cms-toolbar { grid-template-columns: 1fr 1fr; }
    .cms-editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .cms-page { width: min(100% - 20px, 1240px); margin-top: 16px; }
    .cms-heading { align-items: flex-start; flex-direction: column; padding: 21px; }
    .cms-heading-actions { width: 100%; flex-wrap: wrap; }
    .cms-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cms-toolbar { grid-template-columns: 1fr; }
    .cms-pagination { align-items: flex-start; flex-direction: column; }
}
