:root {
  --bg: #0b1120;
  --panel: #111827;
  --card: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 14px;
  line-height: 1.45;
}

.hidden { display: none !important; }
.container { max-width: 1320px; margin: 0 auto; }
.mobile-container { max-width: 480px; margin: 0 auto; }

/* Górny pasek */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
}

.top-bar h1 { margin: 0; font-size: 1.3rem; color: var(--accent); }
.user-badge { background: rgba(56, 189, 248, 0.15); color: var(--accent); padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }

.btn {
  background: var(--accent);
  color: #0b1120;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { opacity: 0.9; }
.btn-green { background: var(--green); color: #064e3b; }
.btn-red { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 5px 9px; font-size: 0.78rem; }

/* Układ główny Dyżurki (Lewa część: Sale + Wykres | Prawa część: Aktywność) */
.ward-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 16px;
  align-items: start;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.panel-title {
  margin: 0 0 12px 0;
  font-size: 1.05rem;
  color: var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Sekcje Sal (Układ pionowych kolumn obok siebie jak w Smart School) */
#rooms-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 10px;
  align-items: start;
}

.room-section {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.room-section.room-full {
  border-color: rgba(245, 158, 11, 0.5);
}

.room-header {
  font-weight: 800;
  color: #e2e8f0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.beds-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bed-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  transition: transform 0.12s;
  font-size: 0.82rem;
}
.bed-card:hover { transform: translateY(-2px); }
.bed-card.status-ok { border-color: var(--green); }
.bed-card.status-warn { border-color: var(--amber); }
.bed-card.status-alert { border-color: var(--red); background: rgba(239, 68, 68, 0.14); }

.vitals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 6px 0;
  text-align: center;
}
.vital-item { background: #0b1120; padding: 4px 2px; border-radius: 5px; border: 1px solid var(--border); }
.vital-num { font-weight: 800; font-size: 0.8rem; }
.vital-lbl { font-size: 0.62rem; color: var(--muted); }

.note-box {
  background: #0b1120;
  border-left: 3px solid var(--accent);
  padding: 4px 6px;
  font-size: 0.72rem;
  color: #cbd5e1;
  border-radius: 4px;
  margin-top: 4px;
}


/* Formularze i Log aktywności */
input, select {
  width: 100%;
  background: #0b1120;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}
label { font-size: 0.78rem; color: var(--muted); display: block; margin-bottom: 3px; }

.log-list {
  max-height: 620px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-item {
  background: var(--card);
  border-left: 3px solid var(--green);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
}
.log-item.alert { border-left-color: var(--red); }
.log-time { font-size: 0.72rem; color: var(--muted); }

/* Ekran logowania */
.login-box {
  max-width: 400px;
  margin: 60px auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
