.admin-body { background: #f4f5f7; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; display: flex; flex-direction: column; color: #f6f7ff; background: #10162d; }
.admin-brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; padding: 0 8px 28px; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-size: 17px; }
.admin-brand small { color: #aeb8db; font-size: 12px; }
.brand-mark { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; color: #fff; background: var(--red); border-radius: 9px 12px 8px 11px; font-family: var(--font-display); font-weight: 900; transform: rotate(-2deg); }
.brand-mark-large { width: 58px; height: 58px; font-size: 28px; }
.admin-nav { display: grid; gap: 7px; }
.admin-nav a { padding: 10px 13px; color: #bdc6e4; border-radius: 10px; text-decoration: none; font-weight: 650; }
.admin-nav a:hover, .admin-nav a.active { color: white; background: #25305a; }
.admin-nav a.active::after { content: ""; float: right; width: 7px; height: 7px; margin-top: 9px; border-radius: 50%; background: var(--yellow); }
.admin-logout { margin-top: auto; }
.admin-logout .button { color: #bdc6e4; justify-content: flex-start; width: 100%; }
.admin-main { min-width: 0; }
.admin-topbar { height: 58px; display: flex; align-items: center; justify-content: flex-end; padding: 0 34px; color: var(--muted); background: rgba(255,255,255,0.88); border-bottom: 1px solid #e4e5e9; }
.sidebar-toggle { display: none; background: transparent; border: 0; font-weight: 700; }
.admin-content { max-width: 1380px; margin: 0 auto; padding: 34px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin-bottom: 5px; font-size: clamp(28px, 3vw, 42px); line-height: 1.15; letter-spacing: -0.025em; }
.page-heading p { max-width: 760px; margin: 0; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 14px; text-decoration: none; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 34px; }
.metrics article { padding: 20px 22px; background: white; border-radius: var(--radius); box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05); }
.metrics strong { display: block; font-size: 32px; line-height: 1.15; }
.metrics span { color: var(--muted); font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 24px; }
.detail-grid { margin-top: 24px; }
.section-heading { min-height: 42px; display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.section-heading a { font-size: 14px; }
.row-list, .activity-list { overflow: hidden; background: white; border-radius: var(--radius); }
.row-item, .activity-list > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 72px; padding: 13px 17px; color: inherit; text-decoration: none; border-bottom: 1px solid #ecece8; }
.row-item:last-child, .activity-list > div:last-child { border-bottom: 0; }
.row-item:hover { background: #f9f9f6; }
.row-item strong, .row-item small, .activity-list strong, .activity-list small { display: block; }
.row-item small, .activity-list small, .activity-list time { color: var(--muted); font-size: 12px; }
.status { display: inline-flex; align-items: center; white-space: nowrap; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.status-published, .status-active { color: #0d6b43; background: #def5e9; }
.status-draft { color: #845b00; background: #fff0c2; }
.status-archived, .status-disabled { color: #686864; background: #eaeaE6; }
.panel { padding: 22px; background: white; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05); }
.empty-state { max-width: 720px; padding: 52px; text-align: center; background: white; border-radius: var(--radius); }
.empty-state p, .quiet-empty { color: var(--muted); }
.quiet-empty { padding: 28px; background: white; border-radius: var(--radius); }
.form-stack { display: grid; gap: 17px; }
.form-stack label, .inline-form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; color: var(--ink); background: white; border: 1px solid #cfcfca; border-radius: 9px; }
input, select { min-height: 44px; padding: 8px 11px; }
textarea { padding: 14px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: #9c9c96; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline-form { display: flex; align-items: end; gap: 10px; min-width: 300px; }
.inline-form label { flex: 1; }
.import-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.help-panel { position: sticky; top: 82px; padding: 22px; color: #f8f8f4; background: var(--blue); border-radius: var(--radius); box-shadow: 0 8px 0 var(--blue-dark); }
.help-panel h2 { font-size: 20px; }
.help-panel ol { margin: 0 0 22px; padding-left: 22px; }
.help-panel li { margin-bottom: 10px; }
.help-panel .button-secondary { margin-bottom: 12px; }
.help-panel .text-link { display: block; color: white; text-align: center; }
.separator { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.separator::before, .separator::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.data-table-wrap { overflow-x: auto; background: white; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { color: var(--muted); background: #fafaf7; text-align: left; font-size: 12px; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid #ecece8; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { color: var(--muted); }
.data-table a { font-weight: 700; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; background: #10162d; border-radius: var(--radius); }
.summary-strip div { padding: 16px 22px; border-right: 1px solid #30395f; }
.summary-strip div:last-child { border: 0; }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { color: #abb5d7; font-size: 12px; }
.summary-strip strong { color: white; font-size: 23px; }
.created-link { display: grid; grid-template-columns: .7fr 1.3fr; gap: 24px; align-items: center; padding: 20px; margin-bottom: 22px; color: #0d5438; background: #def5e9; border-radius: var(--radius); }
.created-link p { margin: 2px 0 0; font-size: 13px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { min-width: 0; }
.inline-warning { padding: 10px 12px; color: #755200; background: #fff2c9; border-radius: 9px; font-size: 13px; }
.distribution-list { display: grid; gap: 12px; }
.distribution-list > div { display: grid; grid-template-columns: minmax(100px, auto) 1fr 30px; align-items: center; gap: 10px; font-size: 13px; }
.distribution-list progress { width: 100%; height: 8px; accent-color: var(--blue); }
.section-block { margin-top: 30px; }
.table-copy { display: flex; max-width: 360px; }
.table-copy input { min-width: 180px; height: 36px; min-height: 36px; border-radius: 8px 0 0 8px; font-size: 12px; }
.table-copy button, .table-link-button { border: 0; color: var(--blue); background: #eef2ff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.table-copy button { padding: 0 10px; border-radius: 0 8px 8px 0; }
.table-link-button { padding: 7px 10px; border-radius: 8px; }
.actions-cell { display: flex; align-items: center; gap: 10px; }
.text-button { padding: 0; color: var(--blue); background: transparent; border: 0; font-weight: 700; cursor: pointer; }
.text-button.danger { color: var(--danger); }
.config-preview { margin-top: 28px; background: #1c2032; color: #f4f4ee; border-radius: var(--radius); }
.config-preview summary { padding: 14px 18px; cursor: pointer; font-weight: 700; }
.config-preview pre { max-height: 520px; overflow: auto; margin: 0; padding: 18px; border-top: 1px solid #3a3f54; font-size: 12px; }
.docs-content { max-width: 860px; }
.docs-content h2 { margin-top: 34px; }
.docs-content h2:first-child { margin-top: 0; }
.docs-content dt { margin-top: 14px; font-weight: 850; }
.docs-content dd { margin-left: 0; color: var(--muted); }
.docs-content code { padding: 2px 5px; color: #123bb0; background: #edf1ff; border-radius: 5px; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #10162d; }
.login-panel { width: min(900px, 100%); display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; background: white; border-radius: 18px; box-shadow: 0 22px 60px rgba(0,0,0,.3); }
.login-intro { min-height: 520px; padding: 54px; color: white; background: var(--blue); }
.login-intro h1 { margin-top: 72px; font-size: clamp(38px, 5vw, 64px); line-height: 1.05; letter-spacing: -0.035em; }
.login-intro p { color: #dce4ff; }
.login-form { align-self: center; display: grid; gap: 17px; padding: 48px; }
.login-form h2 { font-size: 27px; }
.login-form label { display: grid; gap: 6px; font-weight: 700; }
.error-panel { width: min(500px, 100%); padding: 44px; text-align: center; background: white; border-radius: 18px; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; z-index: 20; width: 244px; transform: translateX(-105%); transition: transform 180ms ease-out; box-shadow: 16px 0 40px rgba(0,0,0,.22); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-topbar { justify-content: space-between; padding: 0 20px; }
  .sidebar-toggle { display: block; }
  .admin-content { padding: 24px 20px 40px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-grid, .import-layout { grid-template-columns: 1fr; }
  .help-panel { position: static; }
}

@media (max-width: 640px) {
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .metrics { gap: 10px; }
  .metrics article { padding: 16px; }
  .metrics strong { font-size: 27px; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-strip div:nth-child(2) { border-right: 0; }
  .summary-strip div:nth-child(-n+2) { border-bottom: 1px solid #30395f; }
  .created-link { grid-template-columns: 1fr; }
  .copy-field { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
  .inline-form { width: 100%; min-width: 0; }
  .login-body { padding: 14px; }
  .login-panel { grid-template-columns: 1fr; }
  .login-intro { min-height: 230px; padding: 28px; }
  .login-intro h1 { margin: 35px 0 12px; font-size: 38px; }
  .login-form { padding: 32px 26px; }
  .data-table th, .data-table td { padding: 11px 12px; }
}
