.attendance-hub { gap: 14px; }
.attendance-hub > .module-heading { align-items: center; gap: 8px 12px; margin-bottom: 5px; }
.attendance-hub .panel { padding: 19px 23px; }
.hub-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-heading-actions .icon { width: 16px; height: 16px; }
.hub-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}
.hub-submit { color: white; background: var(--accent); }
.hub-submit:hover { background: #862839; }

.hub-punch-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.hub-punch-header .module-intro { margin-top: 4px; font-variant-numeric: tabular-nums; }
.hub-days { display: flex; align-items: center; gap: 3px; }
.hub-days button {
  min-width: 45px;
  min-height: 44px;
  padding: 4px 7px;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 14px;
}
.hub-days button[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 750; }
.hub-date-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}
.hub-date-filter:is(:hover, .is-current) { background: var(--accent-soft); color: var(--accent); }
.hub-date-filter .icon { width: 16px; height: 16px; }
.hub-date-filter:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.hub-date-filter input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.hub-date-filter input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.hub-marks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 620px; margin: 14px auto 0; }
.hub-punch-segments-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.hub-punch-segments-split .hub-punch-segment { border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; min-width: 0; }
.hub-punch-segment h3 { text-align: center; font-size: 15px; margin: 0; }
.hub-punch-segment h3 small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
@media (max-width: 460px) { .hub-punch-segments-split { grid-template-columns: 1fr; } }
.hub-mark { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.hub-mark strong { margin-top: 4px; font-variant-numeric: tabular-nums; font-size: 18px; }
.hub-round {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 75px;
  height: 75px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: white;
  font-size: 13px;
  font-weight: 700;
}
.hub-round .icon { width: 26px; height: 26px; }
.hub-round-rose { background: #a53348; box-shadow: 0 5px 12px #a5334838; }
.hub-round-green { background: #367459; box-shadow: 0 5px 12px #36745938; }
button.hub-round:hover { filter: brightness(.9); }
.hub-round-static { box-shadow: none; }
.hub-round-static.hub-round-rose { color: #854454; background: #f7e9ee; border-color: #ecd7e0; }
.hub-round-static.hub-round-green { color: #32684d; background: #e5f3eb; border-color: #d7e9df; }
.hub-punch-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px 8px; margin-top: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.hub-link { min-height: 44px; padding: 3px 5px; color: var(--accent); background: transparent; border: 0; font-size: inherit; font-weight: 700; }
.hub-link:hover { text-decoration: underline; }

.hub-tiles { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; margin-top: 8px; }
.hub-tile {
  min-width: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 3px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}
.hub-tile:hover { background: var(--canvas); }
.hub-tile-icon { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.hub-rose { background: #f9e7ed; color: #9a354d; }
.hub-amber { background: #f9efdb; color: #80531a; }
.hub-green { background: #e5f3eb; color: #32684d; }
.hub-count { position: absolute; top: -5px; left: 75%; padding: 2px 5px; border-radius: 20px; background: var(--accent); color: white; font-size: 10px; }

.hub-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: min(82dvh, 760px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 15px 52px #29161d36;
}
.hub-dialog::backdrop { background: #26151e68; }
.hub-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 10px 22px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.hub-dialog-header h2 { font-size: 19px; }
.hub-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
}
.hub-close:hover { background: var(--accent-soft); }
.hub-dialog-body { display: grid; gap: 13px; padding: 16px 22px 22px; }
.attendance-hub .hub-dialog-body .attendance-history { margin: 0; padding: 0; border: 0; box-shadow: none; }
.attendance-history .module-table :is(th, td) { white-space: nowrap; }
.attendance-history th small { display: block; color: var(--muted); font-weight: 400; }
.hub-empty { padding: 12px 13px; border-radius: 8px; background: var(--canvas); color: var(--muted); font-size: 14px; line-height: 1.55; }
.hub-prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.hub-rule-summary { display: grid; gap: 8px; font-size: 14px; line-height: 1.6; }
.hub-manage-nav, .hub-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-manage-nav button[aria-pressed="true"] { background: var(--accent-soft); border-color: #daa6b3; }
.hub-form, .hub-form-grid { display: grid; gap: 11px; min-width: 0; }
.hub-field { display: grid; gap: 5px; min-width: 0; }
.hub-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.hub-form label { display: grid; gap: 5px; min-width: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.hub-form :is(input, textarea, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
.hub-form textarea { resize: vertical; }
.hub-weekdays { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 0; padding: 0; border: 0; font-size: 13px; }
.hub-weekdays label { display: inline-flex; align-items: center; min-height: 44px; gap: 4px; }
.hub-weekdays input { width: auto; min-height: 0; accent-color: var(--accent); }
.hub-form-error { padding: 8px 10px; border-radius: 8px; background: #fbe7eb; color: #8b243a; font-size: 13px; }
.hub-application-list { display: grid; gap: 8px; }
.hub-application, .hub-list-row { min-width: 0; border: 1px solid var(--line); border-radius: 8px; }
.hub-application summary, .hub-list-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 8px 10px; font-size: 14px; }
.hub-application summary { list-style: none; }
.hub-application summary::-webkit-details-marker { display: none; }
.hub-application summary::after { content: "+"; color: var(--accent); font-size: 19px; }
.hub-application[open] summary::after { content: "−"; }
.hub-application summary > span:first-child { flex: 1; }
.hub-application small, .hub-list-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.hub-application-body { display: grid; gap: 8px; padding: 10px 11px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }

.hub-dialog-calendar, .hub-dialog-workspace, .hub-dialog-makeup { background: var(--canvas); }
.hub-dialog-calendar .hub-dialog-header, .hub-dialog-workspace .hub-dialog-header, .hub-dialog-makeup .hub-dialog-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  padding-inline: 16px;
  text-align: center;
}
.hub-dialog-makeup .hub-dialog-header h2:first-child { grid-column: 2; }
.hub-calendar-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hub-calendar-toolbar .export-button { margin-left: auto; }
.hub-calendar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hub-calendar-nav button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
}
.hub-calendar-nav button:not(:disabled):hover { background: var(--accent-soft); }
.hub-calendar-nav button:disabled { opacity: .35; cursor: default; }
.hub-record-stats, .hub-record-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.hub-record-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px 4px; padding: 14px; }
.hub-record-stats div { display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.hub-record-stats dt { color: var(--muted); font-size: 13px; }
.hub-record-stats dd {
  margin: 0;
  padding: 1px 7px;
  border-radius: 6px;
  color: var(--accent);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 730;
}
.hub-record-stats .hub-record-alert { background: var(--accent-soft); }
.hub-record-card { padding-inline: 14px; }
.hub-record-table { width: 100%; border-collapse: collapse; text-align: center; font-size: 14px; }
.hub-record-table tr + tr, .hub-record-table tbody { border-top: 1px solid var(--line); }
.hub-record-table th, .hub-record-table td { padding: 10px 4px; }
.hub-record-table th:first-child { width: 24%; text-align: start; padding-left: 8px; }
.hub-record-table :is(th, td):not(:first-child) { width: 38%; }
.hub-record-table tbody strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.hub-record-table small, .hub-record-note { color: var(--muted); font-size: 13px; font-weight: 400; }
.hub-record-table .hub-link { min-width: 54px; border-radius: 8px; }
.hub-record-table .hub-link:hover { background: var(--accent-soft); }
.hub-record-table td[colspan] { padding-block: 24px; }
.hub-makeup-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.hub-date-detail { color: var(--accent); font-size: 13px; font-weight: 650; }
.hub-attachment-row { display: flex; align-items: center; gap: 8px; }
.hub-attachment-row input { flex: 1; }
.hub-attachment-row button { flex: none; }
.hub-attachment-saved { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.hub-attachment-link { color: var(--accent); text-underline-offset: 3px; }
.hub-makeup-actions { position: sticky; bottom: 0; justify-content: flex-end; padding: 8px 0; background: var(--canvas); }
.hub-dialog-makeup { scroll-padding-block: 66px 76px; }
.hub-application-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.hub-application-tabs button {
  min-width: 0;
  min-height: 44px;
  padding: 4px 1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: clamp(12px, 2.8vw, 14px);
  font-weight: 650;
}
.hub-application-tabs button[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--accent); }
.hub-application-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hub-application-filters select, .hub-filter-status, .hub-department-filter {
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.hub-filter-status[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.hub-application-filters select:focus-visible, .hub-department-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hub-filter-status span { margin-left: 4px; }
.hub-dialog-workspace .hub-application { background: var(--paper); }
.hub-requests-empty { display: grid; justify-items: center; gap: 6px; padding: clamp(24px, 6vh, 56px) 10px; text-align: center; }
.hub-requests-empty svg { width: 90px; height: 72px; }
.hub-requests-empty p { color: var(--muted); font-size: 13px; }
.hub-calendar-nav button:active:not(:disabled), .hub-application-tabs button:active, .hub-link:active { background: var(--accent-soft); }
.hub-team-list { display: grid; gap: 8px; }
.hub-team-card, .hub-rank-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.hub-team-card { padding: 8px 14px 14px; }
.hub-team-name, .hub-rank-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  color: var(--ink);
  text-align: start;
  overflow-wrap: anywhere;
}
.hub-team-name { width: 100%; padding: 4px; border: 0; border-radius: 7px; background: transparent; }
.hub-team-name:hover, .hub-rank-row:hover { background: var(--accent-soft); }
.hub-team-name > span:not(.hub-team-avatar) { color: var(--muted); font-size: 12px; }
.hub-team-name > .icon { margin-left: auto; flex: none; color: var(--muted); }
.hub-team-avatar { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.hub-team-avatar .icon, .hub-rank-row > .icon { width: 16px; height: 16px; flex: none; }
.hub-team-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; margin: 6px 0 0 4px; font-size: 14px; }
.hub-team-metrics div { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: baseline; }
.hub-team-metrics dt { color: var(--muted); }
.hub-team-metrics dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.hub-rank-row { width: 100%; min-height: 55px; padding: 8px 12px; }
.hub-rank-number { flex: none; min-width: 24px; padding: 2px 5px; border-radius: 5px; color: var(--accent); background: var(--accent-soft); text-align: center; }
.hub-rank-count { margin-left: auto; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 570px) {
  .main-content:has(> .attendance-hub) { padding-top: 15px; }
  .attendance-hub { gap: 9px; }
  .attendance-hub > .module-heading { margin-bottom: 1px; }
  .attendance-hub .panel { padding: 12px 14px; border-radius: 12px; }
  .hub-punch-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; }
  .hub-punch-header > div:first-child { display: contents; }
  .hub-punch-header .module-intro { grid-column: 1 / -1; grid-row: 2; margin-top: 0; font-size: 12px; }
  .hub-punch-header .hub-days { grid-column: 2; grid-row: 1; }
  .hub-days { gap: 1px; }
  .hub-date-filter { padding-inline: 7px; }
  .hub-marks { margin-top: 8px; }
  .hub-round { width: 68px; height: 68px; }
  .hub-punch-note { margin-top: 7px; }
  .hub-tiles { margin-top: 5px; }
  .hub-tile { font-size: 11px; min-height: 57px; }
  .hub-tile-icon { width: 32px; height: 32px; }
  .hub-dialog-header { padding-left: 14px; }
  .hub-dialog-body { padding: 13px 14px 16px; }
  .hub-dialog-calendar, .hub-dialog-workspace, .hub-dialog-makeup { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .hub-record-card { padding-inline: 8px; }
}

@media (max-width: 380px) {
  .attendance-hub .attendance-history .module-table :is(th, td) { padding-inline: 4px; font-size: 12px; }
  .attendance-hub .attendance-history .badge { padding-inline: 5px; font-size: 11px; }
  .hub-makeup-section.hub-form-grid { grid-template-columns: 1fr; }
}
