/* ============================================================
   LASHBROW — Design System Rose Gold
   Cílios & Sobrancelhas | Sistema de Gestão Premium
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;1,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* === TOKENS === */
:root {
  --primary: #C4758A;
  --primary-dark: #9E4F65;
  --primary-light: #F0B8C8;
  --primary-xlight: #FDF0F3;
  --gold: #C9A96E;
  --gold-light: #EDD9B0;
  --gold-xlight: #FBF5E8;
  --rose: #E8A0B0;
  --rose-light: #FAE8ED;

  --bg: #FDF8F9;
  --bg-card: #FFFFFF;
  --bg-sidebar: #2C1A22;
  --bg-sidebar-hover: #3E2530;
  --bg-sidebar-active: #C4758A;

  --text-primary: #2C1A22;
  --text-secondary: #7A5563;
  --text-muted: #B89CA6;
  --text-on-primary: #FFFFFF;
  --text-sidebar: #F0DCE2;

  --border: #EDD9E2;
  --border-focus: #C4758A;

  --success: #4CAF7D;
  --success-bg: #E8F5EE;
  --warning: #E8A838;
  --warning-bg: #FEF3DC;
  --danger: #E05C6A;
  --danger-bg: #FDEAEC;
  --info: #5E9ECC;
  --info-bg: #E8F2FA;

  --shadow-sm: 0 1px 3px rgba(44, 26, 34, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 26, 34, 0.10);
  --shadow-lg: 0 8px 32px rgba(44, 26, 34, 0.14);
  --shadow-gold: 0 4px 20px rgba(201, 169, 110, 0.25);
  --shadow-rose: 0 4px 20px rgba(196, 117, 138, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition: 0.2s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* === UTILITIES === */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.rounded-full { border-radius: var(--radius-full); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === SPINNER === */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === APP LAYOUT === */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* === SIDEBAR === */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}
#sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(240,220,226,0.08);
}
.logo-brand {
  display: flex; align-items: center; gap: 10px;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 100%);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-rose);
}
.logo-text { font-weight: 700; font-size: 1.15rem; color: #fff; letter-spacing: -0.3px; }
.logo-sub { font-size: 0.65rem; color: var(--text-muted); font-weight: 400; margin-top: -4px; }

#sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(240,220,226,0.08);
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary-light), var(--gold-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
#user-name { font-weight: 600; font-size: 0.875rem; color: #fff; }
#user-role { font-size: 0.7rem; color: var(--text-muted); }

/* === NAV === */
#sidebar-nav { padding: 12px 12px; flex: 1; }
.nav-section-label {
  font-size: 0.65rem; font-weight: 600;
  color: rgba(240,220,226,0.4);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 0.875rem; font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all var(--transition);
  border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-item.active {
  background: var(--bg-sidebar-active);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196,117,138,0.4);
}
.nav-item .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }

/* Módulo exclusivo — destaque gold */
.nav-item.exclusive {
  background: linear-gradient(90deg, rgba(201,169,110,0.15), transparent);
  border-left: 2px solid var(--gold);
}
.nav-item.exclusive:hover { background: rgba(201,169,110,0.25); }
.nav-item.exclusive.active {
  background: linear-gradient(90deg, var(--gold), #B8862A);
  border-left: none;
}

#sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(240,220,226,0.08);
}
#btn-logout {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(240,220,226,0.6); font-size: 0.875rem;
  background: transparent; border: none; width: 100%;
  transition: all var(--transition);
}
#btn-logout:hover { color: var(--danger); background: rgba(224,92,106,0.1); }

/* === MAIN CONTENT === */
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* === TOP BAR === */
#topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
#topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 20px;
  transition: all var(--transition);
}
.topbar-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-xlight); }

/* === PAGE CONTENT === */
#page-content { flex: 1; padding: 24px; overflow-y: auto; }

