/* Sala Reuniões — visual inspirado no Agregados Portal V2 (Cia Verde). */

:root {
  --green-900: #1b5e20;
  --green-800: #2e7d32;
  --green-700: #388e3c;
  --green-600: #43a047;
  --green-500: #66bb6a;
  --green-50: #f1f8f3;

  --page: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --surface-hover: #f3f7f4;
  --line: #e2e7ec;
  --line-strong: #d5dce6;
  --text: #334155;
  --text-strong: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #2e7d32;
  --accent-soft: #eef7ef;
  --ring: rgba(67, 160, 71, 0.22);
  --danger: #c62828;
  --danger-soft: #fdecea;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px -6px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 40px -20px rgba(15, 23, 42, 0.22), 0 6px 12px -6px rgba(15, 23, 42, 0.08);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: 240px;
  --radius: 12px;
}

html.dark {
  color-scheme: dark;
  --page: #0f1318;
  --surface: #151a21;
  --surface-2: #1a2028;
  --surface-hover: #1b232b;
  --line: #222932;
  --line-strong: #2b333d;
  --text: #cdd4dd;
  --text-strong: #f1f5f9;
  --muted: #97a2b0;
  --faint: #7f8a98;
  --accent: #81c784;
  --accent-soft: #1a2a1e;
  --ring: rgba(102, 187, 106, 0.28);
  --danger: #ef9a9a;
  --danger-soft: #3a1f22;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px -8px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, 0.65);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 2px;
}

/* Shell — sidebar fixed like Agregados V2 */
.app-shell {
  min-height: 100vh;
}

.cv-sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #2e7d32 0%, #2a7330 45%, #23642a 100%);
  color: #fff;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  width: 15rem;
  height: 100vh;
  transition: width 0.3s var(--ease);
}

html.dark .cv-sidebar {
  background: linear-gradient(180deg, #1f5a24 0%, #1b4f20 50%, #16431b 100%);
}

.cv-sidebar.collapsed {
  width: 4.5rem;
}
.cv-sidebar.collapsed .sb-head {
  justify-content: center;
  padding: 0;
}
.cv-sidebar.collapsed .sb-brand,
.cv-sidebar.collapsed .label {
  opacity: 0;
  max-width: 0;
}
.cv-sidebar.collapsed .sb-brand {
  display: none;
}
.cv-sidebar.collapsed .section-label {
  opacity: 0;
  height: 6px;
  padding: 0;
}
.cv-sidebar.collapsed .nav-item {
  width: 40px;
  padding: 0;
  justify-content: center;
  gap: 0;
  margin: 2px auto;
}
.cv-sidebar.collapsed .nav-item.active::before {
  left: -1rem;
}
.cv-sidebar.collapsed .user-inner {
  justify-content: center;
  flex-wrap: wrap;
}
.cv-sidebar.collapsed .user-details,
.cv-sidebar.collapsed .sb-logout {
  opacity: 0;
  max-width: 0;
  flex: 0;
  overflow: hidden;
  pointer-events: none;
}
.cv-sidebar.collapsed .sb-logout {
  display: none;
}

.sb-head {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.9rem 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sb-brand {
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s var(--ease), max-width 0.2s var(--ease);
}
.sb-brand b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}
.sb-brand small {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.62);
}

.sb-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sb-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.sb-icon-btn.dark {
  color: var(--muted);
  background: var(--surface-2);
}
.sb-icon-btn.dark:hover {
  color: var(--text-strong);
}

.cv-sidebar nav {
  flex: 1;
  padding: 0.6rem;
  overflow: auto;
}

.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding: 0.3rem 0.7rem 0.3rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: 36px;
  padding: 0 0.65rem;
  margin: 1px 0;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12.5px;
  font-weight: 500;
  position: relative;
  transition: background-color 0.18s var(--ease);
  white-space: nowrap;
}
.nav-item .label {
  overflow: hidden;
  max-width: 170px;
  transition: opacity 0.2s var(--ease), max-width 0.2s var(--ease);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -0.6rem;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #fff;
}
.nav-item .ico {
  width: 18px;
  height: 18px;
}

