/* ============================================================
   CONCIERGE OS — app shell
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: 15rem 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "side top" "side main";
  min-height: 100svh;
}

/* ============ SIDEBAR ============ */
.side {
  grid-area: side;
  background: var(--bg-1);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 1.25rem;
  position: sticky; top: 0; height: 100svh; overflow-y: auto;
}
.side__brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; }
.side__mark { width: 1.75rem; height: 1.75rem; flex: none; color: var(--acc); }
.side__name { font-weight: 550; letter-spacing: -0.01em; }
.side__name small { display: block; font-family: var(--mono); font-size: var(--fs-xs); color: var(--tx-2); letter-spacing: 0.1em; font-weight: 400; }

.side__prop {
  border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 0.55rem 0.7rem; display: grid; gap: 0.15rem;
  background: var(--bg-2);
}
.side__prop select {
  background: transparent; border: 0; padding: 0; width: 100%;
  font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
}
.side__prop select option { background: var(--bg-2); }

.side__nav { display: grid; gap: 0.15rem; }
.side__nav a {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 0.6rem; border-radius: var(--r);
  color: var(--tx-1); font-size: var(--fs-sm);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.side__nav a:hover { background: var(--bg-2); color: var(--tx-0); }
.side__nav a[aria-current="page"] { background: var(--bg-3); color: var(--tx-0); font-weight: 500; }
.side__nav svg { width: 1rem; height: 1rem; flex: none; opacity: 0.8; }
.side__nav .count {
  margin-left: auto; font-family: var(--mono); font-size: var(--fs-xs);
  background: var(--bg-3); padding: 0.1em 0.45em; border-radius: 99px; color: var(--tx-1);
}
.side__nav a[aria-current="page"] .count { background: var(--acc-dim); color: var(--tx-0); }

.side__foot { margin-top: auto; display: grid; gap: 0.5rem; }
.side__user { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; border-top: 1px solid var(--line-soft); }
.side__avatar {
  width: 1.9rem; height: 1.9rem; border-radius: 99px; flex: none;
  background: var(--acc-dim); color: var(--tx-0);
  display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600;
}

/* ============ TOPBAR ============ */
.top {
  grid-area: top;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--bg-0) 88%, transparent);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 30;
}
.top__title { font-size: var(--fs-lg); font-weight: 550; }
.top__sub { font-family: var(--mono); font-size: var(--fs-xs); color: var(--tx-2); letter-spacing: 0.08em; }
.top__spacer { flex: 1; }
.top__search {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-1); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 0.4rem 0.7rem; min-width: 14rem;
}
.top__search input { background: transparent; border: 0; width: 100%; font-size: var(--fs-sm); }
.top__search input:focus { outline: none; }
.top__search svg { width: 0.9rem; height: 0.9rem; color: var(--tx-2); flex: none; }
.top__search kbd {
  font-family: var(--mono); font-size: 0.62rem; color: var(--tx-2);
  border: 1px solid var(--line); border-radius: 3px; padding: 0.1em 0.3em;
}

.burger-app { display: none; }

/* ============ MAIN ============ */
.main { grid-area: main; padding: 1.25rem; display: grid; gap: 1.25rem; align-content: start; }

/* ---- stat strip ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; }
.stat { padding: 0.9rem 1rem; display: grid; gap: 0.3rem; }
.stat__v { font-family: var(--mono); font-size: var(--fs-2xl); line-height: 1; font-weight: 500; }
.stat__l { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx-2); }
.stat__d { font-size: var(--fs-xs); display: flex; align-items: center; gap: 0.3rem; }
.stat__d--up { color: var(--acc); }
.stat__d--down { color: var(--urgent); }

/* ---- two column work area ---- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 68rem) { .grid-2 { grid-template-columns: 1fr; } }

.panel { display: grid; }
.panel__head {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--line-soft);
}
.panel__title { font-size: var(--fs-md); font-weight: 550; }
.panel__spacer { flex: 1; }
.panel__body { padding: 0.5rem; }
.panel__body--flush { padding: 0; }

/* ---- segmented control ---- */
.seg { display: inline-flex; background: var(--bg-2); border-radius: var(--r); padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: transparent; border-radius: 4px;
  padding: 0.3em 0.7em; font-size: var(--fs-xs); font-family: var(--mono);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--tx-2); cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.seg button:hover { color: var(--tx-0); }
.seg button[aria-pressed="true"] { background: var(--bg-3); color: var(--tx-0); }

