/* ==========================================================================
   CRC CRM DESIGN SYSTEM & COMPONENT STYLING (Premium Dark Glassmorphism)
   ========================================================================== */

/* Design Tokens & Variables */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-title: 'Outfit', sans-serif;

  /* Premium Color Palette (CRC Card Brand: Blue and Green) - Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  
  --panel-bg: rgba(255, 255, 255, 0.95);
  --panel-border: rgba(0, 0, 0, 0.08);
  --panel-glow: rgba(0, 102, 255, 0.04);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Accent Colors */
  --color-primary: #0066ff; /* Royal Blue from Logo */
  --color-primary-hover: #0055dd;
  --color-primary-rgb: 0, 102, 255;
  
  --color-secondary: #33b827; /* Grass Green from Logo */
  --color-secondary-hover: #2ca321;
  
  /* Highlight / Holiday Color (Orange/Coral) */
  --color-holiday: #f97316; /* Vibrant Orange */
  --color-holiday-hover: #ea580c;
  --color-holiday-glow: rgba(249, 115, 22, 0.1);
  
  --color-danger: #ef4444; /* Alert Red */
  --color-danger-hover: #dc2626;
  --color-success: #10b981; /* Success Green */
  --color-success-hover: #059669;

  /* Layout and Effects */
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-blur: blur(16px);
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
  font-family: inherit;
  color: inherit;
}

select option {
  background-color: #ffffff;
  color: #0066ff;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */
.sidebar {
  width: 280px;
  background: #f8fafc;
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding-left: 5px;
}

.brand-logo-svg {
  filter: drop-shadow(0 2px 8px rgba(0, 102, 255, 0.3));
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.brand-title .white-text {
  color: #0f172a;
}

.brand-title .green-text {
  color: #33b827;
  text-shadow: 0 0 10px rgba(51, 184, 39, 0.15);
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 1px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 18px;
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.menu-item svg {
  transition: var(--transition-smooth);
}

.menu-item:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.03);
  padding-left: 22px;
}

.menu-item.active {
  color: var(--color-primary);
  background: rgba(0, 102, 255, 0.06);
  border-color: rgba(0, 102, 255, 0.15);
  box-shadow: inset 0 0 12px rgba(0, 102, 255, 0.03);
}

.menu-item.active svg {
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px rgba(0, 102, 255, 0.2));
}

