/* Nordkey Housekeeping styles */
.nkhk-wrap { border:1px solid #e5e7eb; padding:16px; border-radius:12px; background:#fff; }
.nkhk-cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; gap:8px; }
.nkhk-title { margin:0; font-size:1.25rem; }
.nkhk-nav { background:#f3f4f6; border:1px solid #e5e7eb; padding:6px 10px; border-radius:8px; cursor:pointer; }
.nkhk-nav:hover { background:#e5e7eb; }

/* Calendar container controls vertical spacing globally */
.nkhk-calendar {
  --nkhk-gap: 6px;              /* horizontal gap between columns */
  display: grid !important;     /* stack header + week rows */
  grid-auto-flow: row;
  row-gap: 12px !important;     /* vertical space between header and each week */
  width: 100%;
}

/* Weekday header and week rows share the same 7-col grid */
.nkhk-calendar .nkhK-head,
.nkhk-calendar .nkhk-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  column-gap: var(--nkhk-gap);
  margin: 0 !important;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
  box-sizing: border-box;
}

.nkhK-dow { text-align:center; font-weight:600; color:#6b7280; padding:6px 0; }

.nkhk-cell {
  position:relative;
  padding:12px;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:10px;
  text-align:right;
  min-height:56px;
  cursor:pointer;
  width: 100%;
  box-sizing: border-box;
  justify-self: stretch;
}

.nkhk-cell.off { opacity:0.5; }
.nkhk-cell.today { outline:2px solid #3b82f6; }
.nkhk-cell.todo { background:#fff1f2; border-color:#fecaca; } /* red-ish */
.nkhk-cell.done { background:#ecfdf5; border-color:#bbf7d0; } /* green-ish */
.nkhk-cell.selected { box-shadow:0 0 0 2px #374151 inset; }

.nkhk-badge {
  position:absolute;
  left:8px;
  top:8px;
  font-size:12px;
  background:#111827;
  color:#fff;
  border-radius:20px;
  padding:2px 6px;
}

.nkhk-day-panel { margin-top:16px; }
.nkhk-day-title { margin:0 0 8px 0; font-size:1.1rem; }
.nkhk-loading, .nkhk-msg, .nkhk-error { padding:10px; background:#f3f4f6; border-radius:8px; }

/* Cards */
.nkhk-card { border:1px solid #e5e7eb; border-radius:12px; padding:10px; margin:10px 0; background:#ffffff; overflow:hidden; transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.nkhk-card.cleaned { border-color:#86efac; background:#f0fdf4; }

/* Not cleaned: light red background + soft red outline */
.nkhk-card:not(.cleaned) {
  background: #fdf3f4;
  border: 1px solid #ec9fa2;
  box-shadow: none;
}

.nkhk-card-head { margin-bottom:6px; }
.nkhk-card-body > div { margin:4px 0; }

/* Footer layout: form on top, button on its own row */
.nkhk-card-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 10px 16px 0;
  margin-top: 10px;
  border-top: 1px solid #ececec;
}

.nkhk-btn { background:#10b981; border:none; color:#fff; padding:8px 12px; border-radius:8px; cursor:pointer; }
.nkhk-card.cleaned .nkhk-btn { background:#6b7280; }

.nkhk-tasks h5 { margin:16px 0 8px 0; font-size:1rem; border-bottom:1px solid #e5e7eb; padding-bottom:4px; }

/* URGENT styling */
.nkhk-card { position: relative; }
.nkhk-urgent { display:flex; align-items:center; gap:6px; color:#ffa500; font-weight:700; margin-bottom:6px; }
.nkhk-urgent-icon { width:16px; height:16px; object-fit:contain; }
.nkhk-urgent-emoji { font-size:16px; line-height:1; }
.nkhk-urgent-text { color:#ffa500; font-weight:700; }
.nkhk-urgent-badge { position:absolute; right:12px; top:12px; background:rgba(255,165,0,0.08); color:#ffa500; border:1px solid #ffa500; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:700; z-index:20; display:flex; align-items:center; gap:6px; }
.nkhk-urgent-time { color:#ffa500; }

/* CLEANED bubble */
.nkhk-card.cleaned .nkhk-urgent-badge { display:none; }
.nkhk-cleaned-badge { position:absolute; right:12px; top:12px; background:rgba(16,185,129,0.12); color:#10b981; border:1px solid #10b981; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:700; z-index:20; display:flex; align-items:center; gap:6px; }
.nkhk-cleaned-text { color:#10b981; font-weight:700; }
.nkhk-cleaned-icon { width:14px; height:14px; object-fit:contain; display:inline-block; }

/* NOT CLEANED badge */
.nkhk-not-cleaned-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nkhk-not-cleaned-text { color: #b91c1c; font-weight: 700; }
.nkhk-not-cleaned-emoji { font-size: 16px; line-height: 1; }

/* Stack urgent below NOT CLEANED when present */
.nkhk-urgent-badge { top: 44px; }

/* ===== TASK FORMS ALIGN (clean) ===== */

/* Two-column grid: label | control */
.nkhk-form {
  width: 100%;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 8px;
  align-items: center;
}

/* Labels */
.nkhk-label {
  font-weight: 600;
  font-size: 13px;
  color: #111;
  text-align: right;
}

/* Inputs */
.nkhk-input,
.nkhk-textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  padding: 6px 10px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
}

.nkhk-textarea {
  min-height: 56px;
  resize: vertical;
}

/* Primary action button (right, own row), flips style when cleaned */
.nkhk-btn.nkhK-action {
  align-self: flex-end;
  margin-top: 4px;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform .02s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  box-shadow: 0 2px 0 rgba(0,0,0,.08);
}

/* Mark cleaned (green) */
.nkhk-btn.nkhK-action:not(.is-cleaned) { background: #10b981; color: #fff; }
.nkhk-btn.nkhK-action:not(.is-cleaned):hover { filter: brightness(1.03); }
.nkhk-btn.nkhK-action:not(.is-cleaned):active { transform: translateY(1px); }

/* Undo cleaned (neutral) */
.nkhk-btn.nkhK-action.is-cleaned {
  background: #f3f4f6;
  color: #111;
  border: 1px solid #d1d5db;
  box-shadow: none;
}
.nkhk-btn.nkhK-action.is-cleaned:hover { background: #e5e7eb; }

/* Ensure left alignment inside the footer */
.nkhk-card-foot, .nkhk-card-foot * { text-align: left; }

/* "Cleaned at" line: smaller, bold, green */
.nkhk-card .nkhk-cleaned-at {
  font-size: 15px;
  font-weight: 700;
  color: #10b981;
  margin-top: 4px;
}

/* Photo links: smaller text */
.nkhk-photo-links {
  font-size: 15px;
  line-height: 1.2;
  margin-top: 4px;
}
.nkhk-photo-links .nkhk-photo-link,
.nkhk-photo-links .nkhk-photo-sep { font-size: inherit; }
.nkhk-photo-links .nkhk-photo-sep { opacity: .7; }

/* Tiny info icon for notes/photos */
.nkhk-meta-ico {
  position: absolute;
  right: 3px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.9;
  pointer-events: none;
}

/* Default badge (desktop/tablet) */
.nkhk-calendar .nkhk-badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  /* Slightly tighter vertical spacing on small screens (optional) */
  .nkhk-calendar { row-gap: 8px !important; }

  .nkhK-dow {
    text-align: center;
    font-size: 12px;
    padding: 6px 0;
  }

  /* Day buttons: square-ish tiles, number centered */
  .nkhK-day {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    aspect-ratio: 1 / 1;
  }
}

/* Even smaller badge on phones */
@media (max-width: 600px) {
  .nkhk-calendar .nkhk-badge {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 8px;
  }
}
@media (max-width: 360px) {
  .nkhk-calendar .nkhk-badge {
    font-size: 9px;
    padding: 0 3px;
    border-radius: 7px;
  }
}

/* Mobile: stack labels above controls in the card form */
@media (max-width: 600px) {
  .nkhk-form {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .nkhk-label { text-align: left; }
}

/* Mobile: move 0/1 badge further up-left */
@media (max-width: 600px) {
  .nkhk-calendar .nkhk-cell .nkhk-badge {
    top: 2px;           /* was 8px */
    left: 2px;          /* was 8px */
    padding: 0 3px;     /* a bit tighter so it fits the corner nicely */
    border-radius: 6px;
    line-height: 1.1;
    pointer-events: none; /* don't block taps on the day */
    z-index: 3;
  }
}

/* Smaller text for the Checklist section */
.nkhk-checks .nkhk-check span {
  font-size: 14px;  /* checkbox label text (e.g., "asadsadadsa") */
}


/* Optional: even smaller on mobile */
@media (max-width: 600px) {
  .nkhk-checks .nkhk-check span { font-size: 11px; }
  .nkhk-form label.nkhk-label:has(+ .nkhk-checks) { font-size: 11px; }
}


/* Bold the room name and the values for:
   - Cleaned by
   - Beds prepared (latest)
   - Latest cleaned at
*/
.nkhk-units-status .nkhk-us-room strong {
  font-weight: 700;
}


/* --- NKHK calendar: make all dates visible on small screens --- */

/* Header row (Mon–Sun) */
.nkhk-calendar .nkhK-head {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 6px !important;
}

/* Each week row = 7 equal columns */
.nkhk-calendar .nkhk-row:not(.nkhK-head) {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

/* Day buttons fill their grid cells and center the number */
.nkhk-calendar .nkhK-day {
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px;                 /* keeps them tappable */
  border-radius: 12px;
}

/* Tweak for very small screens */
@media (max-width: 420px) {
  .nkhk-calendar .nkhk-row { gap: 4px !important; }
  .nkhk-calendar .nkhK-day { min-height: 38px; font-size: 14px; }
}

/* iOS Safari rounding fix: avoid any horizontal overflow */
.nkhk-calendar, .nkhk-calendar * { max-width: 100%; }