/* Duke Housekeeping: hotel sage palette; room-status colours retain their meaning. */
body.duke-ui {
  --surface: #fff;
  --sage: #9caf88;
  --sage-ink: #293b2d;
  --blue: #496247;
  --blue-dark: #293b2d;
  --accent: #9caf88;
  --bg: #f6f6f1;
  --text: #2d382f;
  --muted: #65715f;
  --border: #dfe5d9;
  background: #f6f6f1;
  font-family: "Segoe UI", var(--app-font, Arial), sans-serif;
  color: var(--text);
}
.duke-ui.has-sidebar { padding-left: 248px; }
.duke-ui .topbar {
  min-height: 114px; padding: 22px 28px; gap: 16px;
  background: var(--sage); color: var(--sage-ink); border-bottom: 4px solid #899d76;
  box-shadow: none; position: relative; flex-wrap: wrap; flex-direction: row; align-items: center;
}
.workspace-heading { display: grid; gap: 5px; min-width: 180px; flex: 1; }
.workspace-heading > span { font-size: .83rem; color: #33462f; }
.workspace-heading > strong { font-size: 1.12rem; color: var(--sage-ink); }
.duke-ui .topbar .language-form { margin-left: auto; }
.duke-ui .topbar .language-label { min-width: 120px; color: var(--sage-ink); }
.duke-ui .topbar .language-label select { border: 0; color: #293b2d; min-height: 38px; }
.duke-ui .topbar .button { min-height: 42px; background: #fff; color: #344f35; border: 1px solid #fff; font-size: .86rem; }
.duke-ui .topbar .top-message-button { background: #ffffff40; color: var(--sage-ink); border-color: #ffffff65; }
.duke-ui .userbox { gap: 12px; color: var(--sage-ink); }
.duke-ui .userbox > span { max-width: 180px; overflow-wrap: anywhere; font-size: .8rem; }
.duke-ui .topbar .nav-toggle { display: none; }
.duke-ui .app-shell { width: 100%; margin: 0; display: block; }
.duke-ui .app-main, .duke-ui .app-shell .container { width: 100%; margin: 0; padding: 26px 28px 40px; min-width: 0; }
.duke-ui .sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; height: 100dvh;
  margin: 0; padding: 24px 12px 32px; background: #2d332e; color: white;
  overflow-y: auto; scrollbar-width: thin; z-index: 20;
}
.duke-ui .sidebar .brand { padding: 2px 10px 19px; min-width: 0; align-items: center; }
.duke-ui .sidebar .brand strong { font-size: 1.03rem; line-height: 1.25; display: block; }
.duke-ui .sidebar .brand span { font-size: .75rem; color: #c2ccbb; }
.duke-ui .sidebar .brand .brand-mark { flex: 0 0 42px; border-radius: 12px; background: var(--sage); color: var(--sage-ink); font-size: 1rem; }
.duke-ui .sidebar .brand-logo { width: 48px; max-height: 62px; object-fit: contain; }
.sidebar-system-label { margin: 0 9px 12px; border-top: 1px solid #ffffff17; padding-top: 14px; color: #b2bea9; font-size: .73rem; }
.duke-ui .side-nav { padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; gap: 3px; display: flex; flex-direction: column; }
.duke-ui .side-nav-section { color: #acb8a4; font-size: .64rem; letter-spacing: .12em; margin: 18px 12px 6px; }
.duke-ui .side-link { border: 0; border-radius: 9px; min-height: 42px; padding: 10px 13px; font-size: .88rem; font-weight: 500; color: #e3e8df; gap: 8px; }
.duke-ui .side-link::after { content: "›"; margin-left: auto; color: #adbaa3; font-size: 1.2rem; line-height: 1; }
.duke-ui .side-link:hover { background: #ffffff0e; color: white; }
.duke-ui .side-link.active { background: #dce7d3; color: #293b2d; font-weight: 700; box-shadow: none; }
.duke-ui .side-link.active::after { color: #496247; }
.duke-ui .page-header { align-items: center; margin-bottom: 22px; }
.duke-ui .page-header h1 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); font-weight: 700; letter-spacing: -.025em; }
.duke-ui .page-header p { max-width: 68ch; font-size: .94rem; }
.duke-ui .panel { padding: 24px; border-radius: 20px; border: 1px solid #e3e7dd; box-shadow: 0 8px 26px #1a304808; margin-bottom: 20px; min-width: 0; }
.duke-ui .panel h2 { font-size: 1.04rem; color: #496247; }
.duke-ui .button { border-radius: 10px; min-height: 44px; font-family: inherit; }
.duke-ui .button.primary { background: var(--sage); color: var(--sage-ink); }
.duke-ui .button.secondary { background: #e9eee2; color: #344f35; }
.duke-ui input, .duke-ui select, .duke-ui textarea { border-color: #cbd5c2; border-radius: 9px; min-width: 0; }
.duke-ui input:not([type=checkbox]):not([type=radio]), .duke-ui select { min-height: 44px; }
.duke-ui input[type=checkbox], .duke-ui input[type=radio] { width: 20px; height: 20px; accent-color: #526b49; flex-shrink: 0; }
.duke-ui :focus-visible { outline: 3px solid #526b49; outline-offset: 3px; }
.duke-ui .grid-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; }
.duke-ui .grid-form label { font-size: .9rem; }
.duke-ui .grid-form small { color: var(--muted); font-weight: 400; line-height: 1.5; }
.duke-ui .grid-form > button { justify-self: start; align-self: end; }
.duke-ui .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.duke-ui th { background: #e6eddd; color: #344f35; border-bottom: 1px solid #ccd8c0; }
.duke-ui th:first-child { border-radius: 10px 0 0 0; }
.duke-ui th:last-child { border-radius: 0 10px 0 0; }
.dashboard-eyebrow { display: block; color: #496247; text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 700; margin-bottom: 5px; }
.dashboard-overview { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 16px; margin-bottom: 16px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.overview-metric { background: white; border: 1px solid #e3e7dd; border-radius: 20px; padding: 22px 10px 18px; text-align: center; box-shadow: 0 8px 26px #1a304808; }
.overview-metric h2 { font-size: .86rem; font-weight: 650; margin: 0 0 18px; min-height: 2.5em; display: grid; place-items: center; }
.overview-metric p { color: var(--muted); font-size: .75rem; margin: 14px 0 0; }
.metric-pending { --metric-colour: #c84456; }
.metric-started { --metric-colour: #b98010; }
.metric-completed { --metric-colour: #228a69; }
.metric-unallocated { --metric-colour: #778794; }
.metric-ring { width: min(132px,100%); aspect-ratio: 1; margin: auto; border-radius: 50%; background: conic-gradient(var(--metric-colour) var(--portion),#edf1f4 0); display: grid; place-items: center; position: relative; }
.metric-ring::before { content: ""; position: absolute; inset: 12px; background: white; border-radius: 50%; }
.metric-ring strong { font-size: clamp(1.8rem,2.4vw,2.7rem); color: var(--metric-colour); line-height: 1; z-index: 1; font-weight: 750; }
.dashboard-briefing { background: white; border: 1px solid #e3e7dd; border-radius: 20px; box-shadow: 0 8px 26px #1a304808; padding: 20px; display: grid; gap: 12px; }
.dashboard-briefing > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #edf1f4; padding-bottom: 12px; }
.dashboard-briefing span { color: #5b6b54; font-size: .8rem; }
.dashboard-briefing strong { font-size: 1.35rem; }
.dashboard-briefing .briefing-date { display: grid; gap: 3px; }
.dashboard-briefing .briefing-date span { color: #496247; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 700; }
.dashboard-briefing .briefing-date strong { font-size: 1rem; font-weight: 650; }
.dashboard-briefing .needs-attention strong { color: #a06600; }
.cleaning-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.type-check { --type-colour: #7451b7; --type-bg: #f0eafa; }
.type-stay { --type-colour: #087c80; --type-bg: #e5f5f3; }
.type-change { --type-colour: #286cb1; --type-bg: #e8f1fb; }
.type-public { --type-colour: #656b77; --type-bg: #edf0f4; }
.cleaning-summary-item { display: flex; align-items: center; gap: 10px; padding: 14px 17px; border-radius: 13px; background: var(--type-bg); color: var(--type-colour); font-size: .87rem; font-weight: 650; }
.cleaning-summary-item strong { margin-left: auto; font-size: 1.35rem; }
.type-dot { background: var(--type-colour); border-radius: 50%; width: 9px; height: 9px; flex: 0 0 9px; }
.duke-ui .status-legend { background: transparent; border: 0; font-size: .76rem; padding: 0 2px; margin-bottom: 20px; }
.duke-ui .allocation-alert-panel { border-width: 1px; border-radius: 15px; padding: 16px 20px; box-shadow: none; }
.duke-ui .allocation-alert-panel h2 { font-size: 1rem; }
.duke-ui .allocation-alert-panel p { font-size: .85rem; }
.duke-ui .dashboard-workspace { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 20px; align-items: start; }
.duke-ui .dashboard-job-card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 18px; }
.duke-ui .dashboard-job-card { min-width: 0; border-radius: 15px; box-shadow: 0 3px 12px #273e5008; }
.duke-ui .dashboard-job-card.job-pending { border-left: 5px solid #c84456; background: #fff; }
.duke-ui .dashboard-job-card.job-started { border-left: 5px solid #bf8b23; background: #fff; }
.duke-ui .dashboard-job-card.job-completed { border-left: 5px solid #228a69; background: #f7fcf9; }
.duke-ui .dashboard-job-card.job-unallocated { border-left: 5px solid #8d9ca6; background: #fff; }
.duke-ui .dashboard-job-card[data-unallocated-job-card="1"] { outline: 0; }
.duke-ui .job-room-number { font-size: 1.75rem; color: #344c35; }
.cleaning-type-badge { display: inline-block; border-radius: 6px; padding: 3px 8px; font-size: .72rem; font-weight: 700; color: var(--type-colour); background: var(--type-bg); }
.duke-ui .job-card-meta-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.duke-ui .job-card-meta-grid strong { overflow-wrap: anywhere; }
.duke-ui .job-card-meta-grid .bed-change-highlight { background: #fff1c8; border-radius: 9px; padding: 8px; border: 1px solid #efcb6b; }
.bed-change-highlight small { display: block; color: #815500; font-weight: 650; margin-top: 3px; }
.duke-ui .dashboard-manager-panel { padding: 16px; }
.duke-ui .dashboard-manager-panel .bulk-panel-heading p { font-size: .85rem; }
.duke-ui .allocation-step-three { border: 1px solid #c5d2b7; background: #f0f4e9; }
.duke-ui .allocation-step-card { border: 1px solid #d0dbc4; background: #f8faf4; }
.duke-ui .allocation-staff-field, .duke-ui .allocation-staff-picker { border-color: #c5d2b7 !important; background: #f8faf4; }
.duke-ui .step-pill { display: inline-flex; width: fit-content; background: #496247; color: #fff; }
.duke-ui .topbar > .brand { color: var(--sage-ink); }
.duke-ui .topbar .brand-mark { background: #f5f8ef; color: var(--sage-ink); }
.duke-ui .group-button-row [data-bulk-room-group] {
  display: grid; justify-items: start; align-content: start; gap: 5px;
  min-width: 155px; max-width: 100%; min-height: 90px; padding: 12px 15px;
  text-align: left; white-space: normal; border: 2px solid transparent;
}
.duke-ui [data-bulk-room-group] > span:first-child { font-size: .88rem; font-weight: 750; }
.duke-ui [data-bulk-room-group] > small { display: block; margin: 0; font-size: .74rem; line-height: 1.35; font-weight: 550; }
.duke-ui [data-bulk-room-group] .group-selection-state {
  display: inline-flex; align-items: center; font-size: .76rem; font-weight: 750;
  padding: 3px 7px; border-radius: 5px; background: #ffffff80; line-height: 1.35;
}
.duke-ui [data-bulk-room-group].group-selected {
  background: #496247 !important; color: #fff !important; border-color: #31452f !important;
  box-shadow: 0 0 0 3px #d1dfc5;
}
.duke-ui [data-bulk-room-group].group-selected .group-selection-state { background: #ffffff26; color: #fff; }
.duke-ui [data-bulk-room-group].group-part-selected {
  background: #e4ecd9 !important; color: #31452f !important; border: 2px dashed #496247 !important;
}
.duke-ui .group-selection-help { color: #566550; font-size: .84rem; margin: 8px 0 0; font-weight: 400; }
.duke-ui .bulk-selection-summary { margin: 10px 0 0; padding: 10px 13px; border-radius: 8px; font-weight: 700; color: #617159; background: #f0f3eb; }
.duke-ui .bulk-selection-summary.has-selection { background: #dce7d3; color: #293b2d; border-left: 4px solid #496247; }
.duke-ui .dashboard-job-card.selection-active { outline: 3px solid #607952; outline-offset: 2px; }
.duke-ui .job-status-table tr.selection-active td { background: #e4ecd9; }
.duke-ui .job-status-table tr.selection-active td:first-child { box-shadow: inset 4px 0 #496247; }
.duke-ui .save-staff-selected-button { box-shadow: none; min-width: 0; }
@media (max-width: 1500px) {
  .dashboard-overview { grid-template-columns: minmax(0,1fr); }
  .dashboard-briefing { grid-template-columns: repeat(3,minmax(0,1fr)) auto; align-items: center; padding: 15px 20px; }
  .dashboard-briefing > div { border: 0; padding: 0; }
  .duke-ui .dashboard-workspace { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 1120px) {
  .duke-ui.has-sidebar { padding-left: 0; }
  .duke-ui .topbar { min-height: 100px; padding: 18px 20px; }
  .duke-ui .sidebar { position: static; width: 100%; height: auto; max-height: 55vh; padding: 12px 18px; }
  .duke-ui .sidebar .brand, .duke-ui .sidebar-system-label { display: none; }
  .duke-ui .side-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .duke-ui .side-nav-section { grid-column: 1 / -1; }
  .duke-ui.nav-ready .sidebar { display: none; }
  .duke-ui.nav-ready.nav-open .sidebar { display: block; }
  .duke-ui.nav-ready.has-sidebar .topbar .nav-toggle { display: inline-flex; gap: 8px; }
  .duke-ui .app-main, .duke-ui .app-shell .container { padding: 22px 20px 36px; }
  .duke-ui .userbox { margin-left: auto; }
}
@media (max-width: 700px) {
  .duke-ui .topbar { gap: 12px; padding: 14px; }
  .workspace-heading { min-width: 160px; }
  .duke-ui .topbar .language-form { margin-left: 0; }
  .duke-ui .userbox { flex-wrap: wrap; }
  .duke-ui .app-main, .duke-ui .app-shell .container { padding: 18px 12px 30px; }
  .duke-ui .side-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .duke-ui .panel { padding: 18px; border-radius: 16px; }
  .dashboard-metrics, .cleaning-summary, .dashboard-briefing { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-briefing .button { white-space: normal; }
  .overview-metric { padding: 18px 10px; }
  .overview-metric h2 { margin-bottom: 12px; }
  .metric-ring { width: 110px; }
  .cleaning-summary-item { padding: 12px; gap: 7px; font-size: .8rem; }
  .duke-ui .grid-form { grid-template-columns: minmax(0,1fr); }
  .duke-ui .page-header .inline-form { margin-top: 14px; }
  .duke-ui .page-header .inline-form .button { white-space: normal; }
  .duke-ui .dashboard-job-card-grid { grid-template-columns: minmax(0,1fr); }
}
@media print {
  .duke-ui.has-sidebar { padding: 0; }
  .duke-ui .sidebar, .duke-ui .topbar { display: none; }
  .duke-ui .panel, .overview-metric { box-shadow: none; break-inside: avoid; }
}

/* A selected floor must stand apart from its saved allocation colour. */
.duke-ui .schedule-room-group-button {background:#f4f6ef!important;color:#344f35!important;border-color:#cbd5c2!important;display:flex;flex-direction:column;gap:5px;min-height:58px;text-align:left}
.duke-ui .schedule-room-group-button.selected-group {background:#496247!important;color:#fff!important;border-color:#31452f!important;box-shadow:0 0 0 3px #d1dfc5}
.duke-ui .schedule-room-group-button.part-selected-group {background:#e4ecd9!important;color:#31452f!important;border:2px dashed #496247!important}
.duke-ui .schedule-room-group-button:disabled {opacity:.6;cursor:not-allowed}
.duke-ui .schedule-room-group-button .group-selection-state {font-size:.78rem;font-weight:700}
.duke-ui .room-check.selection-active {background:#e4ecd9;outline:2px solid #496247;outline-offset:-2px}