.sb-user-footer {
  padding: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.user-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem;
  border-radius: 10px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.user-meta,
.user-details {
  flex: 1;
  min-width: 0;
  transition: opacity 0.18s var(--ease), max-width 0.2s var(--ease);
}
.user-meta strong,
.user-details .nm {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span,
.user-details .un {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
}
.sb-logout {
  margin: 0;
}

.main-panel {
  padding: 1.25rem 1.5rem 2rem;
  min-width: 0;
  margin-left: 4.5rem;
  transition: margin-left 0.3s var(--ease);
  min-height: 100vh;
}
html.sb-open .main-panel {
  margin-left: 15rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.muted {
  color: var(--muted);
  margin: 0.25rem 0 0;
}
.tiny {
  font-size: 12px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.seg a {
  padding: 0.45rem 0.85rem;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.seg a.on {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-dates {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Buttons */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    color 0.15s var(--ease), transform 0.12s var(--ease);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--green-700);
  color: #fff;
}
.btn-primary:hover {
  background: var(--green-800);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--surface-hover);
}
.btn-danger,
.btn.danger,
.linkish.danger {
  color: var(--danger);
}
.btn-danger {
  background: var(--danger-soft);
  border-color: transparent;
}

.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
}

/* Flash (inline, ex. erro no modal) */
.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 13px;
}
.flash-ok {
  background: var(--accent-soft);
  color: var(--green-800);
}
html.dark .flash-ok {
  color: var(--accent);
}
.flash-error {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Toasts — canto inferior direito */
.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.55rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: min(360px, calc(100vw - 2rem));
  padding: 0.75rem 0.7rem 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  animation: toast-in 0.22s var(--ease);
}
.toast.is-out {
  animation: toast-out 0.18s var(--ease) forwards;
}
.toast-msg {
  flex: 1;
  min-width: 0;
}
.toast-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.toast-close:hover {
  background: var(--surface-2);
  color: var(--text-strong);
}
.toast-ok {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
}
.toast-error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 75%, var(--surface));
  color: var(--danger);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* Room cards */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.room-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    border-color 0.18s var(--ease);
  animation: rise 0.35s var(--ease) both;
}
.room-card:nth-child(2) {
  animation-delay: 0.05s;
}
.room-card:nth-child(3) {
  animation-delay: 0.1s;
}
.room-card:nth-child(4) {
  animation-delay: 0.15s;
}
.room-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--room) 35%, var(--line));
}
.room-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.room-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--room);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--room) 18%, transparent);
}
.room-card h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.room-status {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: var(--surface-2);
}
.room-status strong {
  font-size: 12.5px;
}
.room-status span {
  font-size: 12px;
  color: var(--muted);
}
.room-status.is-free {
  background: var(--accent-soft);
}
.room-status.is-free strong {
  color: var(--accent);
}
.room-status.is-busy {
  background: var(--danger-soft);
}
.room-status.is-busy strong {
  color: var(--danger);
}
.room-card-cta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.room-card.is-featured {
  border-color: color-mix(in srgb, var(--room) 45%, var(--line));
  box-shadow: var(--shadow-md);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--room) 10%, var(--surface)) 0%, var(--surface) 55%);
}
.badge-best {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #e67e22, #c45c00);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}
.room-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.hint.warn {
  color: #b45309;
  background: #fff7ed;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}
html.dark .hint.warn {
  color: #fdba74;
  background: #3a2a1a;
}
.status-pill {
  display: inline-flex;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-pending { background: #fff7ed; color: #c2410c; }
.status-approved { background: var(--accent-soft); color: var(--accent); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }
.status-cancelled { background: var(--surface-2); color: var(--muted); }

.approve-list { display: grid; gap: 0.75rem; }
.approve-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--room, var(--accent));
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: var(--surface-2);
}
.approve-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.approve-card strong { color: var(--text-strong); }
.time-pill {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-strong);
}
.approve-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.approve-actions input {
  flex: 1 1 180px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: var(--surface);
  color: var(--text-strong);
}

.series-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 1rem;
  align-items: start;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.panel-head h2 { margin: 0; }
.chip-soft {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.series-cards {
  display: grid;
  gap: 0.75rem;
}
.series-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: var(--surface-2);
}
.series-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.series-card header strong { color: var(--text-strong); }
.series-card header span { color: var(--muted); font-size: 12px; }
.series-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
  margin: 0 0 0.75rem;
}
.series-card dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.series-card dd {
  margin: 0.1rem 0 0;
  font-size: 13px;
  color: var(--text-strong);
}
@media (max-width: 900px) {
  .series-layout { grid-template-columns: 1fr; }
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 0.35rem;
}
.pill-free {
  background: var(--accent-soft);
  color: var(--accent);
}
.pill-busy {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Agenda */
.agenda-day {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  min-height: 420px;
}
.agenda-axis {
  display: grid;
  gap: 0;
}
.axis-row {
  height: 36px;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.axis-row span {
  font-size: 11px;
  color: var(--faint);
  width: 40px;
  text-align: right;
}
.axis-line {
  flex: 1;
  border-top: 1px dashed var(--line);
  margin-top: 7px;
}
.agenda-events {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}
.event-block {
  border-left: 4px solid var(--room);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  animation: rise 0.25s var(--ease) both;
}
.event-block header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-strong);
}
.event-block p {
  margin: 0.25rem 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.event-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.55rem;
}
.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.agenda-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 0.65rem;
  overflow-x: auto;
}
.week-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 320px;
  box-shadow: var(--shadow-sm);
}
.week-col header {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.week-col header strong {
  color: var(--text-strong);
}
.week-col header span {
  font-size: 12px;
  color: var(--muted);
}
.week-list {
  padding: 0.55rem;
  display: grid;
  gap: 0.4rem;
}
.week-event {
  text-align: left;
  border: 0;
  border-left: 3px solid var(--room);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  display: grid;
  gap: 0.1rem;
}
.week-event strong {
  font-size: 11px;
  color: var(--text-strong);
}
.week-event span {
  font-size: 12px;
}
.week-event em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

/* Panels / forms */
.two-col {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 1rem;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.panel h2 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  color: var(--text-strong);
}

.stack-form {
  display: grid;
  gap: 0.75rem;
}
.stack-form label {
  display: grid;
  gap: 0.3rem;
}
.stack-form label span,
.weekday-set legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.stack-form input,
.stack-form select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-strong);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}
.stack-form input:disabled {
  background: var(--surface-2);
  color: var(--muted);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  max-width: 100%;
}
.form-actions .btn {
  flex: 0 1 auto;
}
.hint {
  font-size: 12px;
  color: var(--faint);
  margin: 0;
}
.weekday-set {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 12.5px;
}

