/* =============================================================
   Solo Veterinário — Design System
   Visual clínico-profissional, mobile-first.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    --accent-color: #0d9488;
    --accent-color-dark: #0f766e;
    --accent-color-darker: #115e59;
    --accent-color-light: #ccfbf1;
    --accent-color-soft: #f0fdfa;

    --ink: #0f1b2b;
    --ink-soft: #1e293b;

    --danger-color: #dc2626;
    --danger-soft: #fef2f2;
    --warning-color: #d97706;
    --warning-soft: #fffbeb;
    --success-color: #16a34a;
    --success-soft: #f0fdf4;
    --info-color: #2563eb;
    --info-soft: #eff6ff;

    --bg-color: #f1f5f4;
    --surface: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --border-color: #e2e8f0;
    --border-soft: #eef2f1;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-card: 0 1px 2px rgba(15,27,43,0.04), 0 2px 8px rgba(15,27,43,0.06);
    --shadow-elevated: 0 8px 24px rgba(15,27,43,0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: 80px;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 800; }
h3 { font-size: 0.95rem; font-weight: 700; }
.mono, .valor-clinico { font-family: 'JetBrains Mono', 'Courier New', monospace; font-weight: 600; }

/* ---------- Header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, var(--ink) 0%, #16293e 100%);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(15,27,43,0.18);
}
.app-header .clinica-info { display: flex; align-items: center; gap: 10px; }
.app-header .clinica-icone {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-color-light);
    flex-shrink: 0;
}
.app-header .clinica-icone svg { width: 20px; height: 20px; }
.app-header h1 { font-size: 1rem; margin: 0; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.app-header .subtitulo { font-size: 0.74rem; color: rgba(255,255,255,0.6); margin-top: 1px; }
.app-header .badge-cargo {
    font-size: 0.65rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    background: rgba(204,251,241,0.15); color: var(--accent-color-light);
    text-transform: uppercase; letter-spacing: 0.03em;
}

.app-content { padding: 16px; max-width: 640px; margin: 0 auto; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.section-header h3 { margin: 0; text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }
.section-header a.ver-tudo { font-size: 0.8rem; font-weight: 700; color: var(--accent-color); }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 12px 20px; border-radius: var(--radius-md);
    font-weight: 700; font-size: 0.95rem; font-family: inherit; border: none; cursor: pointer;
    width: 100%; transition: transform 0.06s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent-color); color: #fff; box-shadow: 0 2px 8px rgba(13,148,136,0.28); }
.btn-primary:active { background: var(--accent-color-dark); }
.btn-outline { background: var(--surface); color: var(--accent-color); border: 1.5px solid var(--accent-color); }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-success { background: var(--success-color); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border-color); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 0.85rem; width: auto; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; color: var(--ink-soft); }
.form-hint { font-size: 0.74rem; color: var(--text-faint); margin-top: 4px; }
.form-control {
    width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color); font-size: 1rem; font-family: inherit;
    background: var(--surface); color: var(--text-color);
}
.form-control:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-color-light); }
textarea.form-control { min-height: 90px; resize: vertical; }
fieldset.clinico { border: 1.5px solid var(--border-soft); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; }
fieldset.clinico legend { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-color-dark); padding: 0 6px; }

details.secao-form { border: 1.5px solid var(--border-soft); border-radius: var(--radius-md); margin-bottom: 12px; overflow: hidden; }
details.secao-form summary {
    padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--accent-color-soft); color: var(--accent-color-darker); font-size: 0.88rem;
}
details.secao-form summary::-webkit-details-marker { display: none; }
details.secao-form summary::after { content: '+'; font-size: 1.2rem; font-weight: 400; }
details.secao-form[open] summary::after { content: '−'; }
details.secao-form .secao-body { padding: 14px; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px;
    box-shadow: var(--shadow-card); border: 1px solid var(--border-soft);
}
.card-list-item {
    display: flex; align-items: center; gap: 10px; background: var(--surface);
    border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 6px;
    box-shadow: var(--shadow-card); border: 1px solid var(--border-soft);
}
.avatar {
    width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
    background: var(--accent-color-light); color: var(--accent-color-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
    border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--accent-color-light);
}

.card-destaque { border-left: 4px solid var(--accent-color); }
.card-destaque.alerta { border-left-color: var(--danger-color); background: linear-gradient(90deg, var(--danger-soft) 0%, var(--surface) 14%); }
.card-destaque.atencao { border-left-color: var(--warning-color); background: linear-gradient(90deg, var(--warning-soft) 0%, var(--surface) 14%); }
.card-destaque.ok { border-left-color: var(--success-color); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.01em; }
.badge-teal { background: var(--accent-color-light); color: var(--accent-color-dark); }
.badge-green { background: var(--success-soft); color: #15803d; }
.badge-yellow { background: var(--warning-soft); color: #b45309; }
.badge-red { background: var(--danger-soft); color: #b91c1c; }
.badge-blue { background: var(--info-soft); color: #1d4ed8; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ---------- Bottom navigation ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: 64px;
    background: var(--surface); border-top: 1px solid var(--border-color);
    display: flex; z-index: 50; box-shadow: 0 -4px 16px rgba(15,27,43,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 0.66rem; font-weight: 600; color: var(--text-faint); position: relative;
}
.bottom-nav a.ativo { color: var(--accent-color); }
.bottom-nav a.ativo::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent-color);
}
.bottom-nav svg { width: 22px; height: 22px; stroke-width: 2; }

/* ---------- FAB ---------- */
.fab {
    position: fixed; bottom: 82px; right: 18px; width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent-color); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; box-shadow: 0 6px 18px rgba(13,148,136,0.45); z-index: 45;
}

