:root {
  color-scheme: light;
  --ink: #151727;
  --muted: #667085;
  --line: #e5e7ef;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --soft: #f7f8fc;
  --night: #17182f;
  --pink: #ff3d8b;
  --coral: #ff6b4a;
  --yellow: #ffd23f;
  --mint: #34d399;
  --cyan: #00b8d9;
  --blue: #4263eb;
  --green: #0f9f6e;
  --amber: #b76a00;
  --red: #d92d20;
  --shadow: 0 22px 70px rgba(28, 32, 66, 0.13);
  --shadow-soft: 0 14px 34px rgba(28, 32, 66, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #fcfcff;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 210, 63, 0.22), transparent 28%),
    linear-gradient(225deg, rgba(0, 184, 217, 0.2), transparent 30%),
    #fcfcff;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(66, 99, 235, 0.28);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 61, 139, 0.24), transparent 34%),
    linear-gradient(145deg, var(--night), #101126 64%, #092d3a);
  color: #f8fafc;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  box-shadow: 12px 0 40px rgba(23, 24, 47, 0.16);
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: conic-gradient(from 210deg, var(--yellow), var(--pink), var(--cyan), var(--mint), var(--yellow));
  color: #111827;
  font-weight: 950;
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(255, 61, 139, 0.24);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.brand-block h1 {
  font-size: 20px;
  letter-spacing: 0;
}

.brand-block p,
.side-note span {
  color: #d8e2ef;
  font-size: 13px;
  line-height: 1.45;
}

.nav-list {
  display: grid;
  gap: 9px;
}

.nav-button {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #edf4ff;
  padding: 12px;
  border-radius: var(--radius);
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

.nav-button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
}

.nav-button.is-active {
  background: #ffffff;
  color: #151727;
  border-color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.nav-button.is-active span {
  background: var(--yellow);
}

.side-note {
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  display: grid;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.main-panel {
  min-width: 0;
  padding: 30px;
}

.topbar,
.job-toolbar,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.topbar {
  align-items: center;
}

.eyebrow {
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
}

h3 {
  font-size: 22px;
}

h4 {
  font-size: 16px;
  margin-bottom: 12px;
}

.topbar-actions,
.job-actions,
.dialog-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.date-control {
  color: var(--muted);
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
}

input[type="date"],
input[type="text"],
input[type="password"],
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

input[type="date"] {
  height: 42px;
  padding: 0 11px;
  box-shadow: var(--shadow-soft);
}

input[type="text"],
input[type="password"],
select {
  min-height: 42px;
  padding: 0 11px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 15px;
  border: 1px solid transparent;
  font-weight: 900;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--pink), var(--coral));
  color: #fff;
  box-shadow: 0 14px 28px rgba(255, 61, 139, 0.25);
}

.secondary-button {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  box-shadow: 0 14px 28px rgba(66, 99, 235, 0.2);
}

.ghost-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.signin-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 210, 63, 0.24), transparent 34%),
    linear-gradient(225deg, rgba(0, 184, 217, 0.26), transparent 36%),
    rgba(252, 252, 255, 0.94);
  backdrop-filter: blur(12px);
}

.signin-screen.is-hidden {
  display: none;
}

.signin-card {
  width: min(440px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  display: grid;
  gap: 16px;
}

.signin-card label {
  display: grid;
  gap: 7px;
  font-weight: 900;
}

.job-toolbar,
.section-heading,
.panel,
.status-card,
.task-card,
.room-section,
.qr-card {
  background: var(--panel);
  border: 1px solid rgba(229, 231, 239, 0.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.job-toolbar,
.section-heading {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.job-toolbar::before,
.section-heading::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--pink), var(--yellow), var(--cyan));
}

.job-toolbar p,
.section-heading p,
.muted {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.progress-track {
  width: min(420px, 100%);
  height: 9px;
  margin-top: 14px;
  border-radius: 999px;
  background: #eceff8;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(21, 23, 39, 0.1);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--mint), var(--cyan));
  transition: width 260ms ease;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.status-card {
  padding: 16px;
  display: grid;
  gap: 7px;
  position: relative;
  overflow: hidden;
}

.status-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--mint), var(--cyan));
}

.status-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-card strong {
  font-size: 21px;
}

.task-list,
.history-list {
  display: grid;
  gap: 11px;
}

.room-section {
  overflow: hidden;
}

.room-heading {
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(66, 99, 235, 0.12), rgba(0, 184, 217, 0.1));
  border-bottom: 1px solid var(--line);
}

.room-heading h4 {
  margin-bottom: 2px;
}

.room-heading p {
  color: var(--muted);
  font-weight: 800;
}

.room-task-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.task-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.room-task-list .task-card {
  box-shadow: none;
}

.task-card:hover {
  transform: translateY(-1px);
  border-color: rgba(66, 99, 235, 0.28);
}

.task-card.is-done {
  border-color: rgba(52, 211, 153, 0.48);
  background: rgba(255, 255, 255, 0.72);
}

.task-card input[type="checkbox"] {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border: 2px solid #ccd2e3;
  border-radius: 7px;
  background: #fff;
  display: grid;
  place-items: center;
}

.task-card input[type="checkbox"]::before {
  content: "";
  width: 11px;
  height: 7px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

.task-card input[type="checkbox"]:checked {
  border-color: var(--green);
  background: linear-gradient(135deg, var(--green), var(--mint));
}

.task-card input[type="checkbox"]:checked::before {
  transform: rotate(-45deg) scale(1);
}

.task-title {
  display: grid;
  gap: 4px;
}

.task-title strong {
  font-size: 15px;
}

.task-title span {
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
}

.task-card.is-done .task-title strong {
  color: #0f766e;
}

.task-tools {
  min-width: 190px;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #e8fbf4;
  color: #08704f;
}

.badge.photo {
  background: #fff4bf;
  color: #8a5300;
}

.photo-input {
  max-width: 190px;
  font-size: 12px;
}

.photo-status {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.owner-grid,
.qr-layout,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.summary-box {
  display: grid;
  gap: 10px;
  color: var(--ink);
  line-height: 1.45;
}

textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(20, 23, 39, 0.04);
}

.qr-card {
  padding: 20px;
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.qr-card img {
  width: min(100%, 280px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 44px rgba(0, 184, 217, 0.15);
}

.qr-card span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.mono-link {
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.history-item {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.history-item ul {
  margin: 0;
  padding-left: 20px;
}

.settings-panel {
  margin-top: 16px;
}

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

.day-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-pill,
.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 800;
}

.room-order-list,
.storage-settings,
.task-settings-list {
  display: grid;
  gap: 8px;
}

.storage-settings label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.room-order-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.room-order-row span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e8fbf4;
  color: #08704f;
  font-weight: 900;
}

.task-setting-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.4fr) 170px auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.finish-dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: min(560px, calc(100vw - 24px));
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.finish-dialog::backdrop {
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(5px);
}

.finish-dialog form {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.finish-dialog label {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.finish-dialog textarea {
  min-height: 120px;
  font-weight: 400;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .owner-grid,
  .qr-layout,
  .settings-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .task-setting-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .main-panel,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .job-toolbar,
  .section-heading,
  .task-card {
    display: grid;
  }

  .task-card {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .task-tools {
    grid-column: 1 / -1;
    justify-items: start;
    min-width: 0;
  }

  .topbar-actions,
  .job-actions {
    width: 100%;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  input[type="date"] {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .view:not(#qrView) {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main-panel {
    padding: 0;
  }

  .qr-layout {
    grid-template-columns: 1fr;
  }
}