/* === CARDS === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.card-body { padding: 20px; }

/* === KPI CARDS === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: all var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: ''; position: absolute;
  top: 0; right: 0; width: 80px; height: 80px;
  border-radius: 0 var(--radius-lg) 0 80px;
  opacity: 0.08;
}
.kpi-card.rose::before { background: var(--primary); }
.kpi-card.gold::before { background: var(--gold); }
.kpi-card.green::before { background: var(--success); }
.kpi-card.blue::before { background: var(--info); }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}
.kpi-card.rose .kpi-icon { background: var(--primary-xlight); color: var(--primary); }
.kpi-card.gold .kpi-icon { background: var(--gold-xlight); color: var(--gold); }
.kpi-card.green .kpi-icon { background: var(--success-bg); color: var(--success); }
.kpi-card.blue .kpi-icon { background: var(--info-bg); color: var(--info); }
.kpi-value { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.kpi-label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-top: 4px; }
.kpi-change { font-size: 0.75rem; margin-top: 8px; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 20px;
  border-radius: var(--radius-sm); border: none;
  font-family: inherit; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; box-shadow: var(--shadow-rose);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(196,117,138,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #B8862A 100%);
  color: #fff; box-shadow: var(--shadow-gold);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(201,169,110,0.4); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-xlight); }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-xlight); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0404e; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* === BADGE / STATUS === */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600;
}
.badge-rose { background: var(--primary-xlight); color: var(--primary-dark); }
.badge-gold { background: var(--gold-xlight); color: #856C2A; }
.badge-green { background: var(--success-bg); color: #2E7D55; }
.badge-red { background: var(--danger-bg); color: #B0283A; }
.badge-blue { background: var(--info-bg); color: #2472A8; }
.badge-gray { background: #F0EBF0; color: var(--text-secondary); }

/* === FORMS === */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.form-control {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.9rem;
  color: var(--text-primary); background: var(--bg);
  transition: all var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(196,117,138,0.12);
}
.form-control::placeholder { color: var(--text-muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A5563' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* === TABLE === */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--primary-xlight); }
th {
  padding: 12px 16px; text-align: left;
  font-size: 0.75rem; font-weight: 700;
  color: var(--primary-dark); text-transform: uppercase; letter-spacing: 0.5px;
}
td { padding: 12px 16px; font-size: 0.875rem; color: var(--text-primary); border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-xlight); transition: background 0.15s; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(44, 26, 34, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; animation: fadeIn 0.2s forwards;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.96); animation: modalIn 0.2s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
@keyframes modalIn { to { transform: scale(1); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: none; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 20px; cursor: pointer;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 12px;
}

/* === SEARCH BAR === */
.search-bar {
  position: relative; flex: 1; max-width: 320px;
}
.search-bar input {
  padding-left: 38px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.875rem; width: 100%; padding: 9px 16px 9px 38px;
  transition: all var(--transition);
}
.search-bar input:focus { outline: none; border-color: var(--primary); background: var(--bg-card); }
.search-bar .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 18px; pointer-events: none;
}

/* === EMPTY STATE === */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 24px; text-align: center;
}
.empty-state-icon { font-size: 48px; color: var(--primary-light); margin-bottom: 12px; }
.empty-state-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.empty-state-desc { font-size: 0.875rem; color: var(--text-secondary); margin-top: 4px; }

/* === AUTH SCREENS === */
#login-screen, #register-screen, #blocked-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FDF0F3 0%, #FBF5E8 50%, #F8EEF2 100%);
  padding: 20px;
}
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%; max-width: 420px;
}
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 100%);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 12px;
  box-shadow: var(--shadow-rose);
}
.auth-logo-text { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.auth-logo-sub { font-size: 0.8rem; color: var(--text-secondary); }
.auth-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 24px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-muted); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 10px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: white; font-family: inherit; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); color: var(--text-primary);
}
.btn-google:hover { border-color: var(--primary); background: var(--primary-xlight); }
.auth-link {
  color: var(--primary); font-weight: 600; cursor: pointer;
  transition: color var(--transition);
}
.auth-link:hover { color: var(--primary-dark); text-decoration: underline; }
.auth-error {
  background: var(--danger-bg); color: var(--danger);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.825rem; margin-top: 8px;
}
.auth-success {
  background: var(--success-bg); color: var(--success);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.825rem;
}