.sidebar-footer {
  margin-top: auto;
  padding-left: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MAIN CONTENT AREA & VIEWS
   ========================================================================== */
.main-content {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  position: relative;
  background: radial-gradient(circle at 70% 10%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
}

.view-section {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.view-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.view-header {
  margin-bottom: 30px;
}

.view-header h1 {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.7px;
  margin-bottom: 6px;
  background: linear-gradient(to right, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.view-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   GLASS PANELS & CARDS
   ========================================================================== */
.glass-card {
  background: var(--panel-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-premium);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.form-group input, 
.form-group select, 
.form-group textarea {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  border-color: var(--color-primary);
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 102, 255, 0.15);
}

.form-group input.input-readonly {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Autocomplete search styling */
.autocomplete-container {
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper input {
  width: 100%;
  padding-right: 40px;
}

.btn-icon {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.search-input-wrapper .btn-icon {
  position: absolute;
  right: 8px;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--border-radius-sm);
  margin-top: 5px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  backdrop-filter: var(--glass-blur);
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: rgba(0, 102, 255, 0.08);
}

.autocomplete-item .patient-code {
  font-weight: 700;
  color: var(--color-primary);
  margin-right: 8px;
}

.selected-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 102, 255, 0.06);
  border: 1px solid rgba(0, 102, 255, 0.18);
  border-radius: var(--border-radius-sm);
  padding: 10px 16px;
  margin-top: 10px;
}

.selected-badge strong {
  color: var(--color-primary);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: var(--text-inverse);
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 12px 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 12px 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--color-danger);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  transition: var(--transition-smooth);
  font-size: 0.85rem;
}

.btn-text-danger:hover {
  text-decoration: underline;
  color: var(--color-danger-hover);
}

.btn-pulse {
  position: relative;
  overflow: hidden;
}

.btn-pulse::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 1;
  transition: transform 0.5s, opacity 0.5s;
}

.btn-pulse:active::after {
  transform: translate(-50%, -50%) scale(2);
  opacity: 0;
  transition: 0s;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-container {
  overflow-x: auto;
  margin-top: 15px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.95rem;
  color: var(--text-main);
  vertical-align: middle;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

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

/* Actions in tables */
.table-actions {
  display: flex;
  gap: 10px;
}

.btn-action-edit {
  background: rgba(6, 182, 212, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-weight: 500;
}

.btn-action-edit:hover {
  background: var(--color-primary);
  color: var(--text-inverse);
}

.btn-action-del {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-weight: 500;
}

.btn-action-del:hover {
  background: var(--color-danger);
  color: var(--text-main);
}

/* ==========================================================================
   SPLIT VIEW LAYOUT & FORM PANELS
   ========================================================================== */
.split-view-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.list-panel {
  flex: 1.2;
}

.form-panel {
  flex: 0.8;
  border-color: rgba(6, 182, 212, 0.15);
}

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

.panel-header h2 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

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

/* ==========================================================================
   SCHEDULER SCREEN (2 COLUMNS)
   ========================================================================== */
.booking-grid-wrapper {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.booking-scheduler-container {
  position: relative;
  min-height: 400px;
}

.booking-scheduler-container.disabled {
  filter: blur(2px);
  pointer-events: none;
}

.overlay-msg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-lg);
  border: 1px dashed rgba(0, 0, 0, 0.15);
}

.overlay-msg p {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-primary);
  padding: 16px 30px;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--panel-border);
}

.scheduler-two-columns {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 25px;
}

.scheduler-left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Calendar Navigation */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.calendar-nav h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 15px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
  position: relative;
}

.calendar-day.empty {
  cursor: default;
  opacity: 0.2;
}

.calendar-day.inactive {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Highlights in calendar */
.calendar-day.day-available {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--color-success);
}

.calendar-day.day-available:hover {
  background: var(--color-success);
  color: var(--text-inverse);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.calendar-day.day-holiday {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.4);
  color: var(--color-holiday);
  cursor: not-allowed;
}

.calendar-day.day-holiday:hover {
  background: rgba(249, 115, 22, 0.2);
}

.calendar-day.day-selected {
  border-color: var(--color-primary) !important;
  background: rgba(6, 182, 212, 0.2) !important;
  color: var(--text-main) !important;
  font-weight: 700;
  box-shadow: inset 0 0 8px rgba(6, 182, 212, 0.3);
}

/* Day of budget expiration dot */
.calendar-day.day-budget::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  background: #f43f5e; /* Rose Red */
  border-radius: 50%;
}

.calendar-legends {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--panel-border);
  padding-top: 15px;
  margin-bottom: 5px;
}

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

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-available {
  background: var(--color-success);
}

.legend-holiday {
  background: var(--color-holiday);
}

.legend-booked {
  background: var(--color-secondary);
}

.legend-budget {
  background: #f43f5e;
}

/* Scheduler Right Column: Available slots of the day */
.day-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 20px;
  margin-bottom: 25px;
}

.day-details-header h2 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
}

.day-weekday-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.slots-periods-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.period-block h3 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 15px;
  border-left: 3px solid var(--color-primary);
  padding-left: 10px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.no-slots-msg {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.slot-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.slot-btn:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--color-primary);
}

.slot-btn span {
  font-size: 0.95rem;
}

.slot-btn .btn-slot-action {
  font-size: 0.75rem;
  background: var(--color-primary);
  color: var(--text-inverse);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.slot-btn:hover .btn-slot-action {
  background: var(--color-primary-hover);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* ==========================================================================
   DENTIST SUB TABS (Within Dentist Edit Form)
   ========================================================================== */
.dentist-sub-tabs {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  margin: 15px 0 25px;
  gap: 5px;
}

.sub-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.sub-tab:hover {
  color: var(--text-main);
}

.sub-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.sub-tab-content {
  display: none;
}

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

/* Weekday Config Cards */
.weekday-config-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  margin-bottom: 15px;
}

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

.weekday-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-add-block {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.2);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-add-block:hover {
  background: #0ea5e9;
  color: var(--text-inverse);
  border-color: #0ea5e9;
}

/* Hourly blocks config row */
.schedule-block-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.block-time-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.block-time-inputs input[type="time"] {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
}

.block-time-inputs span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.block-duration-select select {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
}

.block-toggle-active {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-remove-block {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.btn-remove-block:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Shortcuts */
.shortcut-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.shortcut-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-shortcut {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.btn-shortcut:hover {
  border-color: var(--color-primary);
  background: rgba(0, 153, 255, 0.05);
}

.btn-shortcut-danger {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: #fff5f5;
}

.btn-shortcut-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-danger);
}

/* Exceptions sub-tab style */
.exception-form-inline {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--panel-border);
  margin-bottom: 25px;
}

.exception-form-inline .inline-group {
  margin-bottom: 0;
  flex: 1;
}

/* Slots Visualizer Subtab style */
.slots-view-header {
  margin-bottom: 20px;
}

.slots-view-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--border-radius-sm);
  width: fit-content;
}

