:root {
  --bg: #0f172a;
  --bg-elevated: #020617;
  --bg-soft: #111827;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-strong: #0ea5e9;
  --border-subtle: rgba(148, 163, 184, 0.35);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;
  --success: #4ade80;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 999px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.55);
  --shadow-subtle: 0 10px 30px rgba(15, 23, 42, 0.5);
}

body.light-theme {
  --bg: #f9fafb;
  --bg-elevated: #ffffff;
  --bg-soft: #f3f4f6;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-strong: #1d4ed8;
  --border-subtle: rgba(148, 163, 184, 0.4);
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --shadow-soft: 0 18px 45px rgba(148, 163, 184, 0.4);
  --shadow-subtle: 0 10px 30px rgba(148, 163, 184, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1e293b 0, #020617 45%, #020617 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body.light-theme {
  background: radial-gradient(circle at top left, #e0f2fe 0, #eff6ff 40%, #e5e7eb 100%);
}

.app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100vh;
  padding: 18px;
  gap: 18px;
}

.sidebar {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.85));
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(24px);
}

body.light-theme .sidebar {
  background: linear-gradient(145deg, #ffffff, #eff6ff);
}

.logo {
  margin-bottom: 18px;
}

.logo-main {
  display: block;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
}

.logo-sub {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-top: 4px;
  color: var(--text-muted);
}

.role-switch {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  margin-bottom: 14px;
}

body.light-theme .role-switch {
  background: rgba(239, 246, 255, 0.9);
}

.role-switch-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.role-switch-buttons {
  display: flex;
  gap: 6px;
}

.btn-role {
  flex: 1;
  border-radius: 999px;
  border: 0;
  padding: 6px 8px;
  font-size: 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease-out;
}

.btn-role.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1120;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.45);
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 14px 4px 8px;
}

.nav-item {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease-out;
}

.nav-item::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: transparent;
  margin-right: 8px;
  transition: background 0.18s ease-out;
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.8);
}

body.light-theme .nav-item:hover {
  background: rgba(226, 232, 240, 0.8);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-item.active::before {
  background: var(--accent);
}

.main {
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.98));
  border-radius: var(--radius-lg);
  padding: 18px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(24px);
}

body.light-theme .main {
  background: radial-gradient(circle at top left, rgba(191, 219, 254, 0.6), #ffffff);
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumb-sep {
  margin: 0 6px;
  opacity: 0.7;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  min-width: 220px;
}

.main-content {
  flex: 1;
  overflow: hidden auto;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  border-radius: 16px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(30, 64, 175, 0.55);
}

body.light-theme .main-content {
  background: linear-gradient(145deg, #ffffff, #f9fafb);
  border-color: rgba(148, 163, 184, 0.5);
}

.page {
  display: none;
}

.page-active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.page-header h2 {
  margin: 0;
  font-size: 18px;
}

.page-actions {
  display: flex;
  gap: 8px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.input {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main);
  padding: 7px 12px;
  font-size: 12px;
  outline: none;
  min-width: 120px;
  transition: all 0.18s ease-out;
}

body.light-theme .input {
  background: rgba(255, 255, 255, 0.92);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main);
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.18s ease-out;
}

body.light-theme .btn {
  background: rgba(255, 255, 255, 0.95);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #0b1120;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.4);
}

.btn.ghost {
  background: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.45);
}

.btn.primary:hover {
  box-shadow: 0 16px 38px rgba(56, 189, 248, 0.65);
}

.table-wrapper {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(30, 64, 175, 0.85);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow-subtle);
}

body.light-theme .table-wrapper {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.6);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

thead {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.85), rgba(37, 99, 235, 0.7));
  color: #e5e7eb;
}

body.light-theme thead {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

th,
td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.7);
}

body.light-theme td {
  border-bottom-color: rgba(226, 232, 240, 0.9);
}

tbody tr:nth-child(2n) td {
  background: rgba(15, 23, 42, 0.9);
}

body.light-theme tbody tr:nth-child(2n) td {
  background: rgba(249, 250, 251, 0.9);
}

.tag {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tag.success {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.tag.success .tag-dot {
  background: #4ade80;
}

.tag.warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fed7aa;
}

.tag.warning .tag-dot {
  background: #facc15;
}

.tag.danger {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

.tag.danger .tag-dot {
  background: #f97373;
}

.tag.info {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.tag.info .tag-dot {
  background: #60a5fa;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 16px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(30, 64, 175, 0.8);
  box-shadow: var(--shadow-subtle);
}

body.light-theme .card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.6);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-main);
}

.list li + li {
  margin-top: 6px;
}

.list li:hover {
  border-color: rgba(56, 189, 248, 0.8);
  background: rgba(15, 23, 42, 0.9);
}

body.light-theme .list li:hover {
  background: rgba(239, 246, 255, 0.9);
}

.list li.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.muted {
  font-size: 12px;
  color: var(--text-muted);
}

.permission-detail ul {
  margin: 0;
  padding-left: 18px;
}

.permission-detail li {
  margin: 4px 0;
}

.room-calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.room-card {
  border-radius: 14px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(30, 64, 175, 0.8);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

body.light-theme .room-card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.7);
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.room-name {
  font-weight: 600;
}

.room-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), rgba(15, 23, 42, 0.98));
}

body.light-theme .kpi-card {
  background: radial-gradient(circle at top left, rgba(191, 219, 254, 0.9), #ffffff);
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
}

.revenue-summary {
  font-size: 13px;
  color: var(--text-main);
}

.revenue-summary p {
  margin: 4px 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row label {
  font-size: 12px;
  color: var(--text-muted);
}

.form-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  z-index: 40;
}

.modal.visible {
  display: flex;
}

.modal-dialog {
  width: 380px;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.7);
  padding: 14px 14px 12px;
}

body.light-theme .modal-dialog {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.7);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  border-radius: 999px;
  width: 26px;
  height: 26px;
  border: 0;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-main);
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.96);
  color: #ecfdf5;
  font-size: 13px;
  box-shadow: 0 14px 40px rgba(22, 163, 74, 0.6);
  z-index: 50;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.2s ease-out;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 14px;
  }

  .main-content {
    padding: 12px;
  }

  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

