/* ============================================================
   MED ANGEL — DASHBOARD CSS · "OBSIDIAN CLINIC"
   Sidebar, Topbar, Layout de Dashboard
   ============================================================ */

/* ─── Sidebar — A linha dourada ─── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #0A0B11;
  border-right: 1px solid rgba(184, 150, 46, 0.1);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
}
/* A linha dourada — assinatura visual do MedAngel Obsidian */
.sidebar::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(184, 150, 46, 0.4) 20%,
    rgba(212, 176, 96, 0.7) 50%,
    rgba(184, 150, 46, 0.4) 80%,
    transparent 100%
  );
  z-index: 1;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(184, 150, 46, 0.08);
  min-height: 68px;
  overflow: hidden;
  position: relative;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: contain;
  overflow: hidden;
  border: 1px solid rgba(184, 150, 46, 0.2);
}

.sidebar-logo-svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar-brand {
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}

.sidebar-brand-name {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 1.1875rem;
  font-weight: 600;
  font-style: italic;
  background: linear-gradient(135deg, #C9A030 0%, #E8CC78 50%, #C9A030 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.sidebar-brand-sub {
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 2px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.sidebar.collapsed .sidebar-brand {
  opacity: 0;
  width: 0;
}

/* Sidebar Toggle */
.sidebar-toggle {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background: #13151F;
  border: 1px solid rgba(184, 150, 46, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
  z-index: 10;
}
.sidebar-toggle:hover {
  background: rgba(184, 150, 46, 0.12);
  color: var(--gold-light);
  border-color: var(--gold);
}
.sidebar.collapsed .sidebar-toggle { transform: translateY(-50%) rotate(180deg); }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 2px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(184, 150, 46, 0.2); border-radius: 2px; }

.nav-section {
  margin-bottom: 4px;
}

.nav-section-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(184, 150, 46, 0.4);
  padding: 10px 16px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(139, 132, 121, 0.85);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
  margin: 1px 8px;
  border-radius: 6px;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-item:hover {
  background: rgba(184, 150, 46, 0.07);
  color: var(--gold-pale);
}

.nav-item.active {
  background: rgba(184, 150, 46, 0.1);
  color: var(--gold-light);
  border: 1px solid rgba(184, 150, 46, 0.18);
}
/* A marquinha dourada no item ativo — bistoury indicator */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  border-radius: var(--radius-full);
}

.nav-icon {
  flex-shrink: 0;
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
.nav-icon .icon { width: 17px; height: 17px; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-label {
  transition: opacity var(--transition), width var(--transition);
  overflow: hidden;
}
.nav-viewonly {
  display: inline-flex;
  vertical-align: -2px;
  opacity: 0.55;
  margin-left: 2px;
}
.nav-viewonly .icon { width: 12px; height: 12px; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.nav-badge {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  min-width: 17px;
  text-align: center;
  flex-shrink: 0;
  transition: opacity var(--transition);
  letter-spacing: 0.04em;
}
.sidebar.collapsed .nav-badge { opacity: 0; }

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid rgba(184, 150, 46, 0.08);
  padding: var(--space-md);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
  overflow: hidden;
}
.sidebar-user:hover { background: rgba(184, 150, 46, 0.06); }

.sidebar-user-info { overflow: hidden; flex: 1; }
.sidebar-user-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── Topbar — Obsidian Clinic ─── */
.topbar {
  height: 60px;
  background: rgba(10, 11, 17, 0.95);
  border-bottom: 1px solid rgba(184, 150, 46, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Notification Bell */
.notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(184, 150, 46, 0.05);
  border: 1px solid rgba(184, 150, 46, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.notif-btn:hover {
  border-color: rgba(184, 150, 46, 0.3);
  color: var(--gold-light);
  background: rgba(184, 150, 46, 0.08);
}
.notif-count {
  position: absolute;
  top: -5px; right: -5px;
  background: #EF4444;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0A0B11;
  animation: pulse 2s ease-in-out infinite;
}
.notif-count.hidden { display: none; }

/* Notification Dropdown */
.notif-dropdown {
  position: absolute;
  top: 56px; right: 0;
  width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  animation: slideUp 200ms ease;
  overflow: hidden;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { background: rgba(184, 150, 46, 0.05); }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.notif-text {
  flex: 1;
  min-width: 0;
}
.notif-title { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.notif-time  { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.notif-unread-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-secondary);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Mobile hamburger */
.hamburger-btn {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .sidebar-toggle { display: none; }

  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .topbar { padding: 0 var(--space-md); }
}

/* ─── Dashboard Overview ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* ─── Quick Actions ─── */
.quick-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.quick-action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ─── Patient Card ─── */
.patient-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  transition: all var(--transition);
}
.patient-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
.patient-info { flex: 1; min-width: 0; }
.patient-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.patient-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Appointment Calendar ─── */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

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

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--space-sm) 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.875rem;
  position: relative;
  color: var(--text-secondary);
}
.calendar-day:hover { background: var(--bg-card); color: var(--text-primary); }
.calendar-day.today {
  background: rgba(184, 150, 46, 0.18);
  color: var(--gold-light);
  font-weight: 700;
}
.calendar-day.selected {
  background: var(--brand-secondary);
  color: white;
}
.calendar-day.other-month { color: var(--text-muted); opacity: 0.4; }
.calendar-day.has-events::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--brand-accent);
}

/* ─── Appointment list ─── */
.appointment-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: all var(--transition);
  cursor: pointer;
}
.appointment-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.apt-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  text-align: center;
  border-right: 1px solid var(--border);
  padding-right: var(--space-md);
}

.apt-time {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}
.apt-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.apt-info { flex: 1; min-width: 0; }
.apt-type { font-weight: 600; font-size: 0.9375rem; color: var(--text-primary); }
.apt-patient { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.apt-location { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Documents ─── */
.doc-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}
.doc-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.doc-icon {
  width: 44px; height: 44px;
  background: var(--error-bg);
  border: 1px solid rgba(255,91,91,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Profile Page ─── */
.profile-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand-gradient);
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--brand-secondary);
  object-fit: cover;
  box-shadow: 0 0 0 6px rgba(184, 150, 46, 0.15);
  margin-bottom: var(--space-lg);
}

.social-links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

.social-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
}
.social-link:hover {
  border-color: var(--brand-secondary);
  color: var(--brand-secondary);
  background: rgba(184, 150, 46, 0.05);
}

