/* =========================================================================
   MedGuide — Portal do Paciente | paciente.css
   Design system consumer-app: limpo, acolhedor, mobile-first.
   CSS custom properties para fácil theming. Sem dependências externas.
   ========================================================================= */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Paleta principal */
    --color-primary:       #0d9488;
    --color-primary-dark:  #0f766e;
    --color-primary-light: #f0fdfa;
    --color-primary-mid:   #99f6e4;

    /* Neutros */
    --color-bg:            #f8fafc;
    --color-surface:       #ffffff;
    --color-border:        #e2e8f0;
    --color-border-light:  #f1f5f9;

    /* Texto */
    --color-text:          #0f172a;
    --color-text-secondary:#64748b;
    --color-text-muted:    #94a3b8;

    /* Status */
    --color-success:       #059669;
    --color-success-bg:    #ecfdf5;
    --color-warning:       #d97706;
    --color-warning-bg:    #fffbeb;
    --color-danger:        #e11d48;
    --color-danger-bg:     #fff1f2;
    --color-info:          #0284c7;
    --color-info-bg:       #f0f9ff;

    /* Layout */
    --sidebar-w:           260px;
    --topbar-h:            64px;
    --bottom-nav-h:        64px;
    --radius-sm:           0.375rem;
    --radius:              0.625rem;
    --radius-lg:           0.875rem;
    --radius-xl:           1.25rem;
    --radius-full:         9999px;

    /* Sombras */
    --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:  0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:  0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
    --shadow-xl:  0 20px 50px rgba(0,0,0,0.14);

    /* Tipografia */
    --font-sans:  'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Poppins', var(--font-sans);

    /* Transições */
    --transition-fast:  0.15s ease;
    --transition:       0.2s ease;
    --transition-slow:  0.35s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── Tipografia ──────────────────────────────────────────────────────────── */
h1 { font-size: 1.625rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.25rem;  font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.0625rem;font-weight: 600; line-height: 1.4; }
h4 { font-size: 0.9375rem;font-weight: 600; line-height: 1.4; }