.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(46, 125, 50, 0.18), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(67, 160, 71, 0.12), transparent 55%),
    var(--page);
}
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: rise 0.4s var(--ease) both;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(160deg, #43a047, #1b5e20);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.login-brand strong {
  display: block;
  color: var(--text-strong);
}
.login-brand p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.login-card h1 {
  margin: 0 0 0.25rem;
  color: var(--text-strong);
  font-size: 1.4rem;
}

/* Modal */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-root[hidden] {
  display: none !important;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  animation: fade 0.18s var(--ease);
}
.modal-card {
  position: relative;
  width: min(520px, calc(100vw - 2rem));
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow-lg);
  animation: rise 0.22s var(--ease);
  max-height: calc(100vh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}
.modal-card .stack-form,
.modal-card .time-picker,
.modal-card label,
.modal-card input,
.modal-card select {
  max-width: 100%;
  min-width: 0;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-strong);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Time picker — compact wrapping chips (no horizontal scroll) */
.time-picker {
  display: grid;
  gap: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
  min-width: 0;
}
.time-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.time-kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.time-summary strong {
  font-size: 1rem;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.time-summary em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.time-rail {
  min-width: 0;
}
.time-rail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.time-rail-head span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.time-rail-head small {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
}
.time-chips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.28rem;
  overflow: hidden;
  padding: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.time-chip {
  width: 100%;
  min-width: 0;
  height: 1.85rem;
  padding: 0 0.15rem;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    color 0.15s var(--ease);
  box-sizing: border-box;
}
.time-chip:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.time-chip.is-on:not(:disabled) {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
}
.time-chip.is-busy,
.time-chip:disabled {
  background: #e8ecf0;
  border-color: #d5dce3;
  color: #9aa6b2;
  cursor: not-allowed;
  text-decoration: line-through;
  opacity: 0.85;
}
html.dark .time-chip.is-busy,
html.dark .time-chip:disabled {
  background: #232a33;
  border-color: #2f3843;
  color: #6d7886;
}

/* Month agenda */
.agenda-month {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.month-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.month-head > div {
  padding: 0.55rem 0.4rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.month-cell {
  min-height: 110px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.month-cell:nth-child(7n) {
  border-right: 0;
}
.month-cell.is-out {
  background: color-mix(in srgb, var(--page) 65%, var(--surface));
  opacity: 0.72;
}
.month-cell.is-today {
  background: var(--accent-soft);
}
.month-cell header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.month-cell header strong {
  font-size: 12px;
  color: var(--text-strong);
}
.month-events {
  display: grid;
  gap: 0.2rem;
}
.month-event {
  text-align: left;
  border: 0;
  border-left: 3px solid var(--room);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.month-event b {
  color: var(--text-strong);
}
.month-more {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.week-col.is-today {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -2px;
}

/* Mobile bar (hidden on desktop) */
.mobile-bar {
  display: none;
}
.sb-backdrop {
  display: none;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
}
body.no-scroll {
  overflow: hidden;
}

@media (max-width: 900px) {
  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    position: sticky;
    top: 0;
    z-index: 25;
    margin: -1.25rem -1rem 1rem;
    padding: 0.65rem 1rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-bar-brand {
    flex: 1;
    min-width: 0;
    line-height: 1.15;
  }
  .mobile-bar-brand strong {
    display: block;
    font-size: 13px;
    color: var(--text-strong);
  }
  .mobile-bar-brand span {
    font-size: 11px;
    color: var(--muted);
  }

  .sb-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
  }
  .sb-backdrop[hidden] {
    display: none !important;
  }

  .cv-sidebar {
    width: min(18rem, 86vw) !important;
    transform: translateX(-105%);
    transition: transform 0.28s var(--ease);
    z-index: 50;
    box-shadow: var(--shadow-lg);
  }
  .cv-sidebar.collapsed {
    width: min(18rem, 86vw) !important;
  }
  /* On mobile drawer, always show labels (ignore collapsed visuals) */
  .cv-sidebar.collapsed .sb-brand,
  .cv-sidebar.collapsed .label,
  .cv-sidebar.collapsed .user-details,
  .cv-sidebar.collapsed .sb-logout,
  .cv-sidebar .sb-brand,
  .cv-sidebar .label,
  .cv-sidebar .user-details,
  .cv-sidebar .sb-logout {
    display: unset;
    opacity: 1 !important;
    max-width: none !important;
    flex: 1;
    pointer-events: auto;
  }
  .cv-sidebar.collapsed .sb-brand {
    display: block !important;
  }
  .cv-sidebar.collapsed .sb-head {
    justify-content: space-between;
    padding: 0 0.9rem 0 1rem;
  }
  .cv-sidebar.collapsed .nav-item,
  .cv-sidebar .nav-item {
    width: auto;
    padding: 0 0.65rem;
    justify-content: flex-start;
    gap: 0.7rem;
    margin: 1px 0;
  }
  .cv-sidebar.collapsed .section-label {
    opacity: 1;
    height: auto;
    padding: 0.3rem 0.7rem;
  }
  .cv-sidebar.collapsed .user-inner {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
  .cv-sidebar.is-drawer-open,
  html.sb-drawer-open .cv-sidebar {
    transform: translateX(0);
  }

  .main-panel,
  html.sb-open .main-panel {
    margin-left: 0 !important;
    padding: 1.25rem 1rem 2rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .room-grid {
    grid-template-columns: 1fr;
  }

  .two-col,
  .series-layout,
  .agenda-week {
    grid-template-columns: 1fr !important;
  }

  .agenda-week {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow: visible;
  }
  .week-col {
    min-height: auto;
  }

  .agenda-month {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .month-grid,
  .month-head {
    min-width: 640px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar h1 {
    font-size: 1.15rem;
  }
  .action-row {
    width: 100%;
  }
  .action-row .btn-primary {
    flex: 1;
    text-align: center;
  }
  .nav-dates {
    flex: 1;
    justify-content: space-between;
  }

  .modal-card {
    width: min(520px, calc(100vw - 1rem));
    padding: 0.85rem;
  }
  .time-chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .toast-host {
    right: 0.65rem;
    bottom: 0.65rem;
    left: 0.65rem;
    max-width: none;
    align-items: stretch;
  }
  .toast {
    width: 100%;
  }
  .approve-actions {
    flex-direction: column;
  }
  .approve-actions .btn {
    width: 100%;
  }
  .table-wrap {
    overflow-x: auto;
  }
}