/* ─── Master Dashboard ─── */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: all var(--transition);
}
.admin-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.admin-card-info { flex: 1; min-width: 0; }
.admin-card-name { font-weight: 700; color: var(--text-primary); font-size: 1rem; }
.admin-card-meta { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; }
.admin-card-actions { display: flex; gap: var(--space-sm); }

/* ─── Welcome Banner ─── */
.welcome-banner {
  background: var(--brand-gradient);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-2xl);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}
.welcome-banner::after {
  content: '🏥';
  position: absolute;
  right: var(--space-xl);
  top: 50%;
  transform: translateY(-50%);
  font-size: 5rem;
  opacity: 0.15;
}
.welcome-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}
.welcome-sub {
  color: rgba(255,255,255,0.75);
  font-size: 0.9375rem;
  margin-top: var(--space-xs);
}

/* ─── Mobile Overlay ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: calc(var(--z-sidebar) - 1);
  backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }


/* ─── Navbar pending requests highlights ─── */
.nav-item-highlight-danger {
  border-left: 4px solid var(--error) !important;
  background: rgba(255, 91, 91, 0.08) !important;
  color: var(--error) !important;
  font-weight: 700 !important;
}
.nav-item-highlight-danger .nav-icon {
  color: var(--error) !important;
}

/* ═══════════════════════════════════════════════
   DASHBOARD PREMIUM ENHANCEMENTS — MedAngel v2
   ═══════════════════════════════════════════════ */

/* ─── Sidebar Premium Glassmorphism ─── */
.sidebar {
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(6,14,26,0.98) 100%);
  border-right: 1px solid var(--glass-border);
  box-shadow: 4px 0 24px rgba(0,0,0,0.35);
}

/* ─── Active Nav Item Premium ─── */
.nav-item.active {
  background: linear-gradient(90deg,
    rgba(62,146,204,0.25) 0%,
    rgba(27,255,219,0.08) 60%,
    rgba(10,36,99,0.12) 100%
  );
  border: 1px solid rgba(62,146,204,0.32);
  box-shadow:
    0 4px 16px rgba(10,36,99,0.35),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ─── Active Indicator Bar Pulse ─── */
@keyframes indicatorPulse {
  0%, 100% { box-shadow: 0 0 6px var(--brand-accent); }
  50%       { box-shadow: 0 0 14px var(--brand-accent), 0 0 28px rgba(27,255,219,0.3); }
}

.nav-item.active::before {
  width: 4px;
  background: linear-gradient(180deg, var(--brand-accent) 0%, var(--brand-secondary) 100%);
  animation: indicatorPulse 2.5s ease-in-out infinite;
}

/* ─── Nav Icon Scale on Active/Hover ─── */
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  transform: scale(1.18);
  filter: drop-shadow(0 0 6px rgba(62,146,204,0.55));
  transition: all var(--transition);
  display: inline-block;
}

.nav-item .nav-icon {
  transition: transform var(--transition), filter var(--transition);
}

/* ─── Sidebar Header Logo Glow ─── */
.sidebar-logo-svg svg,
.sidebar-logo {
  filter: drop-shadow(0 0 8px rgba(27,255,219,0.25));
  transition: filter var(--transition);
}

.sidebar-logo-svg:hover svg,
.sidebar-logo:hover {
  filter: drop-shadow(0 0 16px rgba(27,255,219,0.45));
}

/* ─── Topbar Premium ─── */
.topbar {
  background: rgba(12, 26, 46, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(62,146,204,0.2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
}

/* ─── Sidebar Footer User Card ─── */
.sidebar-user {
  border: 1px solid transparent;
  transition: all var(--transition);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.sidebar-user:hover {
  background: rgba(62,146,204,0.08);
  border-color: var(--glass-border);
  cursor: pointer;
}

/* ─── Welcome Banner Enhanced ─── */
.welcome-banner {
  background: linear-gradient(135deg,
    rgba(10,36,99,0.95) 0%,
    rgba(62,146,204,0.8) 55%,
    rgba(27,255,219,0.6) 100%
  );
  box-shadow: 0 8px 32px rgba(10,36,99,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* ─── Notification Button Glow ─── */
.notif-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 1.1rem;
  transition: all var(--transition);
  position: relative;
}

.notif-btn:hover {
  background: rgba(62,146,204,0.12);
  border-color: var(--brand-secondary);
  box-shadow: 0 0 14px rgba(62,146,204,0.2);
}

.notif-count {
  background: var(--error);
  box-shadow: 0 0 8px rgba(255,91,91,0.6);
}

/* ─── Nomes de Pacientes Sempre em Maiúsculas ─── */
.patient-name,
.prontuario-name,
.patient-card-name,
.patient-title,
.patient-header-name,
.apt-patient,
.patient-info .patient-name {
  text-transform: uppercase;
}

