/* CSS Variables & Design System */
:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #121620;
  --bg-tertiary: #1b2130;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --primary: #9d4edd;
  --primary-hover: #7b2cbf;
  --primary-light: rgba(157, 78, 221, 0.1);
  --primary-glow: rgba(157, 78, 221, 0.3);
  
  --whatsapp-green: #10b981;
  --whatsapp-bg: #075e54;
  --whatsapp-chat-bg: #0b141a;
  --whatsapp-msg-in: #202c33;
  --whatsapp-msg-out: #005c4b;
  
  --accent-blue: #3b82f6;
  --accent-blue-light: rgba(59, 130, 246, 0.1);
  --accent-green: #10b981;
  --accent-green-light: rgba(16, 185, 129, 0.1);
  --accent-gold: #f59e0b;
  --accent-gold-light: rgba(245, 158, 11, 0.1);
  --accent-red: #ef4444;
  
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  height: 100vh;
}

/* App Layout */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), #e0aaff);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--primary-glow);
}

.logo-icon i {
  width: 20px;
  height: 20px;
}

.logo-text h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-text h2 span {
  color: var(--primary);
  background: linear-gradient(to right, #c77dff, #e0aaff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-item i {
  width: 18px;
  height: 18px;
}

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

.nav-item.active {
  background-color: var(--primary-light);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid var(--primary);
  padding-left: 13px;
}

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

.status-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background-color: var(--whatsapp-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-details {
  font-size: 0.75rem;
}

.status-label {
  color: var(--text-muted);
  font-weight: 500;
}

.status-value {
  color: var(--text-primary);
  font-weight: 600;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

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

/* Main Content Layout */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background-color: var(--bg-primary);
}

.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(10, 12, 16, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-title-area h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.page-title-area p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

.current-time-badge {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.current-time-badge i {
  width: 16px;
  height: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

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

.btn-secondary:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color-hover);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

/* Tab Content Visibility */
.tab-content {
  display: none;
  padding: 32px;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

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

/* Dashboard: Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition-normal);
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-icon-wrapper.blue { background-color: var(--accent-blue-light); color: var(--accent-blue); }
.stat-icon-wrapper.green { background-color: var(--accent-green-light); color: var(--accent-green); }
.stat-icon-wrapper.purple { background-color: var(--primary-light); color: var(--primary); }
.stat-icon-wrapper.gold { background-color: var(--accent-gold-light); color: var(--accent-gold); }

.stat-data {
  flex-grow: 1;
}

.stat-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-data h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 4px 0;
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 500;
}

.stat-trend.positive {
  color: var(--whatsapp-green);
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-trend.positive i {
  width: 12px;
  height: 12px;
}

/* Dashboard: Simulator Grid Layout */
.simulator-grid {
  display: grid;
  grid-template-columns: 340px 380px 1fr;
  gap: 24px;
  height: calc(100vh - 280px);
  min-height: 520px;
}

/* Panel Card Base Styles */
.panel-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title i {
  width: 20px;
  height: 20px;
}

.panel-title h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Badges */
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.badge-purple { background-color: var(--primary-light); color: var(--primary); }
.badge-blue { background-color: var(--accent-blue-light); color: var(--accent-blue); }
.badge-success { background-color: var(--accent-green-light); color: var(--accent-green); }

/* --- Panel 1: Chat Simulator --- */
.chat-panel {
  border-color: rgba(16, 185, 129, 0.15);
}

.chat-header {
  background-color: var(--whatsapp-chat-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.chat-contact-details h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.chat-contact-details .status-text {
  font-size: 0.7rem;
  color: var(--whatsapp-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--whatsapp-green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.chat-actions {
  display: flex;
  gap: 16px;
  color: var(--text-secondary);
}

.chat-actions i {
  width: 18px;
  height: 18px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-actions i:hover {
  color: var(--text-primary);
}

.chat-messages-container {
  flex-grow: 1;
  background-color: var(--whatsapp-chat-bg);
  background-image: radial-gradient(rgba(255,255,255,0.02) 1px, transparent 0);
  background-size: 16px 16px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Chat Bubbles */
.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
  animation: slideMsg 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chat-msg.in {
  background-color: var(--whatsapp-msg-in);
  align-self: flex-start;
  border-top-left-radius: 2px;
  color: #fff;
}

.chat-msg.out {
  background-color: var(--whatsapp-msg-out);
  align-self: flex-end;
  border-top-right-radius: 2px;
  color: #e4f7e5;
}

.msg-time {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
  margin-top: 4px;
  display: block;
}

.chat-msg.out .msg-time {
  color: rgba(228, 247, 229, 0.6);
}

.quick-prompts-area {
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  padding: 12px;
}

.quick-prompts-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.quick-prompts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 85px;
  overflow-y: auto;
}

.quick-prompt-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.quick-prompt-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: #fff;
}

.chat-input-area {
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input-area input {
  flex-grow: 1;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition-fast);
}

.chat-input-area input:focus {
  border-color: var(--whatsapp-green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.15);
}

.chat-send-btn {
  background-color: var(--whatsapp-green);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.chat-send-btn i {
  width: 16px;
  height: 16px;
  margin-left: 2px;
}

/* --- Panel 2: AI Console (Brain) --- */
.ai-console-panel {
  border-color: var(--primary-glow);
}

.ai-console-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: calc(100% - 53px);
}

.console-log-area {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  background-color: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.console-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.console-placeholder i {
  width: 32px;
  height: 32px;
}

.console-row {
  display: flex;
  gap: 8px;
  line-height: 1.35;
  animation: fadeIn 0.15s ease;
}

.console-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.console-badge {
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 0 4px;
  border-radius: 2px;
}

.console-badge.info { background-color: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.console-badge.db { background-color: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }
.console-badge.ai { background-color: var(--primary-light); color: var(--primary); }

.console-text {
  color: #d1d5db;
}

.console-text span.highlight {
  color: #fff;
  font-weight: bold;
}

.ai-draft-area {
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.draft-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.draft-body {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 12px;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

/* --- Panel 3: Calendar Panel --- */
.calendar-panel {
  border-color: rgba(59, 130, 246, 0.15);
}

.calendar-subheader {
  padding: 12px 20px;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-nav h4 {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}

.cal-nav-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cal-nav-btn:hover {
  background-color: var(--bg-secondary);
  color: #fff;
  border-color: var(--border-color-hover);
}

.cal-nav-btn i {
  width: 14px;
  height: 14px;
}

.calendar-views-switch {
  display: flex;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 15px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.calendar-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calendar-days-header {
  display: grid;
  grid-template-columns: 50px repeat(3, 1fr); /* 50px for hours, then days */
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.1);
  text-align: center;
  padding: 8px 0;
  flex-shrink: 0;
}

.calendar-days-header.week-view {
  grid-template-columns: 50px repeat(6, 1fr);
}

.cal-header-cell {
  font-size: 0.72rem;
  font-weight: 600;
}

.cal-header-cell.day {
  color: var(--text-secondary);
}

.cal-header-cell.day.today {
  color: var(--accent-blue);
  font-weight: 700;
}

.calendar-grid-body {
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
}

.calendar-row {
  display: grid;
  grid-template-columns: 50px repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  height: 60px; /* 1 hour height */
  position: relative;
}

.calendar-grid-body.week-view .calendar-row {
  grid-template-columns: 50px repeat(6, 1fr);
}

.cal-hour-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
  padding-right: 8px;
  transform: translateY(-6px);
  user-select: none;
}

.cal-cell {
  border-right: 1px solid rgba(255, 255, 255, 0.02);
  position: relative;
  background-color: transparent;
  transition: var(--transition-fast);
}

.cal-cell:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

/* Calendar Event Blocks */
.calendar-event {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 3px solid;
  cursor: pointer;
  transition: var(--transition-normal);
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  animation: eventFadeIn 0.35s ease;
}

@keyframes eventFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.calendar-event:hover {
  transform: scale(1.02);
  z-index: 5;
  box-shadow: var(--shadow-md);
}

/* Service Colors */
.event-purple {
  background-color: rgba(157, 78, 221, 0.15);
  color: #d8b4fe;
  border-left-color: #a78bfa;
}
.event-blue {
  background-color: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-left-color: #60a5fa;
}
.event-green {
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-left-color: #34d399;
}
.event-gold {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fde047;
  border-left-color: #facc15;
}
.event-rose {
  background-color: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border-left-color: #fb7185;
}

.event-title {
  font-weight: 700;
  display: block;
}

.event-desc {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1px;
}

/* --- TAB: SETTINGS --- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.panel-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

input[type="text"],
input[type="time"],
textarea,
select {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

input[type="text"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 6px var(--primary-glow);
}

.days-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.checkbox-label:has(input:checked) {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: #fff;
}

.checkbox-label input {
  accent-color: var(--primary);
}

.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 0.8rem; }

/* Table Styles */
.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.premium-table th,
.premium-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
}

.premium-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.premium-table tr:last-child td {
  border-bottom: none;
}

.color-dot-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.action-btn-group {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-tertiary);
  color: #fff;
}

.btn-icon.delete:hover {
  color: var(--accent-red);
  background-color: rgba(239, 68, 68, 0.1);
}

/* --- TAB: INTEGRATION CODE --- */
.code-guide-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  height: calc(100vh - 200px);
}

.code-steps-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.code-step-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.code-step-item:hover {
  border-color: var(--border-color-hover);
}

.code-step-item.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.code-step-item.active .step-num {
  background-color: var(--primary);
  color: #fff;
}

.step-desc h5 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.step-desc p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.code-display-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.code-panel-header {
  background-color: rgba(0,0,0,0.1);
}

.code-viewer-container {
  flex-grow: 1;
  overflow: auto;
  padding: 20px;
  background-color: #080a0f;
  margin: 0;
}

.code-viewer-container pre {
  margin: 0;
}

.code-viewer-container code {
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #abb2bf;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Billing & Sales Sandbox */
.badge-gold {
  background-color: var(--accent-gold-light);
  color: var(--accent-gold);
}

.event-pending {
  border: 1px dashed var(--accent-gold) !important;
  background-color: rgba(245, 158, 11, 0.08) !important;
  color: #fef08a !important;
  border-left: 3px solid var(--accent-gold) !important;
}

.event-pending::after {
  content: " ⏳ Pix Pendente";
  font-size: 0.55rem;
  color: var(--accent-gold);
  font-weight: 500;
  display: block;
}

.billing-sandbox-area {
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-color);
  flex-grow: 0;
  display: flex;
  flex-direction: column;
}

.billing-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.billing-pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.billing-empty-state {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.75rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.billing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.78rem;
  animation: fadeIn 0.2s ease;
}

.billing-item:hover {
  border-color: var(--border-color-hover);
}

.billing-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-client-name {
  font-weight: 700;
  color: #fff;
}

.billing-service-name {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.billing-amount {
  font-weight: 700;
  color: var(--accent-gold);
}

.billing-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-confirm-pix {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #fff;
  border: none;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-confirm-pix:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-confirm-pix i {
  width: 12px;
  height: 12px;
}

/* Layouts for Waiting List & Patient Charts */
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.col-span-2 {
  grid-column: span 2;
}

.mt-6 {
  margin-top: 24px;
}

.config-resource-box {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.config-resource-box h5 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

/* Waitlist Styles */
.waitlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.waitlist-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: var(--transition-fast);
}

.waitlist-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

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

.waitlist-badge-pos {
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waitlist-client-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.waitlist-service-tag {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.waitlist-pref-time {
  font-size: 0.75rem;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Patients Section Layout */
.patients-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  height: calc(100vh - 200px);
}

.patients-sidebar-card {
  height: 100%;
}

.patients-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 12px;
  overflow-y: auto;
  flex-grow: 1;
}

.patient-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: var(--transition-fast);
}

.patient-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.patient-nav-item.active {
  background-color: var(--primary-light);
  border-color: var(--primary-glow);
  color: #fff;
}

.patient-nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.patient-nav-item.active .patient-nav-avatar {
  background-color: var(--primary);
}

.patient-detail-card {
  height: 100%;
}

.scrollable-y {
  overflow-y: auto;
  flex-grow: 1;
}

.patient-select-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
}

/* Patient Profile Content */
.patient-profile-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.patient-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.patient-section-title i {
  width: 18px;
  height: 18px;
}

.patient-info-box {
  background-color: rgba(0,0,0,0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.patient-meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.patient-meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.patient-meta-label {
  color: var(--text-muted);
}

.patient-meta-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* Anamnese Tags */
.anamnese-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.anamnese-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.anamnese-tag.safe { background-color: var(--accent-green-light); color: var(--accent-green); }
.anamnese-tag.warn { background-color: var(--accent-gold-light); color: var(--accent-gold); }
.anamnese-tag.danger { background-color: rgba(239, 68, 68, 0.1); color: var(--accent-red); }

.anamnese-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.anamnese-q {
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.anamnese-a {
  color: var(--text-secondary);
}

/* Visual Before/After split slider */
.before-after-container {
  background-color: rgba(0,0,0,0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.before-after-slider {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  box-shadow: var(--shadow-sm);
  background-color: #000;
}

.slider-img-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.slider-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-before {
  z-index: 1;
}

.slider-after {
  z-index: 2;
  width: 100%;
  clip-path: inset(0 0 0 50%);
}

.slider-after .slider-img {
  width: 100%; /* Important to lock aspect ratio of the underlying img */
  max-width: none;
}

/* Custom placeholder gradients for clinical photos */
.img-placeholder-before {
  background: linear-gradient(135deg, #3a225d 0%, #110729 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-weight: bold;
  font-size: 1.1rem;
}

.img-placeholder-after {
  background: linear-gradient(135deg, #a78bfa 0%, #4c1d95 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
}

.slider-label {
  position: absolute;
  bottom: 12px;
  background-color: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  z-index: 5;
}

.slider-label.before {
  left: 12px;
}

.slider-label.after {
  right: 12px;
}

.slider-handle-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%; /* Synchronized with after width */
  width: 2px;
  background-color: #fff;
  z-index: 10;
  transform: translateX(-50%);
  pointer-events: none;
}

.slider-handle-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #fff;
  border: 1px solid var(--border-color);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 11;
  pointer-events: none;
}

.slider-handle-circle i {
  width: 14px;
  height: 14px;
}

.calendar-resource-select select {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.75rem;
  outline: none;
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .simulator-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Reports Dashboard Styles */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .reports-grid {
    grid-template-columns: 1fr;
  }
}

.chart-bar-container {
  margin-bottom: 16px;
}

.chart-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.chart-bar-name {
  font-weight: 600;
  color: var(--text-primary);
}

.chart-bar-value {
  font-weight: 700;
  color: var(--text-secondary);
}

.chart-bar-bg {
  background-color: var(--bg-tertiary);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

.chart-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.staff-report-item {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  transition: var(--transition-fast);
}

.staff-report-item:hover {
  border-color: var(--border-color-hover);
}

.staff-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.staff-report-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}

.staff-report-revenue {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--whatsapp-green);
}

.staff-report-occupancy {
  margin-top: 8px;
}

.staff-occupancy-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}

.funnel-stage {
  display: flex;
  align-items: center;
  height: 48px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  padding: 0 16px;
  transition: var(--transition-fast);
  border: 1px solid var(--border-color);
}

.funnel-stage:hover {
  transform: scale(1.01);
  border-color: var(--border-color-hover);
}

.funnel-stage-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  opacity: 0.08;
  z-index: 1;
  border-radius: var(--radius-md);
}

.funnel-stage-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.funnel-stage-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.funnel-stage-metrics {
  text-align: right;
}

.funnel-stage-value {
  font-weight: 700;
  color: #fff;
}

.funnel-stage-pct {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-left: 6px;
}

.funnel-stage.step-1 {
  background-color: rgba(59, 130, 246, 0.05);
  border-left: 4px solid var(--accent-blue);
  width: 100%;
}
.funnel-stage.step-1 .funnel-stage-bg {
  background-color: var(--accent-blue);
}

.funnel-stage.step-2 {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary);
  width: 90%;
  margin-left: 5%;
}
.funnel-stage.step-2 .funnel-stage-bg {
  background-color: var(--primary);
}

.funnel-stage.step-3 {
  background-color: rgba(16, 185, 129, 0.05);
  border-left: 4px solid var(--accent-green);
  width: 80%;
  margin-left: 10%;
}
.funnel-stage.step-3 .funnel-stage-bg {
  background-color: var(--accent-green);
}

.crm-report-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.crm-report-item:hover {
  border-color: var(--border-color-hover);
}

.crm-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crm-client-name {
  font-weight: 700;
  color: #fff;
}

.crm-treatment-status {
  font-size: 0.72rem;
  color: var(--accent-gold);
}

.crm-last-visit {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.crm-action-btn {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-glow);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.crm-action-btn:hover {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary-hover);
}

/* LGPD Privacy Alert card in patient details */
.lgpd-compliance-card {
  margin-top: 16px;
  background-color: rgba(16, 185, 129, 0.03);
  border: 1px dashed rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lgpd-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--whatsapp-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lgpd-header i {
  width: 16px;
  height: 16px;
}

.lgpd-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Real-time Sentiment Badges */
.sentiment-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.sentiment-positive {
  background-color: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.sentiment-neutral {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.sentiment-anxious {
  background-color: var(--accent-gold-light);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* LTV Forecast Projection Charts */
.forecast-chart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forecast-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.forecast-month {
  width: 80px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
}

.forecast-bar-bg {
  flex-grow: 1;
  background-color: var(--bg-primary);
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

.forecast-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent-blue));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.forecast-value {
  width: 100px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--whatsapp-green);
}

/* Esthetic Club MRR Recurring Stats */
.club-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.club-stat-box {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition-fast);
}

.club-stat-box:hover {
  border-color: var(--border-color-hover);
}

.club-stat-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.club-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
}

/* Patient Chart details Subscription status card */
.patient-subscription-card {
  background-color: var(--bg-tertiary);
  border: 1px dashed var(--primary-glow);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.patient-subscription-card:hover {
  border-color: var(--primary);
}

.sub-badge {
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* --- TELA DE LOGIN (AUTHENTICATION WALL) --- */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(6, 8, 12, 0.9);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity var(--transition-normal);
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.login-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 440px;
  padding: 40px;
  animation: loginCardFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* --- USER PROFILE FOOTER & LOGOUT --- */
.user-profile-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.15);
}

.user-profile-container .user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-logout:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

/* --- BLOQUEIO DE SIDEBAR NAV ITEMS --- */
.nav-item.locked {
  opacity: 0.45;
  cursor: not-allowed !important;
  position: relative;
}

.nav-item.locked:hover {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

.nav-item-lock-icon {
  margin-left: auto;
  color: var(--text-muted);
  width: 14px;
  height: 14px;
}

/* --- TAB CONTEÚDO: ACESSO RESTRITO --- */
.restricted-overlay-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70vh;
  padding: 40px;
}

.restricted-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  max-width: 480px;
  text-align: center;
  animation: loginCardFadeIn 0.4s ease;
}

.restricted-lock-icon {
  width: 56px;
  height: 56px;
  color: var(--accent-red);
  background-color: rgba(239, 68, 68, 0.1);
  padding: 12px;
  border-radius: 50%;
  margin-bottom: 20px;
  display: inline-block;
}

.restricted-box h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.restricted-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* --- PAINEL DE RH E COMISSÕES --- */
.rh-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition-fast);
  color: var(--text-secondary);
}

.rh-list-item:hover {
  border-color: var(--border-color-hover);
  background-color: rgba(255, 255, 255, 0.02);
  color: #fff;
}

.rh-list-item.active {
  border-color: var(--primary-glow);
  background-color: var(--primary-light);
  color: #fff;
}

.rh-staff-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

.rh-list-item.active .rh-staff-avatar {
  background-color: var(--primary);
  color: #fff;
  border-color: transparent;
}

.rh-staff-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rh-staff-name-text {
  font-size: 0.8rem;
  font-weight: 600;
}

.rh-staff-role-text {
  font-size: 0.65rem;
  opacity: 0.7;
}

.rh-financial-summary {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.03), rgba(16, 185, 129, 0.03));
  border-color: var(--primary-light) !important;
}

/* --- Staff Roles Tags --- */
#roles-tags-container > div {
  transition: background 0.2s, border-color 0.2s;
}
#roles-tags-container > div:hover {
  background: rgba(255,255,255,0.1) !important;
  border-color: var(--primary) !important;
}

/* --- Individual Permissions Section --- */
#rh-staff-perms-section h6 {
  background: linear-gradient(90deg, var(--primary), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#rh-staff-perms-section .checkbox-label {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  transition: background 0.2s, border-color 0.2s;
}

#rh-staff-perms-section .checkbox-label:has(input:checked) {
  background: rgba(157, 78, 221, 0.12);
  border-color: var(--primary);
}

/* --- Role Select Dropdown --- */
#rh-staff-role option {
  background-color: var(--bg-secondary);
  color: #fff;
}

/* --- CALENDAR INTERACTIVITY & CELL HOVER --- */
.cal-cell:not(.non-working) {
  cursor: cell;
}

.cal-cell:not(.non-working):hover {
  background-color: rgba(157, 78, 221, 0.06);
  box-shadow: inset 0 0 4px rgba(157, 78, 221, 0.15);
}

/* --- BLOCKED AGENDA EVENTS STYLE --- */
.calendar-event.event-blocked {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.02) 8px,
    rgba(255, 255, 255, 0.05) 8px,
    rgba(255, 255, 255, 0.05) 16px
  ), rgba(28, 25, 45, 0.9);
  border-left-color: #6b7280 !important; /* Gray indicator */
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: #9ca3af;
  opacity: 0.9;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-event.event-blocked:hover {
  opacity: 1;
  transform: scale(1.02);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.calendar-event.event-blocked .event-title {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #d1d5db;
}

.calendar-event.event-blocked .event-desc {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.65rem;
}

/* --- MODAL DIALOG STYLE (GLASSMORPHISM) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 8, 22, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: rgba(23, 20, 43, 0.95);
  border: 1px solid rgba(157, 78, 221, 0.18);
  border-radius: var(--radius-lg, 16px);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  padding: 24px 28px;
  animation: modalAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #fff 30%, #e9d5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted, #9ca3af);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.modal-body .form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.modal-body label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #d1d5db);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-body input[type="text"],
.modal-body select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md, 8px);
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.modal-body input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.modal-body input[type="text"]:focus,
.modal-body select:focus {
  border-color: var(--primary, #9d4edd);
  box-shadow: 0 0 8px rgba(157, 78, 221, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.modal-body select option {
  background-color: #17142b;
  color: #fff;
}

.modal-body .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .modal-body .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}


