html {
  font-size: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  background: #f4f6f8;
  color: #263238;
  overflow-x: hidden;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 520px;
}

.full-width {
  width: 100%;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  max-width: 100%;
}

.admin-sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: #0d47a1;
  color: #fff;
  padding: 1.5rem 1rem;
}

.admin-sidebar .brand {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.admin-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.admin-sidebar ul li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.4rem;
}

.admin-sidebar ul li a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.admin-content {
  flex: 1 1 0;
  padding: 2rem;
  max-width: 100%;
  width: calc(100% - 260px);
}

.public-content {
  min-height: 100vh;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.inline-form {
  display: inline-block;
  margin-left: 0.4rem;
}

.admin-form-card {
  max-width: 700px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.admin-sidebar {
  overflow-y: auto;
}

.admin-menu .material-icons {
  font-size: 1.2rem;
}

.material-icons {
  display: inline-block;
  flex: 0 0 1.25em;
  max-width: 1.25em;
  overflow: hidden;
  white-space: nowrap;
}

.admin-menu-section {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 1rem 0 0.35rem;
  padding: 0 0.8rem;
  text-transform: uppercase;
}

.admin-metrics {
  margin-bottom: 1rem;
}

.metric-card .card-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-value {
  color: #0d47a1;
  font-size: 1.8rem;
  font-weight: 700;
}

.metric-label {
  color: #546e7a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

.filter-card {
  padding: 1rem;
}

.no-bottom-margin {
  margin-bottom: 0;
}

.filter-actions {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.table-card {
  overflow: hidden;
}

.admin-record-table th,
.admin-record-table td {
  vertical-align: top;
}

.status-pill {
  background: #e3f2fd;
  border-radius: 999px;
  color: #0d47a1;
  display: inline-block;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.25rem 0.65rem;
}

.record-fields {
  display: grid;
  gap: 0.25rem 0.75rem;
  grid-template-columns: max-content minmax(180px, 1fr);
  margin: 0;
}

.record-fields dt {
  color: #546e7a;
  font-weight: 700;
}

.record-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status-update-form {
  display: grid;
  gap: 0.45rem;
  min-width: 220px;
}

.status-update-form input {
  margin-bottom: 0;
}

.danger-action-form {
  margin-top: 0.45rem;
}

.workspace-summary {
  color: #5d4037;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

:root {
  --admin-primary: #1565c0;
  --admin-primary-dark: #0d47a1;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f7faff;
  --admin-border: #dbe6ff;
  --admin-text: #1f2d4a;
  --admin-muted: #60718d;
  --admin-radius: 14px;
  --admin-shadow: 0 12px 28px rgba(31, 48, 94, 0.08);
  --admin-focus: 0 0 0 3px rgba(21, 101, 192, 0.18);
}

body {
  background: #f4f7fb;
  color: var(--admin-text);
}

.admin-sidebar {
  background: linear-gradient(180deg, var(--admin-primary-dark) 0%, #123d82 100%);
  box-shadow: 10px 0 30px rgba(13, 71, 161, 0.14);
}

.admin-sidebar .brand {
  letter-spacing: 0.01em;
}

.admin-sidebar ul li a {
  min-height: 40px;
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.admin-sidebar ul li a:focus-visible,
.logout-form button:focus-visible,
.auth-card .btn:focus-visible,
.admin-content .btn:focus-visible {
  outline: 0;
  box-shadow: var(--admin-focus);
}

.admin-content {
  min-width: 0;
}

.admin-page-header {
  align-items: flex-start;
  background: linear-gradient(180deg, var(--admin-surface) 0%, var(--admin-surface-soft) 100%);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.admin-page-header h1,
.admin-page-header h2,
.admin-page-header h3 {
  margin-bottom: 0.25rem;
}

.card,
.auth-card,
.admin-form-card,
.filter-card,
.table-card,
.metric-card {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
}

.card .card-title {
  color: var(--admin-text);
  font-weight: 700;
}

.input-field input:focus,
.input-field textarea:focus,
.input-field select:focus,
.status-update-form input:focus,
.admin-content input:focus,
.admin-content textarea:focus,
.admin-content select:focus {
  border-bottom-color: var(--admin-primary) !important;
  box-shadow: 0 1px 0 0 var(--admin-primary), var(--admin-focus) !important;
}

.btn,
.btn-large,
.btn-small,
.status-pill {
  border-radius: 999px;
  font-weight: 700;
  text-transform: none;
}

.btn,
.btn-large,
.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
}

.btn:hover,
.btn-large:hover,
.btn-small:hover {
  box-shadow: 0 10px 20px rgba(13, 71, 161, 0.16);
}

.table-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-record-table {
  min-width: 760px;
}

.admin-record-table thead th {
  background: #f0f5ff;
  color: var(--admin-text);
  font-weight: 700;
}

.admin-record-table tbody tr:hover {
  background: #f8fbff;
}

.text-danger,
.field-validation-error {
  color: #b42318 !important;
  font-weight: 600;
}

.alert,
.validation-summary-errors {
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.alert-success {
  background: #ecfdf5;
  color: #047857;
}

.auth-wrapper {
  background: radial-gradient(circle at top right, #e8f1ff 0%, #f4f7fb 42%, #eef8f7 100%);
}

.auth-card .card-action {
  background: #f8fbff;
}

@media (max-width: 992px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    flex-basis: auto;
    max-height: 45vh;
  }

  .admin-content {
    padding: 1rem;
    width: 100%;
  }

  .admin-page-header,
  .filter-actions {
    flex-direction: column;
  }

  .filter-actions .btn,
  .filter-actions button,
  .admin-page-header .btn {
    width: 100%;
  }
}

/* Version 3.1 PR10 Administrator UI Modernization: TaskManager component aliases */
.tm-page-header { margin-bottom: 1rem; }
.tm-eyebrow { color: var(--admin-primary); display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tm-header-actions { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; }
.tm-grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.tm-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tm-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tm-card, .tm-stat-card { color: inherit; display: block; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.tm-card:hover, .tm-stat-card:hover, .tm-card:focus-visible, .tm-stat-card:focus-visible { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(31,48,94,.14); }
.tm-alert { border: 1px solid var(--admin-border); border-radius: var(--admin-radius); box-shadow: var(--admin-shadow); margin: 0 0 1rem; padding: .85rem 1rem; }
.tm-alert-warning { background: #fff8e1; border-color: #ffe08a; color: #7a4d00; }
.tm-alert-info { background: #eef6ff; border-color: #bfdbfe; color: #164e8a; }
.tm-quick-actions { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tm-quick-action { align-items: center; background: #f8fbff; border: 1px solid var(--admin-border); border-radius: 12px; color: var(--admin-text); display: flex; gap: .6rem; min-height: 52px; padding: .75rem; text-decoration: none; }
.tm-quick-action:hover, .tm-quick-action:focus-visible { background: #eef6ff; outline: 0; box-shadow: var(--admin-focus); }
.tm-quick-action .material-icons { color: var(--admin-primary); }
.tm-activity-feed { margin: .5rem 0 0; padding-left: 1.2rem; }
.tm-activity-feed li { margin-bottom: .55rem; }
.tm-timeline { border-left: 3px solid var(--admin-border); display: grid; gap: .75rem; margin-left: .35rem; padding-left: 1rem; }
.tm-timeline a { color: var(--admin-text); display: grid; gap: .15rem; position: relative; text-decoration: none; }
.tm-timeline a:before { background: var(--admin-primary); border: 3px solid #fff; border-radius: 999px; box-shadow: 0 0 0 1px var(--admin-border); content: ""; height: .75rem; left: -1.48rem; position: absolute; top: .2rem; width: .75rem; }
.tm-timeline span { color: var(--admin-muted); }
.card-panel.green, .card-panel.red, .card-panel.orange, .card-panel.amber { border-radius: var(--admin-radius); box-shadow: var(--admin-shadow); }
table.striped.responsive-table, table.highlight.responsive-table { background: #fff; border: 1px solid var(--admin-border); border-radius: var(--admin-radius); overflow: hidden; }
table.striped.responsive-table thead th, table.highlight.responsive-table thead th { background: #f0f5ff; color: var(--admin-text); font-weight: 800; }
@media (max-width: 992px) { .tm-header-actions { width: 100%; } .tm-header-actions .btn { width: 100%; } }

.ai-management-header p {
  color: var(--admin-muted);
  margin: 0;
}

.ai-management-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: 240px minmax(0, 1fr);
}

.ai-management-nav {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  position: sticky;
  top: 1rem;
}

.ai-management-nav a {
  align-items: center;
  border-radius: 10px;
  color: var(--admin-text);
  display: flex;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  text-decoration: none;
}

.ai-management-nav a.active,
.ai-management-nav a:hover,
.ai-management-nav a:focus-visible {
  background: #eef6ff;
  color: var(--admin-primary-dark);
  outline: 0;
}

.ai-management-nav a:focus-visible {
  box-shadow: var(--admin-focus);
}

.ai-management-main {
  min-width: 0;
}

.ai-management-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.ai-management-form label {
  color: var(--admin-text);
  font-weight: 700;
}

.ai-management-form textarea {
  min-height: 5rem;
}

.ai-management-main code {
  background: #eef2ff;
  border-radius: 6px;
  color: #1e3a8a;
  display: inline-block;
  max-width: 42rem;
  overflow-wrap: anywhere;
  padding: 0.12rem 0.35rem;
}

@media (max-width: 1100px) {
  .ai-management-layout {
    grid-template-columns: 1fr;
  }

  .ai-management-nav {
    display: flex;
    overflow-x: auto;
    position: static;
    -webkit-overflow-scrolling: touch;
  }

  .ai-management-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.mp-admin {
  display: grid;
  gap: 1rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.marketplace-payments-header p,
.mp-refresh-note {
  color: var(--admin-muted);
  margin: 0;
}

.mp-status-strip {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.mp-status-strip article {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: var(--admin-shadow);
  min-width: 0;
  padding: .75rem;
}

.mp-status-strip span {
  color: var(--admin-muted);
  display: block;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mp-status-strip strong,
.metric-value {
  overflow-wrap: anywhere;
}

.mp-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: 250px minmax(0, 1fr);
  max-width: 100%;
  min-width: 0;
}

.mp-main {
  max-width: 100%;
  min-width: 0;
}

.mp-nav {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  display: grid;
  gap: .25rem;
  padding: .75rem;
  position: sticky;
  top: 1rem;
}

.mp-nav a,
.mp-nav-disabled {
  align-items: center;
  border-radius: 10px;
  color: var(--admin-text);
  display: flex;
  gap: .55rem;
  min-height: 44px;
  padding: .6rem .7rem;
  text-decoration: none;
}

.mp-nav a.active,
.mp-nav a:hover,
.mp-nav a:focus-visible {
  background: #eef6ff;
  color: var(--admin-primary-dark);
  outline: 0;
}

.mp-nav a:focus-visible,
.mp-form input:focus,
.mp-form textarea:focus {
  box-shadow: var(--admin-focus) !important;
}

.mp-nav-disabled {
  color: var(--admin-muted);
  opacity: .78;
}

.mp-nav-disabled small {
  margin-left: auto;
}

.mp-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.mp-main > * {
  max-width: 100%;
  min-width: 0;
}

.mp-main .tm-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.mp-main .tm-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.mp-card-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mp-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.mp-grid article,
.mp-panel {
  background: #f8fbff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  min-width: 0;
  padding: .85rem;
}

.mp-grid span,
.mp-panel h2,
.mp-definition-list dt {
  color: var(--admin-muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mp-grid strong,
.mp-wrap,
.mp-definition-list dd {
  overflow-wrap: anywhere;
}

.mp-mini-card {
  background: #f8fbff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  min-width: 0;
  padding: .85rem;
}

.mp-mini-card h2 {
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 .45rem;
  overflow-wrap: anywhere;
}

.mp-mini-card p {
  margin: .5rem 0 0;
  overflow-wrap: anywhere;
}

.mp-table-region {
  contain: inline-size;
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.mp-table-wrap {
  contain: inline-size;
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.mp-definition-list {
  display: grid;
  gap: .5rem .75rem;
  grid-template-columns: minmax(140px, .35fr) minmax(0, 1fr);
}

.mp-definition-list dd {
  margin: 0;
}

.mp-table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.mp-table td,
.mp-table th {
  overflow-wrap: anywhere;
  vertical-align: top;
  white-space: normal;
}

.mp-table span,
.mp-warning {
  color: var(--admin-muted);
}

.mp-warning {
  background: #fff8e1;
  border: 1px solid #ffe08a;
  border-radius: 8px;
  margin: .75rem 0 0;
  padding: .75rem;
}

.mp-form {
  display: grid;
  gap: .85rem;
  margin-top: .75rem;
}

.mp-form label {
  color: var(--admin-text);
  display: grid;
  font-weight: 700;
  gap: .25rem;
}

.mp-form textarea {
  min-height: 5rem;
}

.mp-inline-form {
  margin: 0;
}

.mp-phase-list,
.mp-activity {
  display: grid;
  gap: .75rem;
  margin: .75rem 0 0;
}

.mp-phase-list article,
.mp-activity li {
  background: #f8fbff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: .75rem;
}

.mp-activity {
  padding-left: 1.25rem;
}

@media (max-width: 1100px) {
  .mp-layout {
    grid-template-columns: 1fr;
  }

  .mp-nav {
    display: flex;
    overflow-x: auto;
    position: static;
  }

  .mp-nav a,
  .mp-nav-disabled {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .mp-definition-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .admin-content:has(.mp-admin) {
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
    padding-left: .75rem;
    padding-right: .75rem;
    width: 100%;
  }

  .mp-admin .card,
  .mp-admin .card-content,
  .mp-admin table {
    max-width: 100%;
  }

  .mp-status-strip,
  .mp-card-grid,
  .mp-grid,
  .tm-grid-2,
  .tm-grid-4 {
    grid-template-columns: 1fr;
  }

  .mp-nav {
    display: grid;
    overflow-x: visible;
  }

  .mp-nav a,
  .mp-nav-disabled,
  .mp-form .btn,
  .mp-form button,
  .mp-inline-form .btn-small {
    min-height: 44px;
    width: 100%;
  }
}
.ai-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ai-stat-grid .card-content { display: flex; flex-direction: column; gap: .35rem; }
.ai-stat-grid span { color: #667085; font-size: .8rem; }
.ai-stat-grid strong { color: #102a43; font-size: 1.35rem; }
.ai-policy-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.admin-form-grid label { display: flex; flex-direction: column; gap: .3rem; color: #344054; font-size: .8rem; font-weight: 600; }
.admin-form-grid label > input[type="checkbox"] { position: static; width: auto; height: auto; opacity: 1; pointer-events: auto; }
.admin-form-grid .form-wide { grid-column: 1 / -1; }
.admin-form-grid button { justify-self: start; }
@media (max-width: 900px) { .ai-stat-grid, .ai-policy-form-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .admin-form-grid { grid-template-columns: 1fr; } .admin-form-grid .form-wide { grid-column: auto; } }
/* Phase 22A.3.5 metadata-only import operations. */
.admin-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin:1rem 0}.admin-summary-grid article{border:1px solid #dbe3ef;border-radius:.6rem;display:grid;padding:1rem}.admin-summary-grid strong{font-size:1.5rem}.admin-filter-row{align-items:end;display:flex;flex-wrap:wrap;gap:1rem}.responsive-table{max-width:100%;overflow:auto}.responsive-table caption{text-align:left;font-weight:700;padding:.75rem 0}@media(max-width:768px){.admin-summary-grid{grid-template-columns:1fr 1fr}}
.marketplace-growth-nav { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0 0 1rem; padding: .75rem 0; background: transparent; box-shadow: none; line-height: 1.4; }
.marketplace-growth-nav a { color: #1565c0; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
