/* Modern Vibrant Dark Design System for RentingHub Dashboard v2.0 */
:root {
  --bg-main: #0b1329;
  --bg-card: #152238;
  --bg-card-hover: #1e3050;
  --border-color: #243656;
  --border-highlight: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.25);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.25);
  --accent-indigo: #6366f1;
  --accent-red: #ef4444;

  --font-stack: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-stack);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 50px;
}

/* Sidebar Layout CSS */
body {
  padding-bottom: 0;
  overflow-x: hidden;
}

.sidebar-layout {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-main);
}

/* Sidebar Styling */
.app-sidebar {
  width: 280px;
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.menu-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 4px 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.menu-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
}

.menu-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.menu-badge.badge-teal { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }
.menu-badge.badge-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; }

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Workspace Area */
.app-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.workspace-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: rgba(21, 34, 56, 0.6);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.top-bar-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.top-bar-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.workspace-body {
  padding: 28px 32px;
  flex: 1;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeInView 0.25s ease-in-out;
}

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .sidebar-layout { flex-direction: column; }
  .app-sidebar { width: 100%; height: auto; position: static; }
  .app-workspace { height: auto; }
}

.version-tag {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.brand-info .subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
}

.live-stream-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
}

.status-dot.pulse {
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.timestamp-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.ts-val {
  color: var(--text-primary);
  font-weight: 600;
  font-family: monospace;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.toggle-switch input { display: none; }

.toggle-slider {
  width: 38px;
  height: 22px;
  background-color: var(--bg-card-hover);
  border-radius: 20px;
  position: relative;
  transition: 0.25s;
  border: 1px solid var(--border-color);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;

}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-blue-glow);
}

.shadow-glow {
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-card-hover);
  border-color: #3b82f6;
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Analytics Bar */
.analytics-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .analytics-bar { grid-template-columns: 1fr; }
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
}

.analytics-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.analytics-title {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.analytics-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 10px;
  background-color: var(--bg-main);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-sent {
  background: linear-gradient(to right, #10b981, #34d399);
}

.progress-avail {
  background: linear-gradient(to right, #3b82f6, #60a5fa);
}

.analytics-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
}

.metric-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.icon-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.icon-teal { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.3); }
.text-teal { color: #2dd4bf; }
/* Special VIP Highlight for Building Code A460 */
.badge-a460-vip {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.3));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: goldPulse 2s infinite ease-in-out;
}

@keyframes goldPulse {
  0% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.6); }
  100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
}

.room-card.highlight-a460 {
  border: 2px solid #f59e0b !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-card) 100%) !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25) !important;
}

.rooms-table tr.highlight-a460 td {
  background-color: rgba(245, 158, 11, 0.07) !important;
  border-left: 3px solid #f59e0b;
}

.bbar-card.highlight-a460 {
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3) !important;
}