/* ── Layout Principal ─────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border-light);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform var(--transition-slow);
    overflow: hidden;
}

.sidebar-logo {
    padding: 1.25rem 1.25rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
.sidebar-logo-icon {
    width: 2.25rem; height: 2.25rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 1.125rem; height: 1.125rem; color: #fff; }
.sidebar-logo-text {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-text);
}
.sidebar-logo-text span { color: var(--color-primary); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

.nav-section-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 0.5rem 1.25rem 0.25rem;
    margin-top: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    margin: 0.125rem 0.75rem;
    border-radius: var(--radius);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    cursor: pointer;
    border: none;
    background: none;
    width: calc(100% - 1.5rem);
    text-align: left;
}
.nav-item svg {
    width: 1.125rem; height: 1.125rem;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}
.nav-item:hover {
    background: var(--color-bg);
    color: var(--color-text);
}
.nav-item.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}
.nav-item.active svg { color: var(--color-primary); }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--color-primary);
    border-radius: 0 3px 3px 0;
}

.nav-badge {
    margin-left: auto;
    min-width: 1.25rem; height: 1.25rem;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    padding: 0 0.25rem;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    border-radius: var(--radius);
    transition: background var(--transition-fast);
    cursor: pointer;
}
.sidebar-user:hover { background: var(--color-bg); }

/* ── Conteúdo principal ───────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-xs);
}
.topbar-menu-btn {
    display: none;
    width: 2.25rem; height: 2.25rem;
    align-items: center; justify-content: center;
    border-radius: var(--radius);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}
.topbar-menu-btn:hover { background: var(--color-bg); color: var(--color-text); }
.topbar-menu-btn svg { width: 1.25rem; height: 1.25rem; }

.topbar-title {
    flex: 1;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-text);
}

.page-content {
    flex: 1;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + var(--bottom-nav-h));
    animation: page-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes page-enter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Bottom Nav Mobile ────────────────────────────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-light);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bottom-nav-list {
    display: flex;
    height: 100%;
    list-style: none;
}
.bottom-nav-item {
    flex: 1;
}
.bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%; height: 100%;
    color: var(--color-text-muted);
    font-size: 0.625rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}
.bottom-nav-btn svg {
    width: 1.375rem; height: 1.375rem;
    transition: transform var(--transition-fast);
}
.bottom-nav-btn.active {
    color: var(--color-primary);
}
.bottom-nav-btn.active svg { transform: scale(1.1); }
.bottom-nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 2rem; height: 2px;
    background: var(--color-primary);
    border-radius: 0 0 2px 2px;
}
.bottom-nav-dot {
    position: absolute;
    top: 0.625rem; right: 0.875rem;
    width: 0.5rem; height: 0.5rem;
    background: var(--color-danger);
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-surface);
}

/* ── Overlay Mobile ──────────────────────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 99;
    animation: overlay-in 0.2s ease;
}
.sidebar-overlay.active { display: block; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.avatar {
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
}
.avatar-sm  { width: 2rem;    height: 2rem;    font-size: 0.6875rem; }
.avatar-md  { width: 2.5rem;  height: 2.5rem;  font-size: 0.875rem;  }
.avatar-lg  { width: 3rem;    height: 3rem;    font-size: 1.0625rem; }
.avatar-xl  { width: 4rem;    height: 4rem;    font-size: 1.25rem;   }
.avatar-2xl { width: 5rem;    height: 5rem;    font-size: 1.5rem;    }
.avatar-primary { background: var(--color-primary-light); color: var(--color-primary); }
.avatar-teal    { background: #ccfbf1; color: #0d9488; }
.avatar-blue    { background: #dbeafe; color: #2563eb; }
.avatar-purple  { background: #ede9fe; color: #7c3aed; }
.avatar-rose    { background: #ffe4e6; color: #e11d48; }
.avatar-amber   { background: #fef3c7; color: #d97706; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.card-hover {
    transition: box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
}
.card-hover:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-body { padding: 1.25rem; }
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.card-header h3 { font-size: 0.9375rem; font-weight: 600; color: var(--color-text); }
.card-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Stats Row ───────────────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
@media (max-width: 640px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 1.125rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.stat-icon {
    width: 2rem; height: 2rem;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 1rem; height: 1rem; }
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-top: 0.25rem;
}
.stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
}
.stat-teal  .stat-icon  { background: #f0fdfa; color: #0d9488; }
.stat-green .stat-icon  { background: #f0fdf4; color: #16a34a; }
.stat-blue  .stat-icon  { background: #eff6ff; color: #2563eb; }
.stat-amber .stat-icon  { background: #fffbeb; color: #d97706; }
.stat-rose  .stat-icon  { background: var(--color-danger-bg); color: var(--color-danger); }
.stat-purple .stat-icon { background: #ede9fe; color: #7c3aed; }
.stat-teal  .stat-value { color: #0d9488; }
.stat-green .stat-value { color: #16a34a; }
.stat-blue  .stat-value { color: #2563eb; }
.stat-amber .stat-value { color: #d97706; }

/* ── Next Appointment Card ───────────────────────────────────────────────── */
.next-appt-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    color: #fff;
}
.next-appt-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.next-appt-date-block {
    background: rgba(255,255,255,0.18);
    border-radius: var(--radius);
    padding: 0.625rem 0.875rem;
    text-align: center;
    flex-shrink: 0;
    min-width: 52px;
}
.next-appt-day {
    display: block;
    font-size: 1.625rem;
    font-weight: 800;
    line-height: 1;
}
.next-appt-month {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.75;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
}
.next-appt-info { flex: 1; min-width: 0; }
.next-appt-doctor {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.next-appt-specialty,
.next-appt-clinic {
    font-size: 0.8125rem;
    opacity: 0.8;
    margin-top: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.next-appt-time {
    font-size: 1.125rem;
    font-weight: 700;
    background: rgba(255,255,255,0.18);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    flex-shrink: 0;
}
.next-appt-footer {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.next-appt-notes {
    font-size: 0.8125rem;
    opacity: 0.75;
    font-style: italic;
}
.badge-scheduled { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}
.badge-dot {
    width: 0.4375rem; height: 0.4375rem;
    border-radius: var(--radius-full);
    background: currentColor;
    opacity: 0.75;
}
.badge-teal    { background: var(--color-primary-light); color: var(--color-primary); }
.badge-green   { background: var(--color-success-bg);    color: var(--color-success); }
.badge-amber   { background: var(--color-warning-bg);    color: var(--color-warning); }
.badge-rose    { background: var(--color-danger-bg);     color: var(--color-danger); }
.badge-blue    { background: #dbeafe;  color: #1d4ed8; }
.badge-purple  { background: #ede9fe;  color: #6d28d9; }
.badge-slate   { background: #f1f5f9;  color: #475569; }

/* ── Botões ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5625rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 1px 4px rgba(13,148,136,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #065f58 100%);
    box-shadow: 0 4px 12px rgba(13,148,136,0.4);
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--color-bg); border-color: #94a3b8; }
.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--color-bg); color: var(--color-text); }
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}
.btn-danger:hover { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; width: 2.25rem; height: 2.25rem; }
.btn-icon.btn-sm { width: 1.875rem; height: 1.875rem; padding: 0.375rem; }
.btn[disabled], .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Formulários ─────────────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}
.form-required { color: var(--color-danger); margin-left: 0.125rem; }
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: all var(--transition-fast);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
.form-control::placeholder { color: var(--color-text-muted); }
.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.form-control:disabled {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    cursor: not-allowed;
}
.form-hint { font-size: 0.75rem; color: var(--color-text-muted); }
.form-error { font-size: 0.75rem; color: var(--color-danger); }
.form-control.error { border-color: var(--color-danger); }

.input-group {
    position: relative;
}
.input-group .input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%; transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    width: 1.125rem; height: 1.125rem;
}
.input-group .form-control { padding-left: 2.5rem; }
.input-group .input-action {
    position: absolute;
    right: 0.75rem;
    top: 50%; transform: translateY(-50%);
    color: var(--color-text-muted);
    background: none; border: none; cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    display: flex; align-items: center;
}
.input-group .input-action:hover { color: var(--color-text-secondary); }
.input-group .input-action svg { width: 1rem; height: 1rem; }

/* ── Divisor ─────────────────────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ── Spinner / Loading ───────────────────────────────────────────────────── */
.spinner {
    border-radius: var(--radius-full);
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    animation: spin 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}
.spinner-sm  { width: 1rem;    height: 1rem;   }
.spinner-md  { width: 1.5rem;  height: 1.5rem; }
.spinner-lg  { width: 2rem;    height: 2rem;   }
.spinner-xl  { width: 2.75rem; height: 2.75rem; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 1rem; z-index: 999;
}
.loading-overlay p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    gap: 0.625rem;
}
.empty-state-icon {
    width: 3.5rem; height: 3.5rem;
    color: var(--color-text-muted);
    opacity: 0.4;
    margin-bottom: 0.25rem;
}
.empty-state h4 { font-size: 0.9375rem; color: var(--color-text-secondary); }
.empty-state p  { font-size: 0.875rem;  color: var(--color-text-muted); max-width: 280px; }

/* ── Consultas / Timeline ────────────────────────────────────────────────── */
.consulta-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.consulta-card::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
}
.consulta-card.status-agendada::before    { background: var(--color-primary); }
.consulta-card.status-confirmada::before  { background: var(--color-success); }
.consulta-card.status-realizada::before   { background: #475569; }
.consulta-card.status-cancelada::before   { background: var(--color-danger); }
.consulta-card:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.consulta-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 2.75rem;
    flex-shrink: 0;
    text-align: center;
}
.consulta-date-day {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
}
.consulta-date-month {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.consulta-date-year {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-top: 0.125rem;
}

.consulta-info { flex: 1; min-width: 0; }
.consulta-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}
.consulta-meta {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.consulta-meta svg { width: 0.875rem; height: 0.875rem; }

/* ── Documentos ──────────────────────────────────────────────────────────── */
.doc-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    background: var(--color-surface);
    transition: all var(--transition-fast);
    cursor: pointer;
}
.doc-item:hover { border-color: var(--color-border); box-shadow: var(--shadow-xs); }
.doc-icon {
    width: 2.5rem; height: 2.5rem;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.doc-icon svg { width: 1.125rem; height: 1.125rem; }
.doc-pdf  { background: #fef2f2; color: #ef4444; }
.doc-img  { background: #eff6ff; color: #3b82f6; }
.doc-file { background: #f5f3ff; color: #8b5cf6; }
.doc-name { font-size: 0.875rem; font-weight: 500; color: var(--color-text); }
.doc-meta { font-size: 0.75rem; color: var(--color-text-muted); }

/* ── Mensagens ───────────────────────────────────────────────────────────── */
.msg-thread {
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.msg-thread:hover { background: var(--color-bg); }
.msg-thread.unread { background: var(--color-primary-light); }
.msg-thread.unread .msg-sender { font-weight: 700; color: var(--color-text); }
.msg-sender { font-size: 0.875rem; font-weight: 500; color: var(--color-text); }
.msg-preview { font-size: 0.8125rem; color: var(--color-text-secondary); }
.msg-time    { font-size: 0.6875rem; color: var(--color-text-muted); white-space: nowrap; }

/* ── Clínicas ────────────────────────────────────────────────────────────── */
.clinic-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}
.clinic-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.08);
}
.clinic-logo {
    width: 3rem; height: 3rem;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--color-primary-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
}
.clinic-name { font-size: 0.9375rem; font-weight: 600; color: var(--color-text); }
.clinic-meta { font-size: 0.8125rem; color: var(--color-text-secondary); }

/* ── Perfil ──────────────────────────────────────────────────────────────── */
.profile-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.profile-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 280px; height: 280px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-full);
}
.profile-header::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: 40%;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-full);
}
.profile-header-content { position: relative; z-index: 1; }
.profile-avatar-large {
    width: 5rem; height: 5rem;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.4);
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: #fff;
    margin-bottom: 1rem;
}
.profile-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.profile-sub  { font-size: 0.875rem; opacity: 0.8; }

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--color-border-light);
}
.profile-field:last-child { border-bottom: none; }
.profile-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}
.profile-field-value {
    font-size: 0.9375rem;
    color: var(--color-text);
}

