:root { --admin-sidebar: 258px; }
.admin-body { min-height: 100vh; background: #f3f5fa; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; width: var(--admin-sidebar); padding: 24px 17px; display: flex; flex-direction: column; color: #d9d5e7; background: #161122; }
.admin-brand { margin: 2px 9px 35px; color: #fff; }
.admin-label { padding: 0 12px 9px; color: #888097; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; }
.admin-sidebar nav { display: grid; gap: 4px; }
.admin-sidebar nav a { padding: 11px 12px; display: flex; align-items: center; gap: 11px; border-radius: 10px; color: #bdb7ca; font-size: 13px; font-weight: 650; }
.admin-sidebar nav a span { width: 18px; color: #8e7dbd; text-align: center; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: #fff; background: #2b213f; }
.admin-sidebar nav a.active span { color: #ac89ff; }
.logout-form { margin-top: auto; }
.logout-form button { width: 100%; padding: 10px; color: #bdb7ca; border: 1px solid #3d344b; border-radius: 10px; background: transparent; cursor: pointer; }
.admin-main { min-height: 100vh; margin-left: var(--admin-sidebar); }
.admin-topbar { height: 68px; padding: 0 32px; display: flex; align-items: center; gap: 8px; color: #44495b; background: #fff; border-bottom: 1px solid #e3e6ee; font-size: 13px; }
.admin-breadcrumb { color: #9aa0af; }
.admin-user { margin-left: auto; font-weight: 700; }
.admin-menu-button { display: none; }
.admin-content { max-width: 1500px; margin: 0 auto; padding: 34px; }
.admin-page-title { margin-bottom: 25px; display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.admin-page-title h1 { margin: 4px 0 5px; font-size: 36px; letter-spacing: -1.3px; }
.admin-page-title p { max-width: 720px; margin: 0; color: var(--muted); font-size: 14px; }
.admin-alert { margin-bottom: 18px; padding: 13px 16px; border-radius: 11px; font-size: 13px; }
.admin-alert ul { margin: 6px 0 0; }
.admin-alert.success { color: #086c3c; background: #e8f8ef; border: 1px solid #bde5cf; }
.admin-alert.error { color: #a11a2e; background: #fff0f2; border: 1px solid #f0c5cc; }
.primary-button, .secondary-button { min-height: 42px; padding: 9px 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 750; cursor: pointer; }
.primary-button { color: #fff; background: var(--purple); border: 1px solid var(--purple); }
.primary-button:hover { background: var(--purple-dark); }
.secondary-button { color: var(--purple); background: #fff; border: 1px solid #cfc5eb; }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.stat-grid article { min-height: 126px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 7px 20px rgba(25, 30, 48, .04); }
.stat-grid span { color: var(--muted); font-size: 12px; }
.stat-grid strong { font-size: 34px; letter-spacing: -1px; }
.overview-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.admin-two-column { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-panel { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 26px rgba(28, 34, 52, .045); }
.panel-heading { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.panel-heading h2, .admin-panel h2 { margin: 3px 0; font-size: 21px; }
.admin-list-row { padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.admin-list-row:last-child { border: 0; }
.admin-list-row strong, .admin-list-row small { display: block; }
.admin-list-row strong { font-size: 13px; }
.admin-list-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.scheduler-panel { margin-top: 18px; border-left: 4px solid #d4a437; }
.scheduler-panel.scheduler-healthy { border-left-color: #1da15e; }
.scheduler-panel.scheduler-stale { border-left-color: #df8d2e; }
.scheduler-panel.scheduler-missing { border-left-color: #dc414a; }
.scheduler-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.scheduler-heading p { max-width: 800px; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.scheduler-status { padding: 7px 11px; color: #9a6412; background: #fff3d8; border-radius: 99px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.scheduler-healthy .scheduler-status { color: #087441; background: #e4f8ed; }
.scheduler-stale .scheduler-status { color: #8a4b0f; background: #ffedda; }
.scheduler-missing .scheduler-status { color: #bd243a; background: #ffebee; }
.scheduler-details { margin: 20px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.scheduler-details > div { padding: 13px; background: #f7f8fb; border: 1px solid #e5e8ef; border-radius: 10px; }
.scheduler-details span, .scheduler-details strong { display: block; }
.scheduler-details span { color: var(--muted); font-size: 9px; }
.scheduler-details strong { margin-top: 5px; font-size: 12px; }
.cron-command-block { padding: 15px; display: grid; grid-template-columns: minmax(190px, .65fr) 2fr; gap: 18px; align-items: center; color: #ded7eb; background: #1d1728; border-radius: 11px; }
.cron-command-block strong, .cron-command-block small { display: block; }
.cron-command-block small { margin-top: 4px; color: #aaa2b8; font-size: 9px; }
.cron-command-block code { padding: 11px 13px; overflow-x: auto; color: #d8f6e5; background: #2b2437; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.status-pill, .health-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-active, .status-published, .health-healthy { color: #087441; background: #e4f8ed; }
.status-paused, .status-collecting, .status-awaiting_summary, .status-awaiting_slot, .health-needs-key, .health-unconfigured, .health-untested, .health-cooldown { color: #a76a00; background: #fff3d8; }
.status-expired_unmatched { color: #697083; background: #eef0f4; }
.status-error, .status-ai_failed, .health-failed, .health-auth_failed, .health-billing_required { color: #bd243a; background: #ffebee; }
.health-rate_limited { color: #8a4b0f; background: #ffedda; }
.muted-empty { padding: 26px 0; color: var(--muted); text-align: center; }
.import-panel { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.import-panel p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.import-panel form { display: flex; align-items: center; gap: 10px; }
.import-panel input[type="file"] { max-width: 280px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.feed-toolbar { display: flex; justify-content: flex-end; margin-bottom: 15px; }
.admin-search { display: flex; gap: 7px; }
.admin-search input { width: 280px; padding: 9px 12px; border: 1px solid #d8dde7; border-radius: 9px; }
.admin-search button { padding: 8px 13px; border: 1px solid #d8dde7; border-radius: 9px; background: #fff; cursor: pointer; }
.bulk-bar { padding: 11px 13px; display: flex; align-items: center; gap: 12px; background: #f7f5fc; border: 1px solid #e4def1; border-radius: 11px; }
.bulk-bar label { margin-right: auto; font-size: 12px; font-weight: 650; }
.bulk-bar select, .inline-edit-form select, .inline-edit-form input { padding: 8px 10px; border: 1px solid #d8dde7; border-radius: 8px; background: #fff; }
.feed-list { margin-top: 12px; }
.feed-row { padding: 15px 5px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 13px; align-items: start; border-bottom: 1px solid var(--line); }
.feed-main > div:first-child { display: flex; align-items: center; gap: 8px; }
.feed-main strong { font-size: 13px; }
.feed-main > div:first-child span { color: #4f5668; font-size: 13px; }
.feed-main > small { max-width: 750px; display: block; margin: 4px 0 7px; overflow: hidden; color: #8b92a2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; }
.feed-actions { display: flex; gap: 7px; }
.feed-actions a, .feed-actions button { padding: 7px 9px; color: var(--purple); border: 1px solid #ded7f0; border-radius: 8px; background: #fff; font-size: 11px; cursor: pointer; }
.feed-editor { grid-column: 2 / -1; padding: 13px; background: #f8f7fb; border-radius: 10px; }
.inline-edit-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.inline-edit-form label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.narrow-panel { max-width: 940px; }
.admin-form { display: grid; gap: 17px; }
.admin-form label { display: grid; gap: 7px; color: #303648; font-size: 12px; font-weight: 750; }
.admin-form input:not([type="checkbox"]), .admin-form select { width: 100%; min-height: 44px; padding: 9px 12px; color: var(--ink); background: #fff; border: 1px solid #d5dae5; border-radius: 9px; outline: 0; }
.admin-form input:focus, .admin-form select:focus { border-color: #8c68e2; box-shadow: 0 0 0 3px #f0ebff; }
.form-grid { grid-template-columns: repeat(2, 1fr); }
.switch-line { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; }
.switch-line input { width: 18px; height: 18px; accent-color: var(--purple); }
.form-actions { grid-column: 1 / -1; padding-top: 6px; }
.provider-stack { display: grid; gap: 13px; }
.provider-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 22px rgba(26, 31, 49, .04); }
.provider-card > header { min-height: 91px; padding: 18px 22px; display: grid; grid-template-columns: 115px minmax(220px, 1fr) auto auto 38px 80px; gap: 15px; align-items: center; }
.provider-number { color: var(--purple); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .9px; }
.provider-card h2 { margin: 0; font-size: 17px; }
.provider-card header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.enabled-label { font-size: 12px; font-weight: 700; }
.provider-expand, .provider-order button { width: 35px; height: 35px; color: var(--purple); border: 1px solid #ded7ef; border-radius: 9px; background: #fff; cursor: pointer; }
.provider-order { display: flex; gap: 5px; }
.provider-order button:disabled { opacity: .3; cursor: default; }
.provider-config { padding: 24px; border-top: 1px solid var(--line); background: #fcfcfe; }
.key-status { margin-bottom: 21px; padding: 13px; display: flex; gap: 11px; background: #f6f7fa; border-radius: 11px; }
.key-status strong { font-size: 12px; }
.key-status p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.key-status code, .admin-page-title code { padding: 2px 5px; background: #ece9f3; border-radius: 4px; }
.status-dot { width: 10px; height: 10px; margin-top: 4px; flex: 0 0 auto; background: #e3a32d; border-radius: 50%; }
.status-dot.configured { background: #1aa362; }
.provider-form { grid-template-columns: repeat(3, 1fr); }
.provider-form .wide-field { grid-column: 1 / -1; }
.provider-actions { display: flex; align-items: end; }
.provider-test-form { margin-top: 17px; display: flex; align-items: center; gap: 12px; }
.provider-test-form small { color: var(--muted); }
.provider-error { margin-top: 16px; padding: 13px; color: #9f2435; background: #fff1f3; border-radius: 10px; font-size: 11px; }
.provider-error p { margin: 4px 0; overflow-wrap: anywhere; }
.ai-health-title { align-items: center; }
.health-summary-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.health-summary-grid article { min-height: 128px; padding: 19px; display: grid; align-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 7px 20px rgba(25, 30, 48, .04); }
.health-summary-grid span, .health-summary-grid small { color: var(--muted); font-size: 11px; }
.health-summary-grid strong { font-size: 31px; letter-spacing: -1px; }
.health-summary-grid .success strong, .metric-success { color: #169653; }
.health-summary-grid .warning strong, .metric-warning { color: #c47a00; }
.health-summary-grid .failure strong, .metric-failure { color: #d83b47; }
.add-provider-panel { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 22px; border-color: #dcd0f6; }
.add-provider-panel[hidden] { display: none; }
.add-provider-panel p, .panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.add-provider-form { display: flex; align-items: end; gap: 9px; }
.add-provider-form label { display: grid; gap: 5px; color: #303648; font-size: 11px; font-weight: 750; }
.add-provider-form select { min-width: 220px; min-height: 42px; padding: 8px 11px; border: 1px solid #d5dae5; border-radius: 9px; background: #fff; }
.health-chart-panel, .provider-performance-panel, .task-health-panel, .recent-failures-panel { margin-bottom: 18px; }
.health-chart { height: 245px; padding: 14px 8px 0; display: grid; grid-template-columns: repeat(14, minmax(24px, 1fr)); gap: 12px; border-top: 1px solid var(--line); }
.health-day { min-width: 0; display: grid; grid-template-rows: 1fr 16px 15px; align-items: end; justify-items: center; }
.health-bar-track { width: 100%; height: 170px; display: flex; align-items: end; justify-content: center; }
.health-bar { width: min(30px, 62%); min-height: 4px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: #edf1f7; border-radius: 6px 6px 3px 3px; }
.health-bar.empty { background: #edf1f7; }
.health-bar-failed { display: block; background: #dc414a; }
.health-bar-success { display: block; background: #29a866; }
.health-day strong { font-size: 10px; }
.health-day small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.table-scroll { width: 100%; overflow-x: auto; }
.health-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.health-table th { padding: 11px 12px; color: #8a91a1; border-bottom: 1px solid var(--line); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .45px; }
.health-table td { min-width: 78px; padding: 14px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
.health-table tr:last-child td { border-bottom: 0; }
.health-table td:first-child { min-width: 165px; }
.health-table td:nth-child(6) { min-width: 165px; }
.health-table td:last-child { min-width: 165px; }
.health-table strong, .health-table small { display: block; }
.health-table small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.quota-track { width: 100%; height: 5px; margin-top: 7px; display: block; overflow: hidden; background: #edf0f5; border-radius: 99px; }
.quota-track i { height: 100%; display: block; background: #7760bd; border-radius: inherit; }
.task-health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.task-health-grid article { padding: 17px; background: #f7f8fb; border: 1px solid #e5e8ef; border-radius: 11px; }
.task-health-grid h3 { margin: 0 0 17px; font-size: 13px; }
.task-health-grid article > div { display: flex; gap: 30px; }
.task-health-grid strong { font-size: 22px; }
.task-health-grid strong small { margin-top: 2px; display: block; color: var(--muted); font-size: 8px; font-weight: 600; }
.failure-message { min-width: 360px !important; max-width: 680px; overflow-wrap: anywhere; line-height: 1.5; }
.provider-chain-title { margin-top: 31px; }
.provider-key-notice { margin-bottom: 14px; padding: 14px 16px; display: grid; gap: 4px; color: #51397c; background: #f3effc; border: 1px solid #ded3f3; border-radius: 11px; font-size: 11px; }
.provider-key-notice span { color: #74658c; }
.provider-key-field input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.provider-key-field small { color: var(--muted); font-weight: 500; }
.settings-form label { padding-bottom: 17px; grid-template-columns: minmax(260px, 1fr) 180px; align-items: center; border-bottom: 1px solid var(--line); }
.settings-form label span { display: grid; gap: 3px; }
.settings-form label small { color: var(--muted); font-weight: 500; }
.release-update-panel { margin-bottom: 18px; }
.release-update-panel > p { max-width: 820px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.release-update-panel .status-pill.success { color: #087441; background: #e4f8ed; }
.release-update-panel .status-pill.warning { color: #8a4b0f; background: #ffedda; }
.release-update-complete { border-color: #cce8d8; background: #fbfffd; }
.release-update-checks { margin: 15px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.release-update-checks span { padding: 11px 12px; display: grid; gap: 4px; color: #60687a; background: #f7f8fb; border: 1px solid #e5e8ef; border-radius: 9px; font-size: 11px; }
.release-update-checks strong { color: #292f40; font-size: 10px; text-transform: uppercase; letter-spacing: .35px; }
.release-update-form { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.release-confirmation { display: flex; align-items: center; gap: 9px; color: #363c50; font-size: 11px; font-weight: 700; }
.release-confirmation input { width: 16px; height: 16px; }
.release-update-form button:disabled { cursor: not-allowed; opacity: .55; }
.backup-warning { margin-bottom: 14px; padding: 14px; display: grid; gap: 3px; color: #6d4b0c; background: #fff7e8; border: 1px solid #efdbb5; border-radius: 11px; font-size: 12px; }
.backup-warning code { padding: 2px 4px; background: #f3e5c9; border-radius: 4px; }
.backup-warning span { color: #856b3c; }
.category-create-panel { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.category-create-panel p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.category-create-form { display: grid; grid-template-columns: 1.2fr 1fr 1.5fr 70px auto; gap: 8px; }
.category-create-form input, .category-create-form select, .category-edit-form input { min-width: 0; padding: 8px 10px; background: #fff; border: 1px solid #d8dde7; border-radius: 8px; }
.category-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.category-admin-card { padding: 14px; }
.category-edit-form { display: grid; grid-template-columns: 43px 1fr .8fr 1.3fr 60px 68px 50px; gap: 7px; align-items: center; }
.category-edit-form label { font-size: 10px; white-space: nowrap; }
.category-edit-form button { padding: 7px; color: var(--purple); background: #fff; border: 1px solid #d8d0ed; border-radius: 7px; cursor: pointer; }
.category-level { color: var(--purple); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.subcategory-list { margin-top: 9px; padding: 7px 0 0 16px; border-top: 1px solid var(--line); }
.child-form { padding: 6px 0; }
.subcategory-list > small { display: block; padding: 12px; color: var(--muted); }
.simple-category-create { margin-bottom: 16px; display: grid; grid-template-columns: minmax(190px, .7fr) 2fr; gap: 28px; align-items: end; }
.simple-category-create p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.simple-category-form { display: grid; grid-template-columns: 1fr 1fr 1.5fr auto; gap: 10px; align-items: end; }
.simple-category-form label, .simple-category-edit label { display: grid; gap: 5px; color: #34394a; font-size: 10px; font-weight: 750; }
.simple-category-form label small { color: var(--muted); font-weight: 500; }
.simple-category-form input, .simple-category-form select, .simple-category-edit input:not([type="checkbox"]), .simple-category-edit textarea { width: 100%; min-width: 0; padding: 9px 10px; color: var(--ink); background: #fff; border: 1px solid #d7dce6; border-radius: 8px; }
.simple-category-list { display: grid; gap: 11px; }
.simple-category-card { padding: 0; overflow: hidden; }
.simple-category-card > summary { padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; gap: 15px; cursor: pointer; list-style: none; }
.simple-category-card > summary::-webkit-details-marker, .simple-child-card > summary::-webkit-details-marker { display: none; }
.simple-category-card > summary strong, .simple-category-card > summary small { display: block; }
.simple-category-card > summary strong { font-size: 16px; }
.simple-category-card > summary small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.category-summary-meta { display: flex; align-items: center; gap: 12px; }
.category-open-label { color: var(--purple); font-size: 11px; font-weight: 800; }
.simple-category-card[open] .category-open-label::after { content: " settings"; }
.simple-category-content { padding: 20px; border-top: 1px solid var(--line); background: #fbfbfd; }
.simple-category-edit { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 13px; align-items: end; }
.category-active-toggle { min-height: 41px; display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; white-space: nowrap; }
.category-active-toggle input { width: 17px; height: 17px; accent-color: var(--purple); }
.category-advanced { grid-column: 1 / -1; padding: 10px 13px; background: #f2f3f7; border-radius: 9px; }
.category-advanced > summary { color: #655578; cursor: pointer; font-size: 10px; font-weight: 800; }
.category-advanced > div { padding-top: 12px; display: grid; grid-template-columns: 2fr .6fr; gap: 10px; }
.category-advanced .wide-field { grid-column: 1 / -1; }
.simple-subcategory-list { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.simple-subcategory-heading { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; }
.simple-subcategory-heading strong { font-size: 12px; }
.simple-subcategory-heading small { color: var(--muted); font-size: 9px; }
.simple-child-card { margin-top: 7px; overflow: hidden; background: #fff; border: 1px solid #e1e4eb; border-radius: 9px; }
.simple-child-card > summary { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-size: 12px; font-weight: 700; list-style: none; }
.child-category-edit { padding: 13px; border-top: 1px solid var(--line); }
.login-body { min-height: 100vh; padding: 22px; display: grid; place-items: center; background: radial-gradient(circle at 20% 15%, #ece4ff, transparent 35%), radial-gradient(circle at 90% 85%, #dff0ff, transparent 35%), #f7f8fc; }
.login-card { width: min(440px, 100%); padding: 38px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 70px rgba(35, 29, 55, .12); }
.login-card .brand { width: max-content; margin-bottom: 36px; display: flex; }
.login-card > .eyebrow { display: block; }
.login-card h1 { margin: 6px 0; font-size: 36px; letter-spacing: -1.4px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.login-card .check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; font-weight: 500; }

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .overview-stat-grid { grid-template-columns: repeat(3, 1fr); }
    .scheduler-details { grid-template-columns: repeat(2, 1fr); }
    .health-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .health-chart { gap: 7px; }
    .provider-card > header { grid-template-columns: 90px 1fr auto 38px; }
    .enabled-label, .provider-order { display: none; }
    .provider-form { grid-template-columns: repeat(2, 1fr); }
    .inline-edit-form { grid-template-columns: repeat(2, 1fr); }
    .category-admin-grid { grid-template-columns: 1fr; }
    .simple-category-create { grid-template-columns: 1fr; }
    .simple-category-form { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .2s; }
    .admin-menu-open .admin-sidebar { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-menu-button { display: block; border: 0; background: transparent; font-size: 20px; }
    .admin-content { padding: 22px 15px; }
    .admin-page-title, .import-panel { align-items: flex-start; flex-direction: column; }
    .stat-grid, .admin-two-column { grid-template-columns: 1fr 1fr; }
    .overview-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .scheduler-heading { flex-direction: column; }
    .cron-command-block { grid-template-columns: 1fr; }
    .add-provider-panel { align-items: stretch; flex-direction: column; }
    .add-provider-form { align-items: stretch; flex-wrap: wrap; }
    .health-chart { grid-template-columns: repeat(14, 42px); overflow-x: auto; }
    .import-panel form, .bulk-bar { width: 100%; align-items: stretch; flex-direction: column; }
    .feed-row { grid-template-columns: 22px 1fr; }
    .feed-actions, .feed-editor { grid-column: 2; }
    .provider-card > header { grid-template-columns: 1fr auto; }
    .provider-number, .health-badge { grid-row: 1; }
    .provider-card header > div:first-of-type { grid-column: 1 / -1; }
    .provider-expand { grid-column: 2; grid-row: 2; }
    .provider-form, .form-grid { grid-template-columns: 1fr; }
    .provider-form .wide-field { grid-column: auto; }
    .settings-form label { grid-template-columns: 1fr; }
    .category-create-panel { align-items: stretch; flex-direction: column; }
    .category-create-form { grid-template-columns: 1fr 1fr; }
    .category-edit-form { grid-template-columns: 38px 1fr 1fr; }
    .category-edit-form label, .category-edit-form button { grid-row: 2; }
    .simple-category-form, .simple-category-edit { grid-template-columns: 1fr; }
    .category-keywords-field, .category-advanced { grid-column: auto; }
    .category-advanced > div { grid-template-columns: 1fr; }
    .category-advanced .wide-field { grid-column: auto; }
}

@media (max-width: 520px) {
    .stat-grid, .admin-two-column { grid-template-columns: 1fr; }
    .overview-stat-grid, .scheduler-details { grid-template-columns: 1fr; }
    .health-summary-grid, .task-health-grid { grid-template-columns: 1fr; }
    .add-provider-form { display: grid; }
    .add-provider-form select { min-width: 0; width: 100%; }
    .admin-panel { padding: 18px; }
    .feed-main > div:first-child, .feed-meta, .feed-actions { align-items: flex-start; flex-direction: column; }
    .inline-edit-form { grid-template-columns: 1fr; }
    .provider-card > header { padding: 16px; }
    .provider-config { padding: 16px; }
    .login-card { padding: 27px; }
}

/* RealNews admin design refresh — v0.4 */
:root {
    --admin-sidebar: 272px;
    --admin-canvas: #f5f6fa;
    --admin-panel: #fff;
    --admin-line: #e5e7ee;
    --admin-ink: #171b2e;
    --admin-muted: #737b8f;
    --admin-purple: #6032d5;
    --admin-purple-soft: #f1edff;
    --admin-shadow: 0 12px 34px rgba(24, 28, 45, .055);
}

.admin-body { color: var(--admin-ink); background: var(--admin-canvas); }
.admin-sidebar {
    width: var(--admin-sidebar);
    padding: 25px 18px 20px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 8% 0, rgba(119, 70, 224, .24), transparent 28%),
        linear-gradient(180deg, #171126 0%, #120e1d 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 18px 0 48px rgba(26, 17, 43, .08);
}
.admin-brand { margin: 1px 10px 39px; font-size: 24px; letter-spacing: -.8px; }
.admin-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; box-shadow: 0 10px 25px rgba(94, 43, 211, .42); }
.admin-label { padding: 0 13px 10px; color: #777089; font-size: 9px; letter-spacing: 1.6px; }
.admin-sidebar nav { gap: 5px; }
.admin-sidebar nav a {
    min-height: 45px;
    padding: 11px 13px;
    color: #c0bacd;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.admin-sidebar nav a span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: #9a84d8;
    background: rgba(255, 255, 255, .04);
    border-radius: 7px;
}
.admin-sidebar nav a:hover { transform: translateX(2px); background: rgba(255, 255, 255, .055); border-color: rgba(255, 255, 255, .06); }
.admin-sidebar nav a.active { background: linear-gradient(135deg, rgba(111, 70, 201, .34), rgba(70, 48, 112, .42)); border-color: rgba(179, 145, 255, .13); box-shadow: inset 3px 0 #9c75ff; }
.admin-sidebar nav a.active span { color: #fff; background: rgba(146, 105, 239, .28); }
.logout-form { padding-top: 22px; }
.logout-form button { min-height: 43px; border-color: rgba(255, 255, 255, .13); transition: border-color .16s, color .16s, background .16s; }
.logout-form button:hover { color: #fff; background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .23); }
.admin-sidebar-scrim { display: none; }

.admin-main { margin-left: var(--admin-sidebar); }
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 45;
    height: 70px;
    padding: 0 38px;
    color: #555d71;
    background: rgba(255, 255, 255, .9);
    border-color: rgba(221, 224, 233, .9);
    backdrop-filter: blur(18px);
}
.admin-route { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.admin-route strong { color: #2f3548; font-weight: 760; }
.admin-breadcrumb { color: #9ca2b1; }
.admin-user { display: inline-flex; align-items: center; gap: 9px; color: #3c4255; font-size: 12px; }
.admin-user i { width: 9px; height: 9px; display: block; background: #24a86a; border: 2px solid #dcf7e9; border-radius: 50%; box-shadow: 0 0 0 2px #edf9f2; }
.admin-content { max-width: 1370px; padding: 42px 40px 76px; }
.admin-page-title { margin-bottom: 28px; align-items: center; }
.admin-page-title h1 { margin: 5px 0 7px; color: #14182a; font-size: clamp(32px, 3vw, 42px); line-height: 1.03; letter-spacing: -1.8px; }
.admin-page-title p { max-width: 760px; color: var(--admin-muted); font-size: 14px; line-height: 1.55; }
.admin-page-title .eyebrow { font-size: 9px; letter-spacing: 1.5px; }

.primary-button, .secondary-button {
    min-height: 43px;
    padding: 9px 17px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.primary-button { background: linear-gradient(135deg, #6940df, #5223c1); border-color: #5525c5; box-shadow: 0 8px 18px rgba(84, 36, 201, .18); }
.primary-button:hover { transform: translateY(-1px); background: linear-gradient(135deg, #5f35d4, #4316a8); box-shadow: 0 11px 22px rgba(84, 36, 201, .24); }
.secondary-button { color: #5c35ba; background: #fff; border-color: #dcd5ec; }
.secondary-button:hover { transform: translateY(-1px); color: #4c21ae; background: #faf8ff; border-color: #c9b9ed; box-shadow: 0 8px 18px rgba(50, 36, 80, .07); }

.admin-panel, .provider-card, .simple-category-card {
    background: var(--admin-panel);
    border-color: var(--admin-line);
    border-radius: 18px;
    box-shadow: var(--admin-shadow);
}
.admin-panel { padding: 25px; }
.panel-heading { margin-bottom: 16px; align-items: flex-start; }
.panel-heading h2, .admin-panel h2 { margin: 3px 0; color: #22273a; font-size: 20px; letter-spacing: -.4px; }
.panel-heading p, .add-provider-panel p { color: var(--admin-muted); font-size: 11px; line-height: 1.55; }
.admin-alert { border-radius: 13px; box-shadow: 0 7px 20px rgba(28, 34, 52, .04); }

.stat-grid, .health-summary-grid { gap: 15px; }
.stat-grid article, .health-summary-grid article {
    position: relative;
    min-height: 132px;
    padding: 20px 21px;
    overflow: hidden;
    background: linear-gradient(150deg, #fff 35%, #fbfbfe);
    border: 1px solid var(--admin-line);
    border-radius: 17px;
    box-shadow: 0 9px 28px rgba(24, 29, 47, .05);
}
.stat-grid article::before, .health-summary-grid article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #7756d3; opacity: .7; }
.stat-grid span, .health-summary-grid span { color: var(--admin-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .45px; }
.stat-grid strong, .health-summary-grid strong { color: #1b2033; font-size: 32px; line-height: 1; letter-spacing: -1.3px; }
.health-summary-grid small { color: #9298a8; font-size: 10px; }
.health-summary-grid .success::before { background: #22a567; }
.health-summary-grid .warning::before { background: #d99524; }
.health-summary-grid .failure::before { background: #dc4c58; }
.health-summary-grid .success strong { color: #168b56; }
.health-summary-grid .warning strong { color: #ad6900; }
.health-summary-grid .failure strong { color: #cf3d49; }

.admin-two-column { gap: 20px; }
.admin-list-row { padding: 16px 2px; }
.admin-list-row strong { color: #2b3043; font-size: 13px; line-height: 1.4; }
.admin-list-row small { color: var(--admin-muted); line-height: 1.45; }
.scheduler-panel { margin-top: 20px; border-left-width: 5px; }
.scheduler-details > div { padding: 15px; background: #f8f9fc; border-color: #eaecf2; }
.scheduler-details span { color: #8a91a3; text-transform: uppercase; letter-spacing: .35px; }
.cron-command-block { background: linear-gradient(135deg, #1d1729, #272036); }

.import-panel { padding: 22px 24px; }
.import-panel input[type="file"] { max-width: 340px; padding: 5px; color: #697084; background: #fafbfc; border-color: #dfe2ea; }
.import-panel input[type="file"]::file-selector-button { margin-right: 10px; padding: 8px 11px; color: #5731b5; background: #f0ebff; border: 0; border-radius: 7px; font-weight: 750; cursor: pointer; }
.feed-directory-panel { padding: 20px; }
.feed-toolbar { margin: 0 0 14px; align-items: center; justify-content: space-between; gap: 18px; }
.feed-directory-title { display: grid; gap: 2px; }
.feed-directory-title strong { color: #33394c; font-size: 13px; }
.admin-search input { width: 310px; min-height: 42px; padding: 9px 13px; background: #fafbfc; border-color: #dde1e9; border-radius: 11px; outline: none; }
.admin-search input:focus { background: #fff; border-color: #8f72da; box-shadow: 0 0 0 3px #f0ecfb; }
.admin-search button { min-height: 42px; padding: 8px 15px; color: #5130a9; border-color: #ddd5ef; border-radius: 11px; font-weight: 750; }
.bulk-bar { padding: 12px 14px; background: #f7f4fe; border-color: #e8e1f5; border-radius: 12px; }
.bulk-bar select { min-height: 39px; min-width: 205px; }
.feed-list { margin-top: 13px; display: grid; gap: 8px; }
.feed-row {
    padding: 16px;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 14px;
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 13px;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.feed-row:hover { background: #fdfcff; border-color: #d9d0ec; box-shadow: 0 7px 18px rgba(32, 35, 52, .04); }
.feed-main > div:first-child { flex-wrap: wrap; }
.feed-main strong { color: #24293b; font-size: 13px; }
.feed-main > div:first-child span { color: #646c7e; font-size: 12px; }
.feed-main > small { margin: 5px 0 9px; color: #969cac; font-size: 10px; }
.feed-meta { flex-wrap: wrap; gap: 7px; }
.feed-meta > span:not(.status-pill) { padding: 3px 7px; color: #72798b; background: #f4f5f8; border-radius: 6px; }
.feed-actions { align-self: center; }
.feed-actions a, .feed-actions button { min-height: 34px; padding: 7px 10px; color: #5d38b7; border-color: #ded7ef; border-radius: 9px; font-weight: 700; }
.feed-actions a:hover, .feed-actions button:hover { background: #f4efff; border-color: #cfc0ec; }
.feed-editor { margin-top: 2px; padding: 16px; background: #f8f7fc; border: 1px solid #e8e3f2; }

.simple-category-create { padding: 24px; grid-template-columns: minmax(210px, .65fr) 2fr; gap: 35px; }
.simple-category-form { gap: 11px; }
.simple-category-form label, .simple-category-edit label { color: #4a5063; font-size: 10px; text-transform: uppercase; letter-spacing: .3px; }
.simple-category-form label small { text-transform: none; letter-spacing: 0; }
.simple-category-form input, .simple-category-form select, .simple-category-edit input:not([type="checkbox"]), .simple-category-edit textarea { min-height: 42px; padding: 9px 11px; background: #fafbfc; border-color: #dfe2e9; border-radius: 10px; outline: none; }
.simple-category-form input:focus, .simple-category-form select:focus, .simple-category-edit input:focus, .simple-category-edit textarea:focus { background: #fff; border-color: #8e71da; box-shadow: 0 0 0 3px #f0ecfb; }
.simple-category-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.simple-category-card { min-width: 0; }
.simple-category-card[open] { grid-column: 1 / -1; }
.simple-category-card > summary { position: relative; min-height: 82px; padding: 17px 20px 17px 60px; }
.simple-category-card > summary::before {
    content: "›";
    position: absolute;
    top: 50%;
    left: 20px;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    color: #6842c7;
    background: #f0ebff;
    border-radius: 8px;
    font-size: 19px;
    transform: translateY(-50%);
    transition: transform .16s ease;
}
.simple-category-card[open] > summary::before { transform: translateY(-50%) rotate(90deg); }
.simple-category-card > summary:hover { background: #fdfcff; }
.simple-category-card > summary strong { color: #24293b; font-size: 15px; }
.simple-category-card > summary small { color: #8b92a3; }
.category-open-label { padding: 6px 9px; color: #5d38b7; background: #f4efff; border-radius: 8px; }
.simple-category-content { padding: 22px; background: #fafafe; }
.category-advanced { background: #f1f2f6; border: 1px solid #e7e8ee; }
.simple-child-card { border-radius: 11px; }

.health-chart-panel, .provider-performance-panel, .task-health-panel, .recent-failures-panel { margin-bottom: 20px; }
.health-chart { height: 260px; padding: 18px 10px 0; gap: 14px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 54px, #f1f2f6 55px); }
.health-bar-track { height: 175px; }
.health-bar { width: min(34px, 64%); background: #edf0f5; border-radius: 7px 7px 3px 3px; }
.health-day strong { color: #303648; font-size: 10px; }
.health-day small { color: #858c9d; font-size: 8px; }
.table-scroll { border: 1px solid #eceef3; border-radius: 12px; }
.health-table { font-size: 11px; }
.health-table th { padding: 12px 13px; color: #7f8799; background: #f8f9fb; border-color: #e7e9ef; font-size: 8px; }
.health-table td { padding: 15px 13px; color: #343a4d; border-color: #eceef3; line-height: 1.45; }
.health-table tbody tr:hover { background: #fcfbff; }
.health-table small { color: #858c9d; line-height: 1.4; }
.quota-track { height: 6px; background: #eceef3; }
.quota-track i { background: linear-gradient(90deg, #6b48c7, #9473e6); }
.task-health-grid article { padding: 19px; background: linear-gradient(145deg, #f8f9fc, #fff); border-color: #e7e9ef; border-radius: 13px; }
.failure-message { color: #60677a; font-size: 10px; }
.provider-chain-title { margin-top: 38px; }
.provider-key-notice { padding: 15px 17px; border-radius: 13px; }
.provider-stack { gap: 11px; }
.provider-card { transition: border-color .15s ease, box-shadow .15s ease; }
.provider-card:hover { border-color: #d9d1ea; box-shadow: 0 13px 30px rgba(30, 30, 49, .07); }
.provider-card > header { min-height: 88px; padding: 18px 21px; grid-template-columns: 100px minmax(220px, 1fr) auto auto 38px 80px; }
.provider-number { color: #7858c7; }
.provider-card h2 { color: #24293b; font-size: 16px; }
.provider-card header p { color: #878ea0; }
.provider-expand, .provider-order button { border-color: #e0daed; border-radius: 10px; }
.provider-expand:hover, .provider-order button:hover:not(:disabled) { background: #f2edff; border-color: #cdbfea; }
.provider-config { background: #fbfbfd; }

@media (max-width: 1180px) {
    :root { --admin-sidebar: 245px; }
    .admin-content { padding-right: 26px; padding-left: 26px; }
    .simple-category-list { grid-template-columns: 1fr; }
    .simple-category-card[open] { grid-column: auto; }
}

@media (max-width: 780px) {
    .admin-sidebar { width: min(286px, 84vw); box-shadow: 24px 0 60px rgba(13, 9, 23, .35); }
    .admin-main { margin-left: 0; }
    .admin-sidebar-scrim { position: fixed; inset: 0; z-index: 70; display: block; visibility: hidden; opacity: 0; background: rgba(15, 11, 24, .5); border: 0; transition: opacity .2s ease, visibility .2s ease; }
    .admin-menu-open .admin-sidebar-scrim { visibility: visible; opacity: 1; }
    .admin-menu-open { overflow: hidden; }
    .admin-topbar { height: 64px; padding: 0 17px; }
    .admin-menu-button { width: 38px; height: 38px; color: #5130a9; background: #f4f0fe; border: 1px solid #e2d9f5; border-radius: 10px; }
    .admin-user { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .admin-content { padding: 27px 16px 55px; }
    .admin-page-title h1 { font-size: 34px; }
    .simple-category-create { grid-template-columns: 1fr; gap: 20px; }
    .feed-directory-panel { padding: 15px; }
    .feed-toolbar { align-items: stretch; flex-direction: column; }
    .admin-search input { width: 100%; }
    .admin-search { width: 100%; }
    .admin-search input { flex: 1; }
    .feed-row { padding: 14px; }
}

@media (max-width: 520px) {
    .admin-route .admin-breadcrumb, .admin-route > span[aria-hidden] { display: none; }
    .admin-user { max-width: 118px; font-size: 11px; }
    .admin-page-title { margin-bottom: 22px; }
    .admin-page-title h1 { font-size: 31px; }
    .admin-panel { padding: 17px; border-radius: 15px; }
    .stat-grid article, .health-summary-grid article { min-height: 112px; }
    .simple-category-card > summary { padding-right: 14px; padding-left: 52px; }
    .simple-category-card > summary::before { left: 15px; }
    .category-summary-meta { gap: 7px; }
    .category-open-label { display: none; }
    .feed-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .feed-actions a, .feed-actions button { text-align: center; }
    .health-chart { gap: 9px; }
}

/* Portable background backup and restore — v0.5 */
.recovery-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.recovery-action-card { min-height: 390px; position: relative; display: flex; flex-direction: column; gap: 22px; overflow: hidden; }
.recovery-action-card::after { content: ""; position: absolute; right: -80px; bottom: -100px; width: 240px; height: 240px; pointer-events: none; background: radial-gradient(circle, rgba(103, 53, 216, .12), transparent 68%); }
.recovery-card-icon { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #7342df, #4e22bb); border-radius: 14px; box-shadow: 0 10px 25px rgba(87, 44, 187, .24); font-size: 25px; font-weight: 850; }
.restore-card .recovery-card-icon { background: linear-gradient(145deg, #2d7c9c, #155b77); box-shadow: 0 10px 25px rgba(29, 105, 134, .22); }
.recovery-action-card h2 { margin: 5px 0 8px; font-size: 25px; letter-spacing: -.65px; }
.recovery-action-card p { max-width: 620px; margin: 0; color: var(--admin-muted); font-size: 13px; line-height: 1.65; }
.recovery-form { margin-top: auto; position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.restore-card .recovery-form { grid-template-columns: 1fr 1fr; }
.restore-card .recovery-form button, .restore-upload-status { grid-column: 1 / -1; }
.recovery-form label { display: grid; gap: 6px; }
.recovery-form label > span { color: #363c50; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .45px; }
.recovery-form label small { min-height: 28px; color: #8b92a3; font-size: 10px; line-height: 1.4; }
.recovery-form input { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--admin-ink); background: #fafafd; border: 1px solid #dfe2ea; border-radius: 10px; }
.recovery-form input[type="file"] { padding: 8px; }
.recovery-form button { min-width: 178px; }
.restore-upload-status { padding: 12px 14px; color: #44366b; background: #f3effd; border: 1px solid #e2d9f5; border-radius: 10px; }
.restore-upload-status > div { margin-bottom: 7px; display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.restore-upload-status progress, .recovery-operation progress { width: 100%; height: 7px; overflow: hidden; accent-color: var(--admin-purple); border: 0; border-radius: 99px; }
.recovery-operations-panel, .stored-backups-panel { margin-top: 18px; }
.recovery-live-indicator { display: inline-flex; align-items: center; gap: 7px; color: #6d7589; font-size: 10px; }
.recovery-live-indicator i { width: 7px; height: 7px; display: block; background: #24a86a; border-radius: 50%; box-shadow: 0 0 0 3px #e6f7ee; }
.recovery-operation-list { display: grid; gap: 10px; }
.recovery-operation { min-height: 78px; padding: 14px 15px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 13px; align-items: center; background: #fbfbfd; border: 1px solid #e7e9f0; border-radius: 12px; }
.operation-type { width: 36px; height: 36px; display: grid; place-items: center; color: #5e34c5; background: #f0eafd; border-radius: 10px; font-size: 18px; font-weight: 850; }
.recovery-operation strong, .recovery-operation small { display: block; }
.recovery-operation strong { color: #2e3447; font-size: 12px; }
.recovery-operation small { margin: 4px 0 9px; color: #7d8496; font-size: 10px; }
.operation-progress { color: #7e8598; font-size: 11px; font-weight: 800; }
.operation-completed { border-color: #cfeadb; background: #fbfffd; }
.operation-failed { border-color: #f0cbd1; background: #fffafb; }
.operation-failed .operation-type { color: #bd243a; background: #ffebee; }
.stored-backups-panel .backup-warning { margin: 14px 0 4px; }
.backup-download-list .admin-list-row { padding-right: 5px; padding-left: 5px; }

@media (max-width: 980px) {
    .recovery-action-grid { grid-template-columns: 1fr; }
    .recovery-action-card { min-height: 0; }
}

@media (max-width: 640px) {
    .recovery-form, .restore-card .recovery-form { grid-template-columns: 1fr; }
    .restore-card .recovery-form button, .restore-upload-status { grid-column: auto; }
    .recovery-operation { grid-template-columns: 36px minmax(0, 1fr) auto; }
    .recovery-operation .secondary-button { grid-column: 2 / -1; }
    .operation-progress { align-self: start; }
}

.story-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.story-row-actions form { margin: 0; }
.admin-filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 220px auto; gap: 10px; margin-bottom: 18px; }
.editorial-layout { align-items: start; }
.editorial-actions { display: grid; gap: 12px; }
.editorial-actions form { display: grid; gap: 8px; }
.funnel-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.funnel-grid article { padding: 18px 12px; display: grid; gap: 5px; text-align: center; background: #f7f5fb; border: 1px solid #ebe7f2; border-radius: 12px; }
.funnel-grid strong { color: #211936; font-size: 24px; }
.funnel-grid span, .pipeline-health-grid span { color: #777087; font-size: 12px; }
.pipeline-health-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pipeline-health-grid > div { padding: 13px; display: grid; gap: 5px; border-left: 3px solid #6631d7; background: #fff; }
.correction-notice { margin: 20px 0; padding: 18px 20px; border: 1px solid #e6c276; border-left: 4px solid #c17a00; border-radius: 12px; background: #fff9ec; }
.correction-notice p { margin: 6px 0; }
@media (max-width: 1050px) { .funnel-grid { grid-template-columns: repeat(4, 1fr); } .pipeline-health-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .admin-filter-bar { grid-template-columns: 1fr; } .funnel-grid { grid-template-columns: repeat(2, 1fr); } .pipeline-health-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .release-update-checks { grid-template-columns: 1fr; } .release-update-form { align-items: stretch; flex-direction: column; } }
.compact-button { min-height: 30px; padding: 5px 9px; border-radius: 8px; font-size: 10px; }
.quarantine-panel { margin-top: 18px; }

@media (max-width: 620px) {
    .story-row-actions { align-items: flex-end; flex-direction: column; }
}

/* RealNews v0.10 branding */
.admin-brand .admin-wordmark { width: 214px; height: auto; }
.login-card .login-wordmark { width: 230px; height: auto; }

@media (max-width: 700px) {
    .login-card .login-wordmark { width: min(230px, 100%); }
}

/* Video, channel and YouTube key admin screens */
.stat-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-note { margin: 12px 0 0; padding: 11px 13px; color: #4c5468; background: #f7f8fb; border: 1px solid #e6e8ef; border-radius: 10px; font-size: 11px; line-height: 1.6; }
.error-text { color: #bd243a; }
.row-actions { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-actions form { display: inline-flex; }
.text-link { font-size: 11px; font-weight: 750; color: #5c35ba; }
.text-link:hover { color: #46189c; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 0; }
.detail-grid > div { padding: 12px 13px; background: #fafbfd; border: 1px solid #eceef3; border-radius: 11px; }
.detail-grid > div.wide { grid-column: 1 / -1; }
.detail-grid span { display: block; color: var(--admin-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .4px; }
.detail-grid strong { display: block; margin-top: 5px; color: #212637; font-size: 14px; line-height: 1.45; }
.plain-list { margin: 8px 0 0; padding-left: 18px; color: #333a4d; font-size: 13px; line-height: 1.65; }
.summary-body { margin: 10px 0 0; color: #2c3245; font-size: 13px; line-height: 1.75; }
.provider-text { margin: 10px 0 0; padding: 14px; max-height: 320px; overflow: auto; white-space: pre-wrap; color: #3b4155; background: #fafbfd; border: 1px solid #eceef3; border-radius: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.6; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #eceef3; vertical-align: top; }
.admin-table thead th { color: var(--admin-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .45px; background: #fafbfd; }
.admin-table tbody th { color: #262c3d; font-weight: 750; }
.admin-table .table-note { color: var(--admin-muted); max-width: 420px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.danger-button { color: #bd243a; border-color: #f0c5cc; }
.danger-button:hover { color: #9c1c2f; background: #fff5f6; border-color: #e7a7b1; }
.tier-chip, .state-chip, .tag-chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 750; }
.tier-chip { color: #5130a9; background: #f1ecfd; border: 1px solid #e2d8fa; }
.state-chip { color: #4a5468; background: #f3f5f9; border: 1px solid #e6e9f0; }
.tag-chip { color: #8a5b00; background: #fff6e0; border: 1px solid #f4e2b8; }
.video-pills { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.channel-row, .video-row, .key-row { position: relative; display: grid; gap: 14px; padding: 16px 2px; border-bottom: 1px solid var(--line); }
.channel-row, .key-row { grid-template-columns: 26px minmax(0, 1fr) auto; align-items: start; }
.video-row { grid-template-columns: 26px 168px minmax(0, 1fr) auto; align-items: start; }
.channel-row:last-child, .video-row:last-child, .key-row:last-child { border-bottom: 0; }
.channel-main, .video-main, .key-main { min-width: 0; }
.channel-main strong, .video-main strong, .key-main strong { margin-right: 8px; color: #262c3d; font-size: 13px; }
.channel-main small, .video-main small, .key-main small { display: block; margin-top: 5px; color: var(--admin-muted); font-size: 11px; line-height: 1.5; }
.channel-main > div, .video-main > div, .key-main > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.channel-actions, .video-actions, .key-actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 7px; }
.channel-actions form, .video-actions form, .key-actions form { display: inline-flex; }
.video-thumb { position: relative; width: 168px; aspect-ratio: 16 / 9; overflow: hidden; background: #eef0f5; border-radius: 10px; }
.video-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-thumb-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--admin-muted); font-size: 10px; }
.video-duration { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; color: #fff; background: rgba(11, 14, 20, .82); border-radius: 6px; font-size: 10px; font-weight: 750; }
.channel-editor, .key-editor { grid-column: 1 / -1; }
.alert-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; color: #333a4d; background: #fafbfd; border: 1px solid #eceef3; border-radius: 11px; font-size: 12px; }
.status-approved, .status-success { color: #087441; background: #e4f8ed; }
.status-pending, .status-running, .status-unresolved { color: #a76a00; background: #fff3d8; }
.status-rejected, .status-failed, .status-invalid { color: #bd243a; background: #ffebee; }
.status-unavailable, .status-disabled, .status-skipped, .status-never { color: #697083; background: #eef0f4; }
.status-hidden { color: #5b4a86; background: #f1ecfd; }
.status-restored { color: #087441; background: #e4f8ed; }
@media (max-width: 1180px) { .stat-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .stat-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-row { grid-template-columns: 26px minmax(0, 1fr); }
  .video-thumb { grid-column: 2 / -1; width: 100%; max-width: 320px; }
  .video-actions, .channel-actions, .key-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}