:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #d0d7de;
  --border-strong: #1f2328;
  --text: #1f2328;
  --muted: #59636e;
  --primary: #1a56db;
  --primary-hover: #1443b0;
  --weekend-bg: #dbe7f6;
  --today-ring: #2563eb;
  --danger: #dc2626;
  --checkin-red: #ff0000;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

.hidden {
  display: none !important;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-logo-lg {
  height: 46px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, #c97a9d, #f28c28, #6aa84f);
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 6px;
  background: #eef2f6;
  padding: 4px;
  border-radius: 9px;
  flex-wrap: wrap;
}

.tab {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  background: #f1f5f9;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: var(--surface);
}

.btn-danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.btn.spinning .sync-icon {
  display: inline-block;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.container {
  max-width: 1520px;
  margin: 0 auto;
  padding: 18px 20px 40px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Alerts banner */
.alerts-banner {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alerts-banner.has-sync-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.sync-err-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sync-err-pill {
  color: #b91c1c;
  font-weight: 700;
}

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

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-title {
  margin: 0;
  font-size: 20px;
  min-width: 175px;
  text-align: center;
  text-transform: capitalize;
}

.month-note-wrap {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 760px;
  flex-wrap: wrap;
}

.month-note-wrap input {
  flex: 1;
  min-width: 180px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

/* Legend */
.legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #333;
}

.swatch-red {
  background: var(--checkin-red);
}

.swatch-vac {
  background: repeating-linear-gradient(
    -45deg,
    #fef3c7,
    #fef3c7 4px,
    #f59e0b 4px,
    #f59e0b 8px
  );
}

.swatch-block,
.cell.cell-blocked {
  background: repeating-linear-gradient(
    -45deg,
    #64748b,
    #64748b 5px,
    #475569 5px,
    #475569 10px
  );
  color: #ffffff;
}

.cell-block-mark {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.55);
}

.legend-tri {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1px solid #333;
  position: relative;
}

.legend-tri::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 7px solid #111;
  border-left: 7px solid transparent;
}

.src-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}

.src-airbnb { background: #ff385c; }
.src-booking { background: #003580; }
.src-direct { background: #0f766e; }
.src-block { background: #475569; }

/* Calendar grid */
.grid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.grid-scroll {
  overflow-x: auto;
}

.cal-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.cal-table th,
.cal-table td {
  border: 1px solid #222;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  user-select: none;
}

.col-apt {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 190px;
  min-width: 190px;
  text-align: left !important;
  padding: 6px 10px !important;
  font-weight: 800;
  font-size: 14px;
  border-right: 3px solid #666 !important;
}

.month-corner {
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-transform: lowercase;
}

.weekday-row th {
  height: 22px;
  font-size: 11px;
  font-weight: 700;
  background: #f8fafc;
  color: #475569;
  width: 34px;
  min-width: 34px;
}

.season-row th {
  height: 28px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.season-row th.season-active {
  background: #e2e8f0;
  color: #0f172a;
  border-bottom: 2px solid #475569;
}

.season-row th.season-has-price {
  background: #fef9c3;
  color: #854d0e;
  border-bottom: 2px solid #ca8a04;
}

.season-row th.season-empty:hover,
.absence-row th.absence-empty:hover {
  background: #e0f2fe;
}

.season-label-col {
  background: #e2e8f0 !important;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  cursor: default !important;
}

.absence-row th {
  height: 24px;
  font-size: 11px;
  font-weight: 700;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
}

.absence-label-col {
  background: #fffbeb !important;
  color: #92400e !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  cursor: default !important;
}

.absence-row th.absence-active {
  background: repeating-linear-gradient(
    -45deg,
    #fef3c7,
    #fef3c7 6px,
    #fde68a 6px,
    #fde68a 12px
  );
  color: #92400e;
  border: 1px solid #d97706;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.day-num-row th {
  height: 28px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  width: 34px;
  min-width: 34px;
}

.day-num-row th.weekend,
.weekday-row th.weekend {
  background: var(--weekend-bg);
}

.day-num-row th.is-today {
  outline: 2px solid var(--today-ring);
  outline-offset: -2px;
  color: var(--today-ring);
}

.day-num-row th.out-month,
.weekday-row th.out-month,
.season-row th.out-month,
.absence-row th.out-month {
  background: #000;
  color: #000;
  cursor: default;
}

.cell {
  height: 36px;
  width: 34px;
  min-width: 34px;
  position: relative;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: filter 0.1s ease;
}

.cell:hover,
.cell.res-hover {
  filter: brightness(0.9);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.55);
}

.cell.is-checkin {
  box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.7);
}

.cell-prev-month {
  font-size: 11px;
  opacity: 0.7;
}

.cell.out-month {
  background: #000 !important;
  cursor: default;
}

.cell.weekend-empty {
  background: var(--weekend-bg);
}

.cell.is-today-col {
  box-shadow: inset 0 0 0 2px var(--today-ring);
}

.cell.has-note::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 8px solid #111;
  border-left: 8px solid transparent;
}

.cell-src {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.85;
}

.cell-star {
  font-size: 10px;
  vertical-align: super;
}

/* Year view */
.year-grids {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.year-month-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.year-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.year-month-header h3 {
  margin: 0;
  font-size: 15px;
  text-transform: capitalize;
}

/* Operations view */
.ops-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.ops-alert-card {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.editor-linen-box {
  background: #eef2ff;
  border: 1px solid #a5b4fc;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-linen-header {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3730a3;
}

.editor-rem-card {
  background: #ffffff;
  border: 1px solid #c7d2fe;
  border-left: 5px solid #4f46e5;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

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

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

.ops-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.summary-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
}

.summary-pill.urgent {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.ops-weekly-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.ops-weekly-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #166534;
}

.ops-weekly-items {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.ops-week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(195px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.ops-day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}

.ops-day-card.is-today {
  border: 2px solid var(--today-ring);
}

.ops-day-card.has-vacation .ops-day-header {
  background: repeating-linear-gradient(
    -45deg,
    #fef3c7,
    #fef3c7 6px,
    #fde68a 6px,
    #fde68a 12px
  );
  border-radius: 6px;
  padding: 6px 8px;
  margin: -4px -4px 0;
}

.ops-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef2f6;
  font-weight: 800;
  font-size: 13px;
  text-transform: capitalize;
  gap: 6px;
}

.day-add-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  width: 22px;
  height: 22px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.day-add-btn:hover {
  background: #e0f2fe;
}

.ops-vac-tag {
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 5px;
}

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

.ops-sec-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 5px;
}

.ops-sec-clean {
  background: #f1f5f9;
  color: #334155;
}

.ops-sec-keys {
  background: #eff6ff;
  color: #1e40af;
}

.ops-sec-other {
  background: #f5f3ff;
  color: #5b21b6;
}

.ops-task-card {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  border-left-width: 5px;
  background: #ffffff;
  font-size: 12px;
  cursor: pointer;
}

.ops-task-card.urgent {
  background: #fef2f2;
  border-color: #fca5a5;
  border-left-color: #dc2626 !important;
}

.ops-task-card.done {
  opacity: 0.48;
  text-decoration: line-through;
}

.ops-task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ops-task-title {
  font-weight: 700;
  word-break: break-word;
}

.ops-task-meta {
  font-size: 11px;
  color: var(--muted);
  word-break: break-word;
}

.ops-urgent-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #b91c1c;
  background: #fee2e2;
  padding: 1px 5px;
  border-radius: 4px;
  width: fit-content;
}

.ops-star-note {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  padding: 2px 6px;
  border-radius: 5px;
  word-break: break-word;
}

.ops-plain-note {
  margin-top: 2px;
  font-size: 11px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 5px;
  word-break: break-word;
}

.task-edit-btn {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}

.task-edit-btn:hover {
  color: var(--primary);
}

.task-del-btn {
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
}

.task-del-btn:hover {
  color: #dc2626;
}

.ops-empty-day {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  padding: 16px 4px;
}

.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: #f8fafc;
}

.day-chip input {
  width: auto !important;
  margin: 0;
}

.icon-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-palette {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  width: 34px;
  height: 34px;
  font-size: 17px;
  cursor: pointer;
}

.icon-btn.active {
  border-color: var(--primary);
  background: #eff6ff;
}

@media (max-width: 900px) {
  .ops-week-board {
    grid-template-columns: 1fr;
  }
  .ops-day-card {
    min-height: auto;
  }
}

/* Config view */
.config-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 14px;
}

.config-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.apt-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.status-ok { background: #dcfce7; color: #166534; }
.status-err { background: #fee2e2; color: #991b1b; }
.status-none { background: #f1f5f9; color: #64748b; }

.config-card label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 8px 0 4px;
}

.config-card input[type="url"],
.config-card input[type="text"] {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.config-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}

.export-link {
  font-size: 11px;
  color: var(--primary);
  text-decoration: none;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 10px;
}

body.read-only .editor-only {
  display: none !important;
}

body.role-cleaner .full-view-only {
  display: none !important;
}

body.role-viewer .no-viewer {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.login-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
}

.user-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--text);
}

.user-badge.role-lector {
  background: #fef3c7;
  color: #92400e;
}

.user-badge.role-viewer {
  background: #eff6ff;
  color: #1d4ed8;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.role-editor {
  background: #dbeafe;
  color: #1e40af;
}

.role-lector-pill {
  background: #fef3c7;
  color: #92400e;
}

.role-viewer-pill {
  background: #eff6ff;
  color: #1d4ed8;
}

.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
}

