:root {
  --bg: #f4f1e7;
  --panel: #fffdf8;
  --ink: #1f2a2e;
  --muted: #687377;
  --line: #ddd5c5;
  --accent: #1f6c5c;
  --accent-soft: #d6ebe5;
  --warning: #9b2c2c;
  --warm: #d9822b;
  --shadow: 0 18px 40px rgba(31, 42, 46, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 130, 43, 0.12), transparent 28%),
    linear-gradient(180deg, #f7f4ea 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(12px);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-kicker,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a,
.filter-pills a,
.logout-link {
  text-decoration: none;
}

.nav a {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
}

.nav a.active,
.nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.user-chip {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.user-chip span,
.user-chip small {
  display: block;
}

.user-chip small {
  margin-top: 4px;
  color: var(--muted);
  text-transform: capitalize;
}

.logout-link {
  color: var(--warning);
}

.content {
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 6px 0 0;
  font-size: 2rem;
}

.stat-grid,
.panel-grid {
  display: grid;
  gap: 18px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 18px;
}

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

.stat-card,
.panel,
.day-card,
.login-panel {
  border: 1px solid rgba(221, 213, 197, 0.85);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-card span,
.stat-card small,
.empty-text {
  color: var(--muted);
}

.stat-card strong {
  font-size: 2rem;
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.panel-head a {
  color: var(--accent);
}

.event-list,
.day-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-row,
.day-card-head,
.detail-list li {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.event-row small,
.day-card-head small,
.detail-list span {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.badge-cleaning {
  background: #efe5d1;
  color: #8b5a19;
}

.badge-breakfast {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-positive {
  background: #e4f4e9;
  color: #1d6d3a;
}

.badge-negative {
  background: #fae7e7;
  color: var(--warning);
}

.badge-neutral {
  background: #ece9df;
  color: var(--muted);
}

.day-card {
  padding: 18px;
}

.detail-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-list li {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-main,
.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-meta {
  text-align: right;
  font-size: 0.92rem;
}

.cleaning-task.is-complete {
  opacity: 0.82;
}

.task-note {
  color: var(--muted);
}

.filter-pills {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
}

.filter-pills a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
}

.filter-pills a.active {
  background: var(--ink);
  color: white;
}

.change-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.change-row:first-child {
  border-top: none;
  padding-top: 0;
}

.change-main {
  min-width: 0;
}

.change-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.change-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.change-check span,
.change-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.change-action-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.selection-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.92);
}

.selection-actions small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.primary-button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.inline-form {
  margin-top: 8px;
}

.alert-success {
  background: #e4f4e9;
  color: #1d6d3a;
}

.alert-warning {
  background: #fbf1df;
  color: #8b5a19;
}

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

.login-panel {
  width: min(460px, 100%);
  padding: 28px;
}

.brand-block h1 {
  margin: 8px 0 10px;
}

.brand-block p {
  margin: 0 0 22px;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form input,
.login-form button,
.stack-form input,
.stack-form select,
.stack-form button {
  font: inherit;
}

.login-form input,
.stack-form input,
.stack-form select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: white;
}

.login-form button {
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.credential-note {
  margin-top: 8px;
}

.credential-note code {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  background: #eef3f2;
  color: var(--muted);
}

.alert-error {
  background: #fae7e7;
  color: var(--warning);
}

.host-summary-panel {
  margin-bottom: 18px;
}

.host-stat-grid {
  margin-bottom: 18px;
}

.month-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.month-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 253, 248, 0.7);
}

.month-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.month-card-head h3 {
  margin: 0 0 4px;
}

.day-card-badges,
.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.month-nav a {
  text-decoration: none;
  color: var(--accent);
}

.subpanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.compact-card {
  padding: 16px;
}

.email-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 18px;
}

.email-panel small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-item {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.settings-item:first-child {
  border-top: none;
  padding-top: 0;
}

.settings-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.settings-details {
  margin: 0;
  display: grid;
  gap: 14px;
}

.settings-details div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-details div:first-child {
  padding-top: 0;
  border-top: none;
}

.settings-details dt {
  font-weight: 600;
}

.settings-details dd {
  margin: 6px 0 0;
  color: var(--muted);
  word-break: break-word;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.reset-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.reset-form input {
  min-width: 240px;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-label {
  min-width: 120px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.compact-form {
  margin: 0;
}

.compact-form button {
  width: 100%;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 22px;
  }

  .stat-grid,
  .panel-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: start;
  }

  .detail-list li,
  .day-card-head,
  .event-row,
  .change-row,
  .selection-actions,
  .month-card-head,
  .email-panel,
  .status-row {
    flex-direction: column;
  }

  .detail-meta {
    text-align: left;
  }

  .status-label {
    min-width: 0;
  }
}
