/* ============================================================
   FisioSaaS – Estilos Personalizados
   ============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #0f1924;
    --sidebar-text: #b0bec5;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: rgba(13, 110, 253, .25);
    --sidebar-hover-bg: rgba(255,255,255,.07);
    --brand-color: #0d6efd;
    --body-bg: #f0f2f5;
    --topbar-h: 0px;
}

/* ── Base ─────────────────────────────────────────────────── */
body {
    background: var(--body-bg);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: .9rem;
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0; left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: transform .28s ease;
    padding-bottom: 1rem;
}

.sidebar-brand {
    padding: 1.2rem 1.2rem 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: .5rem 1.2rem;
    border-radius: 6px;
    margin: 1px 8px;
    display: flex;
    align-items: center;
    gap: .55rem;
    transition: background .18s, color .18s;
    white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    font-weight: 600;
}

.nav-section {
    padding: .8rem 1.2rem .2rem;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
}

.sidebar-footer {
    padding: 1rem 1.1rem .5rem;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: auto;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-color);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 1.8rem;
    flex: 1;
    min-width: 0;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    background: #fff;
    border-radius: 10px;
    padding: .5rem 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

.stat-card {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card .stat-icon {
    font-size: 2.2rem;
    opacity: .7;
}

.stat-card .stat-number {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .8rem;
    opacity: .85;
}

/* ── Tabelas ──────────────────────────────────────────────── */
.table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    font-weight: 600;
    border-top: none;
}

.table-hover tbody tr:hover {
    background: #f8f9ff;
}

/* ── Formulários ──────────────────────────────────────────── */
.form-label {
    font-weight: 500;
    margin-bottom: .3rem;
    font-size: .85rem;
}

.form-section-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--brand-color);
    border-left: 3px solid var(--brand-color);
    padding-left: .6rem;
    margin: 1.5rem 0 .8rem;
}

.form-control, .form-select {
    font-size: .88rem;
}

/* ── Abas do prontuário ───────────────────────────────────── */
.nav-tabs .nav-link {
    font-size: .82rem;
    color: #6c757d;
}

.nav-tabs .nav-link.active {
    font-weight: 600;
    color: var(--brand-color);
}

/* ── Tabela dinâmica de medicamentos / força muscular ─────── */
.dynamic-table th, .dynamic-table td {
    vertical-align: middle;
    padding: .35rem .5rem;
    font-size: .82rem;
}

.dynamic-table .form-control, .dynamic-table .form-select {
    padding: .2rem .4rem;
    font-size: .82rem;
}

.btn-remove-row {
    padding: 0 .35rem;
    line-height: 1.4;
}

/* ── Checkboxes posturais ─────────────────────────────────── */
.postural-group {
    column-count: 2;
    column-gap: 1rem;
}
@media (max-width: 576px) {
    .postural-group { column-count: 1; }
}

.postural-group .form-check {
    break-inside: avoid;
    margin-bottom: .25rem;
}

/* ── Escala de gravidade ──────────────────────────────────── */
.severity-slider { width: 100%; }

/* ── Badge de status ──────────────────────────────────────── */
.badge-ativo   { background: #d1fae5; color: #065f46; }
.badge-inativo { background: #fee2e2; color: #991b1b; }

/* ── Galeria de vídeos ────────────────────────────────────── */
.video-card iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 8px 8px 0 0;
}

/* ── Área de impressão do documento ──────────────────────── */
@media print {
    .sidebar, .topbar, .no-print, .btn, nav[aria-label="breadcrumb"] {
        display: none !important;
    }
    .main-content {
        margin: 0;
        padding: 0;
    }
    .print-doc {
        font-family: 'Times New Roman', serif;
        font-size: 12pt;
        color: #000;
        max-width: 18cm;
        margin: 0 auto;
    }
    .print-doc .assinatura-box {
        margin-top: 3cm;
        border-top: 1px solid #000;
        padding-top: .5cm;
        width: 8cm;
    }
}

/* ── Responsividade ───────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

/* ── Utilitários ──────────────────────────────────────────── */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

.border-dashed {
    border-style: dashed !important;
}
