.admin-body { background: #f4f6f8; }
.admin-topbar { background: #173f63; color: #fff; padding: 16px 0; position: sticky; top: 0; z-index: 20; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.admin-topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-topbar .eyebrow { margin-bottom: 3px; }
.admin-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-nav a { color: #fff; text-decoration: none; font-size: 13px; font-weight: 700; padding: 7px 9px; border-radius: 8px; }
.admin-nav a:hover { background: rgba(255,255,255,.12); }
.admin-user { font-size: 12px; opacity: .75; margin-left: 4px; }
.admin-main { padding-top: 26px; padding-bottom: 28px; }
.admin-page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-page-head h1 { font-size: 28px; color: #16202a; margin: 0; }
.admin-card { background: #fff; border: 1px solid #dfe4e8; border-radius: 14px; padding: 20px; box-shadow: 0 7px 24px rgba(24,39,52,.06); margin-bottom: 18px; }
.admin-card h2 { margin: 0 0 14px; font-size: 18px; }
.admin-narrow, .admin-login-card { max-width: 620px; margin-left: auto; margin-right: auto; }
.admin-form { display: grid; gap: 14px; }
.admin-form button { justify-self: start; }
.admin-alert { border: 1px solid #d9e0e6; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; background: #fff; }
.admin-alert.ok { background: #eaf7f1; color: #0d6b55; border-color: #bfe2d4; }
.admin-alert.error { background: #fff0f0; color: #8d1e1e; border-color: #f1c7c7; }
.admin-alert.warn { background: #fff7df; color: #7a5300; border-color: #ecdca6; }
.admin-alert ul { margin: 8px 0 0; padding-left: 22px; }
.admin-muted, .small-muted, .field-help { color: #66717d; }
.small-muted { font-size: 12px; margin-top: 4px; line-height: 1.4; }
.field-help { display: block; font-size: 11px; font-weight: 500; line-height: 1.35; }
.admin-note { background: #fff7df; border-radius: 9px; padding: 11px 12px; color: #6b500d; font-size: 13px; line-height: 1.45; }
.admin-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-stats { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid #dfe4e8; border-radius: 12px; padding: 16px; box-shadow: 0 5px 18px rgba(24,39,52,.05); }
.stat span { display: block; color: #66717d; font-size: 12px; font-weight: 700; }
.stat strong { display: block; font-size: 28px; margin-top: 5px; color: #173f63; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.button { display: inline-block; border: 1px solid #cfd6dc; background: #fff; color: #173f63; text-decoration: none; padding: 9px 12px; border-radius: 9px; font-size: 13px; font-weight: 800; }
.button:hover { background: #f4f7f9; }
.primary-link { background: #173f63; color: #fff; border-color: #173f63; }
.primary-link:hover { background: #1c4c76; }
.audit-list { display: grid; gap: 10px; }
.audit-list div { border-bottom: 1px solid #edf0f2; padding-bottom: 9px; }
.audit-list div:last-child { border-bottom: 0; }
.audit-list strong, .audit-list span { display: block; }
.audit-list span { color: #66717d; font-size: 12px; margin-top: 3px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.filter-form { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr .8fr .6fr auto; gap: 10px; align-items: end; }
.filter-form button { height: 43px; }
.table-card { padding: 0; overflow: hidden; }
.table-card > h2 { padding: 18px 18px 0; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; background: #f7f9fa; color: #53606c; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; padding: 11px 12px; border-bottom: 1px solid #dfe4e8; white-space: nowrap; }
.admin-table td { vertical-align: top; padding: 12px; border-bottom: 1px solid #edf0f2; line-height: 1.4; }
.admin-table tr:last-child td { border-bottom: 0; }
.rule-link { color: #173f63; font-weight: 800; text-decoration: none; }
.rule-link:hover { text-decoration: underline; }
.status-pill { display: inline-block; border-radius: 999px; padding: 3px 7px; font-size: 10px; font-weight: 800; margin: 0 3px 3px 0; }
.status-pill.active { background: #eaf7f1; color: #0d6b55; }
.status-pill.inactive { background: #eef2f5; color: #5f6b76; }
.status-pill.certified { background: #e9f0ff; color: #285a9e; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-actions form { display: inline; margin: 0; }
.row-actions a, .link-button { color: #173f63; font-size: 12px; font-weight: 700; text-decoration: none; }
.link-button { border: 0; background: transparent; padding: 0; cursor: pointer; font-family: inherit; }
.link-button:hover, .row-actions a:hover { text-decoration: underline; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; border-top: 1px solid #edf0f2; padding: 13px; font-size: 13px; }
.pagination a { color: #173f63; font-weight: 800; text-decoration: none; }
.rule-form { display: grid; gap: 0; }
.section-title { margin-bottom: 14px; }
.section-title h2 { margin-bottom: 4px; }
.section-title p { margin: 0; color: #66717d; font-size: 12px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three-col { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid.four-col { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span-2 { grid-column: 1 / -1; }
textarea { width: 100%; border: 1px solid #cfd6dc; border-radius: 10px; padding: 11px 12px; font: inherit; resize: vertical; color: #16202a; }
textarea:focus { outline: none; border-color: #7398b8; box-shadow: 0 0 0 3px rgba(23,63,99,.08); }
.checkbox-stack { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.checkbox-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 7px; color: #273746; }
.checkbox-label input { width: auto; }
.sticky-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; gap: 10px; background: rgba(244,246,248,.94); border: 1px solid #dfe4e8; border-radius: 12px; padding: 10px; backdrop-filter: blur(8px); margin-bottom: 14px; }
.admin-help-list { margin: 0; padding-left: 20px; color: #53606c; line-height: 1.6; font-size: 13px; }
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 10px; font-size: 14px; }
.detail-list div { color: #66717d; }
code { background: #eef2f5; border-radius: 5px; padding: 2px 5px; font-size: .92em; }
@media (max-width: 1000px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid.four-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .admin-topbar-row, .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-grid-two, .admin-stats, .form-grid.two-col, .form-grid.three-col, .form-grid.four-col, .filter-form { grid-template-columns: 1fr; }
  .admin-nav { width: 100%; }
  .admin-user { width: 100%; margin: 4px 0 0; }
  .admin-page-head h1 { font-size: 24px; }
}