.slots-view-tab {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.slots-view-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.slots-sub-view {
  display: none;
}

.slots-sub-view.active {
  display: block;
}

/* 3-month grid viewer */
.three-months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.month-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

.month-card h4 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  margin-bottom: 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.month-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.month-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: 500;
}

.month-day-cell.header {
  font-weight: 700;
  opacity: 0.5;
}

.month-day-cell.empty {
  opacity: 0.1;
}

.month-day-cell.liberated {
  background: var(--color-success);
  color: var(--text-inverse);
  font-weight: 700;
}

.month-day-cell.booked {
  background: var(--color-secondary);
  color: var(--text-main);
}

.month-day-cell.feriado {
  background: var(--color-holiday);
  color: var(--text-main);
}

.slots-color-legend {
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
  justify-content: center;
  margin-top: 15px;
  color: var(--text-muted);
}

/* Sub-tables */
.sub-table-container {
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-md);
  background: rgba(0, 0, 0, 0.1);
}

.sub-table {
  font-size: 0.85rem;
}

.sub-table th {
  padding: 12px 16px;
}

.sub-table td {
  padding: 12px 16px;
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.available {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-badge.booked {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-secondary);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.form-actions-sticky {
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
  padding: 15px 0 0;
  border-top: 1px solid var(--panel-border);
  margin-top: 25px;
  display: flex;
  gap: 15px;
  z-index: 10;
}

/* ==========================================================================
   PATIENTS PAGE MINOR DETAILS SECTION
   ========================================================================== */
.minor-section-card {
  background: rgba(249, 115, 22, 0.03);
  border: 1px dashed rgba(249, 115, 22, 0.3);
  border-radius: var(--border-radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.minor-alert-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-holiday);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.minor-alert-badge svg {
  color: var(--color-holiday);
  filter: drop-shadow(0 0 4px var(--color-holiday-glow));
}

.patient-history-card {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--panel-border);
}

.patient-history-card h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  margin-bottom: 15px;
}

/* ==========================================================================
   HOLIDAYS VIEW (FIXED & POINT GROUPS)
   ========================================================================== */
.hidden {
  display: none !important;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-left: 4px solid var(--color-primary);
  border-top: 1px solid var(--panel-border);
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  min-width: 300px;
  max-width: 450px;
  animation: toast-in 0.3s ease;
  transition: var(--transition-smooth);
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.error {
  border-left-color: var(--color-danger);
}

.toast.warning {
  border-left-color: var(--color-holiday);
}

.toast-msg {
  font-size: 0.9rem;
  font-weight: 500;
}

.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toast-close:hover {
  color: var(--text-main);
}

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

/* ==========================================================================
   DENTIST FORM SPLIT LAYOUT
   ========================================================================== */
.dentist-form-split-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: stretch;
  margin-top: 10px;
}

.dentist-details-column {
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-md);
  padding: 24px;
}

.dentist-details-column h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
  color: var(--color-primary);
}

.dentist-grid-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.dentist-agenda-column {
  width: 100%;
}

/* Status toggling buttons */
.btn-status-toggle {
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  transition: var(--transition-smooth);
}

.btn-status-toggle.active {
  background: #f97316; /* Orange button style from screenshot */
  color: #fff;
  border: 1px solid #ea580c;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.2);
}

.btn-status-toggle.active:hover {
  background: #ea580c;
  transform: translateY(-1px);
}

.btn-status-toggle.inactive {
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid #cbd5e1;
}

.btn-status-toggle.inactive:hover {
  background: #e2e8f0;
  color: var(--text-main);
  transform: translateY(-1px);
}