/* ---- request rows ---- */
.req {
  display: grid;
  grid-template-columns: 3.2rem minmax(0,1fr) 7rem 6.5rem 2rem;
  gap: 0.75rem; align-items: center;
  padding: 0.6rem 0.75rem; border-radius: var(--r);
  transition: background 0.2s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
}
.req:hover { background: var(--bg-2); }
.req[aria-selected="true"] { background: var(--bg-2); border-color: var(--line); }
.req[hidden] { display: none; }
.req__room { font-family: var(--mono); font-size: var(--fs-sm); color: var(--tx-1); }
.req__what { font-size: var(--fs-sm); }
.req__who { display: block; font-family: var(--mono); font-size: var(--fs-xs); color: var(--tx-2); margin-top: 0.15rem; }
.req__age { font-family: var(--mono); font-size: var(--fs-xs); color: var(--tx-2); }
.req__age--late { color: var(--urgent); }
.req__done {
  width: 1.4rem; height: 1.4rem; border-radius: var(--r); border: 1px solid var(--line);
  background: transparent; cursor: pointer; display: grid; place-items: center;
  color: var(--tx-2); transition: all 0.2s var(--ease);
}
.req__done:hover { border-color: var(--acc); color: var(--acc); }
.req.is-done { opacity: 0.4; }
.req.is-done .req__what { text-decoration: line-through; }
.req.is-done .req__done { background: var(--acc-dim); border-color: var(--acc-dim); color: var(--tx-0); }
@media (max-width: 52rem) {
  .req { grid-template-columns: 3rem 1fr 2rem; row-gap: 0.25rem; }
  .req__status { grid-column: 2 / 3; }
  .req__age { grid-column: 2 / 3; }
}

.empty { padding: 2rem 1rem; text-align: center; color: var(--tx-2); font-size: var(--fs-sm); }

/* ---- housekeeping board ---- */
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr)); gap: 0.4rem; padding: 0.75rem; }
.room {
  aspect-ratio: 1; border-radius: var(--r); border: 1px solid var(--line-soft);
  display: grid; place-content: center; gap: 0.15rem; text-align: center;
  font-family: var(--mono); font-size: var(--fs-xs); cursor: pointer;
  background: var(--bg-2); color: var(--tx-1);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.room:hover { transform: translateY(-2px); border-color: var(--tx-2); }
.room b { font-size: var(--fs-sm); font-weight: 500; color: var(--tx-0); }
.room span { font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; }
.room--clean  { border-color: var(--acc-dim); }
.room--clean span { color: var(--acc); }
.room--dirty  { border-color: color-mix(in oklab, var(--warn) 50%, transparent); }
.room--dirty span { color: var(--warn); }
.room--occupied { background: var(--bg-3); }
.room--occupied span { color: var(--info); }
.room--ooo { opacity: 0.5; }
.room--ooo span { color: var(--urgent); }

.legend { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 0 1rem 1rem; }

/* ---- arrivals timeline ---- */
.arrivals { display: grid; }
.arr {
  display: grid; grid-template-columns: 3.5rem 1fr auto; gap: 0.75rem;
  padding: 0.65rem 1rem; border-bottom: 1px solid var(--line-soft); align-items: center;
}
.arr:last-child { border-bottom: 0; }
.arr__t { font-family: var(--mono); font-size: var(--fs-sm); color: var(--acc); }
.arr__n { font-size: var(--fs-sm); }
.arr__m { font-family: var(--mono); font-size: var(--fs-xs); color: var(--tx-2); margin-top: 0.1rem; }

/* ---- activity feed ---- */
.feed { display: grid; max-height: 20rem; overflow-y: auto; }
.act { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.6rem; padding: 0.55rem 1rem; align-items: start; }
.act__dot { width: 1.6rem; height: 1.6rem; border-radius: 99px; background: var(--bg-3); display: grid; place-items: center; font-family: var(--mono); font-size: 0.6rem; color: var(--tx-1); }
.act__t { font-size: var(--fs-sm); }
.act__m { font-family: var(--mono); font-size: var(--fs-xs); color: var(--tx-2); }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 140%);
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r); padding: 0.6rem 1rem; font-size: var(--fs-sm);
  display: flex; align-items: center; gap: 0.6rem; z-index: 90;
  transition: transform 0.45s var(--ease);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.toast.is-up { transform: translate(-50%, 0); }
.toast b { color: var(--acc); font-weight: 500; }

/* ---- demo ribbon ---- */
.demo-tag {
  position: fixed; right: 0; bottom: 0; z-index: 120;
  background: color-mix(in oklab, var(--bg-1) 94%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--line-soft); border-right: 0; border-bottom: 0;
  padding: 0.5rem 0.9rem; font-family: var(--mono); font-size: 0.64rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx-2);
  transition: color 0.3s var(--ease), transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.demo-tag.is-idle { transform: translateY(85%); opacity: 0.55; }
.demo-tag:hover { color: var(--tx-0); transform: translateY(0); opacity: 1; }
.demo-tag b { color: var(--acc); font-weight: 400; }

/* ============ RESPONSIVE SHELL ============ */
@media (max-width: 60rem) {
  .app { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 15rem; z-index: 60;
    transform: translateX(-100%); transition: transform 0.35s var(--ease);
  }
  .side.is-open { transform: none; }
  .burger-app {
    display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-1); cursor: pointer;
  }
  .burger-app svg { width: 1rem; height: 1rem; }
  .scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 50;
    opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease);
  }
  .scrim.is-on { opacity: 1; pointer-events: auto; }
}
@media (min-width: 60.01rem) { .scrim { display: none; } }
@media (max-width: 40rem) {
  .top__search { min-width: 0; flex: 1; }
  .main { padding: 0.85rem; }
}
