
button, input, select { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
.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(155px, .8fr) minmax(220px, 1.4fr) repeat(3, 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: 1160px; border: 0; border-radius: 0; overflow: visible; }
.module-row { display: grid; grid-template-columns: minmax(190px,1.35fr) minmax(145px,.9fr) 100px 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; }

.status-pill,
.inspection-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); }
.inspection-before { background: var(--surface-2); color: var(--ink-3); }
.inspection-progress { background: var(--primary-soft); color: var(--primary); }
.inspection-complete { background: var(--good-soft); color: var(--good); }
.inspection-recheck { background: var(--warn-soft); color: var(--warn); }

.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; }
.more-menu-wrap { position: relative; flex: 0 0 auto; }
.more-menu-button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: 17px; font-weight: 600; line-height: 1; }
.more-menu-button:hover,
.more-menu-button[aria-expanded="true"] { border-color: var(--line); background: var(--primary-soft); color: var(--primary); }
.row-more-menu { position: absolute; z-index: 30; top: calc(100% + 5px); right: 0; display: grid; width: 138px; padding: 5px; border: 1px solid var(--line-s); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 30px rgba(25, 52, 76, .18); }
.more-menu-item { display: flex; align-items: center; width: 100%; min-height: 28px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: 11px; font-weight: 600; text-align: left; text-decoration: none; }
.more-menu-item:hover { background: var(--primary-soft); color: var(--primary); }
.more-menu-item.danger { color: var(--bad); }
.more-menu-item[disabled] { cursor: not-allowed; opacity: .42; }
.row-action { min-height: 26px; padding: 0 8px; border-radius: 6px; font-size: 11px; }

.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; }
.management-dialog-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(15, 27, 45, .48); }
.management-dialog { width: min(520px, 100%); padding: 22px; border: 1px solid var(--line-s); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 70px rgba(14,35,57,.28); }
.management-dialog h2 { margin: 0; color: var(--ink); font-size: 20px; }
.management-dialog p { margin: 10px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.archive-space-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.archive-space-list span { padding: 5px 8px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 800; }
.management-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 1180px) {
  .filter-bar { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .module-list-panel { overflow-x: auto; }
}

@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; }
}
