
  :root {
    --blue-deep: #1a3a6b;
    --blue-mid: #1e5bbf;
    --blue-light: #3b82f6;
    --green-main: #22c55e;
    --green-dark: #16a34a;
    --green-teal: #0f9f7a;
    /* LIGHT THEME */
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f0f5ff;
    --content-bg: #f4f7fc;
    --card-bg: #ffffff;
    --text-main: #1a2340;
    --text-muted: #6b7a99;
    --border: #e2e8f4;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --accent-yellow: #eab308;
    --accent-purple: #8b5cf6;
    --shadow: 0 2px 12px rgba(30,91,191,0.07);
    --shadow-lg: 0 8px 32px rgba(30,91,191,0.13);
  }

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

  body {
    font-family: 'Inter', sans-serif;
    background: var(--content-bg);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* ===== LOGIN ===== */
  #login-screen {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #0f1f3d 0%, #1a3a6b 50%, #0f9f7a 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
  }
  .login-card {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    width: 420px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.3);
    text-align: center;
  }
  .login-logo { margin-bottom: 32px; }
  .login-logo img { height: 52px; }
  .login-title { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; color: var(--blue-deep); margin-bottom: 8px; }
  .login-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }
  .login-tabs { display: flex; gap: 8px; margin-bottom: 28px; background: var(--content-bg); border-radius: 10px; padding: 4px; }
  .login-tab {
    flex: 1; padding: 10px; border: none; background: none; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all 0.2s;
  }
  .login-tab.active { background: white; color: var(--blue-deep); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
  .login-field { margin-bottom: 16px; text-align: left; }
  .login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
  .login-field input {
    width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px;
    font-size: 14px; outline: none; transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
  }
  .login-field input:focus { border-color: var(--blue-mid); }
  .btn-login {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--blue-mid) 0%, var(--blue-deep) 50%, var(--green-teal) 100%);
    color: white; border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
    cursor: pointer; margin-top: 8px; transition: transform 0.1s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
  }
  .btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(30,91,191,0.4); }
  .login-hint { font-size: 12px; color: var(--text-muted); margin-top: 16px; }

  /* ===== APP LAYOUT ===== */
  #app { display: block; height: 100vh; overflow: hidden; }
  .app-layout { display: flex; height: 100vh; }

  /* ===== SIDEBAR LIGHT ===== */
  .sidebar {
    width: 240px; min-width: 240px;
    background: var(--sidebar-bg);
    border-right: 1.5px solid var(--border);
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: width 0.3s;
  }
  .sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-logo img { height: 36px; }
  .sidebar-role {
    margin: 12px 16px;
    background: linear-gradient(135deg, rgba(30,91,191,0.07), rgba(34,197,94,0.07));
    border-radius: 12px;
    padding: 10px 12px;
    display: flex; align-items: center; gap: 10px;
    border: 1px solid rgba(30,91,191,0.1);
  }
  .role-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-mid), var(--green-teal));
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: white; flex-shrink: 0;
  }
  .role-info { overflow: hidden; }
  .role-name { font-size: 13px; font-weight: 700; color: var(--blue-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .role-label { font-size: 11px; color: var(--text-muted); }
  .sidebar-switch {
    margin: 0 16px 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(30,91,191,0.08), rgba(34,197,94,0.08));
    border: 1px solid rgba(30,91,191,0.15);
    border-radius: 8px;
    font-size: 12px; color: var(--blue-mid);
    cursor: pointer; text-align: center; font-weight: 600;
    transition: all 0.2s;
  }
  .sidebar-switch:hover { background: linear-gradient(135deg, rgba(30,91,191,0.14), rgba(34,197,94,0.14)); }
  .sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
  .nav-section { padding: 8px 16px 4px; font-size: 10px; font-weight: 700; color: #b0bcd4; text-transform: uppercase; letter-spacing: 1px; }
  .nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    cursor: pointer; color: var(--text-muted);
    font-size: 13.5px; font-weight: 500;
    transition: all 0.15s; border-left: none; border-right: 3px solid transparent;
    position: relative;
  }
  .nav-item:hover { background: var(--sidebar-hover); color: var(--blue-mid); }
  .nav-item.active {
    background: linear-gradient(90deg, rgba(30,91,191,0.04), rgba(30,91,191,0.09));
    color: var(--blue-deep);
    border-right-color: var(--blue-mid);
    font-weight: 600;
  }
  .nav-item .nav-icon { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }
  .nav-badge {
    margin-left: auto; background: var(--accent-red);
    color: white; border-radius: 10px; padding: 2px 7px;
    font-size: 10px; font-weight: 700;
  }
  .nav-badge.green { background: var(--green-dark); }
  .sidebar-bottom {
    padding: 16px;
    border-top: 1px solid var(--border);
  }
  .btn-logout {
    width: 100%; padding: 10px; background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.2); border-radius: 8px;
    color: #ef4444; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
  }
  .btn-logout:hover { background: rgba(239,68,68,0.14); }

  /* ===== MAIN CONTENT ===== */
  .main-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

  /* ===== TOPBAR ===== */
  .topbar {
    background: white; border-bottom: 1.5px solid var(--border);
    padding: 0 28px; height: 60px;
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 8px rgba(30,91,191,0.05);
  }
  .topbar-title { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; color: var(--blue-deep); flex: 1; }
  .topbar-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--content-bg); border: 1.5px solid var(--border);
    border-radius: 10px; padding: 8px 14px; width: 260px;
  }
  .topbar-search input { border: none; background: none; outline: none; font-size: 13px; width: 100%; font-family: 'Inter', sans-serif; }
  .topbar-search-icon { color: var(--text-muted); font-size: 15px; }
  .topbar-actions { display: flex; align-items: center; gap: 8px; }
  .icon-btn {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--content-bg); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; color: var(--text-muted);
    position: relative; transition: all 0.15s;
  }
  .icon-btn:hover { background: white; border-color: var(--blue-light); color: var(--blue-mid); }
  .notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--accent-red); border-radius: 50%; border: 1.5px solid white; }

  /* ===== PAGE CONTENT ===== */
  .page { display: none; padding: 24px 28px; flex: 1; }
  .page.active { display: block; }

  /* ===== CARDS & COMPONENTS ===== */
  .card {
    background: var(--card-bg); border-radius: 14px;
    border: 1px solid var(--border); box-shadow: var(--shadow);
    overflow: hidden;
  }
  .card-header {
    padding: 18px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
  }
  .card-title { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--blue-deep); }
  .card-body { padding: 20px; }

  /* ===== STATS GRID ===== */
  .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
  .stat-card {
    background: var(--card-bg); border-radius: 14px;
    border: 1px solid var(--border); box-shadow: var(--shadow);
    padding: 20px; display: flex; gap: 14px; align-items: flex-start;
  }
  .stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
  }
  .stat-info { flex: 1; min-width: 0; }
  .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
  .stat-value { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; color: var(--text-main); line-height: 1; }
  .stat-change { font-size: 11px; margin-top: 4px; font-weight: 600; }
  .stat-change.up { color: var(--green-dark); }
  .stat-change.down { color: var(--accent-red); }

  /* ===== AGENDA ===== */
  .agenda-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
  .time-slot { display: flex; align-items: stretch; gap: 12px; margin-bottom: 8px; min-height: 56px; }
  .time-label { font-size: 12px; color: var(--text-muted); font-weight: 600; width: 44px; padding-top: 8px; flex-shrink: 0; text-align: right; }
  .time-line { width: 1px; background: var(--border); flex-shrink: 0; position: relative; }
  .time-line::before { content:''; position:absolute; top:8px; left:-3px; width:7px; height:7px; border-radius:50%; background: var(--border); }
  .appt-block {
    flex: 1; border-radius: 10px; padding: 10px 14px;
    cursor: pointer; transition: transform 0.1s, box-shadow 0.15s;
    border-left: 4px solid transparent;
  }
  .appt-block:hover { transform: translateX(3px); box-shadow: var(--shadow); }
  .appt-block.blue { background: rgba(59,130,246,0.08); border-left-color: var(--blue-light); }
  .appt-block.green { background: rgba(34,197,94,0.08); border-left-color: var(--green-main); }
  .appt-block.orange { background: rgba(249,115,22,0.08); border-left-color: var(--accent-orange); }
  .appt-block.purple { background: rgba(139,92,246,0.08); border-left-color: var(--accent-purple); }
  .appt-block.red { background: rgba(239,68,68,0.08); border-left-color: var(--accent-red); }
  .appt-block.empty { background: rgba(0,0,0,0.015); border-left-color: transparent; border: 1px dashed var(--border); cursor: default; }
  .appt-name { font-size: 13px; font-weight: 600; color: var(--text-main); }
  .appt-detail { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
  .appt-status { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; margin-top: 4px; }
  .status-confirmed { background: rgba(34,197,94,0.12); color: var(--green-dark); }
  .status-waiting { background: rgba(249,115,22,0.12); color: var(--accent-orange); }
  .status-in-progress { background: rgba(59,130,246,0.12); color: var(--blue-mid); }
  .status-done { background: rgba(107,122,153,0.12); color: var(--text-muted); }
  .status-cancelled { background: rgba(239,68,68,0.12); color: var(--accent-red); }

  /* ===== PATIENTS ===== */
  .patient-table { width: 100%; border-collapse: collapse; }
  .patient-table th {
    text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border); background: var(--content-bg);
  }
  .patient-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
  .patient-table tr:last-child td { border-bottom: none; }
  .patient-table tr:hover td { background: rgba(30,91,191,0.025); }
  .patient-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white; flex-shrink: 0;
  }
  .patient-info { display: flex; align-items: center; gap: 10px; }
  .patient-name { font-weight: 600; color: var(--text-main); }
  .patient-cpf { font-size: 12px; color: var(--text-muted); }
  .tag {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
  }
  .tag-blue { background: rgba(59,130,246,0.1); color: var(--blue-mid); }
  .tag-green { background: rgba(34,197,94,0.1); color: var(--green-dark); }
  .tag-orange { background: rgba(249,115,22,0.1); color: var(--accent-orange); }
  .tag-red { background: rgba(239,68,68,0.1); color: var(--accent-red); }
  .tag-purple { background: rgba(139,92,246,0.1); color: var(--accent-purple); }
  .tag-gray { background: rgba(107,122,153,0.1); color: var(--text-muted); }

  /* ===== BUTTONS ===== */
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.18s; font-family: 'Inter', sans-serif;
  }
  /* Primary: azul→verde (padrão marca) */
  .btn-primary {
    background: linear-gradient(135deg, var(--blue-mid) 0%, var(--blue-deep) 55%, var(--green-teal) 100%);
    color: white;
  }
  .btn-primary:hover { box-shadow: 0 4px 16px rgba(30,91,191,0.35); transform: translateY(-1px); }
  .btn-success {
    background: linear-gradient(135deg, var(--green-main) 0%, var(--green-teal) 100%);
    color: white;
  }
  .btn-success:hover { box-shadow: 0 4px 14px rgba(34,197,94,0.35); transform: translateY(-1px); }
  .btn-outline { background: white; color: var(--blue-mid); border: 1.5px solid var(--border); }
  .btn-outline:hover { border-color: var(--blue-light); background: rgba(59,130,246,0.04); }
  .btn-danger { background: var(--accent-red); color: white; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .btn-icon { padding: 8px; border-radius: 8px; }

  /* ===== PRONTUARIO ===== */
  .prontuario-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
  .prontuario-sidebar { display: flex; flex-direction: column; gap: 16px; }
  .patient-profile-card { background: var(--card-bg); border-radius: 14px; border: 1px solid var(--border); padding: 20px; text-align: center; }
  .profile-photo {
    width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--blue-mid), var(--green-teal));
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700; color: white;
  }
  .profile-name { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 700; color: var(--blue-deep); }
  .profile-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
  .profile-divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
  .profile-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
  .profile-row-label { font-size: 12px; color: var(--text-muted); }
  .profile-row-value { font-size: 12px; font-weight: 600; color: var(--text-main); }
  .timeline-item { display: flex; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
  .timeline-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
  .timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue-light); margin-top: 4px; flex-shrink: 0; }
  .timeline-date { font-size: 11px; color: var(--text-muted); font-weight: 600; }
  .timeline-title { font-size: 13px; font-weight: 600; color: var(--text-main); margin-top: 2px; }
  .timeline-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

  /* ===== TABS ===== */
  .tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
  .tab-btn {
    padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
    border: none; background: none; color: var(--text-muted);
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: all 0.15s; font-family: 'Inter', sans-serif;
  }
  .tab-btn.active { color: var(--blue-mid); border-bottom-color: var(--blue-mid); }
  .tab-btn:hover { color: var(--blue-mid); }
  .tab-content { display: none; }
  .tab-content.active { display: block; }

  /* ===== FORM ===== */
  .form-grid { display: grid; gap: 16px; }
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .form-field { display: flex; flex-direction: column; gap: 6px; }
  .form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
  .form-input, .form-select, .form-textarea {
    padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 9px;
    font-size: 13.5px; outline: none; transition: border-color 0.2s;
    font-family: 'Inter', sans-serif; background: white; color: var(--text-main);
  }
  .form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--blue-light); }
  .form-textarea { resize: vertical; min-height: 90px; }
  .form-section { margin-bottom: 24px; }
  .form-section-title { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; color: var(--blue-deep); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

  /* ===== FINANCEIRO ===== */
  .fin-chart-area { height: 180px; background: linear-gradient(to bottom, rgba(59,130,246,0.04), transparent); border-radius: 10px; position: relative; overflow: hidden; display: flex; align-items: flex-end; gap: 10px; padding: 20px 20px 0; }
  .bar { flex: 1; border-radius: 6px 6px 0 0; position: relative; cursor: pointer; transition: opacity 0.2s; }
  .bar:hover { opacity: 0.8; }
  .bar-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
  .bar-val { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--blue-mid); font-weight: 700; white-space: nowrap; }

  /* ===== MODAL ===== */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(15,31,61,0.45); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 9000; padding: 20px;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: white; border-radius: 20px; padding: 28px;
    max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto;
    box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease;
  }
  @keyframes modalIn { from { transform: scale(0.95) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
  .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
  .modal-title { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; color: var(--blue-deep); }
  .modal-close { width: 32px; height: 32px; border-radius: 8px; background: var(--content-bg); border: none; cursor: pointer; font-size: 18px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
  .modal-close:hover { background: rgba(239,68,68,0.1); color: var(--accent-red); }

  /* ===== NOTIFICACOES ===== */
  .notif-panel {
    position: fixed; right: 20px; top: 70px;
    width: 340px; background: white;
    border-radius: 16px; box-shadow: var(--shadow-lg);
    border: 1px solid var(--border); z-index: 8000;
    display: none; overflow: hidden;
    animation: slideIn 0.2s ease;
  }
  .notif-panel.open { display: block; }
  @keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
  .notif-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .notif-title { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--blue-deep); }
  .notif-item { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; cursor: pointer; transition: background 0.15s; }
  .notif-item:hover { background: var(--content-bg); }
  .notif-item:last-child { border-bottom: none; }
  .notif-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
  .notif-text { font-size: 13px; color: var(--text-main); line-height: 1.4; }
  .notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

  /* ===== MISC ===== */
  .section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
  .section-title { font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 700; color: var(--blue-deep); }
  .badge-count { background: var(--blue-mid); color: white; border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 700; margin-left: 8px; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .flex-row { display: flex; align-items: center; gap: 12px; }
  .flex-gap { display: flex; gap: 8px; flex-wrap: wrap; }
  .mt-16 { margin-top: 16px; }
  .mb-16 { margin-bottom: 16px; }
  .text-muted { color: var(--text-muted); font-size: 13px; }
  .empty-state { text-align: center; padding: 40px; color: var(--text-muted); }
  .empty-state .icon { font-size: 40px; margin-bottom: 12px; }
  .action-row { display: flex; gap: 8px; }
  .progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
  .progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--blue-mid), var(--green-main)); }
  .alert-box { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
  .alert-warning { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.25); color: #854d0e; }
  .alert-info { background: rgba(59,130,246,0.07); border: 1px solid rgba(59,130,246,0.2); color: var(--blue-deep); }
  .alert-success { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25); color: var(--green-dark); }
  .checklist { list-style: none; }
  .checklist li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; display: flex; align-items: center; gap: 10px; }
  .checklist li:last-child { border-bottom: none; }
  .check-box {
    width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 11px; transition: all 0.15s;
  }
  .check-box.checked { background: var(--green-main); border-color: var(--green-main); color: white; }

  /* SALA DE ESPERA */
  .espera-card {
    background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border);
    padding: 14px 16px; display: flex; align-items: center; gap: 12px;
    margin-bottom: 10px; cursor: pointer; transition: all 0.15s;
  }
  .espera-card:hover { border-color: var(--blue-light); box-shadow: var(--shadow); }
  .espera-num { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--blue-mid), var(--green-teal)); color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
  .espera-info { flex: 1; }
  .espera-name { font-size: 14px; font-weight: 600; color: var(--text-main); }
  .espera-detail { font-size: 12px; color: var(--text-muted); }
  .espera-time { font-size: 11px; font-weight: 600; color: var(--accent-orange); background: rgba(249,115,22,0.1); padding: 3px 8px; border-radius: 6px; }

  /* ATENDIMENTO */
  .atend-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
  .vital-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
  .vital-box { background: var(--content-bg); border-radius: 10px; padding: 12px; border: 1px solid var(--border); }
  .vital-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
  .vital-value { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 700; color: var(--text-main); }
  .vital-unit { font-size: 12px; color: var(--text-muted); }

  /* RESPONSIVO */
  @media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .agenda-grid { grid-template-columns: 1fr; }
    .prontuario-layout { grid-template-columns: 1fr; }
    .atend-layout { grid-template-columns: 1fr; }
  }
  @media (max-width: 768px) {
    .sidebar { width: 60px; min-width: 60px; }
    .nav-item span, .role-info, .sidebar-switch, .nav-badge, .nav-section { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
  }

  /* SCROLLBAR */
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(30,91,191,0.18); border-radius: 3px; }


  /* ===== AGENDA TELECONSULTA TAGS ===== */
  .tag-presencial { font-size:10px; background:rgba(59,130,246,0.12); color:var(--blue-mid); padding:1px 6px; border-radius:4px; font-weight:600; margin-left:4px; }
  .tag-tele       { font-size:10px; background:rgba(139,92,246,0.12); color:#8b5cf6; padding:1px 6px; border-radius:4px; font-weight:600; margin-left:4px; }
  .appt-block.tele-done      { border-left-color:#22c55e; background:linear-gradient(135deg,rgba(34,197,94,0.06),rgba(139,92,246,0.06)); }
  .appt-block.tele-waiting   { border-left-color:#8b5cf6; background:linear-gradient(135deg,rgba(139,92,246,0.08),rgba(139,92,246,0.03)); cursor:pointer; }
  .appt-block.tele-confirmed { border-left-color:#8b5cf6; background:linear-gradient(135deg,rgba(139,92,246,0.06),rgba(139,92,246,0.02)); cursor:pointer; }
  .appt-block.tele-waiting:hover,.appt-block.tele-confirmed:hover { transform:translateX(3px); }

  /* ===== TELECONSULTA PAGE ===== */
  .tele-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: 1fr auto;
    gap: 16px;
    height: calc(100vh - 130px);
    min-height: 600px;
  }

  /* VIDEO AREA */
  .tele-video-area {
    grid-column: 1; grid-row: 1;
    background: #0a0f1e;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    min-height: 400px;
  }
  .tele-video-main {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 12px;
    position: relative;
  }
  /* Simulated patient video */
  .tele-patient-video {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #0d1b3e 0%, #1a2a5e 40%, #0f2040 100%);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    position: relative; overflow: hidden;
  }
  .tele-patient-video::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(30,91,191,0.3) 0%, transparent 70%);
    animation: videoGlow 3s ease-in-out infinite alternate;
  }
  @keyframes videoGlow { from { opacity: 0.5; } to { opacity: 1; } }
  .tele-patient-avatar {
    width: 120px; height: 120px; border-radius: 50%;
    background: linear-gradient(135deg, #1e5bbf, #0f9f7a);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; font-weight: 700; color: white;
    font-family: 'Sora', sans-serif;
    border: 4px solid rgba(255,255,255,0.15);
    box-shadow: 0 0 40px rgba(30,91,191,0.4);
    z-index: 1; position: relative;
  }
  .tele-patient-name-tag {
    position: absolute; bottom: 20px; left: 20px;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    color: white; padding: 8px 14px; border-radius: 10px;
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
  }
  .tele-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: blink 1s ease infinite; }
  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
  .tele-timer {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
    color: white; padding: 6px 16px; border-radius: 20px;
    font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
  }
  .tele-quality {
    position: absolute; top: 16px; right: 16px;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
    color: white; padding: 5px 12px; border-radius: 8px; font-size: 12px;
    display: flex; align-items: center; gap: 6px;
  }
  /* Self preview (doctor cam) */
  .tele-self-video {
    position: absolute; bottom: 20px; right: 20px;
    width: 160px; height: 110px;
    background: linear-gradient(135deg, #1a3261, #0f1f3d);
    border-radius: 12px; border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 6px; cursor: pointer; overflow: hidden;
    transition: transform 0.2s;
  }
  .tele-self-video:hover { transform: scale(1.03); }
  .tele-self-video::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(34,197,94,0.2) 0%, transparent 70%);
  }
  .tele-self-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg,#22c55e,#0f9f7a); display:flex;align-items:center;justify-content:center; font-size:14px;font-weight:700;color:white; font-family:'Sora',sans-serif; z-index:1; }
  .tele-self-label { font-size:10px;color:rgba(255,255,255,0.7);z-index:1; }

  /* VIDEO CONTROLS */
  .tele-controls {
    grid-column: 1; grid-row: 2;
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 12px 0;
  }
  .tele-ctrl-btn {
    width: 52px; height: 52px; border-radius: 50%;
    border: none; cursor: pointer; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; position: relative;
  }
  .tele-ctrl-btn.active   { background: rgba(255,255,255,0.12); color: white; border: 1.5px solid rgba(255,255,255,0.2); }
  .tele-ctrl-btn.inactive { background: rgba(239,68,68,0.15); color: var(--accent-red); border: 1.5px solid rgba(239,68,68,0.3); }
  .tele-ctrl-btn.end-call { background: var(--accent-red); color: white; width: 60px; height: 60px; font-size: 22px; box-shadow: 0 4px 20px rgba(239,68,68,0.4); }
  .tele-ctrl-btn.end-call:hover { transform: scale(1.08); }
  .tele-ctrl-btn:not(.end-call):hover { transform: scale(1.1); }
  .tele-ctrl-label { position: absolute; bottom: -18px; font-size: 9px; white-space: nowrap; color: var(--text-muted); font-weight: 600; left: 50%; transform: translateX(-50%); }

  /* SIDEBAR TELECONSULTA */
  .tele-sidebar {
    grid-column: 2; grid-row: 1 / span 2;
    display: flex; flex-direction: column; gap: 12px;
    overflow-y: auto; padding-right: 2px;
  }
  .tele-patient-card {
    background: white; border-radius: 16px; padding: 16px;
    box-shadow: var(--shadow); border: 1px solid var(--border);
  }
  .tele-patient-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
  .tele-patient-pic { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg,#1e5bbf,#22c55e); display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;color:white;font-family:'Sora',sans-serif; }
  .tele-vital-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  .tele-vital { background: var(--content-bg); border-radius: 10px; padding: 10px 12px; text-align: center; }
  .tele-vital-val { font-family:'Sora',sans-serif; font-size:18px; font-weight:700; color:var(--blue-deep); }
  .tele-vital-lbl { font-size:10px; color:var(--text-muted); font-weight:600; margin-top:2px; }

  /* TABS PRONTUARIO NA TELE */
  .tele-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
  .tele-tab { padding: 5px 10px; border-radius: 8px; border: 1.5px solid var(--border); background: white; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all 0.15s; }
  .tele-tab.active { background: var(--blue-mid); color: white; border-color: var(--blue-mid); }

  /* CHAT TELECONSULTA */
  .tele-chat-messages { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
  .tele-chat-msg { padding: 7px 10px; border-radius: 10px; font-size: 12px; line-height: 1.4; max-width: 85%; }
  .tele-chat-msg.paciente { background: white; border: 1px solid var(--border); align-self: flex-start; }
  .tele-chat-msg.medico   { background: linear-gradient(135deg,var(--blue-mid),var(--blue-deep)); color: white; align-self: flex-end; }
  .tele-chat-footer { display: flex; gap: 6px; margin-top: 8px; }
  .tele-chat-input { flex:1; border:1.5px solid var(--border); border-radius:10px; padding:7px 10px; font-size:12px; font-family:'Inter',sans-serif; outline:none; }
  .tele-chat-input:focus { border-color:var(--blue-light); }
  .tele-chat-send { width:34px;height:34px;border-radius:9px;background:var(--blue-mid);border:none;cursor:pointer;color:white;font-size:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }

  /* WAITING ROOM (sala espera virtual) */
  .tele-waiting-list { display: flex; flex-direction: column; gap: 6px; }
  .tele-waiting-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--content-bg); border: 1px solid var(--border); }
  .tele-waiting-item.ready { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.05); }
  .tele-waiting-avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; font-weight: 700; color: white; display:flex;align-items:center;justify-content:center; flex-shrink:0; }

  /* SHARED DOCS */
  .tele-doc-item { display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:9px;background:var(--content-bg);border:1px solid var(--border);margin-bottom:6px;cursor:pointer; }
  .tele-doc-item:hover { background:rgba(59,130,246,0.06); }
  .tele-doc-icon { width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0; }

  /* REC indicator */
  .tele-rec { display:flex;align-items:center;gap:5px;font-size:11px;font-weight:700;color:#ef4444; }
  .tele-rec-dot { width:8px;height:8px;border-radius:50%;background:#ef4444;animation:blink 0.8s ease infinite; }

  /* FULLSCREEN TELE TABS — light */
  .tele-fs-tab {
    padding: 7px 12px; border-radius: 8px 8px 0 0; border: none;
    background: transparent; color: var(--text-muted);
    font-size: 12px; font-weight: 600; cursor: pointer;
    font-family: 'Inter', sans-serif; transition: all 0.15s;
    border-bottom: 2px solid transparent;
  }
  .tele-fs-tab:hover { color: var(--blue-mid); background: rgba(30,91,191,0.05); }
  .tele-fs-tab.active { color: var(--blue-mid); border-bottom-color: var(--blue-mid); background: rgba(30,91,191,0.06); }
  .tele-fs-content { display: block; }

  @keyframes tglow { from{opacity:0.5} to{opacity:1} }
  @keyframes tblink { 0%,100%{opacity:1} 50%{opacity:0.25} }

  /* ===== CHAT INTERNO ===== */
  #chat-panel {
    position: fixed; bottom: 24px; right: 24px;
    width: 360px; height: 520px;
    background: white; border-radius: 20px;
    box-shadow: 0 12px 48px rgba(15,31,61,0.22);
    border: 1px solid var(--border);
    display: none; flex-direction: column;
    z-index: 8500; overflow: hidden;
    animation: chatIn 0.25s cubic-bezier(.34,1.56,.64,1);
  }
  #chat-panel.open { display: flex; }
  @keyframes chatIn { from { transform: scale(0.85) translateY(30px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

  .chat-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--blue-deep), var(--blue-mid));
    display: flex; align-items: center; gap: 10px;
  }
  .chat-header-info { flex: 1; }
  .chat-header-title { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; color: white; }
  .chat-header-sub { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 1px; }
  .chat-online { width: 8px; height: 8px; border-radius: 50%; background: var(--green-main); border: 1.5px solid white; flex-shrink:0; }
  .chat-close { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.15); border: none; color: white; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; }
  .chat-close:hover { background: rgba(255,255,255,0.25); }

  .chat-contacts {
    border-bottom: 1px solid var(--border);
    display: flex; overflow-x: auto; padding: 8px 12px; gap: 8px;
    scrollbar-width: none;
  }
  .chat-contacts::-webkit-scrollbar { display: none; }
  .chat-contact {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; padding: 4px 8px; border-radius: 10px; transition: background 0.15s;
    flex-shrink: 0;
  }
  .chat-contact:hover { background: var(--content-bg); }
  .chat-contact.active { background: rgba(59,130,246,0.1); }
  .chat-contact-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white; position: relative;
  }
  .chat-contact-name { font-size: 10px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
  .chat-unread { position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-red); border: 1.5px solid white; font-size: 9px; font-weight: 700; color: white; display: flex; align-items: center; justify-content: center; }

  .chat-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #f7f9fd; }
  .chat-msg { display: flex; gap: 8px; max-width: 85%; }
  .chat-msg.mine { flex-direction: row-reverse; align-self: flex-end; }
  .chat-msg-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 700; color: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
  .chat-bubble {
    padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.45;
    background: white; color: var(--text-main);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-bottom-left-radius: 4px;
  }
  .chat-msg.mine .chat-bubble {
    background: linear-gradient(135deg, var(--blue-mid), var(--blue-deep));
    color: white; border-radius: 14px; border-bottom-right-radius: 4px;
    border-bottom-left-radius: 14px;
  }
  .chat-msg-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; padding: 0 4px; }
  .chat-msg.mine .chat-msg-time { text-align: right; }

  /* MENSAGEM ESPECIAL — MANDAR ENTRAR */
  .chat-bubble.action-bubble {
    background: linear-gradient(135deg,rgba(34,197,94,0.15),rgba(34,197,94,0.05));
    border: 1.5px solid rgba(34,197,94,0.3);
    color: var(--text-main);
  }
  .chat-bubble.action-bubble .action-title { font-weight: 700; color: var(--green-dark); margin-bottom: 4px; }
  .chat-bubble.notify-bubble {
    background: linear-gradient(135deg,rgba(249,115,22,0.12),rgba(249,115,22,0.04));
    border: 1.5px solid rgba(249,115,22,0.3);
  }
  .chat-bubble.notify-bubble .action-title { font-weight: 700; color: var(--accent-orange); }

  .chat-footer { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; }
  .chat-input {
    flex: 1; resize: none; border: 1.5px solid var(--border); border-radius: 12px;
    padding: 9px 12px; font-size: 13px; font-family: 'Inter', sans-serif;
    outline: none; min-height: 38px; max-height: 80px; line-height: 1.4;
    transition: border-color 0.2s;
  }
  .chat-input:focus { border-color: var(--blue-light); }
  .chat-send {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--blue-mid), var(--blue-deep));
    border: none; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: transform 0.1s;
  }
  .chat-send:hover { transform: scale(1.05); }

  /* CHAT FAB */
  #chat-fab {
    position: fixed; bottom: 24px; right: 24px;
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-mid), var(--blue-deep));
    box-shadow: 0 4px 20px rgba(30,91,191,0.4);
    border: none; cursor: pointer; font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    z-index: 8400; transition: transform 0.2s;
  }
  #chat-fab:hover { transform: scale(1.08); }
  #chat-fab.hidden { display: none; }
  .fab-badge { position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-red); border: 2px solid white; font-size: 10px; font-weight: 700; color: white; display: flex; align-items: center; justify-content: center; }

  /* ALERTA SEC ESPERA */
  .mandar-entrar-alert {
    padding: 14px 16px; border-radius: 12px;
    background: linear-gradient(135deg,rgba(34,197,94,0.12),rgba(34,197,94,0.04));
    border: 2px solid rgba(34,197,94,0.4);
    margin-bottom: 12px; display: none;
    animation: pulse-border 1s ease infinite;
  }
  @keyframes pulse-border { 0%,100%{border-color:rgba(34,197,94,0.4)} 50%{border-color:rgba(34,197,94,0.9)} }

  /* TOOLTIP */
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(data-tip);
    position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
    background: var(--blue-deep); color: white; font-size: 11px; padding: 4px 10px;
    border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s;
    z-index: 100;
  }
  [data-tip]:hover::after { opacity: 1; }

  /* PRESCRIÇÃO */
  .rx-item { background: var(--content-bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
  .rx-icon { font-size: 20px; }
  .rx-name { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
  .rx-detail { font-size: 12px; color: var(--text-muted); }
  .rx-remove { margin-left: auto; cursor: pointer; color: var(--text-muted); font-size: 16px; }
  .rx-remove:hover { color: var(--accent-red); }

  /* FINANCEIRO LISTA */
  .fin-row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; }
  .fin-row:last-child { border-bottom: none; }
  .fin-type { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
  .fin-desc { flex: 1; }
  .fin-title { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
  .fin-subtitle { font-size: 12px; color: var(--text-muted); }
  .fin-amount { font-size: 15px; font-weight: 700; }
  .fin-pos { color: var(--green-dark); }
  .fin-neg { color: var(--accent-red); }

  /* CID */
  .cid-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); border-radius: 8px; font-size: 12.5px; cursor: pointer; transition: all 0.15s; }
  .cid-tag:hover { background: rgba(59,130,246,0.15); }
  .cid-code { font-weight: 700; color: var(--blue-mid); }

  /* TOAST */
  #toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--blue-deep); color: white; padding: 14px 20px;
    border-radius: 12px; font-size: 13.5px; font-weight: 500;
    box-shadow: var(--shadow-lg); z-index: 99999;
    transform: translateY(80px); opacity: 0; transition: all 0.3s;
    display: flex; align-items: center; gap: 10px;
  }
  #toast.show { transform: translateY(0); opacity: 1; }
  #toast.success { background: var(--green-dark); }
  #toast.warning { background: var(--accent-orange); }

  /* SECRETARIA THEME — mesmo padrão azul/verde */

  /* DASHBOARD MINI CALENDAR */
  .mini-cal { background: var(--card-bg); border-radius: 14px; border: 1px solid var(--border); padding: 16px; }
  .mini-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .mini-cal-title { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; color: var(--blue-deep); }
  .mini-cal-nav { font-size: 16px; cursor: pointer; color: var(--text-muted); padding: 0 6px; }
  .mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
  .cal-day-header { font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 4px 0; text-transform: uppercase; }
  .cal-day { font-size: 12.5px; padding: 6px 2px; border-radius: 8px; cursor: pointer; color: var(--text-muted); transition: all 0.15s; }
  .cal-day:hover { background: rgba(59,130,246,0.1); color: var(--blue-mid); }
  .cal-day.today { background: var(--blue-mid); color: white; font-weight: 700; }
  .cal-day.has-appt { position: relative; color: var(--text-main); font-weight: 600; }
  .cal-day.has-appt::after { content:''; position:absolute; bottom:2px; left:50%; transform:translateX(-50%); width:4px; height:4px; border-radius:50%; background:var(--green-main); }
  .cal-day.empty { cursor: default; }

  /* LOADER */
  .loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
  .spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--blue-mid); border-radius: 50%; animation: spin 0.8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
