/* ═══════════════════════════════════════════════════════════════
   PRONTUÁRIO MÉDICO — Folha de estilos
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout de página ────────────────────────────────────────── */
.pron-page {
    padding: 0;
    max-width: 100%;
}

.pron-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pron-page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pron-page-title-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pron-page-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

.pron-page-title p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

[data-theme="dark"] .pron-page-title h1 { color: #f1f5f9; }

/* ── Botões primários ─────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
    text-decoration: none;
}
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}
.btn-secondary:hover { background: #e2e8f0; color: #1e293b; }

[data-theme="dark"] .btn-secondary { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .btn-secondary:hover { background: #334155; color: #f1f5f9; }

/* ── Hero da lista ──────────────────────────────────────────────── */
.pron-hero {
    background: linear-gradient(135deg, #0c1b3b 0%, #1a3f7a 55%, #2563eb 100%);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
.pron-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}
.pron-hero::after {
    content: '';
    position: absolute;
    bottom: -40px; left: 38%;
    width: 140px; height: 140px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    pointer-events: none;
}
.pron-hero-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
    position: relative;
}
.pron-hero-icon-wrap {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
    flex-shrink: 0;
}
.pron-hero-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.2rem;
    letter-spacing: -0.02em;
    position: relative;
}
.pron-hero-sub {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    position: relative;
}
.pron-hero-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    position: relative;
}
.pron-stat-chip {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 0.55rem 1rem;
    text-align: center;
    min-width: 68px;
    backdrop-filter: blur(6px);
}
.stat-num {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    display: block;
    line-height: 1;
}
.stat-label {
    font-size: 0.66rem;
    color: rgba(255,255,255,0.65);
    margin-top: 3px;
    display: block;
    white-space: nowrap;
}
.btn-hero {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    border: 1.5px solid rgba(255,255,255,0.3) !important;
    backdrop-filter: blur(8px);
    white-space: nowrap;
    position: relative;
}
.btn-hero i { color: #fff !important; }
.btn-hero:hover {
    background: rgba(255,255,255,0.25) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
}

/* ── Barra de busca ─────────────────────────────────────────────── */
.pron-search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.pron-search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}
.pron-search-wrap i {
    position: absolute;
    left: 0.9rem;
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}
.pron-search-input {
    width: 100%;
    padding: 0.72rem 1rem 0.72rem 2.4rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.88rem;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pron-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
[data-theme="dark"] .pron-search-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
.pron-patient-count {
    font-size: 0.82rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* ── Grid v2 de pacientes ───────────────────────────────────────── */
.pron-patients-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

/* ── Card v2 de paciente ────────────────────────────────────────── */
.ppc {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.ppc:hover {
    border-color: #2563eb;
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(37,99,235,0.13);
}
[data-theme="dark"] .ppc { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .ppc:hover { border-color: #3b82f6; box-shadow: 0 8px 28px rgba(59,130,246,0.2); }

.ppc-header {
    padding: 1.15rem 1.15rem 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.ppc-avatar {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.ppc-info { flex: 1; min-width: 0; }
.ppc-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}
[data-theme="dark"] .ppc-name { color: #f1f5f9; }
.ppc-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ppc-chip {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.18rem 0.5rem;
    border-radius: 20px;
}
[data-theme="dark"] .ppc-chip { background: #0f172a; color: #94a3b8; }

.ppc-body {
    padding: 0 1.15rem 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.ppc-allergy {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    padding: 0.35rem 0.6rem;
    line-height: 1.4;
}
.ppc-allergy i { margin-top: 1px; flex-shrink: 0; font-size: 0.72rem; }
[data-theme="dark"] .ppc-allergy {
    background: rgba(127,29,29,0.2);
    border-color: rgba(127,29,29,0.4);
    color: #fca5a5;
}
.ppc-history {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.4;
}
.ppc-history i { color: #94a3b8; margin-top: 1px; flex-shrink: 0; font-size: 0.72rem; }
[data-theme="dark"] .ppc-history { color: #94a3b8; }
.ppc-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: auto;
}
.ppc-date i { font-size: 0.7rem; }
.ppc-divider { height: 1px; background: #f1f5f9; margin: 0; }
[data-theme="dark"] .ppc-divider { background: #334155; }
.ppc-footer {
    padding: 0.7rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.ppc-open-btn {
    font-size: 0.78rem;
    font-weight: 700;
    color: #2563eb;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap 0.15s;
    white-space: nowrap;
}
.ppc:hover .ppc-open-btn { gap: 0.55rem; }
[data-theme="dark"] .ppc-open-btn { color: #60a5fa; }

.ppc-quick-rx-btn {
    font-size: 0.74rem;
    font-weight: 700;
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.ppc-quick-rx-btn:hover { background: #fef3c7; border-color: #fbbf24; }
[data-theme="dark"] .ppc-quick-rx-btn {
    color: #fbbf24;
    background: #2a2410;
    border-color: #52440f;
}
[data-theme="dark"] .ppc-quick-rx-btn:hover { background: #3a3010; }

.btn-danger-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: transparent;
    color: #94a3b8;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}
.btn-danger-soft:hover { color: #ef4444; background: #fef2f2; }

/* ── Lista de pacientes ───────────────────────────────────────── */
.pron-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}
.pron-empty i { font-size: 3rem; margin-bottom: 1rem; display: block; }
.pron-empty p { font-size: 0.95rem; margin: 0; }

.pron-patients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pron-patient-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.pron-patient-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.1);
}
.pron-patient-avatar {
    width: 46px; height: 46px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem; color: #2563eb;
    flex-shrink: 0;
}
.pron-patient-info { flex: 1; min-width: 0; }
.pron-patient-name { font-weight: 700; font-size: 0.9rem; color: #0f172a; margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pron-patient-meta { font-size: 0.75rem; color: #64748b; }
.pron-patient-arrow { color: #cbd5e1; font-size: 0.85rem; }

[data-theme="dark"] .pron-patient-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .pron-patient-name { color: #f1f5f9; }

/* ── Layout do atendimento ───────────────────────────────────── */
.pron-atendimento {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .pron-atendimento { grid-template-columns: 1fr; }
}

/* ── Cards do prontuário ─────────────────────────────────────── */
.pron-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    overflow: visible;
    margin-bottom: 1.25rem;
}
[data-theme="dark"] .pron-card { background: #1e293b; border-color: #334155; }

.pron-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 0.75rem;
}
[data-theme="dark"] .pron-card-header { border-bottom-color: #2d3f5a; }

.pron-card-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pron-card-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.pron-card-icon.blue  { background: #dbeafe; color: #2563eb; }
.pron-card-icon.green { background: #d1fae5; color: #059669; }
.pron-card-icon.purple{ background: #ede9fe; color: #7c3aed; }
.pron-card-icon.orange{ background: #ffedd5; color: #ea580c; }

.pron-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
[data-theme="dark"] .pron-card-title { color: #f1f5f9; }

.pron-card-body { padding: 1.25rem; }

/* ── Campos de formulário ────────────────────────────────────── */
.pron-form-grid {
    display: grid;
    gap: 1rem;
}
.pron-form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.pron-form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.pron-form-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

@media (max-width: 700px) {
    .pron-form-grid.cols-2,
    .pron-form-grid.cols-3,
    .pron-form-grid.cols-4 { grid-template-columns: 1fr; }
}

.pron-field { display: flex; flex-direction: column; gap: 0.35rem; }

.pron-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pron-input,
.pron-textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    font-family: 'Inter', sans-serif;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.pron-input:focus,
.pron-textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.pron-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

[data-theme="dark"] .pron-input,
[data-theme="dark"] .pron-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}
[data-theme="dark"] .pron-input:focus,
[data-theme="dark"] .pron-textarea:focus {
    background: #1e293b;
    border-color: #3b82f6;
}

/* Custom select wrapper */
.pron-select-wrap { position: relative; }
.pron-select-wrap::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.7rem;
    pointer-events: none;
}
.pron-select {
    width: 100%;
    padding: 0.65rem 2.25rem 0.65rem 0.9rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.pron-select:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
[data-theme="dark"] .pron-select {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

/* Sinais vitais inline */
.pron-vitals-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}
@media (max-width: 900px) { .pron-vitals-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .pron-vitals-grid { grid-template-columns: repeat(2, 1fr); } }

.vital-field {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: border-color 0.15s;
}
.vital-field:focus-within { border-color: #2563eb; background: #fff; }
.vital-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.vital-input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    width: 100%;
}
[data-theme="dark"] .vital-field { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .vital-input { color: #f1f5f9; }
[data-theme="dark"] .vital-field:focus-within { background: #1e293b; border-color: #3b82f6; }

/* ── SOAP Tabs ────────────────────────────────────────────────── */
.soap-tabs-bar {
    display: flex;
    gap: 0.2rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 12px;
    flex-wrap: wrap;
}
[data-theme="dark"] .soap-tabs-bar { background: #0f172a; }

.soap-tab {
    flex: 1;
    min-width: 90px;
    padding: 0.55rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #64748b;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.soap-tab.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.soap-tab:hover:not(.active) { color: #1e293b; background: rgba(255,255,255,0.6); }
[data-theme="dark"] .soap-tab.active { background: #1e293b; color: #60a5fa; }
[data-theme="dark"] .soap-tab:hover:not(.active) { color: #cbd5e1; }

.soap-tab-badge {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: none;
}
.soap-tab.has-content .soap-tab-badge { display: block; }

.soap-panel { display: none; }
.soap-panel.active { display: block; }

/* ── CID Autocomplete ─────────────────────────────────────────── */
.cid-wrap { position: relative; }

.cid-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.cid-dropdown.open { display: block; }
[data-theme="dark"] .cid-dropdown { background: #1e293b; border-color: #334155; }

.cid-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    transition: background 0.1s;
    border-bottom: 1px solid #f1f5f9;
}
.cid-item:last-child { border-bottom: none; }
.cid-item:hover, .cid-item.highlighted { background: #f0f6ff; }
[data-theme="dark"] .cid-item:hover,
[data-theme="dark"] .cid-item.highlighted { background: #0f172a; }
[data-theme="dark"] .cid-item { border-bottom-color: #334155; }

.cid-code {
    font-size: 0.75rem;
    font-weight: 800;
    color: #2563eb;
    background: #dbeafe;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    flex-shrink: 0;
}
.cid-desc {
    font-size: 0.83rem;
    color: #1e293b;
    line-height: 1.3;
}
[data-theme="dark"] .cid-desc { color: #f1f5f9; }

.cid-selected-badge {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: #dbeafe;
    border: 1.5px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: #1d4ed8;
    font-weight: 600;
}
.cid-selected-badge.visible { display: flex; }
.cid-clear-btn {
    background: none;
    border: none;
    color: #93c5fd;
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1;
    transition: color 0.1s;
}
.cid-clear-btn:hover { color: #1d4ed8; }

/* ── Cards de Protocolo ───────────────────────────────────────── */
.protocol-section {
    margin-bottom: 1.25rem;
}

.protocol-section-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.protocol-section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
[data-theme="dark"] .protocol-section-header::after { background: #334155; }

.protocol-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.protocol-card {
    border: 1.5px solid #bfdbfe;
    background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fe 100%);
    border-radius: 14px;
    padding: 1rem 1.15rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.protocol-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, #2563eb, #60a5fa);
    border-radius: 14px 0 0 14px;
}
.protocol-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.15);
}
.protocol-card:active { transform: translateY(0); }

.protocol-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.35rem;
    padding-left: 0.5rem;
}
.protocol-card-desc {
    font-size: 0.77rem;
    color: #64748b;
    line-height: 1.4;
    padding-left: 0.5rem;
}
.protocol-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
    padding-left: 0.5rem;
}
.protocol-evidence {
    font-size: 0.7rem;
    font-weight: 700;
    background: #dbeafe;
    color: #2563eb;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
}
.protocol-apply-hint {
    font-size: 0.72rem;
    color: #2563eb;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}
.protocol-card-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding-left: 0.5rem;
    margin-bottom: 0.35rem;
}
.protocol-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.protocol-badge.ps    { background: #fee2e2; color: #dc2626; }
.protocol-badge.alta  { background: #dcfce7; color: #16a34a; }
[data-theme="dark"] .protocol-badge.ps   { background: #4c1d1d; color: #fca5a5; }
[data-theme="dark"] .protocol-badge.alta { background: #14532d; color: #86efac; }

[data-theme="dark"] .protocol-card {
    background: linear-gradient(135deg, #1e2d45 0%, #1e293b 100%);
    border-color: #334155;
}
[data-theme="dark"] .protocol-card-title { color: #f1f5f9; }
[data-theme="dark"] .protocol-card-desc { color: #94a3b8; }
[data-theme="dark"] .protocol-card:hover { border-color: #3b82f6; }

/* ── Itens da Prescrição ─────────────────────────────────────── */
.rx-items-list { display: flex; flex-direction: column; gap: 0.75rem; }

.rx-item {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: start;
    position: relative;
    transition: border-color 0.15s;
}
.rx-item:hover { border-color: #bfdbfe; }

.rx-item-main { display: flex; flex-direction: column; gap: 0.5rem; }

.rx-item-name-row { display: flex; align-items: center; gap: 0.5rem; }
.rx-item-num {
    width: 22px; height: 22px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rx-item-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.rx-item-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.rx-field-mini {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.rx-field-mini label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rx-field-mini input,
.rx-field-mini textarea {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.rx-field-mini input:focus,
.rx-field-mini textarea:focus { border-color: #2563eb; }

.rx-delete-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
    align-self: start;
}
.rx-delete-btn:hover { color: #ef4444; background: #fef2f2; }

.rx-item-obs {
    grid-column: 1 / -1;
}
.rx-item-obs input {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    color: #64748b;
    font-family: 'Inter', sans-serif;
    font-style: italic;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.rx-item-obs input:focus { border-color: #2563eb; }

.rx-nome-input { color: #0f172a; }

[data-theme="dark"] .rx-item { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .rx-item-name { color: #f1f5f9; }
[data-theme="dark"] .rx-nome-input { color: #f1f5f9 !important; }
[data-theme="dark"] .rx-field-mini input,
[data-theme="dark"] .rx-field-mini textarea,
[data-theme="dark"] .rx-item-obs input { background: #1e293b; border-color: #334155; color: #f1f5f9; }

.rx-add-btn {
    width: 100%;
    padding: 0.7rem;
    background: transparent;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.rx-add-btn:hover { border-color: #2563eb; color: #2563eb; background: #f0f6ff; }
[data-theme="dark"] .rx-add-btn:hover { background: #1e2d45; }

.rx-empty {
    text-align: center;
    padding: 2rem;
    color: #cbd5e1;
    font-size: 0.85rem;
}
.rx-empty i { font-size: 2rem; display: block; margin-bottom: 0.5rem; }

.rx-subsection-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.6rem;
}
.rx-subsection-title i { color: #2563eb; margin-right: 0.35rem; }
[data-theme="dark"] .rx-subsection-title { color: #94a3b8; }
.rx-sos-add-btn {
    font-size: 0.72rem !important;
    padding: 0.3rem 0.65rem !important;
}

.rx-clinical-box {
    margin-top: 1.25rem;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 12px;
    padding: 0.85rem 1rem;
}
[data-theme="dark"] .rx-clinical-box {
    background: #2a2410;
    border-color: #52440f;
}
.rx-clinical-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
[data-theme="dark"] .rx-clinical-title { color: #fbbf24; }
.rx-clinical-hint {
    font-weight: 500;
    font-size: 0.68rem;
    color: #a16207;
    text-transform: none;
    letter-spacing: 0;
}
[data-theme="dark"] .rx-clinical-hint { color: #d4a72c; }
.rx-clinical-field { margin-bottom: 0.6rem; }
.rx-clinical-field:last-child { margin-bottom: 0; }
.rx-clinical-field strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #78350f;
    margin-bottom: 0.15rem;
}
[data-theme="dark"] .rx-clinical-field strong { color: #fcd34d; }
.rx-clinical-field p {
    font-size: 0.78rem;
    color: #57534e;
    line-height: 1.5;
    margin: 0;
    white-space: pre-line;
}
[data-theme="dark"] .rx-clinical-field p { color: #d6d3d1; }

/* ── Painel de Calculadoras ──────────────────────────────────── */
.calc-panel {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    position: sticky;
    top: 1rem;
    overflow: hidden;
}
[data-theme="dark"] .calc-panel { background: #1e293b; border-color: #334155; }

/* ── View standalone: Calculadoras sem paciente ─────────────────── */
.calc-standalone-intro {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.calc-standalone-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0c1b3b, #1a3f7a);
    color: #93c5fd;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.calc-standalone-intro h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.15rem;
}
[data-theme="dark"] .calc-standalone-intro h2 { color: #f1f5f9; }
.calc-standalone-intro p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}
.calc-standalone-wrap {
    max-width: 1180px;
    margin: 0 auto;
}
.calc-standalone-wrap .calc-panel {
    position: static;
    width: 100%;
}

/* ── Layout em duas colunas (sidebar de busca/especialidades + conteúdo) ── */
.calc-panel-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.calc-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
@media (min-width: 900px) {
    .calc-standalone-wrap .calc-panel-content { flex-direction: row; align-items: flex-start; }
    .calc-standalone-wrap .calc-sidebar {
        width: 300px;
        flex-shrink: 0;
        border-right: 1px solid #f1f5f9;
    }
    .calc-standalone-wrap .calc-selector { max-height: calc(100vh - 220px); overflow-y: auto; }
    .calc-standalone-wrap .calc-body { flex: 1; min-width: 0; padding: 1.5rem 1.75rem; }
    .calc-standalone-wrap .calc-btn {
        width: auto;
        min-width: 220px;
        padding: 0.7rem 2rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 4px 14px -4px #1d4ed866;
    }
}
[data-theme="dark"] .calc-standalone-wrap .calc-sidebar { border-right-color: #263449; }

.calc-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0 1.1rem;
    align-items: start;
}

.calc-panel-header {
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, #0c1b3b, #1a3f7a);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.calc-panel-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.calc-panel-title i { color: #93c5fd; }

.calc-search-wrap {
    position: relative;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}
.calc-search-wrap i {
    position: absolute;
    left: 1.35rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.78rem;
}
.calc-search-wrap input {
    width: 100%;
    padding: 0.45rem 0.7rem 0.45rem 1.85rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.78rem;
    background: #f8fafc;
    color: var(--dark, #0f172a);
    outline: none;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}
.calc-search-wrap input:focus { border-color: #2563eb; background: #fff; }
[data-theme="dark"] .calc-search-wrap { border-bottom-color: #334155; }
[data-theme="dark"] .calc-search-wrap input { background: #0f172a; border-color: #334155; color: #f1f5f9; }

.calc-selector {
    padding: 0.35rem 0;
    border-bottom: 1px solid #f1f5f9;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.calc-selector::-webkit-scrollbar { width: 4px; }
.calc-selector::-webkit-scrollbar-track { background: transparent; }
.calc-selector::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
[data-theme="dark"] .calc-selector { border-bottom-color: #334155; scrollbar-color: #334155 transparent; }

.calc-cat-group.hidden-cat { display: none; }
.calc-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    background: #f8fafc;
    user-select: none;
}
.calc-cat-header:hover { background: #f1f5f9; }
.calc-cat-header-left { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.calc-cat-header-left i.chevron { font-size: 0.65rem; color: #94a3b8; transition: transform 0.15s; flex-shrink: 0; }
.calc-cat-group.collapsed .chevron { transform: rotate(-90deg); }
.calc-cat-name { font-size: 0.76rem; font-weight: 800; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-cat-count { font-size: 0.68rem; font-weight: 700; color: #94a3b8; flex-shrink: 0; }
[data-theme="dark"] .calc-cat-header { background: #16233a; }
[data-theme="dark"] .calc-cat-header:hover { background: #1c2c47; }
[data-theme="dark"] .calc-cat-name { color: #cbd5e1; }

.calc-cat-items { display: flex; flex-direction: column; }
.calc-cat-group.collapsed .calc-cat-items { display: none; }
.calc-cat-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.9rem 0.45rem 1.6rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.12s;
}
.calc-cat-item:hover { background: #f0f6ff; }
.calc-cat-item i { font-size: 0.8rem; color: #94a3b8; width: 16px; text-align: center; flex-shrink: 0; }
.calc-cat-item span { font-size: 0.76rem; font-weight: 600; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-cat-item.active { background: #eff6ff; border-left-color: #2563eb; }
.calc-cat-item.active i, .calc-cat-item.active span { color: #2563eb; }
[data-theme="dark"] .calc-cat-item:hover { background: #16233a; }
[data-theme="dark"] .calc-cat-item span { color: #94a3b8; }
[data-theme="dark"] .calc-cat-item.active { background: #16233a; }
[data-theme="dark"] .calc-cat-item.active i, [data-theme="dark"] .calc-cat-item.active span { color: #60a5fa; }

.calc-body { padding: 0.9rem; }

.calc-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.calc-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.35;
}
[data-theme="dark"] .calc-field label { color: #cbd5e1; }
.calc-input {
    width: 100%;
    padding: 0.55rem 0.8rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.calc-input:focus { border-color: #2563eb; background: #fff; }
[data-theme="dark"] .calc-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
[data-theme="dark"] .calc-input:focus { background: #1e293b; }

.calc-select-wrap { position: relative; }
.calc-select-wrap::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.65rem;
    pointer-events: none;
}

.calc-btn {
    width: 100%;
    padding: 0.65rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
    margin-top: 0.25rem;
}
.calc-btn:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); transform: translateY(-1px); }
.calc-btn:active { transform: translateY(0); }

.calc-result {
    margin-top: 1rem;
    border-radius: 12px;
    padding: 1rem;
    display: none;
    animation: fadeUp 0.2s ease;
}
.calc-result.visible { display: block; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.calc-result.success { background: #d1fae5; border: 1.5px solid #a7f3d0; }
.calc-result.warning { background: #fef3c7; border: 1.5px solid #fde68a; }
.calc-result.danger  { background: #fee2e2; border: 1.5px solid #fca5a5; }
.calc-result.info    { background: #dbeafe; border: 1.5px solid #bfdbfe; }

.calc-result-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 0.2rem;
    letter-spacing: -0.02em;
}
.calc-result.success .calc-result-value { color: #065f46; }
.calc-result.warning .calc-result-value { color: #78350f; }
.calc-result.danger  .calc-result-value { color: #7f1d1d; }
.calc-result.info    .calc-result-value { color: #1e3a8a; }

.calc-result-cls {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    opacity: 0.85;
}
.calc-result-interp {
    font-size: 0.75rem;
    opacity: 0.7;
    line-height: 1.4;
}

/* ── Fórmula do cálculo e valores de referência ────────────────── */
.calc-formula-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-left: 3px solid #2563eb;
    border-radius: 10px;
}
.calc-formula-box i {
    color: #2563eb;
    font-size: 0.85rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}
.calc-formula-box-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2563eb;
    margin-bottom: 0.25rem;
}
.calc-formula-box-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e3a8a;
    line-height: 1.5;
}
[data-theme="dark"] .calc-formula-box { background: #0f1f3d; border-color: #1e3a5f; }
[data-theme="dark"] .calc-formula-box-text { color: #bfdbfe; }

.calc-ref-table {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.calc-ref-table-title {
    padding: 0.55rem 0.9rem;
    background: linear-gradient(135deg, #0c1b3b, #1a3f7a);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.calc-ref-table-title i { color: #93c5fd; }
.calc-ref-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.78rem;
    border-top: 1px solid #f1f5f9;
}
.calc-ref-row:nth-child(even) { background: #f8fafc; }
.calc-ref-faixa {
    font-weight: 800;
    color: #2563eb;
    min-width: 78px;
    flex-shrink: 0;
}
.calc-ref-cls { color: #475569; }
[data-theme="dark"] .calc-ref-table { border-color: #334155; }
[data-theme="dark"] .calc-ref-row { border-top-color: #263449; }
[data-theme="dark"] .calc-ref-row:nth-child(even) { background: #16233a; }
[data-theme="dark"] .calc-ref-faixa { color: #60a5fa; }
[data-theme="dark"] .calc-ref-cls { color: #94a3b8; }

.calc-citacao-box {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.74rem;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
}
.calc-citacao-box strong { color: #334155; }
[data-theme="dark"] .calc-citacao-box { background: #0d1828; border-color: #1e3550; color: #94a3b8; }
[data-theme="dark"] .calc-citacao-box strong { color: #cbd5e1; }

/* ── Seção de histórico de evoluções ─────────────────────────── */
.evolucoes-list { display: flex; flex-direction: column; gap: 0.75rem; }

.evolucao-item {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.evolucao-item:hover { border-color: #2563eb; background: #f0f6ff; }
.evolucao-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2563eb;
    white-space: nowrap;
}
.evolucao-snippet {
    font-size: 0.82rem;
    color: #64748b;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.evolucao-cid {
    font-size: 0.72rem;
    font-weight: 700;
    background: #dbeafe;
    color: #2563eb;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    white-space: nowrap;
}
[data-theme="dark"] .evolucao-item { border-color: #334155; }
[data-theme="dark"] .evolucao-item:hover { background: #0f172a; }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.pron-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
}
.pron-breadcrumb a, .pron-breadcrumb span {
    color: #64748b;
    text-decoration: none;
    transition: color 0.1s;
}
.pron-breadcrumb a:hover { color: #2563eb; }
.pron-breadcrumb .sep { color: #cbd5e1; }
.pron-breadcrumb .current { color: #0f172a; font-weight: 600; }
[data-theme="dark"] .pron-breadcrumb .current { color: #f1f5f9; }

/* ── Badges / status ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #d1fae5; color: #065f46; }

/* ── Toast notification ──────────────────────────────────────── */
.pron-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.pron-toast.show { transform: translateY(0); opacity: 1; }
.pron-toast.success { background: linear-gradient(135deg, #059669, #047857); }
.pron-toast.error   { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ── Painel paciente inline (topo do atendimento) ────────────── */
.patient-info-bar {
    background: linear-gradient(135deg, #0c1b3b, #1a3f7a);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.patient-bar-avatar {
    width: 46px; height: 46px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem; color: #fff;
    flex-shrink: 0;
}
.patient-bar-info { flex: 1; min-width: 0; }
.patient-bar-name { font-size: 1rem; font-weight: 800; color: #fff; margin-bottom: 0.15rem; }
.patient-bar-meta { font-size: 0.78rem; color: rgba(255,255,255,0.7); display: flex; gap: 1rem; flex-wrap: wrap; }
.patient-bar-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.pron-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pron-loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.pron-loading .spinner-lg {
    width: 32px; height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Modal de tipo de receita ───────────────────────────────────── */
.pron-rx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
}
.pron-rx-modal {
    background: #fff;
    border-radius: 20px;
    width: min(400px, 92vw);
    padding: 1.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
[data-theme="dark"] .pron-rx-modal {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.pron-rx-modal-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.pron-rx-modal-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    flex: 1;
    margin: 0;
}
[data-theme="dark"] .pron-rx-modal-header h3 { color: #f1f5f9; }
.pron-rx-modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}
.pron-rx-modal-close:hover { color: #475569; }
.pron-rx-modal-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 1.25rem;
}
.pron-rx-tipo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.pron-rx-tipo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 1.25rem 1rem;
    background: #f8faff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}
.pron-rx-tipo-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.12);
}
[data-theme="dark"] .pron-rx-tipo-card { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .pron-rx-tipo-card:hover { border-color: #3b82f6; background: rgba(37,99,235,0.12); }
.pron-rx-tipo-ico { font-size: 1.8rem; color: #2563eb; }
.pron-rx-tipo-label {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
}
[data-theme="dark"] .pron-rx-tipo-label { color: #f1f5f9; }
.pron-rx-tipo-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: center;
}
.pron-rx-aviso {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    line-height: 1.4;
}
.pron-rx-aviso i { color: #f59e0b; flex-shrink: 0; margin-top: 1px; }
.pron-rx-aviso a { color: #1d4ed8; font-weight: 600; }
[data-theme="dark"] .pron-rx-aviso { background: rgba(146,64,14,0.2); border-color: rgba(253,211,77,0.3); color: #fde68a; }
[data-theme="dark"] .pron-rx-aviso a { color: #93c5fd; }

/* ── Modal: seleção de paciente (Prescrição Rápida) ─────────────── */
#modal-prescricao-rapida .pron-rx-modal { width: min(480px, 92vw); }
.qr-paciente-list {
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.qr-paciente-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    background: #fff;
    width: 100%;
}
.qr-paciente-item:hover { border-color: #d97706; background: #fffbeb; }
[data-theme="dark"] .qr-paciente-item { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .qr-paciente-item:hover { border-color: #d97706; background: rgba(217,119,6,0.12); }
.qr-paciente-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.75rem; font-weight: 700;
    flex-shrink: 0;
}
.qr-paciente-nome { font-size: 0.85rem; font-weight: 700; color: #0f172a; }
[data-theme="dark"] .qr-paciente-nome { color: #f1f5f9; }
.qr-paciente-empty { text-align: center; padding: 1.5rem; color: #94a3b8; font-size: 0.82rem; }

/* ── Banner: modo prescrição rápida ─────────────────────────────── */
.modo-rapido-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fbbf24;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    margin-bottom: 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #92400e;
}
.modo-rapido-banner i.fa-bolt { color: #d97706; font-size: 0.95rem; }
.modo-rapido-banner span { flex: 1; }
.modo-rapido-banner-close {
    background: transparent;
    border: none;
    color: #92400e;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem;
    opacity: 0.7;
}
.modo-rapido-banner-close:hover { opacity: 1; }
[data-theme="dark"] .modo-rapido-banner {
    background: linear-gradient(135deg, #2a2410 0%, #3a3010 100%);
    border-color: #52440f;
    color: #fbbf24;
}
[data-theme="dark"] .modo-rapido-banner-close { color: #fbbf24; }
