:root {
  --navy: #0b2d36;
  --navy-2: #164a52;
  --teal: #137d70;
  --teal-dark: #0c665c;
  --mint: #e6f5f1;
  --mint-2: #c7e7df;
  --gold: #b9872d;
  --gold-soft: #fff6dd;
  --canvas: #f4f7f7;
  --surface: #ffffff;
  --surface-2: #f8fbfa;
  --ink: #102f37;
  --muted: #5f7479;
  --line: #d9e5e3;
  --danger: #b13f4d;
  --danger-soft: #fff0f1;
  --warning: #9a6815;
  --warning-soft: #fff7df;
  --success: #1d7662;
  --blue: #3c6f9d;
  --violet: #725a98;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 12px 36px rgba(13, 53, 61, .08);
  --shadow-lg: 0 24px 70px rgba(7, 39, 47, .18);
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(19, 125, 112, .28);
  outline-offset: 2px;
}
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 1000; top: 10px; right: 12px; padding: 10px 14px; border-radius: 10px; color: #fff; background: var(--navy); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.noscript { margin: 20px; padding: 16px; border: 1px solid #edc6ca; border-radius: 12px; color: var(--danger); background: var(--danger-soft); text-align: center; }

.portal-shell { min-height: 100dvh; }
.sidebar { display: none; }
.app-main { min-width: 0; padding-bottom: calc(78px + var(--safe-bottom)); }
.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgba(210, 224, 222, .92);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}
.topbar > div:first-child { min-width: 0; }
.topbar-identity { display: flex; align-items: center; gap: 10px; }
.topbar-identity > div { min-width: 0; }
.topbar-logo { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid #e4e9e8; border-radius: 13px; background: #fff; }
.topbar-logo img { width: 100%; height: 100%; object-fit: contain; }
.topbar span { display: block; color: var(--teal); font-size: 13px; font-weight: 700; }
.topbar h1 { margin: 1px 0 0; overflow: hidden; font-size: 20px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.sync-state { display: none; }
.icon-button, .top-avatar {
  min-width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.icon-button:active, .top-avatar:active, .primary-button:active, .outline-button:active { transform: scale(.98); }
.icon-button svg { width: 21px; height: 21px; }
.top-avatar svg { width: 23px; height: 23px; color: var(--teal); stroke-width: 2; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 16px 28px; }
.environment-banner, .connection-message { margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.environment-banner { color: #6b5315; background: var(--gold-soft); }
.connection-message { color: #7f303b; background: var(--danger-soft); }

.portal-view { display: none; }
.portal-view.active { display: block; animation: view-in .2s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
.welcome-strip { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 2px 0 20px; }
.welcome-strip span, .page-intro span, .section-head span, .card header span, .swap-step header span { color: var(--teal); font-size: 13px; font-weight: 700; }
.welcome-strip h2 { margin: 2px 0 3px; font-size: clamp(24px, 7vw, 32px); line-height: 1.3; }
.welcome-strip p, .page-intro p { margin: 0; color: var(--muted); font-size: 15px; }
.live-clock { display: none; }

.dashboard-grid, .team-layout, .admin-layout, .profile-grid { display: grid; gap: 16px; }
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.shift-card, .action-card, .team-card, .next-card, .overview-card, .quick-panel, .schedule-card, .team-directory-card,
.attendance-card, .doctor-directory, .permission-editor, .profile-info, .swap-step, .swap-summary, .upload-panel, .audit-card {
  padding: 18px;
}
.shift-card header { display: flex; align-items: center; gap: 14px; }
.shift-card header > div:last-child { min-width: 0; }
.shift-card h3, .action-card h3, .section-head h3, .swap-step h3, .swap-summary h3 { margin: 2px 0 0; font-size: 18px; }
.shift-card p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.shift-code { width: 56px; height: 56px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 16px; color: var(--navy); background: var(--mint-2); font-size: 22px; font-weight: 700; }
.shift-progress { height: 8px; margin: 22px 0 16px; overflow: hidden; border-radius: 999px; background: #e9efee; }
.shift-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #77bcac); transition: width .3s ease; }
.shift-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shift-times span { min-width: 0; display: flex; flex-direction: column; padding: 9px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.shift-times small { color: var(--muted); font-size: 13px; }
.shift-times strong { margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }

.action-card { display: flex; flex-direction: column; }
.action-card > header, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.action-card > header svg { width: 42px; height: 42px; padding: 10px; border-radius: 13px; color: var(--teal); background: var(--mint); }
.category-summary { display: grid; gap: 8px; margin: 16px 0; }
.category-summary button, .category-summary > div:not(.skeleton-row) {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  text-align: right;
  cursor: pointer;
}
.category-summary button > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.category-summary button strong { font-size: 15px; }
.category-summary button small { color: var(--muted); font-size: 13px; }
.category-summary button > b { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #fff; font-size: 13px; }
.category-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; font-size: 16px; font-weight: 700; }
.category-icon svg { width: 22px; height: 22px; }
.category-icon.mint { color: var(--teal); background: var(--mint); }
.category-icon.blue { color: var(--blue); background: #eaf2fb; }
.category-icon.violet { color: var(--violet); background: #f1ecf8; }

.primary-button, .outline-button, .text-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, opacity .15s ease;
}
.primary-button { border: 1px solid var(--teal); color: #fff; background: var(--teal); }
.primary-button:hover { background: var(--teal-dark); }
.outline-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.text-button { min-height: 44px; padding: 8px 0; border: 0; color: var(--teal); background: transparent; }
.primary-button:disabled, .outline-button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.primary-button svg, .outline-button svg { width: 19px; height: 19px; }
.full { width: 100%; }

.overview-card > header > svg, .quick-panel > header > svg { width: 42px; height: 42px; padding: 10px; border-radius: 13px; color: var(--teal); background: var(--mint); }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.overview-grid button {
  min-width: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  text-align: right;
  cursor: pointer;
}
.overview-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 11px; font-size: 14px; font-weight: 700; }
.overview-icon svg { width: 20px; height: 20px; }
.overview-icon.gold { color: #8b651d; background: var(--gold-soft); }
.overview-icon.teal { color: var(--teal); background: var(--mint); }
.overview-icon.green { color: #08733e; background: #e4f6eb; }
.overview-icon.blue { color: #315c96; background: #eaf0ff; }
.overview-icon.training-pair {
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  color: #294c8f;
  background: #edf0ff;
}
.overview-icon.training-pair svg { width: 16px; height: 16px; }
.overview-icon.training-pair svg.intern { color: #294c8f; }
.overview-icon.training-pair svg.student { color: #3b5ceb; }
.overview-grid b { font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.overview-grid small { margin-top: 3px; color: var(--muted); font-size: 13px; }

.section-head > b, .count-chip, .month-chip, .shift-chip { min-width: 34px; min-height: 34px; display: inline-grid; place-items: center; padding: 6px 9px; border-radius: 10px; color: var(--teal); background: var(--mint); font-size: 14px; }
.doctor-list { display: grid; gap: 8px; margin-top: 14px; }
.doctor-row { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #edf2f1; }
.doctor-row:last-child { border-bottom: 0; }
.mini-avatar, .avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #fff; background: var(--teal); font-weight: 700; }
.mini-avatar { width: 40px; height: 40px; font-size: 13px; }
.mini-avatar svg { width: 22px; height: 22px; }
.mini-avatar.doctor-icon { color: var(--teal); background: var(--mint); }
.avatar { width: 46px; height: 46px; }
.avatar.large { width: 68px; height: 68px; border-radius: 20px; font-size: 20px; }
.doctor-row > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.doctor-row strong { font-size: 15px; }
.doctor-row small { color: var(--muted); font-size: 13px; }
.doctor-row > b { color: var(--success); font-size: 13px; }
.team-status { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.team-status svg { width: 16px; height: 16px; }

.next-shift { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px; margin: 18px 0 14px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.next-shift > b { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; color: var(--navy); background: var(--mint-2); font-size: 18px; }
.next-shift > div { display: flex; flex-direction: column; }
.next-shift strong { font-size: 16px; }
.next-shift small { color: var(--muted); font-size: 13px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.quick-actions button {
  min-width: 0;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: right;
  cursor: pointer;
}
.quick-actions button > svg { width: 42px; height: 42px; padding: 10px; border-radius: 12px; color: var(--teal); background: var(--mint); }
.quick-actions button > span { min-width: 0; display: flex; flex-direction: column; }
.quick-actions b { font-size: 15px; }
.quick-actions small { color: var(--muted); font-size: 13px; }

.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.page-intro > div { min-width: 0; }
.page-intro h2 { margin: 2px 0 3px; font-size: 26px; line-height: 1.3; }
.safe-note { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--success) !important; background: var(--mint); font-size: 13px !important; }
.shift-calendar-host { min-width: 0; display: grid; gap: 16px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 7px; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: var(--surface-2); }
.calendar-legend small { color: var(--muted); font-size: 12px; font-weight: 600; }
.shift-calendar { width: 100%; max-width: 760px; margin-inline: auto; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.calendar-month-title { margin: 0 0 11px; color: var(--teal); font-size: 16px; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-weekdays { margin-bottom: 6px; }
.calendar-weekdays span { overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.calendar-cell {
  min-width: 0;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 8px 3px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
button.calendar-cell { cursor: pointer; touch-action: manipulation; }
.calendar-cell.placeholder { visibility: hidden; }
.calendar-cell.empty { border-color: #edf1f1; background: #fbfcfc; }
.calendar-cell.past { opacity: .52; }
.calendar-cell.off { background: #fafbfb; }
.calendar-cell.today { border-color: #d5b65d; box-shadow: inset 0 0 0 1px #e2c66d; }
.calendar-cell.selected { border-color: var(--teal); background: #effaf7; box-shadow: 0 0 0 2px rgba(19,125,112,.18), inset 0 -3px var(--teal); opacity: 1; transform: translateY(-1px); }
.calendar-cell.disabled { cursor: default; }
.calendar-day-number { color: #526a70; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.calendar-shift { min-width: 30px; min-height: 29px; display: grid; place-items: center; padding: 2px 5px; border: 1px solid transparent; border-radius: 9px; color: var(--teal); background: var(--mint); font-size: 13px; font-weight: 700; line-height: 1; }
.calendar-cell.empty .calendar-shift { visibility: hidden; }
.calendar-shift.tone-M { color: #111827; background: #e8eef3; border-color: #cbd5e1; }
.calendar-shift.tone-E { color: #3b2f00; background: #ffe599; border-color: #e0b84f; }
.calendar-shift.tone-N { color: #0b335a; background: #cfe2f3; border-color: #8db6d8; }
.calendar-shift.tone-O { color: #fff; background: #000; border-color: #333; }
.calendar-shift.tone-AL { color: #fff; background: #1e5aa8; border-color: #2e75b6; }
.calendar-shift.tone-HL { color: #fff; background: #6aa84f; border-color: #38761d; }
.calendar-shift.tone-SR { color: #fff; background: #1155cc; border-color: #0b3d91; }
.calendar-shift.tone-AC { color: #fff; background: #6a329f; border-color: #351c75; }
.calendar-shift.tone-ABSENCE { color: #fff; background: #cc0000; border-color: #990000; }
.calendar-shift.tone-EXT { color: #3b1f00; background: #f6b26b; border-color: #e69138; }
.calendar-shift.tone-CL, .calendar-shift.tone-MCA { color: #0d665d; background: #dff3ed; border-color: #8cc9ba; }
.calendar-shift.tone-OTHER { color: #173f43; background: #e5f1ee; border-color: #b9d4ce; }
.calendar-legend .calendar-shift { min-width: 27px; min-height: 25px; font-size: 12px; }
.shift-calendar-host.compact { gap: 12px; }
.shift-calendar-host.compact .shift-calendar { padding: 10px; }
.shift-calendar-host.compact .calendar-cell { min-height: 62px; }
.shift-badge { min-width: 44px; height: 38px; display: grid; place-items: center; padding: 0 8px; border-radius: 11px; font-size: 14px; font-weight: 700; }
.shift-badge.M { color: #74520d; background: #fff1bd; }
.shift-badge.E { color: #176654; background: #dff4ee; }
.shift-badge.N { color: #285481; background: #e2eefb; }
.shift-badge.O { color: #647277; background: #edf1f1; }

.team-banner { padding: 18px; border-radius: var(--radius); color: #fff; background: var(--navy); }
.team-directory-card > .primary-button { margin-top: 18px; }
.roster-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.roster-group > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.roster-group > header > span { display: flex; align-items: center; gap: 8px; color: var(--teal); }
.roster-group > header svg { width: 24px; height: 24px; }
.roster-group > header strong { font-size: 17px; }
.roster-group > header b { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--teal); background: var(--mint); font-size: 13px; }
.roster-group .doctor-list { margin-top: 0; }
.team-category-list { display: grid; }
.team-person {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-inline-start-width: 4px;
  border-radius: 13px;
  color: inherit;
  background: var(--surface-2);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.team-person + .team-person { margin-top: 8px; }
.team-person:active { transform: scale(.985); }
.team-person:hover { box-shadow: 0 7px 18px rgba(13, 53, 61, .08); }
.team-person > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.team-person strong { font-size: 15px; }
.team-person small { color: var(--muted); font-size: 13px; }
.team-person > b { color: var(--muted); font-size: 12px; }
.roster-group.volunteers > header > span, .roster-group.volunteers .team-person { color: #087b46; }
.roster-group.interns > header > span, .roster-group.interns .team-person { color: #294c8f; }
.roster-group.students > header > span, .roster-group.students .team-person { color: #3b5ceb; }
.roster-group.volunteers .team-person { border-inline-start-color: #12a15e; }
.roster-group.interns .team-person { border-inline-start-color: #294c8f; }
.roster-group.students .team-person { border-inline-start-color: #3b5ceb; }
.team-person .mini-avatar.volunteers { background: #0e9760; }
.team-person .mini-avatar.interns { background: #294c8f; }
.team-person .mini-avatar.students { background: #3b5ceb; }
.roster-empty { margin: 0; padding: 13px; border-radius: 12px; color: var(--muted); background: var(--surface-2); font-size: 14px; }

.attendance-stats, .document-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.attendance-stats > span, .document-stats > span { min-height: 72px; display: flex; flex-direction: column; justify-content: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.attendance-stats small, .document-stats small { color: var(--muted); font-size: 13px; }
.attendance-stats b, .document-stats b { margin-top: 2px; font-size: 23px; line-height: 1.2; }
.attendance-toolbar { display: grid; gap: 12px; margin-bottom: 14px; }
.attendance-controls-card { margin-bottom: 14px; }
.attendance-groups { display: grid; gap: 14px; }
.attendance-group-card { position: relative; overflow: hidden; }
.attendance-group-card::before { position: absolute; inset: 0 0 auto; height: 4px; content: ""; }
.current-shift-card::before { background: linear-gradient(90deg, var(--teal), #72bcab); }
.rest-day-card::before { background: linear-gradient(90deg, var(--navy), #d7b95c); }
.attendance-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; padding-top: 3px; }
.attendance-group-head > div { min-width: 0; }
.attendance-group-head span { color: var(--teal); font-size: 12px; font-weight: 700; }
.attendance-group-head h3 { margin: 2px 0 2px; font-size: 19px; }
.attendance-group-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.attendance-group-head > b { min-width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--teal); background: var(--mint); font-size: 16px; }
.rest-day-card .attendance-group-head > b { color: var(--navy); background: var(--gold-soft); }
.tabs, .subnav { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .subnav::-webkit-scrollbar { display: none; }
.tabs button, .subnav button {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tabs button.active, .subnav button.active { border-color: var(--navy); color: #fff; background: var(--navy); }
.subnav { margin-bottom: 16px; }
.subnav b { min-width: 20px; display: inline-grid; place-items: center; margin-inline-start: 5px; padding: 0 5px; border-radius: 999px; color: var(--navy); background: #fff; font-size: 11px; }
.attendance-bulk {
  position: sticky;
  z-index: 8;
  top: 72px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 9px;
  border: 1px solid #a9d6ca;
  border-radius: 14px;
  background: rgba(244, 251, 249, .97);
  box-shadow: 0 8px 20px rgba(10, 48, 55, .08);
  backdrop-filter: blur(8px);
}
.attendance-bulk > span { min-width: 58px; display: flex; align-items: baseline; justify-content: center; gap: 4px; color: var(--teal); }
.attendance-bulk > span b { font-size: 20px; }
.attendance-bulk > span small { font-size: 12px; font-weight: 700; }
.attendance-bulk button { min-height: 44px; }
.attendance-bulk .primary-button { width: 100%; }
.select-visible-button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.select-visible-button:disabled { opacity: .45; cursor: default; }
.attendance-sync-queue { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 11px 12px; border-radius: 13px; color: #285481; background: #edf5fd; }
.attendance-sync-queue > i { width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid #bad2e8; border-top-color: #285481; border-radius: 50%; animation: spin .8s linear infinite; }
.attendance-sync-queue > span { display: flex; flex-direction: column; }
.attendance-sync-queue strong { font-size: 14px; }
.attendance-sync-queue small { color: #4e6b86; font-size: 12px; }
.attendance-list, .request-list, .document-list { display: grid; gap: 12px; }
.attendance-person {
  padding: 15px;
  border: 1px solid var(--line);
  border-inline-start-width: 4px;
  border-radius: 15px;
  background: var(--surface-2);
}
.attendance-person.arrival-highlight {
  animation: attendance-arrival 1.7s ease both;
  scroll-margin-block: 110px;
}
@keyframes attendance-arrival {
  0%, 100% { box-shadow: none; }
  22%, 72% { box-shadow: 0 0 0 4px rgba(19, 125, 112, .2), 0 12px 28px rgba(13, 53, 61, .12); }
}
.attendance-person.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(19,125,112,.13); }
.attendance-person.approved { border-color: #a6d7ca; background: #f1faf7; }
.attendance-person.incomplete { border-color: #ead098; background: #fffbef; }
.attendance-person.locked { border-color: #d6dfe1; background: #f7f9f9; }
.attendance-person.syncing { border-color: #a9c7e3; background: #f2f7fd; }
.attendance-person.sync-failed { border-color: #e3aeb5; background: #fff7f8; }
.attendance-person[data-category="volunteers"] { border-inline-start-color: #12a15e; }
.attendance-person[data-category="interns"] { border-inline-start-color: #294c8f; }
.attendance-person[data-category="students"] { border-inline-start-color: #3b5ceb; }
.attendance-person > header { display: flex; align-items: center; gap: 10px; }
.attendance-selector { position: relative; width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; cursor: pointer; }
.attendance-selector input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.attendance-selector span { width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid #aec0c3; border-radius: 9px; color: #fff; background: #fff; font-size: 16px; font-weight: 700; transition: .18s ease; }
.attendance-selector input:checked + span::after { content: "✓"; line-height: 1; }
.attendance-person[data-category="volunteers"] .attendance-selector input:checked + span { border-color: #12a15e; background: #12a15e; transform: scale(1.05); }
.attendance-person[data-category="interns"] .attendance-selector input:checked + span { border-color: #294c8f; background: #294c8f; transform: scale(1.05); }
.attendance-person[data-category="students"] .attendance-selector input:checked + span { border-color: #3b5ceb; background: #3b5ceb; transform: scale(1.05); }
.attendance-selector input:focus-visible + span { outline: 3px solid rgba(19,125,112,.22); outline-offset: 2px; }
.person-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.person-copy strong { font-size: 16px; }
.person-copy small { color: var(--muted); font-size: 13px; }
.category-pill, .row-status, .event-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.category-pill.mint { color: #087b46; background: #e5f6ed; }
.category-pill.blue { color: #294c8f; background: #eaf0fb; }
.category-pill.violet { color: #3b5ceb; background: #edf0ff; }
.category-pill svg { width: 16px; height: 16px; }
.row-status.pending { color: var(--teal); background: var(--mint); }
.row-status.approved { color: #fff; background: var(--success); }
.row-status.incomplete { color: var(--warning); background: var(--warning-soft); }
.row-status.locked { color: #52656a; background: #e8edef; }
.row-status.denied { color: var(--danger); background: var(--danger-soft); }
.row-status.syncing { color: #285481; background: #e2eefb; }
.row-status.sync-failed { color: var(--danger); background: var(--danger-soft); }
.attendance-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 13px 0; }
.attendance-meta span { min-width: 0; display: flex; flex-direction: column; padding: 9px; border-radius: 10px; background: #fff; text-align: center; }
.attendance-meta small { color: var(--muted); font-size: 13px; }
.attendance-meta b { font-size: 14px; font-variant-numeric: tabular-nums; }
.attendance-events { display: grid; gap: 7px; margin-bottom: 12px; }
.early-event { padding: 10px; border-radius: 11px; color: #6d5118; background: var(--gold-soft); font-size: 13px; }
.early-event strong { display: block; }
.attendance-sync-error { margin-bottom: 12px; padding: 9px 10px; border-radius: 10px; color: var(--danger); background: var(--danger-soft); font-size: 13px; }
.attendance-time-lock {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #52656a;
  background: #e8edef;
  font-size: 13px;
  font-weight: 600;
}
.attendance-time-lock svg { width: 18px; height: 18px; flex: 0 0 auto; }
.attendance-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.attendance-actions button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; font-size: 14px; font-weight: 700; cursor: pointer; }
.attendance-actions button svg { width: 18px; height: 18px; }
.attendance-actions button:disabled { border-color: #d8e0e2; color: #75868a; background: #edf1f2; cursor: not-allowed; opacity: .82; }
.approve-button { border: 1px solid var(--teal); color: #fff; background: var(--teal); }
.override-button { border: 1px solid #d7b05b; color: #6d4e0e; background: var(--warning-soft); }
.early-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.revoke-button { border: 1px solid #e7c8cc; color: var(--danger); background: #fff; }

.swap-panel { display: none; }
.swap-panel.active { display: block; }
.swap-flow { display: grid; gap: 14px; }
.swap-step, .swap-summary { scroll-margin-top: 92px; }
.swap-step > header { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.swap-step > header > b { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #fff; background: var(--teal); }
.swap-step.step-arrived, .swap-summary.step-arrived { border-color: #7dc5b5; box-shadow: 0 0 0 3px rgba(19,125,112,.12), var(--shadow); }
.choice-grid { display: grid; gap: 9px; }
.choice-grid button {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: right;
  cursor: pointer;
}
.choice-grid button.active { border-color: var(--teal); background: var(--mint); box-shadow: 0 0 0 2px rgba(19, 125, 112, .08); }
.choice-grid strong { font-size: 15px; }
.choice-grid small { color: var(--muted); font-size: 13px; }
.search-field, .upload-panel label { display: grid; gap: 6px; }
.search-field > span, .upload-panel label > span { font-size: 13px; font-weight: 700; }
.search-field input, .upload-panel input, .upload-panel select, .modal-card input, .modal-card textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  outline: none;
}
.selectable-list { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
.selectable-card {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  text-align: right;
  cursor: pointer;
}
.selectable-card.selected { border-color: var(--teal); background: var(--mint); box-shadow: inset 4px 0 var(--teal); }
.selectable-card > span { min-width: 0; display: flex; flex-direction: column; }
.selectable-card strong { font-size: 15px; }
.selectable-card small { color: var(--muted); font-size: 13px; }
.swap-summary-body { display: grid; gap: 8px; margin: 14px 0; }
.swap-compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; }
.swap-side { min-width: 0; padding: 11px; border-radius: 12px; background: var(--surface-2); }
.swap-side small { color: var(--muted); font-size: 13px; }
.swap-side strong { display: block; margin-top: 3px; font-size: 14px; }
.swap-arrow { color: var(--teal); font-weight: 700; }
.request-card { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.request-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.request-card h3 { margin: 0; font-size: 16px; }
.request-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.request-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.request-detail > div { padding: 10px; border-radius: 11px; background: var(--surface-2); }
.request-detail small { color: var(--muted); font-size: 13px; }
.request-detail strong { display: block; font-size: 13px; }
.request-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.request-actions button { min-height: 46px; border-radius: 11px; font-size: 14px; font-weight: 700; cursor: pointer; }
.request-actions .accept { border: 1px solid var(--teal); color: #fff; background: var(--teal); }
.request-actions .reject { border: 1px solid #e8c8cc; color: var(--danger); background: #fff; }
.status-chip { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.status-chip.pending { color: var(--warning); background: var(--warning-soft); }
.status-chip.approved { color: var(--success); background: var(--mint); }
.status-chip.rejected { color: var(--danger); background: var(--danger-soft); }

.profile-hero { display: flex; align-items: center; gap: 14px; }
.profile-hero > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.profile-hero small { color: var(--teal); font-size: 13px; font-weight: 700; }
.profile-hero h2 { margin: 2px 0; font-size: 21px; }
.profile-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.profile-grid { margin-top: 14px; }
.profile-item { min-height: 78px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.profile-item span { display: block; color: var(--muted); font-size: 13px; }
.profile-item strong { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 15px; }
.profile-info { margin-top: 14px; }
.profile-info h3 { margin: 0 0 12px; font-size: 17px; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.permission-tags span { padding: 7px 9px; border-radius: 999px; color: #2e675d; background: var(--mint); font-size: 13px; }

.profile-completion { margin-top: 14px; padding: 18px; }
.profile-completion > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.profile-completion h3 { margin: 2px 0 3px; font-size: 18px; }
.profile-completion p { margin: 0; color: var(--muted); font-size: 13px; }
.completion-percent {
  min-width: 70px;
  padding: 8px 10px;
  border-radius: 14px;
  color: var(--teal-dark);
  background: var(--mint);
  font-size: 25px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.document-readiness-rail { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; margin: 18px 0 15px; }
.document-readiness-rail span { min-width: 0; height: 10px; border-radius: 999px; background: #dfe8e7; }
.document-readiness-rail span.approved { background: var(--success); }
.document-readiness-rail span.pending { background: var(--gold); }
.document-readiness-rail span.rejected, .document-readiness-rail span.expired { background: var(--danger); }
.document-readiness-rail span.missing { background: #dfe8e7; box-shadow: inset 0 0 0 1px #c6d5d3; }
.completion-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.completion-metrics span { min-width: 0; padding: 10px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.completion-metrics small { display: block; color: var(--muted); font-size: 12px; }
.completion-metrics b { display: block; margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; }
.profile-missing-docs { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0; }
.profile-missing-docs:empty { display: none; }
.profile-missing-docs span { padding: 6px 8px; border-radius: 999px; color: #8a4c16; background: var(--warning-soft); font-size: 12px; font-weight: 700; }

.document-card { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.document-card.missing { border-style: dashed; box-shadow: none; }
.document-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.document-card h3 { margin: 0; font-size: 16px; }
.document-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.document-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.document-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.document-actions a, .document-actions button { min-height: 44px; display: grid; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.upload-panel { margin-top: 16px; }
.upload-panel form { display: grid; gap: 14px; margin-top: 16px; }
.upload-panel label small { color: var(--muted); font-size: 13px; }
.file-field input { padding: 9px; }
.upload-progress { display: grid; gap: 7px; }
.upload-progress > i { height: 8px; overflow: hidden; border-radius: 999px; background: #e5eeee; }
.upload-progress > i span { display: block; width: 20%; height: 100%; border-radius: inherit; background: var(--teal); transition: width .25s ease; }
.upload-progress b { color: var(--muted); font-size: 13px; }
.form-message { padding: 11px; border-radius: 11px; font-size: 14px; font-weight: 600; }
.form-message.good { color: var(--success); background: var(--mint); }
.form-message.bad { color: var(--danger); background: var(--danger-soft); }

.staff-file-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.staff-file-overview article { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.staff-file-overview small { display: block; color: var(--muted); font-size: 12px; }
.staff-file-overview strong { display: block; margin-top: 4px; color: var(--navy); font-size: 24px; font-variant-numeric: tabular-nums; }
.staff-files-panel { padding: 16px; }
.staff-files-toolbar { display: grid; gap: 10px; margin-bottom: 16px; }
.staff-files-toolbar .outline-button { width: 100%; }
.staff-file-list { display: grid; gap: 10px; }
.staff-file-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--warning);
  border-radius: 15px;
  background: #fff;
}
.staff-file-card.complete { border-inline-start-color: var(--success); }
.staff-file-card.action { border-inline-start-color: var(--danger); }
.staff-file-toggle {
  width: 100%;
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 0;
  color: var(--ink);
  background: #fff;
  text-align: right;
  cursor: pointer;
}
.staff-file-toggle:hover { background: #fbfdfd; }
.staff-file-heading { min-width: 0; }
.staff-file-heading strong { display: block; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.staff-file-heading small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.staff-file-heading p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.staff-file-score { min-width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; color: var(--teal-dark); background: var(--mint); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.staff-file-card.action .staff-file-score { color: var(--danger); background: var(--danger-soft); }
.staff-file-card .document-readiness-rail { margin: 0 14px 14px; }
.staff-file-detail { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.staff-file-detail[hidden] { display: none; }
.staff-file-detail > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; }
.staff-file-detail > header strong { font-size: 14px; }
.staff-file-detail > header span { color: var(--muted); font-size: 12px; }
.staff-document-grid { display: grid; gap: 7px; }
.staff-document-item {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}
.staff-document-item > span { min-width: 0; }
.staff-document-item strong { display: block; font-size: 13px; }
.staff-document-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.staff-document-item > b, .staff-document-item > a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.staff-document-item > b { color: var(--muted); background: #fff; }
.staff-document-item.approved > b, .staff-document-item.approved > a { color: var(--success); background: var(--mint); }
.staff-document-item.pending > b, .staff-document-item.pending > a { color: #8a5b13; background: var(--warning-soft); }
.staff-document-item.rejected > b, .staff-document-item.expired > b,
.staff-document-item.rejected > a, .staff-document-item.expired > a { color: var(--danger); background: var(--danger-soft); }

.information-hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; margin-bottom: 16px; padding: 22px; border-radius: var(--radius); color: #fff; background: var(--navy); }
.information-hero span { color: #91d7c7; font-size: 13px; font-weight: 700; }
.information-hero h2 { margin: 3px 0; font-size: 25px; }
.information-hero p { margin: 0; color: #c9d9dc; font-size: 14px; }
.information-hero > svg { width: 56px; height: 56px; padding: 13px; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; color: #9edccd; }
.resource-grid { display: grid; gap: 12px; }
.resource-card { min-height: 94px; display: flex; align-items: center; gap: 13px; padding: 16px; text-align: right; cursor: pointer; }
button.resource-card { width: 100%; color: inherit; }
.resource-card > svg { width: 44px; height: 44px; flex: 0 0 auto; padding: 10px; border-radius: 13px; color: var(--teal); background: var(--mint); }
.resource-card > span { display: flex; flex-direction: column; }
.resource-card strong { font-size: 16px; }
.resource-card small { color: var(--muted); font-size: 13px; }

.doctor-directory header { display: grid; gap: 11px; }
.doctor-directory h3 { margin: 0; font-size: 18px; }
#permissionDoctorList { display: grid; gap: 7px; max-height: 540px; margin-top: 13px; overflow-y: auto; }
.directory-row { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid transparent; border-radius: 12px; background: var(--surface-2); text-align: right; cursor: pointer; }
.directory-row.active { border-color: #9bcfc3; background: var(--mint); }
.directory-row > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.directory-row strong { font-size: 14px; }
.directory-row small { color: var(--muted); font-size: 13px; }
.editor-person { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.editor-person > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.editor-person strong { font-size: 16px; }
.editor-person small { color: var(--muted); font-size: 13px; }
.version-chip { padding: 5px 8px; border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 13px; }
.permission-group { margin-top: 16px; }
.permission-group > span { color: var(--teal); font-size: 13px; font-weight: 700; }
.permission-options { display: grid; gap: 8px; margin-top: 9px; }
.permission-option { min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.permission-option input { width: 21px; height: 21px; accent-color: var(--teal); }
.permission-option span { display: flex; flex-direction: column; }
.permission-option strong { font-size: 14px; }
.permission-option small { color: var(--muted); font-size: 13px; }
.permission-option.disabled { opacity: .48; cursor: not-allowed; }

.audit-toolbar { display: grid; gap: 10px; margin-bottom: 16px; }
.select-field { display: grid; gap: 5px; }
.select-field > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.select-field select { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; }
.audit-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.audit-stats > span { min-width: 0; display: flex; flex-direction: column; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.audit-stats small { color: var(--muted); font-size: 12px; }
.audit-stats b { font-size: 21px; }
.audit-list { display: grid; gap: 10px; }
.audit-entry { position: relative; padding: 14px; border: 1px solid var(--line); border-inline-start-width: 4px; border-radius: 14px; background: var(--surface-2); }
.audit-entry.attendance { border-inline-start-color: var(--teal); }
.audit-entry.early { border-inline-start-color: var(--gold); }
.audit-entry.permissions { border-inline-start-color: var(--blue); }
.audit-entry > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.audit-entry > header > div { min-width: 0; }
.audit-entry h3 { margin: 0; font-size: 16px; }
.audit-entry header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.audit-type { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: var(--teal); background: var(--mint); font-size: 11px; font-weight: 700; }
.audit-entry.early .audit-type { color: #805912; background: var(--gold-soft); }
.audit-entry.permissions .audit-type { color: #315c83; background: #eaf2fb; }
.audit-details { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.audit-details span { padding: 5px 8px; border-radius: 8px; color: #465f64; background: #fff; font-size: 12px; }
.audit-reason { margin: 10px 0 0; padding: 9px 10px; border-radius: 10px; color: #5f4b21; background: #fff8e8; font-size: 13px; }
.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.editor-actions small { color: var(--muted); font-size: 13px; }
.access-denied, .empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 16px; text-align: center; }
.access-denied > b { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: var(--danger); background: var(--danger-soft); font-size: 22px; }
.empty-state > svg { width: 48px; height: 48px; padding: 11px; border-radius: 14px; color: var(--teal); background: var(--mint); }
.access-denied h2, .empty-state strong { margin: 13px 0 4px; font-size: 18px; }
.access-denied p, .empty-state p { max-width: 480px; margin: 0; color: var(--muted); font-size: 14px; }
.empty-state.compact { padding: 34px 12px; }
.empty-inline { padding: 18px; border-radius: 12px; color: var(--muted); background: var(--surface-2); font-size: 14px; text-align: center; }

.view-loading { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.view-loading i { width: 32px; height: 32px; border: 3px solid var(--mint-2); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
.swap-target-loading { min-height: 180px; border: 1px dashed #c9dad7; border-radius: 14px; background: var(--surface-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-row { min-height: 58px; border-radius: 12px; background: linear-gradient(90deg, #edf2f1 25%, #f8faf9 45%, #edf2f1 65%); background-size: 240% 100%; animation: shimmer 1.3s ease infinite; }
.skeleton-value { position: relative; overflow: hidden; }
.skeleton-value::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent); transform: translateX(-100%); animation: shimmer-move 1.2s infinite; }
@keyframes shimmer { to { background-position: -240% 0; } }
@keyframes shimmer-move { to { transform: translateX(100%); } }

.app-footer { display: none; }
.mobile-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(68px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 5px 6px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -10px 28px rgba(10, 46, 54, .09);
  backdrop-filter: blur(16px);
}
.mobile-nav a, .mobile-nav button { position: relative; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 3px; border: 0; color: #71858a; background: transparent; cursor: pointer; }
.mobile-nav svg { width: 23px; height: 23px; }
.mobile-nav small { font-size: 13px; font-weight: 600; }
.mobile-nav .active { color: var(--teal); }
.mobile-nav b { position: absolute; top: 1px; left: 18%; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--danger); font-size: 10px; }

.sheet-backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(5, 31, 38, .58); }
.more-sheet {
  position: fixed;
  z-index: 75;
  right: 0;
  bottom: 0;
  left: 0;
  height: min(92dvh, 780px);
  max-height: 780px;
  display: flex;
  flex-direction: column;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(110%);
  transition: transform .22s ease;
}
.more-sheet.open { transform: translateY(0); }
.more-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.more-sheet > header > div { display: flex; align-items: center; gap: 10px; }
.more-sheet > header img { width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 13px; object-fit: contain; }
.more-sheet > header span:last-child { display: flex; flex-direction: column; }
.more-sheet > header small { color: var(--muted); font-size: 13px; }
.more-sheet > header button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--surface-2); font-size: 25px; cursor: pointer; }
.more-scroll { min-height: 0; overflow-y: auto; padding: 2px 1px 12px; overscroll-behavior: contain; }
.more-group { margin-top: 15px; }
.more-group h3 { margin: 0 2px 7px; color: var(--muted); font-size: 13px; }
.more-sheet nav { display: grid; gap: 8px; margin: 0; }
.more-sheet nav button, .more-sheet nav a { min-height: 68px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-size: 14px; font-weight: 700; text-align: right; cursor: pointer; }
.more-sheet nav svg { width: 24px; height: 24px; color: var(--teal); }
.more-sheet nav span { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.more-sheet nav span small { color: var(--muted); font-size: 12px; font-weight: 500; }
.more-sheet nav > button > b, .more-sheet nav > a > b { color: var(--teal); font-size: 22px; font-weight: 400; }
.logout-sheet { width: 100%; min-height: 48px; flex: 0 0 auto; margin-top: 8px; border: 1px solid #ebcdd1; border-radius: 12px; color: var(--danger); background: #fff; font-weight: 700; cursor: pointer; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: end center; padding: 14px; background: rgba(5, 29, 37, .7); backdrop-filter: blur(4px); }
.modal-card { width: min(100%, 500px); max-height: calc(100dvh - 28px); overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 24px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-lg); text-align: center; }
.modal-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; color: var(--teal); background: var(--mint); font-size: 20px; }
.modal-card h2 { margin: 13px 0 5px; font-size: 21px; }
.modal-card > p { margin: 0; color: var(--muted); font-size: 15px; }
.modal-card label { width: 100%; display: grid; gap: 6px; margin-top: 14px; text-align: right; }
.modal-card label span { font-size: 13px; font-weight: 700; }
.modal-card textarea { min-height: 96px; resize: vertical; }
.modal-card > div { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.toast { position: fixed; z-index: 130; right: 16px; bottom: calc(80px + var(--safe-bottom)); left: 16px; display: flex; align-items: center; gap: 10px; padding: 13px; border-radius: 15px; color: #fff; background: var(--navy); box-shadow: var(--shadow-lg); animation: toast-in .22s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.toast > b { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--navy); background: #a7ddcf; }
.toast > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.toast strong { font-size: 15px; }
.toast small { color: #c4d5d8; font-size: 13px; }
.toast button { width: 42px; height: 42px; border: 0; color: #c4d5d8; background: transparent; font-size: 22px; cursor: pointer; }

@media (min-width: 560px) {
  .content { padding-inline: 22px; }
  .dashboard-grid, .profile-grid, .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attendance-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { place-items: center; }
  .toast { right: auto; width: 390px; }
}

@media (min-width: 821px) {
  body { font-size: 15px; }
  .portal-shell { display: flex; }
  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    right: 0;
    bottom: 0;
    width: 250px;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    color: #dcebec;
    background: var(--navy);
  }
  .brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 19px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .brand-mark { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: var(--navy); background: #a9dccc; font-size: 17px; font-weight: 700; }
  .brand > span:last-child { display: flex; flex-direction: column; }
  .brand strong { color: #fff; font-size: 16px; }
  .brand small { color: #91aeb2; font-size: 13px; }
  .sidebar-shift { margin: 17px 0 13px; padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.05); }
  .sidebar-shift > small { color: #8fb0b3; font-size: 13px; }
  .sidebar-shift > strong { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
  .sidebar-shift > strong b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--navy); background: #acdace; }
  .sidebar-shift > strong span { color: #fff; font-size: 13px; }
  .sidebar-shift p { margin: 6px 0 0; color: #9bb5b8; font-size: 13px; }
  .side-nav { display: grid; gap: 3px; overflow-y: auto; }
  .side-nav a { position: relative; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; color: #afc5c8; font-size: 13px; font-weight: 600; }
  .side-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
  .side-nav a.active { color: #fff; background: rgba(136, 207, 188, .16); box-shadow: inset -3px 0 #8fd2c0; }
  .side-nav svg { width: 20px; height: 20px; }
  .side-nav .nav-count { position: absolute; left: 8px; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; color: var(--navy); background: #d9c272; font-size: 11px; }
  .sidebar-profile { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
  .sidebar-profile > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
  .sidebar-profile strong { overflow: hidden; color: #fff; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-profile small { color: #91aeb2; font-size: 13px; }
  .sidebar-profile button { min-width: 42px; height: 38px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: #d3e1e3; background: transparent; font-size: 13px; cursor: pointer; }
  .app-main { width: calc(100% - 250px); margin-right: 250px; padding-bottom: 0; }
  .topbar { min-height: 76px; padding: 10px clamp(28px, 4vw, 48px); }
  .topbar h1 { font-size: 21px; }
  .sync-state { height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 13px; }
  .sync-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
  .sync-state.loading i { animation: pulse 1.1s infinite; }
  .sync-state.offline i { background: var(--danger); }
  @keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }
  .content { padding: 28px clamp(28px, 4vw, 48px) 36px; }
  .environment-banner, .connection-message { margin-inline: clamp(28px, 4vw, 48px); }
  .live-clock { display: flex; flex-direction: column; align-items: flex-end; }
  .live-clock strong { font-size: 28px; font-variant-numeric: tabular-nums; }
  .live-clock span { color: var(--muted); font-size: 13px; }
  .dashboard-grid { grid-template-columns: 1.2fr .8fr; }
  .shift-card, .action-card, .team-card, .next-card, .overview-card, .quick-panel, .schedule-card, .team-directory-card,
  .attendance-card, .doctor-directory, .permission-editor, .profile-info, .swap-step, .swap-summary, .upload-panel, .audit-card { padding: 21px; }
  .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-actions button { min-height: 108px; }
  .attendance-stats, .document-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .attendance-toolbar { display: flex; align-items: center; justify-content: space-between; }
  .attendance-person { display: grid; grid-template-columns: minmax(210px, 1.5fr) minmax(220px, 1fr) minmax(190px, auto); align-items: center; gap: 16px; }
  .attendance-person > header { min-width: 0; }
  .attendance-person .attendance-meta { margin: 0; }
  .attendance-person .attendance-side { min-width: 0; }
  .attendance-actions { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .swap-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swap-summary { grid-column: 1 / -1; }
  .request-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .document-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-files-toolbar { grid-template-columns: minmax(260px, 1fr) minmax(190px, auto) auto; align-items: end; }
  .staff-file-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); }
  .permission-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-toolbar { grid-template-columns: minmax(260px, 1fr) minmax(190px, auto) auto; align-items: end; }
  .audit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-footer { display: flex; justify-content: space-between; padding: 0 clamp(28px, 4vw, 48px) 24px; color: #7b8d91; font-size: 13px; }
  .mobile-nav, .more-sheet, .sheet-backdrop { display: none !important; }
  .toast { bottom: 24px; }
}

@media (min-width: 1180px) {
  .sidebar { width: 270px; }
  .app-main { width: calc(100% - 270px); margin-right: 270px; }
  .document-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .topbar { padding-inline: 12px; }
  .content { padding-inline: 12px; }
  .topbar h1 { font-size: 18px; }
  .welcome-strip h2 { font-size: 23px; }
  .page-intro { flex-direction: column; }
  .page-intro > button { width: 100%; }
  .schedule-card, .swap-step { padding-inline: 10px; }
  .shift-calendar { padding: 9px; border-radius: 14px; }
  .calendar-weekdays, .calendar-days { gap: 4px; }
  .calendar-weekdays span { font-size: 11px; }
  .calendar-cell, .shift-calendar-host.compact .calendar-cell { min-height: 58px; padding-inline: 2px; border-radius: 10px; }
  .calendar-day-number { font-size: 12px; }
  .calendar-shift { min-width: 27px; min-height: 27px; font-size: 12px; }
  .attendance-bulk { grid-template-columns: auto 1fr; top: 70px; }
  .attendance-bulk > span { order: -1; justify-self: start; }
  .attendance-bulk .primary-button { grid-column: 1 / -1; }
  .attendance-meta { gap: 5px; }
  .attendance-meta span { padding-inline: 5px; }
  .profile-hero { flex-wrap: wrap; }
  .profile-hero .outline-button { width: 100%; }
  .profile-completion > header { align-items: center; }
  .completion-percent { min-width: 62px; font-size: 22px; }
  .staff-file-overview article { padding-inline: 10px; }
  .staff-file-overview strong { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
