/* Calm daily workspace. Marketing, operator panel and calculations stay separate. */
body:not(.auth-entry) { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: #f4f7fa; color: #172d44; --shadow-panel: none; --shadow-card: none; --surface-card: #fff; --border: #d9e1ea; --radius-panel: 12px; }
body:not(.auth-entry) > .container { max-width: 1220px; }
body:not(.auth-entry) .app-header { margin-bottom: 16px !important; }
body:not(.auth-entry) .brand { letter-spacing: 0; }
body:not(.auth-entry) .brand-logo-wrap { width: 145px; height: 56px; }
body:not(.auth-entry) .ctx-company { font-size: 14px; }
body:not(.auth-entry) .ctx-user { font-size: 12px; font-weight: 400; }
body:not(.auth-entry) .card::before, body:not(.auth-entry) .nav-pills::before { display: none; }
body:not(.auth-entry) .card, body:not(.auth-entry) .nav-pills { background: #fff; box-shadow: none; }
body:not(.auth-entry) .nav-pills { padding: 0; gap: 5px; border: 0; }
body:not(.auth-entry) .nav-pills .nav-link { min-height: 44px; padding: 10px 14px; font-size: 14px; border-radius: 7px; }
body:not(.auth-entry) .btn-dark, body:not(.auth-entry) .nav-pills .nav-link.active, body:not(.auth-entry) .nav-item.dropdown.open .dropdown-toggle { background: #0a326c; color: #fff; box-shadow: none; }
body:not(.auth-entry) .btn-dark:hover { background: #174776; }
body:not(.auth-entry) .nav-icon { color: currentColor; }
body:not(.auth-entry) .page-title { font-size: 23px; letter-spacing: -.03em; }
body:not(.auth-entry) .page-title-badge { background: #eef4fa; color: #174776; box-shadow: none; }
body:not(.auth-entry) .btn { min-height: 40px; border-radius: 7px; box-shadow: none; }
body:not(.auth-entry) .form-control, body:not(.auth-entry) .form-select { min-height: 42px; box-shadow: none; background-color: #fff; border-color: #c8d4e1; font-size: 14px; }
body:not(.auth-entry) .form-label { font-size: 13px; color: #526478; }
body:not(.auth-entry) .absence-section-card, body:not(.auth-entry) .dashboard-section-card, body:not(.auth-entry) .dashboard-metric-card { background: #fff; box-shadow: none; border: 1px solid #d9e1ea; }
body:not(.auth-entry) .absence-section-head { color: #172d44; }
body:not(.auth-entry) #demo-mode-banner { padding: 10px 14px; background: #edf3f8; border: 1px solid #d9e1ea; border-radius: 8px; font-size: 12px; margin-bottom: 16px; }
body:not(.auth-entry) #demo-mode-subscribe { background: transparent; color: #174776; border: 1px solid #b7c8d9; font-size: 12px; padding: 6px 10px; }
.daily-shortcuts { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.trial-guided .daily-shortcuts { display: none; }
.guided-onboarding.is-complete { padding: 10px 14px; background: #f3f8f5; border-color: #c7dfd0; }
.guided-onboarding.is-complete .guided-progress { display: none; }
.guided-complete-line { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; font-size: 13px; }
.guided-complete-line .guided-secondary { min-height: 36px; padding: 7px 10px; }
.guided-onboarding.is-complete .guided-error:empty { display: none; }
#tab-dashboard .dashboard-metric-grid { grid-auto-rows: auto; }
#tab-dashboard .dashboard-metric-grid > .dashboard-metric-card { grid-column: span 3 !important; grid-row: auto !important; }
#tab-dashboard .dashboard-metric-grid > #dashboard-conflicts-card { grid-column: 1 / -1; grid-row: auto; }
#tab-dashboard .dashboard-metric-card { padding: 16px; }
#tab-dashboard .dashboard-metric-value { font-size: 28px; }
#tab-dashboard .dashboard-section-card { padding: 16px; }
#tab-dashboard .dashboard-metric-grid > .daily-secondary-metrics { grid-column: 1 / -1; }
.daily-secondary-metrics > .daily-secondary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.daily-secondary-grid > * { grid-column: auto !important; grid-row: auto !important; min-width: 0; }
summary { cursor: pointer; color: #174776; font-size: 13px; padding: 10px 0; }
summary:focus-visible { outline: 3px solid #367aa5; outline-offset: 3px; }
details:not([open]) > summary.absence-section-head { margin: 0; }
#tab-time { padding: 16px 20px !important; }
#tab-time .page-title { font-size: 20px; margin: 0 8px 6px 0; flex-shrink: 0; }
#tab-time .page-title-badge { width: 28px; height: 28px; font-size: 15px; }
#time-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 10px; }
.time-person-picker { flex: 1; max-width: 440px; min-width: 0; }
.time-person-picker .form-label { margin-bottom: 4px; }
.time-month-switch { display: flex; align-items: center; gap: 6px; }
#time-timeline-month-label { font-size: 13px; font-weight: 650; min-width: 142px; text-align: center; }
#time-timeline-panel { min-width: 0; }
.time-timeline-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
#time-timeline-title { font-size: 13px; font-weight: 650; margin: 0; }
#time-timeline-legend { display: flex; gap: 12px; font-size: 11px; color: #526478; }
#time-timeline-legend[hidden] { display: none; }
#time-timeline-legend span { display: inline-flex; align-items: center; gap: 5px; }
#time-timeline-legend i { width: 14px; height: 7px; border-radius: 3px; }
#time-timeline { overflow-x: auto; border: 1px solid #e0e7ee; border-radius: 7px; }
#time-timeline:focus-visible { outline: 3px solid #367aa5; outline-offset: 2px; }
.time-timeline-grid { min-width: 620px; padding: 0 8px 4px; }
.time-timeline-row { display: grid; grid-template-columns: 116px minmax(0, 1fr) 48px; gap: 8px; align-items: center; min-height: 20px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.time-timeline-row.is-weekend { background: #f6f8fa; }
.time-timeline-row.is-today { background: #eaf2fb; }
.time-timeline-row > :first-child { padding-left: 4px; }
.time-timeline-row > :last-child { padding-right: 4px; }
.time-timeline-hours { min-height: 30px; color: #526478; font-size: 11px; }
.time-timeline-bar { min-width: 0; }
.time-empty-state { padding: 28px 18px; color: #526478; font-size: 14px; }
#time-details-panel { margin-top: 8px; border-top: 1px solid #e0e7ee; }
.time-secondary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#tab-time .time-secondary-grid > details { min-width: 0; margin: 0 !important; padding: 0 12px; border-radius: 7px; }
#tab-time .time-secondary-grid > details[open] { grid-column: 1 / -1; padding-bottom: 12px; }
.time-secondary-grid > details > summary { font-size: 13px; font-weight: 500; min-height: 40px; }
.time-date-range { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.time-summary-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
body:not(.auth-entry):has([data-tab="time"].active) .app-header { margin-bottom: 8px !important; }
#view-admin:has([data-tab="time"].active) > .card.p-3 { padding: 8px !important; margin-bottom: 8px !important; }
body:not(.auth-entry):has([data-tab="time"].active) #demo-mode-banner { margin-bottom: 8px; }
@media (max-width: 1000px) {
  #time-toolbar { flex-wrap: wrap; gap: 6px 14px; }
  #time-toolbar > .page-title { flex-basis: 100%; margin-bottom: 4px; }
}
.daily-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.daily-kpis > div { padding: 12px 14px; border-radius: 8px; background: #f4f7fa; }
.daily-kpis span { display: block; font-size: 12px; color: #526478; }
.daily-kpis strong { display: block; font-size: 23px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.daily-table caption { caption-side: top; color: #526478; font-size: 13px; }
.daily-table { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; margin: 0; }
.daily-table th { background: #f4f7fa; font-size: 12px; font-weight: 650; }
.daily-table td, .daily-table th { padding: 9px 12px; border-color: #e5ebf0; }
.daily-table .daily-today td { background: #edf4fb; }
.daily-table .daily-future td { color: #647488; }
.daily-table .btn { min-height: 36px !important; font-size: 12px; }
.daily-note { font-size: 12px; line-height: 1.6; color: #526478; margin: 12px 0; }
@media (max-width: 767px) {
  #tab-dashboard .dashboard-metric-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  #tab-dashboard .dashboard-metric-grid > .dashboard-metric-card { grid-column: span 6 !important; }
  body:not(.auth-entry) > .container { padding: 14px 12px !important; }
  body:not(.auth-entry) .app-header { flex-direction: row; align-items: center !important; }
  body:not(.auth-entry) .app-context { display: none !important; }
  body:not(.auth-entry) .app-header-actions { width: auto; }
  body:not(.auth-entry) #demo-mode-banner { flex-wrap: nowrap !important; gap: 8px !important; padding: 8px 10px; font-size: 11px; }
  body:not(.auth-entry) #demo-mode-subscribe { width: auto; flex: 0 0 80px; padding: 6px; font-size: 11px; }
  #time-toolbar { flex-wrap: wrap; gap: 6px; }
  .time-person-picker { flex-basis: 100%; max-width: none; }
  .time-month-switch { width: 100%; justify-content: space-between; }
  .time-timeline-grid { min-width: 0; padding-left: 3px; padding-right: 3px; }
  .time-timeline-row { grid-template-columns: 62px minmax(0, 1fr) 38px; gap: 4px; }
  .time-timeline-row > :first-child { white-space: normal !important; padding-left: 2px; }
  .time-timeline-row > :last-child { padding-right: 2px; }
  #time-timeline .timeline-scale-label:nth-child(even) { display: none; }
  #time-timeline .timeline-scale-tick.half { display: none; }
  #time-timeline .timeline-grid-overlay { background-image: linear-gradient(90deg, rgba(148, 163, 184, .28) 0 1px, transparent 1px); background-size: calc(100% / 12) 100%; }
  .time-secondary-grid { grid-template-columns: 1fr; }
  .time-summary-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .time-date-range > div { flex: 1; min-width: 115px; }
  body:not(.auth-entry) .card.p-4 { padding: 16px !important; }
  body:not(.auth-entry) .nav-pills .nav-link { padding: 9px 10px; font-size: 12px; }
  body:not(.auth-entry) .btn, body:not(.auth-entry) .form-control, body:not(.auth-entry) .form-select { min-height: 44px; }
  body:not(.auth-entry) .page-title { font-size: 21px; }
  .daily-kpis { gap: 7px; }
  .daily-kpis > div { padding: 10px 8px; }
  .daily-kpis strong { font-size: 19px; }
  .daily-kpis span { font-size: 11px; }
  .daily-secondary-metrics > .daily-secondary-grid { grid-template-columns: 1fr; }
  .daily-table .btn { min-height: 44px !important; }
}

/* Keep the timeline and its bookings in one directly accessible workspace. */
.time-workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 12px; }
#time-bookings-panel { min-width: 0; scroll-margin-top: 16px; }
.time-timeline-heading { min-height: 40px; margin-bottom: 8px; flex-wrap: wrap; }
#time-timeline-title, #time-bookings-title { font-size: 15px; font-weight: 650; margin: 0; }
.time-section-hint { color: #526478; font-size: 12px; margin: 0 0 10px; }
#time-timeline { max-height: 440px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.time-timeline-grid { min-width: 0; padding: 0 6px 4px; }
.time-timeline-row { grid-template-columns: 90px minmax(0, 1fr) 46px; min-height: 28px; gap: 6px; }
button.time-timeline-row { width: 100%; border: 0; border-bottom: 1px solid #edf1f5; border-radius: 0; padding: 3px 0; color: inherit; background: #fff; font: inherit; text-align: left; cursor: pointer; }
button.time-timeline-row.is-weekend { background: #f6f8fa; }
button.time-timeline-row.is-today { background: #eaf2fb; }
button.time-timeline-row:hover { background: #edf4fb; }
button.time-timeline-row.is-selected { background: #e3eefb; box-shadow: inset 3px 0 #174776; }
button.time-timeline-row:focus-visible { outline: 2px solid #174776; outline-offset: -2px; }
.time-timeline-row > :first-child { white-space: normal !important; }
.time-timeline-bar { display: block; }
.time-timeline-hours { position: sticky; top: 0; z-index: 5; min-height: 30px; background: #fff; }
#time-timeline .timeline-scale-label:nth-child(even) { display: none; }
#time-timeline .timeline-scale-tick.half { display: none; }
.time-bookings-toolbar, .time-day-switch { display: flex; align-items: center; gap: 6px; }
.time-bookings-toolbar { justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.time-day-switch { min-width: 0; flex: 1 1 100%; }
#time-booking-day { width: 145px; min-width: 0; flex: 1; max-width: none; font-size: 13px; }
#time-bookings-all { font-size: 12px; padding-left: 8px; padding-right: 8px; }
#time-bookings-all.active { background: #edf4fb; color: #174776; border-color: #174776; }
#time-table-wrap { max-height: 388px; overflow-y: auto; border: 1px solid #e0e7ee; border-radius: 7px; overscroll-behavior: contain; }
#time-table { width: 100%; table-layout: fixed; margin: 0; font-size: 13px; }
#time-table thead { position: sticky; top: 0; z-index: 1; }
#time-table th { font-size: 11px; background: #f6f8fa; color: #526478; font-weight: 600; }
#time-table td, #time-table th { padding: 6px 8px; vertical-align: top; border-color: #e5ebf0; }
#time-table th:first-child { width: 62px; }
#time-table th:last-child { width: 48px; }
#time-table td:last-child { padding: 4px 8px 4px 0; text-align: right; vertical-align: middle; }
.time-booking-edit { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #526478; font-size: 15px; cursor: pointer; }
.time-booking-edit:hover:not(:disabled) { background: #edf4fb; color: #174776; }
.time-booking-edit:focus-visible { outline: 2px solid #174776; outline-offset: 2px; background: #edf4fb; }
.time-booking-edit:disabled { opacity: .45; cursor: default; }
.time-booking-clock { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.time-booking-clock small, .time-booking-details small { display: block; color: #526478; font-size: 11px; font-weight: 400; }
.time-booking-clock small { margin-top: 2px; }
.time-booking-details { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; overflow-wrap: anywhere; }
.time-booking-details strong { font-weight: 600; }
.time-booking-details > span { flex-basis: 100%; font-size: 12px; }
#time-table .time-empty-state { padding: 22px 14px; font-size: 13px; line-height: 1.6; text-align: left; }
#time-details-panel { margin-top: 18px; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
#tab-time #time-details-panel > details { flex: 1; }
#tab-time #time-details-panel > details[open] { flex-basis: 100%; order: 1; }
#time-details-panel summary { white-space: nowrap; }
.time-entry-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; border: 1px solid #c8d4e1; border-radius: 12px; background: #fff; color: #172d44; box-shadow: 0 16px 60px #172d4433; }
.time-entry-dialog::backdrop { background: #172d4470; }
body:has(.time-entry-dialog[open]) { overflow: hidden; }
.time-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
#time-entry-title { margin: 0; font-size: 20px; font-weight: 650; }
.time-entry-fields { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 16px; }
.time-entry-fields > div { min-width: 0; }
.time-entry-wide { grid-column: 1 / -1; }
.time-entry-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
#time-delete { margin-right: auto; }
@media (max-width: 1000px) {
  .time-workspace { gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .time-timeline-row { grid-template-columns: 66px minmax(0, 1fr) 42px; gap: 3px; }
  #time-timeline-legend { gap: 8px; }
}
@media (max-width: 767px) {
  .time-workspace { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 10px; }
  .time-timeline-heading { min-height: 32px; margin-bottom: 6px; }
  #time-timeline { max-height: 210px; }
  button.time-timeline-row { min-height: 36px; }
  #time-table-wrap { max-height: 360px; }
  #time-table th:last-child { width: 52px; }
  #time-table td:last-child { padding-right: 4px; }
  .time-booking-edit { width: 44px; height: 44px; }
  #time-bookings-panel .time-timeline-heading { gap: 8px; }
  #time-add { padding-left: 10px; padding-right: 10px; font-size: 12px; }
  #time-bookings-all { flex-shrink: 0; }
  .time-bookings-toolbar { gap: 8px; }
  #time-details-panel summary { white-space: normal; }
  #tab-time #time-details-panel > details { flex-basis: 100%; }
  .time-entry-dialog { padding: 18px; }
  .time-entry-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .time-entry-actions { gap: 6px; }
  .time-entry-actions .btn { padding-left: 10px; padding-right: 10px; }
}
#time-toolbar .time-person-picker { max-width: 360px; }
#time-toolbar > #time-add { flex-shrink: 0; }
.time-timeline-row > :last-child { white-space: nowrap; font-variant-numeric: tabular-nums; padding-right: 0; }
@media (max-width: 1000px) {
  #time-timeline .timeline-scale-label:not(:nth-child(4n + 1)) { display: none; }
}
@media (max-width: 767px) {
  #time-toolbar > .page-title { flex-basis: auto; margin-right: auto; font-size: 19px; }
  #time-toolbar > #time-add { order: 1; }
  #time-toolbar .time-person-picker { order: 2; max-width: none; }
  #time-toolbar .time-month-switch { order: 3; }
  #time-booking-day { width: 165px; }
}
