/* =========================================================
   Design system (tokens + base + components + layout)
   Keep legacy classes working while improving cohesion.
   ========================================================= */

* { box-sizing: border-box; }
html, body { height: 100%; }

:root{
  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.06);
  --shadow-md: 0 8px 24px rgba(2, 6, 23, 0.08);
  --shadow-lg: 0 18px 48px rgba(2, 6, 23, 0.12);

  /* Colors (light) */
  --bg: #f7f8fc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(2, 6, 23, 0.10);
  --border-strong: rgba(2, 6, 23, 0.16);
  --ring: rgba(37, 99, 235, 0.35);

  --primary: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;

  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;

  /* Layout */
  --sidebar-w: 272px;
  --topbar-h: 64px;
}

/* Dark theme (supports both body.dark and data-theme attr) */
body.dark,
html[data-theme="dark"] body{
  --bg: #020617;
  --panel: #0b1224;
  --panel-2: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);
  --ring: rgba(96, 165, 250, 0.35);
}

body{
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ color: inherit; }

/* Accessible focus */
:where(button, [role="button"], a, input, select, textarea):focus-visible{
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.page-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.select {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
}

.input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
}

.date-range {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.date-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.layout {
  display: flex;
  min-height: 100vh;
  height: auto;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-800), #102a74);
  color: #fff;
  padding: var(--space-5);
  height: 100vh;
  position: sticky;
  top: 0;
  border-right: 1px solid rgba(255,255,255,0.10);
  overflow: auto;
}

.sidebar-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.sidebar .logo{
  margin: 0;
}

.sidebar-theme{
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.16);
  color: #fff;
}

.nav{
  display: grid;
  gap: var(--space-2);
}

.nav-section{
  display: grid;
  gap: var(--space-2);
}

.nav-item{
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: #fff;
  opacity: 0.92;
}

.nav-item:hover{
  background: rgba(255,255,255,0.14);
  opacity: 1;
}

.nav-item.active{
  background: rgba(255,255,255,0.20);
  opacity: 1;
}

.nav-group{
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

.nav-group:hover{
  background: rgba(255,255,255,0.14);
}

.nav-children{
  display: grid;
  gap: var(--space-1);
  padding-left: var(--space-2);
}

.nav-children .nav-item{
  opacity: 0.88;
  padding: 9px 12px;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 var(--space-6);
  letter-spacing: 0.2px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  padding: 12px 15px;
  margin-bottom: 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  user-select: none;
}

.sidebar li:hover,
.sidebar .active {
  background: rgba(255,255,255,0.14);
}

.sidebar .logout {
  background: #ef4444;
}

/* CONTENT */
.content {
  flex: 1;
  padding: var(--space-6);
  min-width: 0;
}

@media (max-width: 960px){
  .sidebar { width: 240px; }
  .content { padding: var(--space-5); }
}
@media (max-width: 720px){
  .layout { flex-direction: column; }
  .sidebar{
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.10);
  }
}

/* Header (shared) */
.header{
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--topbar-h);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.header h2{
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.header-actions{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Cards */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.card-header h2{
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

/* Inputs */
.search{
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  min-width: 220px;
}

.phone-group{
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--space-2);
}

textarea{
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

/* Buttons (keep existing class names) */
button{ font: inherit; }
.btn, .btn-primary{
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.btn{
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--border);
}
.btn:hover{ box-shadow: var(--shadow-sm); }
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover{ background: var(--primary-700); }
.btn-primary:active{ transform: translateY(1px); }

.btn.danger{ background: color-mix(in srgb, var(--danger) 16%, var(--panel)); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

/* Tables */
.user-table, .data-table{
  width: 100%;
  margin-top: var(--space-4);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.user-table th, .user-table td,
.data-table th, .data-table td{
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.user-table thead th,
.data-table thead th{
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--panel) 85%, var(--panel-2));
  font-size: 12px;
  letter-spacing: 0.2px;
  color: color-mix(in srgb, var(--text) 75%, var(--muted));
  z-index: 1;
}

.user-table tbody tr:hover,
.data-table tbody tr:hover{
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}

/* Modals */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-5);
}
.modal.active{ display: flex; }

.modal-content{
  width: min(720px, 100%);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  max-height: min(82vh, 860px);
  overflow: auto;
}

.modal-content.large{ width: min(980px, 100%); }
.modal-content.scrollable{ max-height: 84vh; overflow: auto; }

.modal-actions{
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* DASHBOARD */
.dashboard-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin: 16px 0 18px;
}

.kpi-card {
  border: 1px solid rgba(2, 6, 23, 0.08);
  background: #fff;
  border-radius: 14px;
  padding: 14px 14px 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.kpi-card:hover {
  transform: translateY(-1px);
  transition: transform 0.15s ease;
}

.kpi-label {
  font-size: 12px;
  color: #475569;
}

.kpi-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px;
}

.table-wrap {
  overflow: auto;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(2, 6, 23, 0.08);
  background: #fff;
}

.pill.pending { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.25); }
.pill.ongoing { background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.25); }
.pill.delivered { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.25); }
.pill.cancelled { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.25); }