.checkbox-row {
  display: flex;
  align-items: flex-end;
  padding-bottom: 6px;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text) !important;
  margin-bottom: 0 !important;
}

.checkbox-label input {
  width: auto !important;
}

.ical-meta {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}

.safety-lock-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #92400e;
}

.safety-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.qpill {
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.qpill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.apt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.apt-chip input {
  width: auto !important;
  margin: 0;
}

/* Stats view */
.stats-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0;
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
}

.delta-up {
  color: #15803d;
  font-weight: 700;
}

.delta-down {
  color: #b91c1c;
  font-weight: 700;
}

.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.stats-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stats-table th,
.stats-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.stats-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8fafc;
}

.stats-table tr.is-selected-month {
  background: #eff6ff;
  font-weight: 700;
}

.bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-fill.prev {
  background: #94a3b8;
}

.modal-footer {
  position: sticky;
  bottom: -14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
  margin-top: 4px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 5;
}

.spacer {
  flex: 1;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 80;
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.today-pill {
  font-size: 10px;
  font-weight: 800;
  background: var(--today-ring);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: auto;
}

@media (max-width: 720px) {
  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }
  .tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .tab {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }
  .container {
    padding: 12px 10px 36px;
  }
  .col-apt {
    width: 112px;
    min-width: 112px;
    font-size: 12px;
    padding: 4px 6px !important;
  }
  .ops-day-card {
    padding: 14px;
    gap: 12px;
  }
  .ops-day-header {
    font-size: 16px;
  }
  .ops-sec-title {
    font-size: 12px;
    padding: 5px 8px;
  }
  .ops-task-card {
    padding: 11px 12px;
    gap: 10px;
    border-left-width: 7px;
    font-size: 14px;
  }
  .ops-task-card input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  .ops-task-title {
    font-size: 15px;
  }
  .ops-task-meta,
  .ops-star-note,
  .ops-plain-note {
    font-size: 13px;
  }
  .past-empty-day {
    display: none;
  }
  .modal-card {
    max-height: 92vh;
    overflow-y: auto;
  }
  .form-row input,
  .form-row select,
  .form-row textarea {
    font-size: 16px;
  }
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .config-list,
  .users-list {
    grid-template-columns: 1fr;
  }
}

