
button, input, select { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
.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;
}
.page-shell {
  display: grid;
  gap: 14px;
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar h1 { margin: 0; font-size: 32px; line-height: 1.12; color: var(--ink); }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.eyebrow { color: var(--blue-ink); font-size: 11px; font-weight: 800; }

.primary-action,
.secondary-action,
.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: background .14s, border-color .14s, color .14s;
}
.primary-action { background: var(--blue); color: #fff; }
.secondary-action,
.row-action { border-color: var(--line); background: var(--surface); color: var(--text); }
.row-action:hover,
.secondary-action:hover { border-color: var(--blue); color: var(--blue-ink); }
.row-action.danger { color: var(--bad); }
.row-action[disabled] { cursor: not-allowed; opacity: .45; }

.notice { padding: 10px 12px; border: 1px solid rgba(46,125,90,.24); border-radius: 9px; background: var(--good-soft); color: var(--good); font-size: 12px; font-weight: 800; }

.surface-card { border: 1px solid var(--line-s); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 4px rgba(15,23,42,.06); }

.module-list-panel { padding: 0; overflow: visible; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(135px, .7fr)) auto; gap: 10px; align-items: end; padding: 12px 16px; border-bottom: 1px solid var(--line-s); background: var(--surface-2); }
.filter-bar label { display: grid; gap: 5px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.filter-bar input,
.filter-bar select { width: 100%; min-height: 32px; border: 1px solid var(--line-s); border-radius: 6px; background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 500; padding: 0 10px; }
.filter-bar > .secondary-action { min-height: 32px; border-radius: 6px; }

.list-headline { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 16px 16px 12px; }
.table-head { border-bottom: 1px solid var(--line-s); }
.list-headline > div { display: flex; align-items: baseline; gap: 8px; }
.list-headline h2 { margin: 0; color: var(--ink); font-size: 18px; }
.list-headline span { color: var(--ink-3); font-size: 12px; font-weight: 800; }

.module-table { min-width: 1080px; border: 0; border-radius: 0; overflow: visible; }
.module-row { display: grid; grid-template-columns: 30px minmax(190px,1.35fr) minmax(145px,.9fr) 100px minmax(135px,.9fr) minmax(140px,.75fr); gap: 14px; align-items: center; min-height: 56px; padding: 10px 14px; border-top: 0; border-bottom: 1px solid var(--line-s); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; }
.module-row[data-row-detail] { cursor: pointer; }
.module-row[data-row-detail]:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--primary); outline-offset: -2px; }
.module-row:hover:not(.table-header) { background: var(--surface-2); }
.module-row.table-header { min-height: 40px; border-top: 0; background: var(--surface-2); color: var(--ink-3); font-size: 11px; font-weight: 700; }
.module-row.highlight { animation: highlight-row 2.8s ease; }
.module-row.menu-open { position: relative; z-index: 20; }
@keyframes highlight-row { 0%,45% { background: var(--primary-soft); } 100% { background: var(--surface); } }

.module-name-cell { display: grid; gap: 3px; min-width: 0; }
.module-name-cell strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.module-name-cell span,
.cell-sub { color: var(--ink-3); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.module-select-cell { display: grid; place-items: center; }
.module-select-cell input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }

.status-pill { display: inline-flex; align-items: center; width: fit-content; min-height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 850; white-space: nowrap; }
.status-registered { background: var(--primary-soft); color: var(--primary); }
.status-draft { background: var(--warn-soft); color: var(--warn); }
.status-disabled,
.status-archived { background: var(--surface-2); color: var(--ink-3); }
.assignment-cell { display: grid; gap: 3px; min-width: 0; }
.assignment-cell strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.updated-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.module-expand-indicator { color: var(--primary); font-size: 13px; font-weight: 800; }
.row-action { min-height: 26px; padding: 0 8px; border-radius: 6px; font-size: 11px; }

.module-selection-bar {
  position: fixed;
  left: 236px;
  right: 16px;
  bottom: 16px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line-s);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(14,35,57,.22);
}
.module-selection-bar > div:first-child { display: grid; gap: 3px; }
.module-selection-bar strong { color: var(--ink); font-size: 14px; }
.module-selection-bar span { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.module-selection-actions { display: flex; align-items: center; gap: 8px; }
.module-bulk-status-control { display: flex; align-items: center; gap: 6px; }
.module-bulk-status-control select {
  min-width: 118px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 28px 0 9px;
  font-size: 11px;
  font-weight: 600;
}
.module-bulk-status-control select:disabled { cursor: not-allowed; opacity: .45; }
.module-bulk-status-control .secondary-action {
  width: 112px;
  min-width: 112px;
  white-space: nowrap;
}
.module-selection-actions .danger { border-color: rgba(185,47,47,.3); color: var(--bad); }
.module-selection-actions button:disabled { cursor: not-allowed; opacity: .45; }
#aiModuleManagementShell .page-shell { padding-bottom: 100px; }

.module-detail { display: grid; padding: 4px 14px 10px 42px; border-top: 1px solid var(--line-s); background: var(--surface-2); }
.module-detail-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; min-height: 36px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line-s); font-size: 12px; }
.module-detail-row:last-child { border-bottom: 0; }
.module-detail-row span { color: var(--ink-3); font-weight: 850; }
.module-detail-row strong { min-width: 0; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.empty-list { padding: 36px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 700; }
@media (max-width: 1180px) {
  .filter-bar { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .module-list-panel { overflow-x: auto; }
}

@media (max-width: 900px) {
  .module-selection-bar { left: 16px; }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 20px, 1560px); padding-top: 12px; }
  .topbar { flex-direction: column; }
  .topbar h1 { font-size: 25px; }
  .topbar-actions { width: 100%; flex-direction: column; }
  .filter-bar { grid-template-columns: 1fr; }
  .primary-action,
  .secondary-action { width: 100%; }
  .module-detail { padding-left: 14px; }
  .module-detail-row { grid-template-columns: 1fr; gap: 4px; }
  .module-selection-bar { align-items: stretch; flex-direction: column; }
  .module-selection-actions { display: grid; grid-template-columns: 1fr; }
  .module-bulk-status-control { display: grid; grid-template-columns: 1fr; }
  .module-bulk-status-control select { width: 100%; min-height: 32px; }
}