/* ---------- Drawer "Mais" ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,27,43,0.5); z-index: 60; }
.drawer {
    position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
    border-radius: 22px 22px 0 0; padding: 8px 16px 28px; z-index: 61; box-shadow: var(--shadow-elevated);
}
.drawer .drawer-handle { width: 40px; height: 4px; background: var(--border-color); border-radius: 999px; margin: 10px auto 14px; }
.drawer a { display: flex; align-items: center; gap: 12px; padding: 13px 4px; font-weight: 600; font-size: 0.92rem; }
.drawer a:not(:last-child) { border-bottom: 1px solid var(--border-soft); }

/* ---------- Flash messages ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 0.86rem; font-weight: 600; border: 1px solid transparent; }
.flash-success { background: var(--success-soft); color: #15803d; border-color: #bbf7d0; }
.flash-error { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }

/* ---------- Grid de atalhos ---------- */
.grid-atalhos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.atalho { background: var(--surface); border-radius: var(--radius-lg); padding: 16px 10px; text-align: center; box-shadow: var(--shadow-card); border: 1px solid var(--border-soft); }
.atalho svg { width: 24px; height: 24px; color: var(--accent-color); margin-bottom: 6px; }
.atalho span { display: block; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }

/* ---------- Timeline ---------- */
.timeline-item { position: relative; padding-left: 22px; padding-bottom: 18px; border-left: 2px solid var(--border-color); margin-left: 6px; }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-color-light); }

