:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-soft: #f0f4ef;
  --ink: #17211f;
  --muted: #5f6f6c;
  --line: #d9e0d7;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --red: #c2413a;
  --red-soft: #fee2e2;
  --amber: #b7791f;
  --amber-soft: #fff4cf;
  --green: #15803d;
  --green-soft: #dcfce7;
  --closed: #ece9df;
  --shadow: 0 16px 42px rgba(23, 33, 31, 0.1);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.ui-hidden {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.25;
}

.login-panel .section-heading {
  margin-bottom: 2px;
}

.employee-shell {
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.employee-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.employee-topbar h1,
.employee-topbar p,
.eyebrow {
  margin: 0;
}

.employee-topbar h1 {
  margin-top: 3px;
  font-size: 1.34rem;
  line-height: 1.25;
}

.employee-topbar p:not(.eyebrow) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.employee-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.employee-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.employee-main-column,
.employee-side-column {
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: start;
}

.employee-task-surface,
.employee-leave-surface,
.employee-counter-surface,
.employee-attendance-surface,
.employee-note-surface,
.employee-swap-surface,
.employee-calendar-surface {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.employee-note-surface {
  display: grid;
  gap: 12px;
}

.employee-attendance-surface {
  display: grid;
  gap: 12px;
}

.employee-swap-surface {
  display: grid;
  gap: 12px;
}

.employee-leave-surface {
  order: 1;
}

.employee-counter-surface {
  order: 2;
}

.employee-note-surface {
  order: 3;
}

.employee-attendance-surface {
  order: 4;
}

.employee-swap-surface {
  order: 5;
}

.employee-task-list {
  display: grid;
  gap: 10px;
}

.swap-list {
  display: grid;
  gap: 8px;
}

.swap-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.swap-item strong,
.swap-item span {
  overflow-wrap: anywhere;
}

.swap-item > div span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.employee-task-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.employee-task-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.employee-task-source {
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.employee-task-item p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.employee-leave-counters {
  display: grid;
  gap: 12px;
}

.employee-leave-counter {
  display: grid;
  gap: 7px;
}

.employee-leave-counter > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.employee-leave-counter strong {
  color: var(--ink);
}

.employee-leave-counter small {
  color: var(--muted);
}

.employee-leave-counter.sick .meter {
  background: var(--red-soft);
}

.employee-leave-counter.sick .meter span {
  background: var(--red);
}

.employee-calendar-grid .employee-day-cell {
  cursor: default;
  min-height: 132px;
}

.employee-calendar-grid .employee-day-cell:hover {
  border-color: var(--line);
}

.employee-calendar-grid .employee-day-cell.today:hover {
  border-color: var(--teal);
}

.employee-calendar-badges {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.employee-leave-badge {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  text-align: left;
}

.employee-leave-badge .leave-type {
  font-weight: 900;
}

.employee-leave-badge .leave-name {
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.attendance-scanner {
  display: grid;
  gap: 10px;
}

.attendance-scanner video {
  width: 100%;
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  object-fit: cover;
}

.attendance-kiosk {
  display: grid;
  gap: 14px;
}

.attendance-kiosk-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.attendance-qr-panel,
.attendance-today-panel,
.attendance-history-panel {
  min-width: 0;
}

.attendance-qr-panel,
.attendance-today-panel {
  display: grid;
  gap: 10px;
}

.attendance-qr-box {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 250px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
}

.attendance-qr-render {
  display: grid;
  place-items: center;
}

.attendance-qr-box canvas,
.attendance-qr-box img {
  width: 220px;
  height: 220px;
  max-width: 100%;
  border-radius: var(--radius);
  background: white;
}

.attendance-qr-box strong {
  max-width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.attendance-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.attendance-panel-head.compact {
  padding: 0;
  border: 0;
}

.attendance-panel-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.attendance-panel-head strong {
  font-size: 1rem;
}

.attendance-panel-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.attendance-panel-head svg {
  width: 22px;
  height: 22px;
  color: var(--teal);
  flex: 0 0 auto;
}

.attendance-today-panel,
.attendance-history-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.attendance-today-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.attendance-status-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.attendance-status-card.open {
  border-color: #f6d58d;
  background: var(--amber-soft);
}

.attendance-status-card.done {
  border-color: #a7f3d0;
  background: var(--green-soft);
}

.attendance-status-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.attendance-status-card header div {
  min-width: 0;
}

.attendance-status-card strong,
.attendance-status-card span {
  display: block;
  overflow-wrap: anywhere;
}

.attendance-status-card header > div > span,
.attendance-status-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.attendance-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attendance-status-card .text-button {
  justify-self: start;
  background: white;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: var(--teal);
  color: white;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.22);
}

.brand h1,
.brand p,
.section-heading h2,
.section-heading p,
#monthLabel {
  margin: 0;
}

.brand h1 {
  font-size: 1.28rem;
  line-height: 1.2;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.top-actions,
.month-controls,
.task-date-controls,
.filter-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-tabs {
  width: 100%;
  margin: 0 auto;
  padding: 14px 28px 0;
  display: flex;
  gap: 8px;
}

.tab-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.tab-button.active {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.workspace {
  width: 100%;
  margin: 0 auto;
  padding: 22px 28px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "calendar";
  gap: 22px;
  align-items: start;
}

.tasks-workspace,
.counters-workspace,
.admin-workspace {
  width: 100%;
  margin: 0 auto;
  padding: 22px 28px 32px;
}

.tasks-workspace,
.counters-workspace {
  display: grid;
}

.admin-workspace {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  align-items: start;
}

.admin-wide {
  grid-column: 1 / -1;
}

.admin-status-strip {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-status-strip h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.admin-status-strip .admin-session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-status-strip #adminSessionInfo {
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.admin-status-strip .status-pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-section-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
}

.admin-section-button.active {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.admin-dashboard {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.admin-stat-card {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  text-align: left;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.admin-stat-card i {
  color: var(--teal);
}

.admin-stat-card span {
  display: grid;
  gap: 2px;
}

.admin-stat-card strong {
  color: var(--teal-dark);
  font-size: 1.75rem;
  line-height: 1;
}

.admin-stat-card small {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
}

.admin-stat-card em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.admin-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.calendar-surface,
.tool-surface,
.counters-surface,
.requests-surface,
.tasks-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calendar-surface {
  grid-area: calendar;
  padding: 18px;
  min-width: 0;
}

.requests-surface {
  padding: 18px;
  min-width: 0;
}

.counters-surface {
  padding: 18px;
  min-width: 0;
}

.side-stack {
  grid-area: side;
  display: grid;
  gap: 18px;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding-right: 2px;
}

.tool-surface {
  padding: 18px;
}

.people-teams-surface {
  grid-column: span 3;
  min-width: 0;
}

.calendar-toolbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2,
#monthLabel {
  font-size: 1.05rem;
  line-height: 1.3;
}

.section-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.section-heading > svg,
.section-heading > i {
  color: var(--teal);
  flex: 0 0 auto;
}

.icon-button,
.text-button,
.primary-button,
.chip {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.text-button,
.primary-button,
.chip {
  padding: 0 12px;
  white-space: nowrap;
}

.primary-button {
  width: 100%;
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  font-weight: 700;
}

.icon-button:hover,
.text-button:hover,
.chip:hover {
  border-color: var(--teal);
  background: var(--surface-soft);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.icon-button:active,
.text-button:active,
.primary-button:active,
.chip:active {
  transform: translateY(1px);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 14px 0 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid transparent;
}

.legend-dot.workday {
  background: var(--green-soft);
  border-color: #86efac;
}

.legend-dot.holiday {
  background: var(--amber-soft);
  border-color: #facc15;
}

.legend-dot.pto {
  background: var(--blue);
}

.legend-dot.sick {
  background: var(--red);
}

.legend-dot.team {
  background: var(--teal);
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  gap: 8px;
  margin-bottom: 8px;
}

.weekday-row span {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-grid {
  gap: 8px;
}

.day-cell {
  min-width: 0;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  text-align: left;
}

.day-cell.workday {
  background: linear-gradient(180deg, white, #fbfffb);
}

.day-cell.closed {
  background: var(--closed);
}

.day-cell.holiday {
  background: var(--amber-soft);
  border-color: #edc967;
}

.day-cell.outside {
  color: #8a948f;
  opacity: 0.62;
}

.day-cell.today {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.day-cell:hover {
  border-color: var(--teal);
}

.day-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: flex-start;
}

.day-number {
  font-weight: 800;
  line-height: 1;
}

.day-hours {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.day-note {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  min-height: 22px;
}

.badge,
.status-pill {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.badge.pto {
  color: #1d4ed8;
  background: var(--blue-soft);
}

.badge.sick {
  color: #991b1b;
  background: var(--red-soft);
}

.badge.more {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.badge.team {
  color: var(--teal-dark);
  background: var(--green-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.status-pill.locked,
.status-pill.declined,
.status-pill.retracted {
  color: #991b1b;
  background: var(--red-soft);
}

.status-pill.unlocked,
.status-pill.approved {
  color: #166534;
  background: var(--green-soft);
}

.status-pill.pending {
  color: #92400e;
  background: var(--amber-soft);
}

.status-pill.unread {
  color: #92400e;
  background: var(--amber-soft);
}

.status-pill.read {
  color: #166534;
  background: var(--green-soft);
}

.form-stack,
.admin-session {
  display: grid;
  gap: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-actions > button {
  flex: 1 1 160px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.form-field-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  color: var(--ink);
  background: white;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.15);
}

.date-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manual-leave-dates {
  grid-template-columns: 1fr;
}

.date-input-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 6px;
  align-items: stretch;
}

.date-picker-button {
  min-height: 42px;
}

.native-date-picker {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px !important;
  min-width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.swap-date-popover {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.swap-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.swap-date-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

.swap-date-head strong,
.swap-date-head span {
  overflow-wrap: anywhere;
}

.swap-date-head span,
.swap-date-help {
  color: var(--muted);
  font-size: 0.82rem;
}

.swap-date-weekdays,
.swap-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.swap-date-weekdays span {
  min-height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.swap-date-day {
  min-width: 0;
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
}

.swap-date-day span {
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
}

.swap-date-day small {
  color: inherit;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
}

.swap-date-day.scheduled {
  border-color: #86efac;
  background: var(--green-soft);
  color: var(--teal-dark);
}

.swap-date-day.selectable:hover {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.swap-date-day.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.swap-date-day.selected span,
.swap-date-day.selected small {
  color: white;
}

.swap-date-day.today {
  box-shadow: inset 0 0 0 1px var(--teal);
}

.swap-date-day.outside {
  opacity: 0.48;
}

.swap-date-day.past,
.swap-date-day:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.swap-date-help {
  margin: 0;
  line-height: 1.35;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.locked-note,
.compact-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.compact-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.work-log-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.employee-roster-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.team-admin-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.team-management-grid {
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(240px, 0.9fr) minmax(420px, 1.45fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.team-control-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.team-control-panel header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-control-panel header svg {
  width: 18px;
  height: 18px;
  color: var(--teal);
  flex: 0 0 auto;
}

.team-control-panel header strong {
  overflow-wrap: anywhere;
}

.team-control-panel .primary-button,
.team-control-panel .text-button {
  width: 100%;
}

.team-schedule-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.team-calendar-picker {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.team-calendar-picker-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
}

.team-calendar-picker-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

.team-calendar-picker-head strong,
.team-calendar-picker-head span {
  overflow-wrap: anywhere;
}

.team-calendar-picker-head span {
  color: var(--muted);
  font-size: 0.74rem;
}

.team-calendar-picker-weekdays,
.team-calendar-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  align-items: stretch;
  overflow: hidden;
}

.team-calendar-picker-weekdays span {
  min-height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-calendar-day {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  overflow: hidden;
}

.team-calendar-day span {
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
}

.team-calendar-day small {
  max-width: 100%;
  color: inherit;
  font-size: 0.56rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-calendar-day.weekend {
  background: var(--surface-soft);
}

.team-calendar-day.holiday {
  color: var(--red);
  background: var(--red-soft);
}

.team-calendar-day.scheduled {
  border-color: #86efac;
  background: var(--green-soft);
  color: var(--teal-dark);
}

.team-calendar-day.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.team-calendar-day.selected span,
.team-calendar-day.selected small {
  color: white;
}

.team-calendar-day.today {
  box-shadow: inset 0 0 0 1px var(--teal);
}

.team-calendar-day.outside {
  opacity: 0.5;
}

.team-calendar-day:not(:disabled):hover {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.team-calendar-day:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  pointer-events: none;
}

.team-calendar-picker-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.team-message-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.team-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.team-create-form .primary-button {
  width: auto;
  min-width: 132px;
}

.team-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.selected-date-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.selected-date-list .team-muted {
  padding: 2px;
}

.employee-roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.employee-roster-item.hidden-employee {
  border-style: dashed;
  background: #f7f8f5;
}

.employee-roster-details {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.employee-roster-item strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.employee-roster-details strong .status-pill {
  flex: 0 0 auto;
  font-size: 0.68rem;
}

.employee-roster-details span {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.employee-roster-actions,
.employee-roster-username {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.employee-roster-username input {
  width: min(210px, 38vw);
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  font: inherit;
  font-size: 0.86rem;
}

.team-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.team-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.team-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.team-card header span,
.team-muted {
  color: var(--muted);
  font-size: 0.84rem;
}

.team-group {
  display: grid;
  gap: 6px;
}

.team-group > strong {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.team-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-pill {
  min-height: 32px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 9px;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--line);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.team-pill.calendar {
  color: var(--teal-dark);
  background: var(--green-soft);
}

.team-pill.hidden-member {
  color: var(--muted);
  border-style: dashed;
  background: var(--surface-soft);
}

.team-pill.hidden-member small {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.work-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.work-log-item div {
  min-width: 0;
}

.work-log-item strong,
.work-log-item span {
  display: block;
  overflow-wrap: anywhere;
}

.work-log-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.work-log-hours {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.work-log-hours > span {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.icon-button.small {
  width: 40px;
  min-height: 40px;
}

.text-button.small {
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.text-button.small svg {
  width: 15px;
  height: 15px;
}

.icon-button.small svg {
  width: 16px;
  height: 16px;
}

.chip {
  min-height: 40px;
  color: var(--muted);
  font-size: 0.84rem;
}

.chip.active {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.requests-heading {
  align-items: flex-start;
}

.tasks-surface {
  padding: 18px;
  min-width: 0;
}

.tasks-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.tasks-toolbar h2,
.tasks-toolbar p {
  margin: 0;
}

.tasks-toolbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.task-date-controls {
  align-items: stretch;
}

.task-date-controls input {
  width: 132px;
}

.task-date-controls .task-date-picker {
  flex: 0 1 178px;
  width: 178px;
}

.task-date-controls .task-date-picker input[type="text"] {
  width: 100%;
}

.task-assignee-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.task-employee-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.task-employee-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-employee-card h3,
.task-item p {
  margin: 0;
}

.task-employee-card header > div {
  min-width: 0;
}

.task-employee-card h3 {
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.task-employee-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.task-employee-card header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.team-task-card {
  border-color: #86d6c8;
  background: linear-gradient(180deg, white, #f2fbf7);
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.task-item p {
  margin-bottom: 8px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.counter-period-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.counter-period-controls label {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.counter-period-controls label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.counter-period-controls select {
  min-height: 40px;
}

.counter-view-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.counter-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.counter-employee-filter {
  display: grid;
  gap: 5px;
  min-width: min(260px, 100%);
}

.counter-employee-filter span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.counter-employee-filter select {
  min-height: 40px;
}

.counter-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.counter-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.counter-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.counter-card header span {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 900;
}

.counter-metric {
  display: grid;
  gap: 6px;
}

.counter-metric > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.counter-metric strong {
  color: var(--ink);
}

.counter-metric small {
  color: var(--muted);
}

.meter {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-soft);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.counter-metric.sick .meter {
  background: var(--red-soft);
}

.counter-metric.sick .meter span {
  background: var(--red);
}

.hours-total {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--teal-dark);
  background: var(--green-soft);
  overflow-wrap: anywhere;
}

.no-work-total {
  color: var(--red);
  background: var(--red-soft);
}

.daily-hours-counter {
  display: grid;
  gap: 12px;
}

.daily-hours-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.daily-hours-meta span {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.daily-hours-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.daily-hours-table {
  --daily-hours-employee-width: 188px;
  --daily-hours-total-width: 96px;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}

.daily-hours-table th,
.daily-hours-table td {
  min-width: 62px;
  height: 72px;
  padding: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.daily-hours-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: var(--surface-soft);
}

.daily-hours-table thead th span,
.daily-hours-table thead th small {
  display: block;
}

.daily-hours-table thead th span {
  color: var(--ink);
  font-size: 0.9rem;
}

.daily-hours-employee {
  position: sticky;
  left: 0;
  z-index: 4;
  width: var(--daily-hours-employee-width) !important;
  min-width: var(--daily-hours-employee-width) !important;
  max-width: var(--daily-hours-employee-width);
  text-align: left !important;
  overflow-wrap: anywhere;
  background: white;
}

.daily-hours-table thead .daily-hours-employee {
  z-index: 6;
  background: var(--surface-soft);
}

.daily-hours-total-head,
.daily-hours-total-cell {
  position: sticky;
  left: var(--daily-hours-employee-width);
  z-index: 3;
  width: var(--daily-hours-total-width) !important;
  min-width: var(--daily-hours-total-width) !important;
  max-width: var(--daily-hours-total-width);
  box-shadow: 1px 0 0 var(--line);
}

.daily-hours-total-cell {
  background: var(--surface-soft);
}

.daily-hours-total-head {
  z-index: 5;
  background: var(--surface-soft);
}

.daily-hours-total-cell strong,
.daily-hours-total-cell small {
  display: block;
}

.daily-hours-total-cell strong {
  color: var(--teal-dark);
}

.daily-hours-total-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.daily-hours-cell {
  color: var(--muted);
  background: white;
}

.daily-hours-cell.closed {
  background: var(--closed);
}

.daily-hours-cell.worked {
  color: var(--teal-dark);
  background: var(--green-soft);
}

.daily-hours-cell.no-work {
  color: var(--red);
  background: var(--red-soft);
}

.daily-hours-cell.pto {
  color: var(--blue);
  background: var(--blue-soft);
}

.daily-hours-cell.sick {
  color: var(--red);
  background: var(--red-soft);
}

.daily-hours-cell.empty {
  color: #9aa6a2;
}

.daily-hours-value,
.daily-hours-badge,
.daily-hours-empty {
  display: block;
}

.daily-hours-input {
  width: 100%;
  max-width: 62px;
  min-height: 42px;
  margin: 0 auto;
  border: 2px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font-size: 1.02rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.daily-hours-input:hover,
.daily-hours-input:focus {
  border-color: var(--teal);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.daily-hours-input:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.daily-hours-value {
  color: var(--teal-dark);
  font-weight: 900;
}

.daily-hours-badge {
  width: max-content;
  max-width: 100%;
  margin: 3px auto 0;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
}

.daily-hours-badge.pto {
  color: var(--blue);
  background: white;
}

.daily-hours-badge.sick,
.daily-hours-badge.no-work {
  color: var(--red);
  background: white;
}

.daily-hours-badge.qr {
  color: var(--teal-dark);
  background: white;
}

.daily-hours-empty {
  font-weight: 800;
}

.daily-hours-cards {
  display: none;
}

.daily-hours-day-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.daily-hours-day-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.daily-hours-day-card header strong {
  color: var(--ink);
}

.daily-hours-mobile-entry {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.daily-hours-mobile-entry strong {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  text-align: right;
}

.daily-hours-mobile-entry .daily-hours-input {
  max-width: 96px;
}

.request-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.empty-state {
  min-height: 100px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.request-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 14px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.request-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.request-card h3,
.request-card p {
  margin: 0;
}

.request-card h3 {
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.request-meta {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.request-note {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--ink);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.doctor-note-upload {
  display: grid;
  gap: 8px;
}

.photo-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.photo-upload-button {
  position: relative;
  overflow: hidden;
  margin: 0;
}

.photo-upload-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.doctor-note-preview,
.doctor-note-attachment a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.doctor-note-preview {
  color: var(--muted);
  font-size: 0.86rem;
}

.doctor-note-preview img,
.doctor-note-attachment img {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: white;
  flex: 0 0 auto;
}

.doctor-note-attachment {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.doctor-note-attachment a {
  color: var(--ink);
  text-decoration: none;
}

.doctor-note-attachment span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.doctor-note-attachment small,
.doctor-note-preview span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.request-actions .text-button {
  min-height: 40px;
  font-size: 0.84rem;
}

.day-dialog {
  width: min(520px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.day-dialog::backdrop {
  background: rgba(23, 33, 31, 0.38);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 0;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.06rem;
}

#dialogBody {
  padding: 14px 16px 16px;
  display: grid;
  gap: 12px;
}

.dialog-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  line-height: 1.35;
}

.dialog-line strong {
  color: var(--ink);
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas: "calendar";
  }

  .attendance-kiosk-grid {
    grid-template-columns: 1fr;
  }

  .team-management-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-teams-surface {
    grid-column: 1 / -1;
  }

  .team-schedule-panel {
    grid-column: 1 / -1;
  }

  .side-stack {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    padding: 14px;
  }

  .employee-shell {
    padding: 14px;
  }

  .employee-topbar {
    flex-direction: column;
  }

  .employee-actions {
    width: 100%;
  }

  .employee-actions .text-button {
    flex: 1 1 auto;
  }

  .employee-overview {
    grid-template-columns: 1fr;
  }

  .view-tabs {
    padding: 12px 14px 0;
  }

  .workspace,
  .tasks-workspace,
  .counters-workspace,
  .admin-workspace {
    padding: 14px;
    gap: 14px;
  }

  .calendar-surface,
  .tool-surface,
  .counters-surface,
  .requests-surface,
  .tasks-surface {
    padding: 14px;
  }

  .calendar-toolbar,
  .tasks-toolbar,
  .counters-heading,
  .requests-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .month-controls {
    justify-content: space-between;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }

  .weekday-row {
    gap: 4px;
  }

  .calendar-grid {
    gap: 4px;
  }

  .day-cell {
    min-height: 88px;
    padding: 6px;
  }

  .day-hours,
  .day-note {
    font-size: 0.68rem;
  }

  .date-pair {
    grid-template-columns: 1fr;
  }

  .team-management-grid,
  .team-message-row,
  .team-calendar-picker-actions,
  .team-schedule-actions {
    grid-template-columns: 1fr;
  }

  .team-create-form,
  .task-assignee-grid {
    grid-template-columns: 1fr;
  }

  .counter-card header,
  .counter-metric > div:first-child {
    flex-direction: column;
    gap: 4px;
  }

  .counter-period-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .counter-period-controls label {
    min-width: 0;
  }

  .counter-view-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .counter-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .counter-employee-filter {
    min-width: 0;
  }

  .daily-hours-table-wrap {
    display: none;
  }

  .daily-hours-cards {
    display: grid;
    gap: 10px;
  }

  .counter-card header span {
    flex: 0 1 auto;
  }

  .task-date-controls {
    flex-wrap: wrap;
  }

  .task-date-controls input {
    flex: 1 1 132px;
  }

  .task-date-controls .task-date-picker {
    flex: 1 1 178px;
  }
}

@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
    gap: 12px;
  }

  .employee-roster-item,
  .employee-roster-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-roster-username input {
    width: 100%;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 1rem;
  }

  .brand p {
    font-size: 0.78rem;
  }

  .top-actions {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
  }

  .legend {
    font-size: 0.78rem;
  }

  .weekday-row span {
    font-size: 0.68rem;
  }

  .day-cell {
    min-height: 62px;
    padding: 6px 4px;
    gap: 4px;
  }

  .employee-calendar-grid .day-cell {
    min-height: 92px;
  }

  .day-top {
    flex-direction: row;
    align-items: center;
  }

  .day-hours,
  .day-note {
    display: none;
  }

  .badges {
    min-height: 18px;
    gap: 3px;
  }

  .badge {
    padding: 2px 5px;
    font-size: 0.62rem;
    line-height: 1.1;
  }

  .employee-calendar-grid .badges {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .employee-calendar-grid .employee-leave-badge {
    grid-template-columns: 1fr;
    gap: 1px;
    padding: 2px 3px;
    font-size: 0.56rem;
    line-height: 1.05;
  }

  .employee-calendar-grid .employee-leave-badge .leave-name {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .filter-buttons {
    flex-wrap: wrap;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab-button {
    padding: 0 8px;
  }
}

@media print {
  .top-actions,
  .view-tabs,
  .tasks-workspace,
  .counters-workspace,
  .admin-workspace,
  .side-stack,
  .counters-surface,
  .requests-surface,
  .text-button,
  .icon-button {
    display: none !important;
  }

  .topbar {
    position: static;
  }

  .workspace {
    display: block;
    padding: 0;
  }

  .calendar-surface {
    box-shadow: none;
    border: 0;
  }
}
