:root {
  --ink: #13263d;
  --muted: #66758a;
  --line: #d9e2ec;
  --soft: #f4f7fb;
  --blue: #0a55b4;
  --blue-2: #0d75d9;
  --teal: #13b9a8;
  --green: #21b56f;
  --amber: #f3a51d;
  --red: #db4d4d;
  --violet: #7765d8;
  --white: #fff;
  --shadow: 0 12px 28px rgba(20, 42, 72, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #eef3f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 44vw) 1fr;
  background: #f7fbff;
}
.login-hero {
  padding: 42px;
  color: white;
  background: linear-gradient(145deg, rgba(6, 45, 96, .96), rgba(14, 150, 176, .92)), url("./assets/transparent-logo.png") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-hero img { width: min(420px, 86%); filter: drop-shadow(0 16px 36px rgba(0,0,0,.28)); }
.login-hero h1 { margin: 32px 0 10px; font-size: clamp(34px, 6vw, 68px); line-height: .95; }
.login-hero p { max-width: 620px; color: rgba(255,255,255,.85); font-size: 18px; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card {
  width: min(430px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-card h2 { margin: 4px 0 20px; font-size: 26px; }
.field { display: grid; gap: 7px; margin: 14px 0; }
.field span { color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: white;
}
textarea { min-height: 92px; resize: vertical; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 222px 1fr; }
.rail {
  background: #10263f;
  color: white;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand img { width: 158px; max-width: 100%; }
.nav { display: grid; gap: 4px; overflow: auto; }
.nav button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: rgba(255,255,255,.82);
  background: transparent;
  text-align: left;
}
.nav button:hover, .nav button.active { background: rgba(255,255,255,.12); color: white; }
.nav .count { color: #9ce7df; font-size: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.title h1 { margin: 0; font-size: 22px; line-height: 1.1; }
.title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.search { max-width: 390px; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  background: #e8fffb;
  color: var(--blue);
  font-weight: 800;
}
.content { padding: 20px; display: grid; gap: 16px; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(20,42,72,.05);
  min-width: 0;
}
.card-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.card-body { padding: 14px; }
.metric { padding: 16px; display: grid; gap: 8px; min-height: 118px; }
.metric strong { font-size: 30px; line-height: 1; }
.metric span { color: var(--muted); font-size: 13px; }
.metric small { color: var(--green); font-weight: 800; }
.btn {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: white;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
}
.btn.primary { border-color: var(--blue); background: var(--blue); color: white; }
.btn.teal { border-color: var(--teal); background: var(--teal); color: white; }
.btn.danger { border-color: var(--red); background: var(--red); color: white; }
.btn.ghost { background: transparent; }
.btn.icon { width: 38px; justify-content: center; padding: 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.pill.clean, .pill.complete, .pill.ready { background: #def8ed; color: #08764b; }
.pill.dirty, .pill.high, .pill.out { background: #ffe6e6; color: #a72e2e; }
.pill.progress, .pill.assigned, .pill.medium { background: #e7f1ff; color: #165db0; }
.pill.inspect, .pill.pending { background: #fff2cf; color: #96650d; }
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 8px;
}
.room {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 3px;
}
.room strong { font-size: 14px; }
.room small { font-size: 10px; color: var(--muted); }
.room.clean { border-color: #9ce2c4; background: #effdf6; }
.room.dirty { border-color: #f2b3b3; background: #fff3f3; }
.room.inspect { border-color: #f6cf76; background: #fff9e8; }
.room.out { border-color: #b9c6d4; background: #eef2f6; }
.list { display: grid; gap: 10px; }
.item {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px;
  display: grid;
  gap: 8px;
  background: white;
}
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item h3 { margin: 0; font-size: 15px; }
.item p { margin: 0; color: var(--muted); font-size: 13px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tabs, .filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
  color: var(--muted);
}
.tab.active { border-color: var(--blue); color: white; background: var(--blue); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: white;
}
.day strong { font-size: 13px; }
.day small { display: block; margin-top: 6px; color: var(--blue); font-size: 11px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 24, 42, .48);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 20px;
}
.modal {
  width: min(620px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.modal .card-head { position: sticky; top: 0; background: white; z-index: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full { grid-column: 1 / -1; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #10263f;
  color: white;
  padding: 12px 14px;
  border-radius: 7px;
  box-shadow: var(--shadow);
  z-index: 40;
}
.progress {
  height: 9px;
  border-radius: 999px;
  background: #e5edf5;
  overflow: hidden;
}
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.split-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 20px; text-align: center; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail { position: sticky; top: 0; z-index: 20; padding: 10px 12px; min-width: 0; overflow: hidden; }
  .brand { min-height: 48px; border-bottom: 0; padding: 0; }
  .brand img { width: 142px; }
  .nav {
    display: flex;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .nav button {
    min-width: 128px;
    grid-template-columns: 24px 1fr auto;
  }
  .topbar { grid-template-columns: 1fr; height: auto; padding: 12px; }
  .toolbar { flex-wrap: wrap; }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: 340px; }
}

@media (max-width: 560px) {
  .content { padding: 12px; }
  .top-left { flex-direction: column; align-items: stretch; }
  .form-grid { grid-template-columns: 1fr; }
  .nav { grid-template-columns: none; }
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
}
