/* Shared Hub layout. Feature styles keep their data/status semantics. */
:root {
  --hub-content-width: 1280px;
  --hub-wide-width: none;
  --hub-border: #e3e6e9;
  --hub-radius: 10px;
  --hub-table-head: #f7f8f9;
}
.main-content:has(> .matrix-page), .main-content:has(> .schedule-body) { --hub-content-width: var(--hub-wide-width); }
.workspace .main-content > .page-header {
  width: 100%; max-width: var(--hub-content-width); margin: 0 auto;
  min-height: 0; padding: 32px 32px 16px; border-bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.workspace .main-content > .page-body {
  width: 100%; max-width: var(--hub-content-width); margin: 0 auto; padding: 12px 32px 40px;
}
.page-header form { margin: 0; }
.page-body > .back-link { margin-bottom: 20px; }
.page-body > .section-heading:first-child { margin-top: 0; }
.page-body > .section-heading { margin: 24px 0 14px; }
.page-body.narrow > :not(.back-link):not(script):not(link) { max-width: 760px; }
.page-body > .notice:first-child { margin-top: 0; }
.hub-panel, .account-profile, .account-shifts, .status-tool, .system-check-result,
.schedule-staff-layout > section, .page-body > .edit-form, .default-role, .schedule-cover {
  border: 1px solid var(--hub-border); border-radius: var(--hub-radius); background: #fff;
}
.hub-panel-padded, .account-profile, .account-shifts, .status-tool, .system-check-result,
.schedule-staff-layout > section, .page-body > .edit-form, .default-role, .schedule-cover { padding: 24px; }
.hub-panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.hub-panel-heading h2 { margin: 0; font-size: 16px; }
.hub-panel-heading form { margin: 0; }
.hub-panel > .muted { margin-top: 12px; }
.system-launch + .system-launch { margin-top: 16px; }
.tool-row { width: 100%; max-width: none; border: 1px solid var(--hub-border); border-radius: var(--hub-radius); padding: 20px; margin-bottom: 12px; }
.tool-row:hover { background: #fafbfc; border-color: #cfd6dd; }
.tool-row > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.tool-icon { background: #f7f8f9; border-color: #e3e6e9; }
.account-layout { grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 24px; }
.account-layout:has(> .account-profile:only-child) { grid-template-columns: minmax(0, 760px); }
.account-profile > .section-heading { margin-top: 24px; }
.account-profile .profile-fields { margin-top: 12px; }
.account-profile .profile-fields > div { grid-template-columns: 82px minmax(0, 1fr); gap: 12px; }
.account-shifts-heading h2, .account-profile > h2, .status-heading h2 { font-size: 16px; }
.status-tool { margin-top: 16px; }
.status-heading h2 { line-height: 1.5; }
.status-component + .status-component { border-top: 1px solid #eceef0; }
.status-page > .muted + .muted { margin-top: 8px; }
.status-warning { padding: 12px 14px; margin: 16px 0; border: 1px solid #ead9ae; border-radius: 7px; background: #fff8e9; }
.system-check-result { margin: 12px 0; }
.system-check-summary > p { margin-top: 6px; }
.page-body > .table-scroll, .schedule-staff-layout .table-scroll {
  border: 1px solid var(--hub-border); border-radius: var(--hub-radius); background: #fff;
}
.page-body > .table-scroll table th, .schedule-staff-layout .table-scroll table th {
  padding: 12px 20px; background: var(--hub-table-head); border-bottom-color: var(--hub-border);
}
.page-body > .table-scroll table td, .schedule-staff-layout .table-scroll table td { padding: 16px 20px; }
.page-body > .table-scroll tbody tr:last-child td, .schedule-staff-layout .table-scroll tbody tr:last-child td { border-bottom: 0; }
.page-body > .table-scroll tbody tr:hover, .schedule-staff-layout .table-scroll tbody tr:hover { background: #fafbfc; }
.page-body > .search-form, .page-body > .audit-filters {
  padding: 20px; margin: 0; border: 1px solid var(--hub-border); border-bottom: 0;
  border-radius: var(--hub-radius) var(--hub-radius) 0 0; background: #fff;
}
.page-body > .search-form + .table-scroll, .page-body > .audit-summary + .table-scroll { border-radius: 0; }
.page-body > .audit-summary { margin: 0; padding: 12px 20px; border: 1px solid var(--hub-border); border-bottom: 0; background: #fafbfc; }
.page-body > .table-scroll:has(+ .pagination) { border-radius: var(--hub-radius) var(--hub-radius) 0 0; }
.page-body > .search-form + .table-scroll:has(+ .pagination),
.page-body > .audit-summary + .table-scroll:has(+ .pagination) { border-radius: 0; }
.page-body > .table-scroll + .pagination {
  margin: 0; padding: 14px 20px; border: 1px solid var(--hub-border); border-top: 0;
  border-radius: 0 0 var(--hub-radius) var(--hub-radius); color: #6a6a6a;
}
.page-body > .edit-form { margin-top: 20px; }
.page-body > .edit-form .form-actions { margin-top: 24px; }
.default-role { margin-top: 24px; }
.default-role .default-form { margin-top: 16px; }
.schedule-staff-layout { grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
.schedule-staff-layout > section { min-width: 0; }
.schedule-staff-layout .table-scroll { margin-top: 18px; }
.schedule-toolbar, .matrix-page .matrix-toolbar {
  padding: 18px 20px; border: 1px solid var(--hub-border); border-radius: var(--hub-radius); margin: 0 0 20px;
}
.matrix-page > .back-link { margin-bottom: 20px; }
.matrix-page .matrix-heading { margin-bottom: 20px; }
.schedule-body .schedule-scroll { border-color: var(--hub-border); border-radius: 0 0 var(--hub-radius) var(--hub-radius); }
.schedule-body .schedule-scroll:first-child { border-radius: var(--hub-radius); }
.schedule-sheet-bar { border-color: var(--hub-border); border-radius: var(--hub-radius) var(--hub-radius) 0 0; }
.schedule-formula { border-color: var(--hub-border); }
.schedule-cover { margin-top: 24px; }
.schedule-cover-row:last-child { border-bottom: 0; padding-bottom: 0; }
.login-card { max-width: 380px; padding: 28px; border: 1px solid var(--hub-border); border-radius: var(--hub-radius); }
@media (max-width: 1050px) {
  .account-layout, .schedule-staff-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .workspace .main-content > .page-header { padding: 24px 20px 12px; }
  .workspace .main-content > .page-body { padding: 12px 20px 32px; }
  .hub-panel-padded, .account-profile, .account-shifts, .status-tool, .system-check-result,
  .schedule-staff-layout > section, .page-body > .edit-form, .default-role, .schedule-cover { padding: 18px; }
  .page-body > .search-form, .page-body > .audit-filters, .schedule-toolbar, .matrix-page .matrix-toolbar { padding: 16px; }
  .tool-row { padding: 16px; gap: 12px; }
  .schedule-toolbar { align-items: flex-start; }
  .hub-panel-heading { align-items: flex-start; }
}
@media (max-width: 480px) {
  .page-header > .button { width: 100%; }
  .page-body > .search-form input { flex-basis: 180px; }
  .default-form select, .schedule-picker input { min-width: 0; flex: 1; }
  .default-form .button { width: 100%; }
  .system-launch .hub-panel-heading > form, .system-launch .hub-panel-heading > form .button { width: 100%; }
  .account-month-nav { max-width: 100%; flex-wrap: wrap; }
}