/* Mossos Check-ins & Invoicing */
.subtabs {
  display: inline-flex;
  gap: 4px;
  background: #eef2f6;
  padding: 4px;
  border-radius: 8px;
  flex-wrap: wrap;
}

.subtab {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.subtab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Prominent Calendar Monthly / Annual view toggle */
.cal-view-switch-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.cal-view-switch {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.cal-mode-btn.subtab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cal-mode-btn.subtab:hover:not(.active) {
  background: #ffffff;
  color: #0f172a;
}

.cal-mode-btn.subtab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.cal-mode-icon {
  font-size: 18px;
  line-height: 1;
}

.cal-mode-text small {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}

@media (max-width: 720px) {
  .cal-view-switch {
    width: 100%;
  }
  .cal-mode-btn.subtab {
    flex: 1 1 50%;
    padding: 10px 12px;
    font-size: 14px;
  }
}

.subtab-panel {
  display: none;
}

.subtab-panel.active {
  display: block;
}

.mossos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mossos-search {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  min-width: 220px;
}

.res-checkin-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 12px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.pill-pending {
  background: #fef3c7;
  color: #92400e;
}

.pill-ok {
  background: #d1fae5;
  color: #065f46;
}

.pill-sent {
  background: #dbeafe;
  color: #1e40af;
}

.pill-purged {
  background: #f1f5f9;
  color: #475569;
}

.mossos-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fafbfc;
}

.mossos-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.copy-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.copy-item small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}

.copy-item strong {
  font-size: 13px;
  word-break: break-word;
}

.copy-mini-btn {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

.copy-mini-btn:hover {
  background: #e2e8f0;
}

.sig-preview {
  max-width: 260px;
  max-height: 90px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  margin-top: 8px;
}

.inv-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}