/* === TIMELINE === */
.timeline { position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 15px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item {
  display: flex; gap: 16px; padding: 0 0 20px 0; position: relative;
}
.timeline-dot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; z-index: 1;
  background: var(--primary-xlight); color: var(--primary);
}
.timeline-content { flex: 1; }
.timeline-date { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 2px; }

/* === FICHA TÉCNICA (Módulo Exclusivo) === */
.ficha-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.ficha-eye-map {
  background: var(--primary-xlight);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.ficha-eye-map svg { max-width: 100%; height: auto; }
.ficha-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: white; padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700;
  box-shadow: var(--shadow-rose);
}
.ficha-section-title {
  font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.product-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gold-xlight); border: 1px solid var(--gold-light);
  color: #856C2A; padding: 4px 10px;
  border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600;
}
.next-retouch {
  background: linear-gradient(135deg, var(--primary-xlight), var(--gold-xlight));
  border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}

/* === TOAST === */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-sidebar); color: white;
  box-shadow: var(--shadow-lg); font-size: 0.875rem;
  animation: toastIn 0.3s ease forwards;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === AGENDA / CALENDAR === */
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
}
.calendar-month { font-size: 1.1rem; font-weight: 700; }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; padding: 0 16px 16px;
}
.cal-day-label { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 4px; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 0.875rem; cursor: pointer;
  transition: all var(--transition); position: relative;
}
.cal-day:hover { background: var(--primary-xlight); }
.cal-day.today { background: var(--primary); color: white; font-weight: 700; }
.cal-day.has-event::after {
  content: ''; position: absolute; bottom: 2px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold);
}
.cal-day.other-month { color: var(--text-muted); }