/* ── Toast / Notificações ────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 1rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    width: min(90vw, 360px);
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: #1e293b;
    color: #f8fafc;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    animation: toast-in 0.25s cubic-bezier(0.16,1,0.3,1);
}
.toast.fade-out { animation: toast-out 0.2s ease forwards; }
.toast svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.toast-success { background: #064e3b; color: #6ee7b7; }
.toast-error   { background: #7f1d1d; color: #fca5a5; }
.toast-warning { background: #78350f; color: #fcd34d; }
@keyframes toast-in  { from { opacity:0; transform: translateY(8px) scale(0.97); } to { opacity:1; transform: none; } }
@keyframes toast-out { to   { opacity:0; transform: translateY(4px) scale(0.97); } }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0;
    animation: overlay-in 0.2s ease;
}
.modal-sheet {
    background: var(--color-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: sheet-in 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes sheet-in { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-handle {
    width: 2.5rem; height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    margin: 0.75rem auto 0;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border-light);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
    width: 2rem; height: 2rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--color-bg); color: var(--color-text); }
.modal-close svg { width: 1.125rem; height: 1.125rem; }
.modal-body { padding: 1.25rem; }

/* Modal centrado para desktop */
@media (min-width: 640px) {
    .modal-overlay { align-items: center; padding: 1.5rem; }
    .modal-sheet {
        border-radius: var(--radius-xl);
        max-width: 480px;
        animation: modal-in 0.25s cubic-bezier(0.16,1,0.3,1);
    }
    .modal-handle { display: none; }
    @keyframes modal-in { from { transform: scale(0.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ── Page sections ───────────────────────────────────────────────────────── */
.page-header {
    margin-bottom: 1.25rem;
}
.page-header h1 { font-size: 1.375rem; color: var(--color-text); }
.page-header p  { font-size: 0.875rem; color: var(--color-text-secondary); margin-top: 0.25rem; }

.section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title svg { width: 1rem; height: 1rem; color: var(--color-primary); }

/* ── Utilitários ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-primary    { color: var(--color-primary); }
.text-secondary  { color: var(--color-text-secondary); }
.text-muted      { color: var(--color-text-muted); }
.text-success    { color: var(--color-success); }
.text-warning    { color: var(--color-warning); }
.text-danger     { color: var(--color-danger); }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.text-lg  { font-size: 1.0625rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr 1fr; gap: 0.875rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 0.875rem; }
.w-full  { width: 100%; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.p-0 { padding: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.cursor-pointer { cursor: pointer; }
.opacity-50 { opacity: 0.5; }
.relative { position: relative; }

/* ── Responsividade ──────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .topbar-menu-btn {
        display: flex;
    }
    .bottom-nav {
        display: flex;
    }
    .page-content {
        padding-bottom: calc(1.25rem + var(--bottom-nav-h));
    }
    .toast-container {
        bottom: calc(var(--bottom-nav-h) + 0.75rem);
    }
}

@media (max-width: 639px) {
    .page-content { padding: 1rem; padding-bottom: calc(1rem + var(--bottom-nav-h)); }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    h1 { font-size: 1.375rem; }
}

@media (min-width: 1024px) {
    .bottom-nav { display: none; }
    .topbar-menu-btn { display: none; }
}

/* ── Login / Register ────────────────────────────────────────────────────── */
.auth-layout {
    min-height: 100vh;
    display: flex;
}

.auth-branding {
    display: none;
    width: 42%;
    background: linear-gradient(150deg, #1e40af 0%, #2563eb 45%, #1d4ed8 75%, #1e3a8a 100%);
    position: relative;
    overflow: hidden;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.auth-branding::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.07) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.05) 0%, transparent 50%),
        radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: auto, auto, 32px 32px;
}
.auth-branding-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 380px;
}
.auth-branding-logo {
    margin: 0 auto 2.5rem;
}
.auth-branding-logo-icon {
    width: 4rem; height: 4rem;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.75rem;
}
.auth-branding-logo-icon svg { width: 2rem; height: 2rem; color: #fff; }
.auth-branding-logo-text {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
}
.auth-branding-logo-text span { opacity: 0.75; }
.auth-branding h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.875rem;
    line-height: 1.3;
}
.auth-branding p {
    color: rgba(255,255,255,0.75);
    font-size: 0.9375rem;
    line-height: 1.65;
    margin-bottom: 2.5rem;
}
.auth-branding-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.auth-stat-item { text-align: center; }
.auth-stat-value {
    font-size: 1.625rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.auth-stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
    margin-top: 0.25rem;
}

.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--color-bg);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.auth-mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 2rem;
}
.auth-mobile-logo-icon {
    width: 2.5rem; height: 2.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.auth-mobile-logo-icon svg { width: 1.25rem; height: 1.25rem; color: #fff; }
.auth-mobile-logo-text {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
}
.auth-mobile-logo-text span { color: var(--color-primary); }

.auth-title { font-size: 1.375rem; font-weight: 700; color: var(--color-text); margin-bottom: 0.25rem; }
.auth-subtitle { font-size: 0.9375rem; color: var(--color-text-secondary); margin-bottom: 1.75rem; }

/* Step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.step-dot {
    width: 1.625rem; height: 1.625rem;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    transition: all var(--transition);
    flex-shrink: 0;
}
.step-dot.done   { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.step-dot.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.step-line {
    flex: 1; height: 2px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background var(--transition);
}
.step-line.done { background: var(--color-success); }
.step-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* Tabs de login/cadastro */
.auth-tabs {
    display: flex;
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}
.auth-tab {
    flex: 1;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
}
.auth-tab.active {
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

@media (min-width: 1024px) {
    .auth-branding { display: flex; }
    .auth-mobile-logo { display: none; }
    .auth-card { border-radius: var(--radius-xl); box-shadow: none; border: 1px solid var(--color-border-light); }
}

/* ── Alert warning ────────────────────────────────────────────────────────── */
.alert-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #78350f;
    line-height: 1.5;
}

/* ── Chat layout ──────────────────────────────────────────────────────────── */
.chat-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - var(--topbar-h) - 180px);
    min-height: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.chat-threads {
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
}
.chat-thread-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
}
.chat-thread-item:hover,
.chat-thread-item.active { background: var(--color-primary-light); }
.chat-thread-item.unread .thread-name { font-weight: 700; }
.chat-thread-item.unread .thread-preview { color: var(--color-text); }

