.ww-main {
  padding-bottom: 2rem;
}

.ww-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.ww-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

.ww-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.ww-date-form {
  margin: 0;
}

.ww-date-form label {
  margin: 0;
  font-size: 0.9rem;
}

/* Date navigation + calendar picker */
.ww-date-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.ww-date-step {
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  margin: 0;
}

.ww-cal-wrap {
  position: relative;
}

.ww-cal-trigger {
  margin: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.ww-cal-trigger:hover {
  border-color: #6366f1;
}

.ww-cal-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 200;
  width: min(320px, calc(100vw - 2rem));
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
}

.ww-cal-popover[hidden] {
  display: none !important;
}

.ww-cal-header {
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.ww-cal-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  min-height: 2rem;
}

.ww-cal-nav,
.ww-cal-zoom,
.ww-cal-cell,
.ww-cal-today {
  margin: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text);
}

.ww-cal-nav {
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ww-cal-nav:hover,
.ww-cal-zoom:hover,
.ww-cal-cell:hover {
  background: var(--surface-2);
}

.ww-cal-zoom {
  padding: 0.25rem 0.5rem;
  border-radius: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.ww-cal-zoom--static {
  cursor: default;
}

.ww-cal-zoom--static:hover {
  background: transparent;
}

.ww-cal-grid {
  display: grid;
  gap: 0.2rem;
}

.ww-cal-grid--days {
  grid-template-columns: repeat(7, 1fr);
}

.ww-cal-grid--months {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.ww-cal-grid--years {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.ww-cal-dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.2rem 0;
}

.ww-cal-cell {
  border-radius: 0.4rem;
  min-height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
}

.ww-cal-cell--empty {
  pointer-events: none;
}

.ww-cal-day.is-today,
.ww-cal-month.is-today,
.ww-cal-year.is-today {
  outline: 1px solid var(--border);
  font-weight: 600;
}

.ww-cal-day.is-selected,
.ww-cal-month.is-selected,
.ww-cal-year.is-selected {
  background: #6366f1 !important;
  color: #fff !important;
  font-weight: 600;
}

.ww-cal-month,
.ww-cal-year {
  min-height: 2.6rem;
  font-size: 0.82rem;
}

.ww-cal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.ww-cal-today {
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

@media (max-width: 640px) {
  .ww-date-nav {
    width: 100%;
    justify-content: center;
  }

  .ww-date-step {
    font-size: 0.78rem;
    padding: 0.4rem 0.55rem;
  }

  .ww-cal-popover {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

.ww-section {
  margin-bottom: 1.75rem;
}

.ww-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.ww-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ww-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ww-table th,
.ww-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.ww-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  white-space: nowrap;
}

.ww-table tbody tr:last-child th,
.ww-table tbody tr:last-child td {
  border-bottom: 0;
}

.ww-desk-col {
  min-width: 6.5rem;
  white-space: nowrap;
}

.ww-names {
  font-weight: 500;
}

.ww-na {
  color: var(--muted-2);
}

.ww-empty {
  display: inline-block;
  min-width: 0.5rem;
}

.ww-off-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ww-off-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.ww-off-side {
  color: var(--muted);
  font-size: 0.78rem;
}

.ww-muted {
  color: var(--muted);
}

.ww-admin-link {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.ww-setup-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.ww-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .ww-admin-grid {
    grid-template-columns: 1fr;
  }
}

.ww-staff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
}

.ww-staff-card h4 {
  margin: 0 0 0.75rem;
}

.ww-staff-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.ww-staff-row label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.ww-staff-row input {
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.ww-pattern-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.ww-pattern-day {
  padding: 0.45rem 0.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.2;
  min-height: 2.6rem;
  word-break: break-word;
}

.ww-pattern-day.selected {
  border-color: #6366f1;
  color: #111;
}

.ww-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.ww-picker-backdrop.show {
  display: flex;
}

.ww-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.ww-picker h4 {
  margin: 0 0 0.75rem;
}

.ww-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.ww-picker-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
  color: #111;
}

.ww-picker-item.rest {
  background: var(--surface-2);
  color: var(--text);
}

.ww-alert {
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.ww-alert.err {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