/* ---------- Login/cadastro wrapper ---------- */
.auth-wrapper { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.auth-logo { text-align: center; margin-bottom: 24px; font-size: 1.3rem; font-weight: 800; color: var(--ink); }

/* ---------- Loading spinner (HTMX) ---------- */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.spinner {
    width: 18px; height: 18px; border: 2.5px solid var(--accent-color-light);
    border-top-color: var(--accent-color); border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================================
   Componentes clínicos (sinais vitais, ECC, mucosas)
   ============================================================= */
.vital-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.vital-item { background: var(--accent-color-soft); border: 1px solid var(--accent-color-light); border-radius: var(--radius-md); padding: 10px 12px; }
.vital-item .rotulo { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent-color-dark); }
.vital-item .valor { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin-top: 2px; }
.vital-item .unidade { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }

.ecc-scale { display: flex; gap: 4px; margin-top: 6px; }
.ecc-ponto { flex: 1; height: 8px; border-radius: 4px; background: var(--border-color); }
.ecc-ponto.preenchido { background: var(--accent-color); }
.ecc-ponto.ideal { background: var(--success-color); }

/* ---------- Mini calendário mensal (Agenda) ---------- */
.calendario { background: var(--surface); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-card); border: 1px solid var(--border-soft); margin-bottom: 16px; }
.calendario-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calendario-header .mes-titulo { font-weight: 800; font-size: 0.92rem; color: var(--ink); text-transform: capitalize; }
.calendario-header button { background: var(--accent-color-soft); border: none; width: 30px; height: 30px; border-radius: 8px; color: var(--accent-color-dark); font-weight: 800; font-size: 0.95rem; cursor: pointer; }
.calendario-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.calendario-grid .dow { font-size: 0.62rem; font-weight: 700; color: var(--text-faint); padding-bottom: 4px; text-transform: uppercase; }
.calendario-dia { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 9px; font-size: 0.78rem; font-weight: 600; color: var(--text-color); position: relative; cursor: pointer; border: 1.5px solid transparent; }
.calendario-dia.fora-mes { color: var(--text-faint); opacity: 0.4; }
.calendario-dia.hoje { border-color: var(--accent-color); font-weight: 800; }
.calendario-dia.selecionado { background: var(--accent-color); color: #fff; font-weight: 800; }
.calendario-dia .ponto-evento { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-color); margin-top: 2px; }
.calendario-dia.selecionado .ponto-evento { background: #fff; }
.calendario-dia.tem-evento:not(.selecionado) { background: var(--accent-color-soft); }

/* ---------- Faixa horizontal de pets (Dashboard) ---------- */
.pets-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.pets-scroll::-webkit-scrollbar { display: none; }
.pet-chip { flex-shrink: 0; text-align: center; width: 72px; }
.pet-chip img, .pet-chip .avatar { width: 60px; height: 60px; margin: 0 auto; }
.pet-chip .nome { display: block; font-size: 0.72rem; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-chip .especie-emoji { font-size: 0.66rem; color: var(--text-muted); }

/* ---------- Barra de distribuição por espécie (Dashboard) ---------- */
.especie-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.especie-bar-row .emoji { font-size: 1.1rem; width: 22px; text-align: center; }
.especie-bar-row .rotulo { font-size: 0.78rem; font-weight: 600; width: 46px; color: var(--text-muted); }
.especie-bar-track { flex: 1; height: 8px; background: var(--border-soft); border-radius: 999px; overflow: hidden; }
.especie-bar-fill { height: 100%; border-radius: 999px; background: var(--accent-color); }
.especie-bar-row .qtd { font-size: 0.78rem; font-weight: 800; color: var(--ink); width: 22px; text-align: right; }

table { width: 100%; }
img, video { max-width: 100%; }
[x-cloak] { display: none !important; }

/* =============================================================
   LAYOUT DESKTOP — módulos de loja (Estoque / Vendas / PDV)
   Sidebar profissional à direita + conteúdo à esquerda.
   ============================================================= */
.desktop-shell { display: flex; min-height: 100vh; background: var(--bg-color); }
.desktop-main { flex: 1; min-width: 0; padding-bottom: 40px; }
.desktop-topbar {
    background: var(--surface); border-bottom: 1px solid var(--border-color);
    padding: 16px 32px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30;
}
.desktop-topbar h1 { font-size: 1.25rem; margin: 0; }
.desktop-topbar .breadcrumb { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.desktop-content { padding: 28px 32px; max-width: 1280px; }

/* Sidebar à direita */
.desktop-sidebar {
    width: 264px; flex-shrink: 0;
    background: linear-gradient(180deg, var(--ink) 0%, #16293e 100%);
    color: #fff; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.desktop-sidebar .marca { display: flex; align-items: center; gap: 12px; padding: 24px 22px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.desktop-sidebar .marca img { width: 40px; height: 40px; }
.desktop-sidebar .marca .nome-clinica { font-weight: 800; font-size: 0.95rem; line-height: 1.2; }
.desktop-sidebar .marca .plano { font-size: 0.68rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.04em; }

.desktop-nav { padding: 8px 12px; flex: 1; }
.desktop-nav .grupo-titulo { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.35); padding: 10px 12px 4px; }
.desktop-nav a {
    display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 10px;
    color: rgba(255,255,255,0.75); font-size: 0.87rem; font-weight: 600; margin-bottom: 1px;
}
.desktop-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.desktop-nav a:hover, .desktop-nav a.ativo { background: rgba(255,255,255,0.1); color: #fff; }
.desktop-nav a.ativo { background: var(--accent-color); color: #fff; }
.desktop-nav a .contador { margin-left: auto; background: var(--danger-color); color: #fff; font-size: 0.65rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; }

.desktop-sidebar .rodape-usuario {
    padding: 16px 22px; border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px; font-size: 0.8rem;
}
.desktop-sidebar .rodape-usuario .avatar { width: 34px; height: 34px; font-size: 0.85rem; }
.desktop-sidebar .rodape-usuario a.sair { margin-left: auto; color: rgba(255,255,255,0.5); font-size: 0.72rem; }

/* Grid de cards estatísticos (dashboard desktop) */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-card); border: 1px solid var(--border-soft); }
.stat-card .topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-card .icone { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-color-soft); color: var(--accent-color-dark); }
.stat-card .icone svg { width: 20px; height: 20px; }
.stat-card .rotulo { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
.stat-card .valor { font-size: 1.6rem; font-weight: 800; color: var(--ink); margin-top: 2px; }
.stat-card .variacao { font-size: 0.74rem; font-weight: 700; margin-top: 4px; }
.stat-card .variacao.positiva { color: var(--success-color); }
.stat-card .variacao.negativa { color: var(--danger-color); }

.chart-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); border: 1px solid var(--border-soft); }
.chart-card h3 { margin: 0 0 14px; }

.desktop-grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

.guide-card { border: 1px solid var(--border-color, #e2e8f0); background: var(--card-bg, #fff); }
.guide-card.active { border-color: var(--accent-color, #0d9488); background: rgba(13, 148, 136, 0.04); }

/* Tabelas de dados (desktop) */
.tabela-dados { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.tabela-dados th {
    text-align: left; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted); font-weight: 700; padding: 6px 10px; background: var(--accent-color-soft);
    border-bottom: 1px solid var(--border-soft);
}
.tabela-dados td { padding: 5px 10px; font-size: 0.78rem; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.tabela-dados tbody tr:hover { background: var(--accent-color-soft); }
.tabela-dados tbody tr:last-child td { border-bottom: none; }
.tabela-dados tbody tr:nth-child(even) { background: #fafafa; }
.tabela-dados tbody tr:nth-child(even):hover { background: var(--accent-color-soft); }
.tabela-dados .cell-mono { font-family: 'Consolas', 'Courier New', monospace; font-size: 0.75rem; }
.tabela-dados .cell-right { text-align: right; }
.tabela-dados .cell-center { text-align: center; }
.tabela-dados a:not(.btn) { color: var(--accent-color); text-decoration: none; }
.tabela-dados a:not(.btn):hover { text-decoration: underline; }

.toolbar-desktop { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-desktop .busca { flex: 1; min-width: 240px; }
.btn-desktop { width: auto; padding: 10px 18px; }

/* PDV */
.pdv-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.pdv-produto-card {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
    border: 1px solid var(--border-soft); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer;
    background: var(--surface);
}
.pdv-produto-card:hover { border-color: var(--accent-color); background: var(--accent-color-soft); }
.pdv-produto-card .nome { font-weight: 700; font-size: 0.9rem; }
.pdv-produto-card .meta { font-size: 0.76rem; color: var(--text-muted); }
.pdv-produto-card .preco { font-weight: 800; color: var(--accent-color-dark); font-family: 'JetBrains Mono', monospace; }
.pdv-carrinho { background: var(--surface); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); border: 1px solid var(--border-soft); position: sticky; top: 90px; }
.pdv-item-carrinho { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.pdv-item-carrinho .nome { flex: 1; font-size: 0.85rem; font-weight: 600; }
.pdv-item-carrinho input[type="number"] { width: 56px; text-align: center; padding: 6px; border-radius: 6px; border: 1px solid var(--border-color); }
.pdv-item-carrinho .remover { color: var(--danger-color); font-size: 1.1rem; cursor: pointer; }
.pdv-total-linha { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.88rem; }
.pdv-total-linha.total { font-size: 1.25rem; font-weight: 800; color: var(--ink); border-top: 1.5px solid var(--border-color); margin-top: 8px; padding-top: 12px; }

/* ---------- Centro Cirúrgico ---------- */
.sala-card { transition: transform 0.15s; }
.sala-card:hover { transform: translateY(-2px); }

/* =============================================================
   RELATÓRIOS FINANCEIROS
   ============================================================= */
.report-filters {
    background: var(--surface); border-radius: var(--radius-lg); padding: 16px 20px;
    box-shadow: var(--shadow-card); border: 1px solid var(--border-soft); margin-bottom: 20px;
}
.report-filters-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.filter-input { min-height: 38px !important; padding: 6px 10px !important; font-size: 0.85rem !important; min-width: 150px; }
.filter-actions { display: flex; gap: 8px; align-items: center; }

.report-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.report-kpi {
    background: var(--surface); border-radius: var(--radius-lg); padding: 18px 20px;
    box-shadow: var(--shadow-card); border: 1px solid var(--border-soft);
    display: flex; align-items: flex-start; gap: 14px;
}
.report-kpi-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.report-kpi-icon svg { width: 22px; height: 22px; }
.report-kpi-dados { flex: 1; min-width: 0; }
.report-kpi-rotulo { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.report-kpi-valor { font-size: 1.4rem; font-weight: 800; color: var(--ink); margin-top: 2px; }
.report-kpi-sub { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.cronometro { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; font-weight: 700; color: var(--accent-color); }
.checklist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.checklist-grid label { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; padding: 6px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border-soft); cursor: pointer; }
.checklist-grid label:has(input:checked) { background: var(--accent-color-soft); border-color: var(--accent-color); }
.checklist-grid input[type="checkbox"] { width: 18px; height: 18px; }
.ficha-anestesica-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.timeline-cirurgia { border-left: 3px solid var(--accent-color); padding-left: 16px; margin-left: 8px; }
.timeline-cirurgia .evento { position: relative; margin-bottom: 12px; }
.timeline-cirurgia .evento::before { content: ''; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-color); }
.timeline-cirurgia .evento.concluido::before { background: var(--success-color); }
.timeline-cirurgia .evento.cancelado::before { background: var(--danger-color); }
.status-cirurgia { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

@media (max-width: 1000px) {
    .desktop-sidebar { display: none; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .report-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-grid, .pdv-layout, .desktop-grid-2 { grid-template-columns: 1fr; }
    .checklist-grid { grid-template-columns: 1fr; }
    .report-filters-form { flex-direction: column; align-items: stretch; }
    .filter-input { min-width: auto !important; }
}

/* ---- Módulo 09 — Bloco 1: Internação / Hospitalização ---- */
.kpi-internacao {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    padding: 10px 8px;
    text-align: center;
}
.kpi-internacao .valor { font-size: 1.35rem; font-weight: 800; }
.kpi-internacao .rotulo { font-size: 0.72rem; color: var(--text-muted); }

.internacao-layout { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .internacao-layout { grid-template-columns: 1fr; } }

/* ---- Painel de internação profissional ---- */
.int-header { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; margin-bottom:18px; flex-wrap:wrap; }
.int-header h2 { font-size:1.25rem; font-weight:800; color:var(--ink); margin:0; }
.int-header .sub { font-size:0.82rem; color:var(--text-muted); margin-top:2px; }

.int-kpis { display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; margin-bottom:20px; }
@media (max-width: 1100px) { .int-kpis { grid-template-columns:repeat(2, 1fr); } }

.kpi-internacao {
    position:relative; overflow:hidden;
    background:var(--surface);
    border:1px solid var(--border-color);
    border-radius:var(--radius-md, 12px);
    padding:14px 16px 12px 18px;
    text-align:left;
}
.kpi-internacao::before {
    content:''; position:absolute; left:0; top:0; bottom:0; width:4px;
    background:var(--kpi-accent, var(--accent-color));
}
.kpi-internacao .rotulo {
    font-size:0.66rem; font-weight:700; color:var(--text-muted);
    text-transform:uppercase; letter-spacing:0.06em;
}
.kpi-internacao .valor { font-size:1.9rem; font-weight:800; line-height:1.15; margin-top:2px; color:var(--ink); }
.kpi-sub { font-size:0.7rem; color:var(--text-muted); margin-top:2px; }
.kpi-barra { height:6px; background:var(--border-soft); border-radius:3px; margin-top:8px; overflow:hidden; }
.kpi-barra > span { display:block; height:100%; border-radius:3px; background:var(--kpi-accent, var(--accent-color)); }

.int-section-title {
    display:flex; align-items:center; gap:8px;
    font-size:0.95rem; font-weight:700; color:var(--ink);
    margin:22px 0 10px;
}
.int-section-title .chip {
    font-size:0.68rem; font-weight:700; color:var(--accent-color);
    background:rgba(13,148,136,0.08); border:1px solid rgba(13,148,136,0.15);
    padding:1px 8px; border-radius:10px;
}

.leito-chip {
    display:inline-block; min-width:52px; text-align:center;
    font-size:0.72rem; font-weight:700;
    background:var(--bg-secondary, #f1f5f9); border:1px solid var(--border-soft);
    border-radius:6px; padding:2px 8px; color:var(--ink);
}
.dia-chip {
    display:inline-block; font-size:0.68rem; font-weight:600;
    color:var(--text-muted); background:var(--bg-secondary, #f1f5f9);
    border-radius:10px; padding:1px 8px;
}
.int-vazia { text-align:center; padding:34px 16px; color:var(--text-muted); }
.int-vazia .icone { font-size:2rem; margin-bottom:6px; }