.inv-box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.inv-line-row {
  display: grid;
  grid-template-columns: 1fr 75px 95px 75px 85px 32px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.inv-line-row input {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
}

.inv-line-total {
  font-weight: 700;
  font-size: 13px;
  text-align: right;
}

.inv-totals {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  font-size: 14px;
}

@media (max-width: 640px) {
  .inv-line-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mossos 1-day-before alerts & Weekly visual cards */
.mossos-alerts-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mossos-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mossos-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 5px solid #94a3b8;
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.mossos-card.state-urgent {
  background: #fef2f2;
  border-color: #fca5a5;
}

.mossos-card.state-ready {
  background: #fffbeb;
  border-color: #fcd34d;
}

.mossos-card.state-sent {
  background: #f0fdf4;
  border-color: #86efac;
}

.mossos-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.mossos-card-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.checkin-date-big {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.pill-urgent {
  background: #fee2e2;
  color: #991b1b;
}

/* Stats Insights & 12-month Visual Chart */
.stats-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.channel-row {
  display: grid;
  grid-template-columns: 120px 1fr minmax(165px, auto);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.yoy-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 4px 4px;
}

.yoy-plot {
  position: relative;
  padding-left: 42px;
  overflow-x: auto;
}

.yoy-gridlines {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  top: 0;
  pointer-events: none;
}

.yoy-gridlines > span {
  position: absolute;
  left: 42px;
  right: 0;
  border-top: 1px dashed #cbd5e1;
}

.yoy-gridlines > span > em {
  position: absolute;
  left: -42px;
  top: -8px;
  width: 36px;
  text-align: right;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.yoy-cols {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(58px, 1fr));
  gap: 8px;
  align-items: end;
  z-index: 1;
}

.yoy-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 4px;
  border-radius: 8px;
}

.yoy-col.is-selected {
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.yoy-bars {
  height: 215px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  border-bottom: 1.5px solid #94a3b8;
  padding-bottom: 2px;
}

.yoy-bar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.yoy-bar {
  width: 22px;
  border-radius: 5px 5px 0 0;
  min-height: 3px;
  transition: height 0.2s ease;
}

.yoy-bar.cur {
  background: var(--primary);
}

.yoy-bar.prev {
  background: #cbd5e1;
}

.yoy-lbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  text-transform: capitalize;
  line-height: 1.2;
}

.yoy-nights {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.2;
}

.yoy-val {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.yoy-val.cur {
  color: var(--primary);
}

.yoy-val.prev {
  color: var(--muted);
}

.yoy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  padding-left: 42px;
}

.part-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.part-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.part-chip:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f8fafc;
}

.part-chip.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

.part-chip:disabled {
  opacity: 0.65;
  cursor: default;
}

.stats-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.stats-presets,
.stats-month-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stats-month-chip {
  min-width: 46px;
  justify-content: center;
  text-transform: capitalize;
}

.channel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.alerts-line {
  padding-left: 4px;
  line-height: 1.45;
}

.alerts-group + .alerts-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #fed7aa;
}

.alerts-sublabel {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
  margin-bottom: 2px;
}

.readonly-kpi {
  background: #f8fafc !important;
  font-weight: 700;
  color: #0f172a;
}

.yoy-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

/* Cleaning hours, extra tasks, maintenance & payroll */
.cleaning-alerts-banner {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #14532d;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 10px;
}

.cleaning-chip-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
}

.cleaning-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.cleaning-section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

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

.cleaning-checkout-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cleaning-checkout-card.is-prepared {
  background: #f0fdf4;
  border-color: #86efac;
}

.cleaning-checkout-card.is-urgent {
  border-color: #fca5a5;
  background: #fef2f2;
}

.cleaning-checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.apt-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.status-pill.prepared {
  background: #dcfce7;
  color: #166534;
}

.status-pill.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.urgent {
  background: #fee2e2;
  color: #991b1b;
}

.cleaning-extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
}

.cleaning-extra-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  background: #f8fafc;
  cursor: pointer;
}

.cleaning-extra-chip:has(input:checked) {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1e40af;
  font-weight: 600;
}

.cleaning-limit-hint {
  margin-top: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
}

.cleaning-limit-hint.over-limit {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-weight: 600;
}

.cleaning-tag {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  margin: 1px 2px;
}

.table-scroll {
  overflow-x: auto;
}

.cleaning-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cleaning-table th,
.cleaning-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.cleaning-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.cleaning-payroll-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  background: #f8fafc;
}
