:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --success: #22c55e;
  --warning: #fbbf24;
  --danger: #ef4444;
  --info: #0ea5e9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
}

.sidebar {
  background: #111827;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #0f172a;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #22c55e);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 14px 14px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  color: #cbd5e1;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav__item:hover,
.nav__item--active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav__item span {
  font-weight: 600;
}

.user-card {
  margin: auto 14px 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card strong {
  display: block;
}

.logout-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fecaca;
  border-radius: 10px;
  font-weight: 700;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.main {
  display: grid;
  grid-template-rows: 70px 1fr;
  overflow: hidden;
}

.main__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.content {
  overflow-y: auto;
  padding: 20px 24px 32px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.02);
}

.stat-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--muted);
}

.stat-card strong {
  font-size: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.badge--success { background: #ecfdf3; color: #16a34a; }
.badge--info { background: #e0f2fe; color: #0284c7; }
.badge--warning { background: #fef3c7; color: #d97706; }
.badge--danger { background: #fee2e2; color: #dc2626; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.section-title {
  margin: 0 0 12px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.room-card {
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: 12px;
  padding: 14px;
  background: var(--panel);
  display: grid;
  gap: 10px;
}

.room-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 18px;
}

.room-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: background 0.2s ease, transform 0.1s ease, color 0.2s ease;
}

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

.btn--primary { background: var(--primary); color: white; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--outline { background: transparent; border-color: var(--border); }
.btn--success { background: #16a34a; color: white; }
.btn--warning { background: #d97706; color: white; }
.btn--danger { background: #dc2626; color: white; }

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.muted { color: var(--muted); }

.login {
  display: grid;
  place-items: center;
  height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.06), transparent 35%),
              radial-gradient(circle at 80% 10%, rgba(14, 165, 233, 0.08), transparent 32%),
              var(--bg);
  padding: 16px;
}

.login__panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: min(460px, 100%);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
}

.login h1 {
  margin: 8px 0 6px;
}

.select,
.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  margin-bottom: 12px;
}

.form-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  font-weight: 700;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid #0f172a;
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  width: min(520px, 100%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.modal__header h3 {
  margin: 0;
}

.modal__close {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.modal__form {
  display: grid;
  gap: 12px;
}

.modal__field {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.modal__label {
  font-size: 13px;
  color: var(--muted);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