.pill.high { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.25); }
.pill.medium { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.25); }
.pill.low { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.25); }

.pill.warning { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.25); }
.pill.error { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.25); }
.pill.info { background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.25); }

.breakdown {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.break-row {
  display: grid;
  gap: 8px;
}

.break-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.break-bar {
  height: 10px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.break-fill {
  height: 100%;
  border-radius: 999px;
}

.break-fill.pending { background: #f59e0b; }
.break-fill.ongoing { background: #3b82f6; }
.break-fill.delivered { background: #22c55e; }
.break-fill.cancelled { background: #ef4444; }

.list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(2, 6, 23, 0.08);
  border-radius: 12px;
  cursor: pointer;
}

.list-item:hover {
  background: rgba(241, 245, 249, 0.7);
}

.list-title {
  font-weight: 600;
}

.list-sub {
  margin-top: 4px;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-top { flex-direction: column; }
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.profile {
  position: relative;
}

.profile img {
  width: 40px;
  border-radius: 50%;
  cursor: pointer;
}

.profile-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 45px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.profile-menu button {
  width: 100%;
  padding: 10px;
  border: none;
  cursor: pointer;
}

/* STATS */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.stat-card p {
  font-size: 28px;
  font-weight: bold;
}
body.dark {
  background: #020617;
  color: #e5e7eb;
}

body.dark .content,
body.dark .stat-card,
body.dark .card,
body.dark table {
  background: #0f172a;
  color: white;
}

body.dark .sidebar {
  background: #020617;
}

body.dark th {
  background: #1e293b;
}

body.dark td {
  border-color: #1e293b;
}
.card {
  background: white;
  padding: 20px;
  border-radius: 12px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.btn-primary {
  background: #2563eb;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

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

.user-table th {
  background: #f1f5f9;
  padding: 12px;
}

.user-table td {
  padding: 12px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.admin { background: #dc2626; color: white; }
.badge.user { background: #16a34a; color: white; }

.btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.btn.edit { background: #22c55e; color: white; }
.btn.delete { background: #ef4444; color: white; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;              
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.active {
  display: flex;              
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 300px;
}
.badge.admin { background: #dc2626; color: white; }
.badge.user { background: #16a34a; color: white; }
.badge.manager { background: #2563eb; color: white; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.modal-content {
  width: 420px;
  background: white;
  padding: 25px;
  border-radius: 14px;
}

.modal-content h3 {
  margin-bottom: 15px;
}

label {
  font-size: 13px;
  color: #475569;
  margin-bottom: 4px;
  display: block;
}

input, select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
}

.checkbox {
  margin: 15px 0;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.user-table td {
  vertical-align: middle;
}
/* MODAL FORM FIX */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
  margin-top: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 13px;
  margin-bottom: 6px;
  color: #555;
}

.form-group input,
.form-group select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
}

/* PASSWORD TOGGLE */
.password-wrap {
  position: relative;
}

.password-wrap input {
  width: 100%;
}

.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.6;
}

/* TERMS FIX */
.terms-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  font-size: 14px;
}

.terms-row input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* TABLE ALIGNMENT */
.user-table th,
.user-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}
.menu li {
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.menu li.active {
  background: #1e40af;
  color: #fff;
}
.menu li:hover {
  background: rgba(255,255,255,0.15);
}

.menu li.active:hover {
  background: #1e40af;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.profile-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.profile-name {
  font-weight: 500;
}

.profile-menu {
  position: absolute;
  top: 55px;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  width: 250px;
  display: none;
  z-index: 100;
}

.profile-menu.show {
  display: block;
}

.profile-card {
  padding: 15px;
  text-align: center;
}

.profile-big {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.profile-info {
  font-size: 13px;
  color: #666;
  margin: 10px 0;
}

.logout-btn {
  width: 100%;
  margin-top: 10px;
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.room-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.room-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.room-info {
  padding: 12px;
}

.room-info h4 {
  margin-bottom: 4px;
}

.room-info .products {
  font-size: 12px;
  opacity: 0.7;
}

.room-actions {
  display: flex;
  justify-content: space-between;
  padding: 10px;
}
.drop-zone {
  border: 2px dashed #bbb;
  padding: 20px;
  text-align: center;
  border-radius: 10px;
  cursor: pointer;
}

.drop-zone.drag {
  background: rgba(0,0,0,0.05);
}

.preview-img {
  width: 100%;
  max-height: 200px;
  margin-top: 10px;
  border-radius: 10px;
  object-fit: cover;
  display: none;
}
.room-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 20px;
}

.room-card {
  background: var(--card);
  padding: 15px;
  border-radius: 12px;
}

.drop-zone {
  border: 2px dashed #999;
  padding: 30px;
  text-align: center;
  cursor: pointer;
}

.drop-zone.drag {
  background: rgba(0,0,0,0.05);
}

.preview img, .thumbs img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  margin: 5px;
  border-radius: 6px;
}

.slider {
  position: relative;
}

.slider img {
  width: 100%;
  border-radius: 10px;
}

.tags span {
  display: inline-block;
  background: #e0e0e0;
  padding: 5px 10px;
  border-radius: 20px;
  margin: 5px;
  cursor: pointer;
}
.room-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
  gap: 20px;
}

.room-card {
  cursor: pointer;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.room-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.before-after {
  position: relative;
  height: 420px;
}

.before-after img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.after {
  width: 50%;
}

.tags span {
  background: #eee;
  padding: 6px 12px;
  border-radius: 20px;
  margin: 4px;
  cursor: pointer;
}
.room-studio {
  display: flex;
  gap: 20px;
}

.room-list {
  width: 260px;
}

.room-viewer {
  flex: 1;
  background: #000;
  position: relative;
  border-radius: 14px;
}

.room-viewer.hidden {
  display: none;
}

.room-canvas {
  position: relative;
}

.room-canvas img {
  width: 100%;
  border-radius: 14px;
}

.pin {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.room-card {
  position: relative;
  cursor: pointer;
  margin-top: 15px;
}

.room-card img {
  width: 100%;
  border-radius: 12px;
}

.room-card .overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 10px;
  background: linear-gradient(to top, #000, transparent);
  color: #fff;
}
body.dark .card,
body.dark .modal-content,
body.dark .viewer-box,
body.dark .product-box {
  background: #1e1e1e;
  color: #fff;
}

body.dark .drop-zone {
  border: 2px dashed #555;
  background: #222;
}

body.dark .room-card {
  background: #242424;
}

body.dark .pin {
  background: #fff;
  color: #000;
}

.viewer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 20px;
}

.room-tile {
  cursor: pointer;
}

.room-tile img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}

.room-tile span {
  display: block;
  margin-top: 6px;
  font-weight: 500;
}

/* SIDE PANEL */
.room-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
}

.room-panel.show {
  display: block;
}

.room-panel-content {
  position: absolute;
  right: 0;
  width: 380px;
  height: 100%;
  background: #fff;
  padding: 20px;
  overflow-y: auto;
}

body.dark .room-panel-content {
  background: #1e1e1e;
  color: #fff;
}

.panel-images img {
  width: 100%;
  margin-top: 10px;
  border-radius: 6px;
}
.data-table{
width:100%;
border-collapse:collapse;
margin-top:20px;
}

.data-table th,
.data-table td{
padding:12px;
text-align:left;
border-bottom:1px solid #e5e5e5;
}

.data-table th{
font-weight:600;
color:#555;
}
body.dark .data-table th,
body.dark .data-table td{
border-color:#333;
}
.data-table{
width:100%;
border-collapse:collapse;
}

.data-table th,
.data-table td{
padding:12px;
border-bottom:1px solid #eee;
text-align:left;
}

.delete-btn{
background:#ff4d4f;
color:white;
border:none;
padding:6px 12px;
border-radius:6px;
cursor:pointer;
}

/* =========================================================
   Final overrides (ensure tokens win vs legacy rules below)
   ========================================================= */

body.dark .sidebar{
  background: linear-gradient(180deg, #020617, #07102a);
}

.card{
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}

.search{
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
}

.btn{
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.btn-primary{
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
}

.user-table, .data-table{
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--panel);
}

.user-table th, .user-table td,
.data-table th, .data-table td{
  border-bottom: 1px solid var(--border);
}

body.dark .content,
body.dark .stat-card,
body.dark .card,
body.dark table{
  background: var(--panel);
  color: var(--text);
}