.thread-avatar {
    width: 42px; height: 42px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.thread-info { flex: 1; min-width: 0; }
.thread-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thread-preview {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.125rem;
}
.thread-time {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.thread-unread-dot {
    width: 8px; height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    flex-shrink: 0;
    margin-top: 4px;
}

.chat-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--color-text-muted);
}
.chat-empty-icon { font-size: 3rem; }

.chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    flex-shrink: 0;
}
.chat-header-avatar {
    width: 38px; height: 38px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.8125rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.chat-header-info strong { display: block; font-size: 0.9375rem; }
.chat-header-info span  { font-size: 0.75rem; color: var(--color-text-muted); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--color-bg);
}
.bubble {
    max-width: 72%;
    padding: 0.625rem 0.875rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
}
.bubble.sent {
    background: var(--color-primary);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
    align-self: flex-end;
}
.bubble.received {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-bottom-left-radius: 0.25rem;
    align-self: flex-start;
}
.bubble-sender {
    font-size: 0.6875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.75;
}
.bubble-time {
    font-size: 0.6875rem;
    opacity: 0.65;
    margin-top: 0.25rem;
    text-align: right;
}
.bubble.received .bubble-time { text-align: left; }
.bubble-auto {
    align-self: center;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.8125rem;
    padding: 0.5rem 0.875rem;
    border-radius: 1rem;
    max-width: 85%;
    text-align: center;
}

