.muted {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.tiny {
  font-size: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.search input,
.modal label input,
.modal label select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font: inherit;
  outline: none;
}

.search input {
  min-width: 220px;
}

.search input:focus,
.modal label input:focus,
.modal label select:focus {
  border-color: rgba(61, 186, 160, 0.55);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #062019;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.kpi {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi-value {
  font-family: var(--serif);
  font-size: 1.9rem;
  margin-top: 0.35rem;
}

.kpi-delta {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--accent);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 38, 46, 0.72);
  backdrop-filter: blur(10px);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(61, 186, 160, 0.12);
  border: 1px solid rgba(61, 186, 160, 0.22);
}

.pill-warn {
  color: var(--warn);
  background: rgba(226, 165, 90, 0.12);
  border-color: rgba(226, 165, 90, 0.25);
}

.ward-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ward {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: center;
}

.ward-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

.bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--info));
  transition: width 700ms ease;
}

.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.queue li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.queue .prio {
  font-size: 0.75rem;
  color: var(--warn);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.dot.free { background: var(--free); }
.dot.occupied { background: var(--occupied); }
.dot.reserved { background: var(--reserved); }
.dot.cleaning { background: var(--cleaning); }

.bed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.7rem;
}

.bed {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  border-radius: 12px;
  padding: 0.85rem 0.7rem;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.bed:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.bed[data-status="free"] { border-color: rgba(61, 186, 160, 0.45); }
.bed[data-status="occupied"] { border-color: rgba(108, 180, 217, 0.45); }
.bed[data-status="reserved"] { border-color: rgba(226, 165, 90, 0.45); }
.bed[data-status="cleaning"] { border-color: rgba(154, 165, 176, 0.4); }

.bed-id {
  font-weight: 600;
  font-size: 0.95rem;
}

.bed-status {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: capitalize;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.slot {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.85rem;
  align-items: center;
}

.slot-time {
  color: var(--muted);
  font-size: 0.85rem;
}

.slot-body {
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(61, 186, 160, 0.12), rgba(255, 255, 255, 0.02));
}

.slot-body strong {
  display: block;
  margin-bottom: 0.2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-on {
  color: var(--accent);
}

.status-break {
  color: var(--warn);
}

.modal {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow);
  max-width: 420px;
  width: calc(100% - 2rem);
}

.modal::backdrop {
  background: rgba(4, 10, 12, 0.65);
  backdrop-filter: blur(4px);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem;
}

.modal-body h2 {
  margin: 0;
  font-family: var(--serif);
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.modal label input,
.modal label select {
  border-radius: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: #16332d;
  border: 1px solid rgba(61, 186, 160, 0.35);
  color: var(--text);
  box-shadow: var(--shadow);
  animation: rise 280ms ease both;
  z-index: 40;
}

@media (max-width: 1100px) {
  .kpi-row,
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .kpi-row,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}
