.cr-wrap { font-size: 14px; line-height: 1.5; }

/* ── Cabeçalho do paciente ──────────────────────── */
.cr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: rgba(0,0,0,.04);
    border: 1px solid rgba(0,0,0,.08);
}
.dark .cr-header {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.08);
}
.cr-header-info { min-width: 0; }
.cr-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .cr-name { color: #f9fafb; }
.cr-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cr-meta-sep { color: #d1d5db; }
.dark .cr-meta-sep { color: #4b5563; }
.cr-meta-text { font-size: 12px; color: #6b7280; }
.dark .cr-meta-text { color: #9ca3af; }

/* ── Badges ─────────────────────────────────────── */
.cr-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
}
.cr-badge-green  { background: #d1fae5; color: #065f46; }
.cr-badge-amber  { background: #fef3c7; color: #92400e; }
.cr-badge-red    { background: #fee2e2; color: #991b1b; }
.cr-badge-gray   { background: #f3f4f6; color: #4b5563; }
.cr-badge-teal   { background: #e0e7ff; color: #4338ca; }
.cr-badge-blue   { background: #dbeafe; color: #1e40af; }
.cr-badge-purple { background: #ede9fe; color: #5b21b6; }
.cr-badge-orange { background: #ffedd5; color: #9a3412; }
.cr-badge-pink   { background: #fce7f3; color: #9d174d; }
.cr-badge-indigo { background: #e0e7ff; color: #3730a3; }
.dark .cr-badge-green  { background: #064e3b; color: #6ee7b7; }
.dark .cr-badge-amber  { background: #451a03; color: #fcd34d; }
.dark .cr-badge-red    { background: #450a0a; color: #fca5a5; }
.dark .cr-badge-gray   { background: #1f2937; color: #9ca3af; }
.dark .cr-badge-teal   { background: #1e1b4b; color: #a5b4fc; }
.dark .cr-badge-blue   { background: #1e3a5f; color: #93c5fd; }
.dark .cr-badge-purple { background: #2e1065; color: #c4b5fd; }
.dark .cr-badge-orange { background: #431407; color: #fdba74; }
.dark .cr-badge-pink   { background: #500724; color: #f9a8d4; }
.dark .cr-badge-indigo { background: #1e1b4b; color: #a5b4fc; }

/* ── Botão Novo Prontuário ───────────────────────── */
.cr-btn-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: #4f46e5;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.cr-btn-new:hover { background: #4338ca; color: #fff; }
.cr-btn-new svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Estado vazio ───────────────────────────────── */
.cr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: #9ca3af;
    text-align: center;
}
.cr-empty svg { width: 40px; height: 40px; margin-bottom: 10px; opacity: .4; }
.cr-empty-title { font-size: 14px; font-weight: 500; margin: 0 0 2px; }
.cr-empty-sub   { font-size: 12px; color: #d1d5db; margin: 0; }

/* ── Timeline ───────────────────────────────────── */
.cr-timeline { position: relative; padding-left: 20px; }
.cr-line {
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 24px;
    width: 2px;
    background: linear-gradient(to bottom, #d1d5db 80%, transparent);
    border-radius: 1px;
}
.dark .cr-line {
    background: linear-gradient(to bottom, #374151 80%, transparent);
}
.cr-items { display: flex; flex-direction: column; gap: 10px; }
.cr-item  { position: relative; display: flex; gap: 12px; }

/* ── Ponto da timeline ──────────────────────────── */
.cr-dot-wrap {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    padding-top: 14px;
}
.cr-dot {
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    outline: 3px solid #fff;
}
.dark .cr-dot { outline-color: #111827; }
.cr-dot-green { background: #22c55e; }
.cr-dot-amber { background: #f59e0b; }
.cr-dot-gray  { background: #9ca3af; }

/* ── Card do prontuário ─────────────────────────── */
.cr-card {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color .15s, box-shadow .15s;
}
.dark .cr-card {
    background: #1f2937;
    border-color: rgba(255,255,255,.08);
}
.cr-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.dark .cr-card:hover { border-color: #4f46e5; }

.cr-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.cr-card-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.cr-date { font-size: 13px; font-weight: 600; color: #111827; }
.dark .cr-date { color: #f3f4f6; }
.cr-time { font-size: 11px; color: #9ca3af; font-family: monospace; }

/* ── Link Abrir ─────────────────────────────────── */
.cr-open-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    color: #4f46e5;
    text-decoration: none;
    opacity: 0;
    transition: opacity .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.cr-card:hover .cr-open-link { opacity: 1; }
.dark .cr-open-link { color: #818cf8; }
.cr-open-link svg { width: 11px; height: 11px; }

/* ── Preview do conteúdo ────────────────────────── */
.cr-preview {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dark .cr-preview { color: #9ca3af; }

/* ── Rodapé do card ─────────────────────────────── */
.cr-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 11px;
    color: #d1d5db;
}
.dark .cr-footer { color: #4b5563; }
.cr-footer svg { width: 11px; height: 11px; flex-shrink: 0; }

/* ── Aviso de limite ────────────────────────────── */
.cr-more {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}
.dark .cr-more { border-color: rgba(255,255,255,.06); }
.cr-more p   { font-size: 11px; color: #9ca3af; margin: 0 0 2px; }
.cr-more a   { font-size: 11px; font-weight: 500; color: #4f46e5; text-decoration: none; }
.cr-more a:hover { text-decoration: underline; }

/* ── Card de contrato ativo / sessões ───────────── */
.cr-contract-card {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.dark .cr-contract-card {
    background: #1e1b4b;
    border-color: #4338ca;
}
.cr-contract-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.cr-contract-plan {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #4338ca;
    min-width: 0;
}
.dark .cr-contract-plan { color: #a5b4fc; }
.cr-contract-plan span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-contract-validity { font-weight: 400; color: #6b7280; font-size: 11px; }
.dark .cr-contract-validity { color: #9ca3af; }

.cr-sessions-counter {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-shrink: 0;
}
.cr-sessions-remaining {
    font-size: 15px;
    font-weight: 700;
    color: #4f46e5;
}
.dark .cr-sessions-remaining { color: #818cf8; }
.cr-sessions-remaining.cr-sessions-low { color: #ef4444; }
.dark .cr-sessions-remaining.cr-sessions-low { color: #fca5a5; }
.cr-sessions-total {
    font-size: 11px;
    color: #9ca3af;
}

.cr-progress-bar-bg {
    height: 6px;
    background: rgba(0,0,0,.08);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 4px;
}
.dark .cr-progress-bar-bg { background: rgba(255,255,255,.1); }
.cr-progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width .4s ease;
}
.cr-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.cr-recent-sessions { margin-top: 10px; }
.cr-recent-title {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 6px;
}
.dark .cr-recent-title { color: #9ca3af; }
.cr-recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cr-recent-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
}
.dark .cr-recent-item {
    background: rgba(255,255,255,.05);
    border-color: #3730a3;
}
.cr-recent-date { font-weight: 500; color: #374151; }
.dark .cr-recent-date { color: #e5e7eb; }
.cr-recent-time { color: #9ca3af; font-family: monospace; font-size: 10px; }

/* ── Sem contrato ────────────────────────────────── */
.cr-no-contract {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 16px;
}
.dark .cr-no-contract {
    background: #422006;
    border-color: #78350f;
    color: #fcd34d;
}

/* ── Card resumo IA do paciente ──────────────────── */
.cr-ai-summary-card {
    border-radius: 10px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.dark .cr-ai-summary-card {
    background: #1e1b4b30;
    border-color: #3730a380;
}
.cr-ai-summary-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #4f46e5;
    margin-bottom: 8px;
}
.dark .cr-ai-summary-header { color: #a5b4fc; }
.cr-ai-summary-text {
    font-size: 13px;
    line-height: 1.65;
    color: #374151;
    margin: 0;
}
.dark .cr-ai-summary-text { color: #d1d5db; }