.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    flex-shrink: 0;
}
.chat-input {
    flex: 1;
    resize: none;
    border: 1.5px solid var(--color-border);
    border-radius: 1.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color var(--transition-fast);
    outline: none;
}
.chat-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.chat-send-btn {
    width: 42px; height: 42px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast), transform var(--transition-fast);
    border: none;
    cursor: pointer;
}
.chat-send-btn:hover  { background: var(--color-primary-dark); }
.chat-send-btn:active { transform: scale(0.93); }

/* Responsivo mobile */
@media (max-width: 768px) {
    .chat-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: unset;
    }
    .chat-threads {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        max-height: 240px;
    }
    .chat-area { min-height: 400px; }
}

/* ── Auth branding: logo sub-label e feature list ────────────────────────── */
.auth-branding-logo-sub {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 0.125rem;
}
.auth-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
    margin-top: 2rem;
}
.auth-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.auth-feature-icon {
    width: 2.5rem; height: 2.5rem;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}
.auth-feature-list strong {
    display: block;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}
.auth-feature-list span {
    color: rgba(255,255,255,0.65);
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* ── Clinic card rich ────────────────────────────────────────────────────── */
.clinic-card-rich {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.clinic-card-rich:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.clinic-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.25rem 1rem;
    color: #fff;
}
.clinic-card-logo {
    width: 3rem; height: 3rem;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}
.clinic-card-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}
.clinic-card-specialty {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}
.clinic-card-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.clinic-card-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}
.clinic-card-info-row a { font-weight: 500; }
.clinic-card-doctors {
    margin-top: 0.375rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--color-border-light);
}
.clinic-card-doctors-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    margin-bottom: 0.625rem;
}
.clinic-doctor-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}
.clinic-doctor-avatar {
    width: 1.875rem; height: 1.875rem;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    flex-shrink: 0;
}
.clinic-doctor-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}
.clinic-doctor-spec {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.clinic-card-footer {
    padding: 0.875rem 1.25rem 1.125rem;
    display: flex;
    gap: 0.625rem;
    border-top: 1px solid var(--color-border-light);
}
.clinic-btn { flex: 1; justify-content: center; }

/* ── btn-outline ─────────────────────────────────────────────────────────── */
.btn-outline {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1.5px solid var(--color-border);
}
.btn-outline:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
    color: var(--color-text);
}