/* Cluster Table List Styles */
.clusters-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.clusters-table th {
  background-color: rgba(15, 23, 42, 0.8);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.clusters-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.clusters-table tr:hover td {
  background-color: var(--bg-card-hover);
}

.cluster-id-cell {
  max-width: 280px;
}

.cluster-id-code {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(45, 212, 191, 0.25);
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.room-count-badge {
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

/* Strategy Inspector CSS */
.strategy-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

.selector-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.selector-body {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: 16px;
}

.strategy-select-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
}

.strategy-select-input:focus {
  border-color: #3b82f6;
}

/* Modal CSS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.json-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 85vw;
  max-width: 1000px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  padding: 20px 24px;
  overflow: auto;
  background: #090e1a;
}

.modal-body pre code {
  font-family: monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  white-space: pre-wrap;
  word-break: break-all;
}

.cluster-lbl { color: var(--text-secondary); }
.cluster-val { color: var(--text-primary); font-weight: 600; }
.cluster-valHighlight { color: #38bdf8; font-weight: 700; }

.cluster-mode-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.cluster-code {
  font-family: monospace;
  background-color: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
  padding: 2px 6px;
  border-radius: 4px;
}

.metric-data {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.metric-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.text-emerald { color: #34d399; }
.text-amber { color: #fbbf24; }
.text-purple { color: #c084fc; }
.text-indigo { color: #818cf8; }

.metric-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.tag-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tag-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.tag-indigo { background: rgba(99, 102, 241, 0.2); color: #818cf8; }

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Building Progress Visualizer */
.building-visualizer-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.section-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.bbar-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bbar-card:hover {
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.bbar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.bbar-code { color: #60a5fa; }
.bbar-title { color: var(--text-primary); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; max-width: 150px; }

.bbar-track {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}

.bbar-fill {
  height: 100%;
  background: linear-gradient(to right, #10b981, #3b82f6);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.bbar-stat {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* Filter Section */
.filter-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

.filter-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-card-hover);
}

.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.view-toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-view {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-view.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.filter-inputs {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 992px) {
  .filter-inputs { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .filter-inputs { grid-template-columns: 1fr; }
}

.input-group { position: relative; }

.search-group input { padding-left: 36px; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

input[type="text"], select {
  width: 100%;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus {
  border-color: var(--accent-blue);
}

/* Rooms Display (Card Grid View) */
.rooms-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}

.room-card:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.rc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.rc-room-code {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.rc-bld-code {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  color: #60a5fa;

}

.rc-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.rc-address {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rc-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.rc-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #34d399;
}

.rc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  gap: 8px;
}

.rc-media-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

/* Table Section */
.table-section, .table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.hidden { display: none !important; }

.rooms-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.rooms-table th {
  background-color: var(--bg-card-hover);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.rooms-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.rooms-table tbody tr { transition: background-color 0.15s; }
.rooms-table tbody tr:hover { background-color: rgba(255, 255, 255, 0.04); }

.loading-cell, .empty-cell, .loading-state {
  text-align: center;
  padding: 40px !important;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Badges */
.badge {
  display: inline-flex;
  flex-direction: column;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.badge-sent {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-unsent {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-unverified {
  background-color: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-unavailable {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-msgid {
  font-family: monospace;
  font-size: 0.72rem;
  opacity: 0.9;
}

.status-text-badge {
  display: inline-block;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.status-text-badge.avail {
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-indicator { font-weight: 600; color: var(--text-primary); }

/* Drawer Component */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 92vw;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-color);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.detail-drawer.active { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.drawer-header h2 { font-size: 1.25rem; font-weight: 800; }
.drawer-subtitle { font-size: 0.78rem; color: var(--text-muted); font-family: monospace; }

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.drawer-close-btn:hover { color: var(--text-primary); }

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-action-bar {
  display: flex;
  gap: 10px;
}

.drawer-card {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.drawer-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-item { display: flex; flex-direction: column; }
.info-label { font-size: 0.75rem; color: var(--text-muted); }
.info-val { font-size: 0.88rem; font-weight: 600; }
.info-valHighlight { font-size: 1.1rem; font-weight: 800; }

.media-stats { display: flex; gap: 24px; }
.media-stat-item { display: flex; flex-direction: column; }
.stat-count { font-size: 1.4rem; font-weight: 800; color: #60a5fa; }
.stat-lbl { font-size: 0.78rem; color: var(--text-secondary); }

.publish-status-box { display: flex; flex-direction: column; gap: 8px; }
.publish-status-badge { font-size: 0.95rem; font-weight: 800; }
.msg-id-group { display: flex; justify-content: space-between; font-size: 0.82rem; }
.msg-code { font-family: monospace; background-color: var(--bg-card); padding: 2px 6px; border-radius: 4px; }

.history-table-container { overflow-x: auto; margin-top: 8px; }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.history-table th { background: var(--bg-card); color: var(--text-secondary); padding: 8px; text-align: left; border-bottom: 1px solid var(--border-color); }
.history-table td { padding: 8px; border-bottom: 1px solid var(--border-color); }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease forwards;
  pointer-events: auto;
}

.toast-success { border-color: var(--accent-emerald); }
.toast-info { border-color: var(--accent-blue); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Navigation Bar */
.main-nav {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-link.active {
  background: var(--accent-blue);
  color: #fff;
}

/* Guide View Styles */
.guide-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.guide-banner {
  background: linear-gradient(135deg, #152238, #1e3050);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.guide-banner-text h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(to right, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.guide-banner-text p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.guide-badge-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.chip-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.chip-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.chip-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.chip-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

.guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.guide-sec-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

/* Flow Steps Grid */
.flow-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.flow-step-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  transition: all 0.25s ease;
}

.flow-step-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.step-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-blue);
  opacity: 0.8;
  margin-bottom: 8px;
}

.flow-step-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.flow-step-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.flow-step-card code {
  font-size: 0.72rem;
  background: var(--bg-card);
  color: #60a5fa;
  padding: 3px 6px;
  border-radius: 4px;
  display: inline-block;
  word-break: break-all;
}

/* Accordion Steps */
.guide-accordion {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.acc-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.acc-header {
  padding: 14px 18px;
  background: var(--bg-card-hover);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.acc-step-badge {
  background: var(--accent-blue);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;

}

.acc-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.acc-body {
  padding: 18px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.acc-body p { margin-bottom: 12px; }

.guide-list, .guide-list-num {
  margin-left: 20px;
  margin-bottom: 12px;
}

.guide-list li, .guide-list-num li {
  margin-bottom: 6px;
}

.callout {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin: 12px 0;
}

.callout-important {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.code-box {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0;
  position: relative;
}

.code-lang {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.code-box pre {
  margin: 0;
  font-family: monospace;
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
}

.template-preview-box {
  background: #0f172a;
  border: 1px dashed var(--accent-emerald);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: monospace;
  font-size: 0.82rem;
  color: #f1f5f9;
  margin: 12px 0;
  line-height: 1.5;
}

.tpl-title { font-weight: 700; color: #fbbf24; margin-bottom: 8px; }

/* Cheatsheet Table */
.cmd-table-container { overflow-x: auto; }

.cmd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cmd-table th {
  background: var(--bg-main);
  color: var(--text-secondary);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.cmd-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.cmd-table code {
  background: var(--bg-main);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
}

/* --- LIBRARY / FRAMEWORK DOCS LAYOUT --- */
.docs-container {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-top: 10px;
}

.docs-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

@media (max-width: 900px) {
  .docs-container { flex-direction: column; }
  .docs-sidebar { width: 100%; position: static; }
}

.sidebar-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;

}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.sidebar-link.active {
  color: #ffffff !important;
  background: linear-gradient(90deg, #2563eb, #1d4ed8) !important;
  border-left: 4px solid #60a5fa !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.docs-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.docs-header-banner {
  background: linear-gradient(135deg, #152238, #1e3a66);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.banner-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.docs-header-banner h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.docs-header-banner p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.docs-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  scroll-margin-top: 20px;
}

.sec-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-blue);
  margin-bottom: 4px;
}

.docs-section h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.docs-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 18px 0 10px;
  color: #e2e8f0;
}

.docs-section p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

@media (max-width: 768px) {
  .grid-2col { grid-template-columns: 1fr; }
}

.concept-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.concept-card h3 {
  margin-top: 0;
  font-size: 0.98rem;
  color: #60a5fa;
}

.concept-card ul {
  margin-left: 18px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.concept-card li { margin-bottom: 6px; }

/* Doc Table */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.85rem;
}

.doc-table th {
  background: var(--bg-main);
  color: var(--text-secondary);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
}

.doc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.doc-table code {
  background: var(--bg-main);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Pipeline Diagram Nodes */
.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
}

.pipe-node {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
}

.pipe-step {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: 0.08em;
}

.pipe-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 2px 0 4px;
}

.pipe-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.pipe-arrow {
  color: var(--text-muted);
  font-weight: 700;
}

/* API Card Docs */
.api-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.api-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.method-get {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
}

.script-item, .diag-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.script-item h4, .diag-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.template-spec-box {
  background: #090f1e;
  border: 1px dashed var(--accent-emerald);
  border-radius: var(--radius-md);
  padding: 18px;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 14px 0;
}

.spec-line { font-weight: 600; }
.spec-divider { color: var(--text-muted); }