/* === FLOATING ACTION BUTTON === */
.fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none;
  box-shadow: var(--shadow-rose);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; cursor: pointer; z-index: 90;
  transition: all var(--transition);
}
.fab:hover { transform: scale(1.1) translateY(-2px); box-shadow: 0 8px 28px rgba(196,117,138,0.5); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #main-content { margin-left: 0; }
  .form-grid, .form-grid-3, .ficha-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  #page-content { padding: 16px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 24px; }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ============================================================ 
   COMPLEMENTO — Novos seletores do HTML final
   ============================================================ */

/* Auth screens (usando classes, não IDs) */
.auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FDF0F3 0%, #FBF5E8 50%, #F8EEF2 100%);
  padding: 20px;
}
.auth-container { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 460px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.auth-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 100%);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin-bottom: 12px;
  box-shadow: var(--shadow-rose);
}
.auth-logo-name { font-size: 1.8rem; font-weight: 900; color: var(--text-primary); letter-spacing: -0.5px; }
.auth-logo-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.auth-card { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 36px 40px; width: 100%; }
.auth-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 20px; }
.auth-switch { text-align: center; font-size: 0.85rem; color: var(--text-secondary); margin-top: 16px; }
.auth-error { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.82rem; margin: 8px 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.8rem; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-link { background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer; font-family: inherit; font-size: inherit; padding: 0; }
.btn-link:hover { text-decoration: underline; color: var(--primary-dark); }
.btn-full { width: 100%; margin-top: 16px; }

/* App Shell layout */
.app-shell { display: flex; min-height: 100vh; }
.main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* Sidebar revisada */
.sidebar {
  width: var(--sidebar-width); background: var(--bg-sidebar);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px; border-bottom: 1px solid rgba(240,220,226,0.08);
}
.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; box-shadow: var(--shadow-rose);
}
.sidebar-logo-name { font-size: 1.1rem; font-weight: 800; color: #fff; }
.sidebar-logo-sub { font-size: 0.65rem; color: var(--text-muted); margin-top: -2px; }
.sidebar-logo-text { display: flex; flex-direction: column; }
.sidebar-nav { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(240,220,226,0.08); }
.nav-group-label {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(240,220,226,0.35); padding: 12px 8px 4px;
}
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-sidebar); font-size: 0.875rem; font-weight: 500;
  background: transparent; border: none; width: 100%; text-align: left; cursor: pointer;
  transition: all var(--transition); }
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-item.active { background: var(--bg-sidebar-active); color: #fff; box-shadow: 0 2px 8px rgba(196,117,138,0.35); }
.nav-item-featured { border-left: 2px solid var(--gold); background: rgba(201,169,110,0.08); }
.nav-item-featured.active { background: linear-gradient(90deg, var(--gold), #B8862A); border-left: none; }
.nav-item-gold { color: #EDCF8A; }
.nav-item-gold.active { background: rgba(201,169,110,0.3); }
.nav-item.danger:hover { color: var(--danger); background: rgba(224,92,106,0.1); }

/* Topbar revisada */
.topbar {
  height: var(--topbar-height); background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 1.1rem; font-weight: 700; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); background: transparent; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; transition: all var(--transition); color: var(--text-secondary); }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-xlight); }
.user-pill { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--primary-dark);
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.user-role { font-size: 0.72rem; color: var(--text-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-container { flex: 1; padding: 24px; overflow-y: auto; }

/* Toolbar genérica */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.search-wrapper { position: relative; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 18px; pointer-events: none; }
.search-input {
  padding: 9px 16px 9px 38px;
  border: 1.5px solid var(--border); border-radius: var(--radius-full);
  font-family: inherit; font-size: 0.875rem; background: var(--bg); width: 280px;
  transition: all var(--transition);
}
.search-input:focus { outline: none; border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(196,117,138,0.1); }

/* Badge extra */
.badge-brown { background: #F3ECE8; color: #7A5040; }

/* Modal revisado */
.modal-container {
  background: var(--bg-card); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.2s forwards;
}
.modal-large { max-width: 780px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-sm); border: none; background: var(--bg); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition); font-size: 16px; }
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }
.form-group-full { grid-column: 1 / -1; }

/* Ficha Técnica card */
.fichas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.ficha-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.ficha-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.ficha-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ficha-card-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.ficha-card-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.ficha-type-badge {
  display: inline-block; background: linear-gradient(135deg, var(--primary-xlight), var(--gold-xlight));
  border: 1px solid var(--primary-light); color: var(--primary-dark);
  font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-full);
  margin-bottom: 12px;
}
.ficha-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ficha-meta span { font-size: 0.78rem; color: var(--text-secondary); background: var(--bg); padding: 3px 8px; border-radius: var(--radius-full); border: 1px solid var(--border); }
.ficha-notes { font-size: 0.82rem; color: var(--text-secondary); background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; border-left: 3px solid var(--primary-light); }
.ficha-section { margin-top: 8px; }
.ficha-section-title { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* Agenda */
.appointments-list { display: flex; flex-direction: column; gap: 12px; }
.appointment-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.appointment-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.appt-time { font-size: 1.2rem; font-weight: 800; color: var(--primary); min-width: 56px; }
.appt-info { flex: 1; }
.appt-name { font-weight: 700; font-size: 1rem; }
.appt-procedure { font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; }
.appt-notes { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
.appt-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }

/* Alertas */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.875rem; }
.alert-warning { background: var(--warning-bg); color: #7A5010; border: 1px solid #F5CCA0; }

/* Planos */
.plan-card {
  border: 2px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 20px; flex: 1; min-width: 140px;
  transition: all var(--transition);
}
.plan-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.plan-badge {
  display: inline-block; background: var(--primary-xlight); color: var(--primary-dark);
  border: 1px solid var(--primary-light); padding: 8px 16px; border-radius: var(--radius-full);
  font-weight: 700; font-size: 0.875rem;
}
.gold-dark { color: #856C2A; }

/* Sidebar open mobile */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.sidebar-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .fichas-grid { grid-template-columns: 1fr; }
  .search-input { width: 200px; }
}