/* Action button alignment for dentists and patients */
.btn-action-inline {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: #0ea5e9;
  margin-right: 5px;
}

.btn-action-inline:hover {
  border-color: #0ea5e9;
  background: #0ea5e9;
  color: var(--text-inverse);
}

.btn-action-inline:last-child {
  margin-right: 0;
}

/* Schedule Timeline Table styling */
.schedule-timeline-table {
  border: 1px solid var(--panel-border);
}

.schedule-timeline-table th {
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 12px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--panel-border);
  min-width: 100px;
}

.schedule-timeline-table th.hour-column {
  min-width: 60px;
  width: 70px;
}

.schedule-timeline-table td {
  padding: 8px;
  border: 1px solid var(--panel-border);
  vertical-align: top;
  height: 60px;
}

.schedule-timeline-table td.hour-cell {
  background: var(--bg-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  vertical-align: middle;
  height: auto;
}

.schedule-slot-card {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.schedule-slot-card.available {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.schedule-slot-card.booked {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #0284c7;
}

.schedule-slot-card.holiday {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: var(--color-holiday);
  text-align: center;
}

.schedule-slot-unavailable {
  color: #cbd5e1;
  font-size: 0.75rem;
  font-style: italic;
  text-align: center;
  padding: 10px 0;
  opacity: 0.5;
}

.disabled-container {
  opacity: 0.5;
  pointer-events: none;
}

/* Modal Overlay & Modal Cards */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

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

.modal-card {
  width: 90%;
  max-width: 480px;
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 35px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--panel-border);
}

.modal-success-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: scale-up 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.modal-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 25px;
}

.booking-details-box {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: 20px;
  width: 100%;
  text-align: left;
  margin-bottom: 25px;
  border: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.booking-details-box p {
  margin: 0 !important;
  font-size: 0.9rem;
  color: var(--text-main);
}

.booking-details-box strong {
  color: var(--text-muted);
  display: inline-block;
  width: 110px;
}

@keyframes scale-up {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.animate-pop {
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Status Badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  display: inline-block;
}

.status-badge.agendado {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: #0284c7;
}

.status-badge.chegou {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.status-badge.atendido {
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid rgba(100, 116, 139, 0.2);
  color: #64748b;
}

.wait-highlight {
  color: #0ea5e9;
  font-weight: 700;
}

.delay-highlight {
  color: #ef4444;
  font-weight: 700;
}

/* ==========================================================================
   TELA DE LOGIN
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 30% 30%, rgba(248, 250, 252, 0.98) 0%, rgba(226, 232, 240, 0.98) 100%);
  z-index: 99999; /* Overlays everything */
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(20px);
}

.login-container {
  width: 100%;
  max-width: 480px;
  padding: 20px;
}

.login-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  border-radius: var(--border-radius-lg);
  padding: 40px;
}

/* ==========================================================================
   MÓDULO DE FUNCIONÁRIOS
   ========================================================================== */
.employees-tabs {
  display: flex;
  gap: 10px;
}

.emp-tab {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--panel-border);
  padding: 8px 18px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.emp-tab:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.emp-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.employee-form-split-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

.employee-details-column {
  border-right: 1px solid var(--panel-border);
  padding-right: 30px;
}

.employee-access-column {
  padding-left: 10px;
}

.employee-details-column h3, 
.employee-access-column h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
}

.employee-photo-row {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  align-items: center;
}

.employee-photo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.photo-placeholder {
  width: 110px;
  height: 110px;
  border: 1.5px dashed var(--text-muted);
  border-radius: var(--border-radius-md);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.photo-placeholder span {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.photo-buttons {
  display: flex;
  gap: 5px;
}

.btn-photo-action {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--panel-border);
  background: white;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-photo-action:hover {
  background: var(--bg-secondary);
}

.photo-side-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.employee-grid-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 25px 0 15px 0;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 5px;
}

.access-info-alert {
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  font-size: 0.8rem;
  color: #0284c7;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 25px;
}

.access-info-alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.input-with-icon input {
  width: 100%;
  padding: 10px 12px 10px 38px !important;
}

@media (max-width: 1024px) {
  .employee-form-split-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .employee-details-column {
    border-right: none;
    padding-right: 0;
  }
  
  .employee-access-column {
    padding-left: 0;
    border-top: 1px solid var(--panel-border);
    padding-top: 30px;
  }
}
