/* ==========================================================
   FISIO BEAT — Hoja de estilos (Blanco y Azul marino)
   ========================================================== */
:root {
    --fb-navy: #0b2545;
    --fb-navy-2: #13315c;
    --fb-navy-3: #1e4976;
    --fb-blue: #3a6ea5;
    --fb-sky: #e8eff7;
    --fb-white: #ffffff;
    --fb-bg: #f5f7fb;
    --fb-text: #1b2a3d;
    --fb-muted: #6b7a8f;
    --fb-border: #dfe6ef;
    --fb-wa: #25d366;
    --fb-radius: 14px;
    --bs-primary: #13315c;
    --bs-primary-rgb: 19, 49, 92;
    --bs-link-color: #13315c;
    --bs-link-hover-color: #0b2545;
    --bs-link-color-rgb: 19, 49, 92;
    --bs-link-hover-color-rgb: 11, 37, 69;
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--fb-bg);
    color: var(--fb-text);
    font-size: .93rem;
}

h1, h2, h3, h4, h5, .fw-title { font-weight: 700; color: var(--fb-navy); letter-spacing: -.01em; }

a { text-decoration: none; }

/* ---------- Layout ---------- */
.fb-sidebar {
    position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 1040;
    background: var(--fb-navy);
    background-image: linear-gradient(180deg, var(--fb-navy) 0%, var(--fb-navy-2) 100%);
    color: #fff; display: flex; flex-direction: column;
    transition: transform .25s ease;
}
.fb-brand { padding: 1.4rem 1.25rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.fb-brand .tag { font-size: .66rem; letter-spacing: .14em; color: #a9bdd6; text-transform: uppercase; margin-top: .35rem; }
.fb-nav { padding: 1rem .75rem; flex: 1; overflow-y: auto; }
.fb-nav .label { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #7f98b8; padding: .9rem .75rem .35rem; }
.fb-nav a {
    display: flex; align-items: center; gap: .75rem; color: #d7e2f0; padding: .62rem .8rem;
    border-radius: 10px; font-weight: 500; margin-bottom: 2px;
}
.fb-nav a i { font-size: 1.1rem; width: 1.2rem; text-align: center; }
.fb-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.fb-nav a.active { background: #fff; color: var(--fb-navy); font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.fb-sidebar-foot { padding: 1rem 1.25rem; font-size: .75rem; color: #a9bdd6; border-top: 1px solid rgba(255,255,255,.08); }
.fb-sidebar-foot a { color: #fff; font-weight: 600; }

.fb-main { margin-left: 250px; min-height: 100vh; display: flex; flex-direction: column; }
.fb-topbar {
    background: #fff; border-bottom: 1px solid var(--fb-border); padding: .85rem 1.75rem;
    display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1030;
}
.fb-topbar .page-title { font-size: 1.15rem; font-weight: 700; color: var(--fb-navy); margin: 0; }
.fb-content { padding: 1.75rem; flex: 1; }
.fb-footer { padding: 1rem 1.75rem; font-size: .78rem; color: var(--fb-muted); border-top: 1px solid var(--fb-border); background: #fff; }

.fb-topbar .fb-toggle { display: none; }

@media (max-width: 991.98px) {
    .fb-sidebar { transform: translateX(-100%); }
    .fb-sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .fb-main { margin-left: 0; }
    .fb-topbar .fb-toggle { display: inline-flex; }
    .fb-content { padding: 1rem; }
    .fb-topbar { padding: .75rem 1rem; }
}

/* ---------- Componentes ---------- */
.card { border: 1px solid var(--fb-border); border-radius: var(--fb-radius); box-shadow: 0 2px 10px rgba(11,37,69,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--fb-border); font-weight: 600; color: var(--fb-navy); padding: .9rem 1.2rem; border-radius: var(--fb-radius) var(--fb-radius) 0 0 !important; }
.card-body { padding: 1.2rem; }

.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { background: var(--fb-navy-2); border-color: var(--fb-navy-2); }
.btn-primary:hover, .btn-primary:focus { background: var(--fb-navy); border-color: var(--fb-navy); }
.btn-outline-primary { color: var(--fb-navy-2); border-color: var(--fb-navy-2); }
.btn-outline-primary:hover { background: var(--fb-navy-2); border-color: var(--fb-navy-2); color: #fff; }
.btn-wa { background: var(--fb-wa); color: #fff; border-color: var(--fb-wa); }
.btn-wa:hover { background: #1ebe5b; color: #fff; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

.text-navy { color: var(--fb-navy) !important; }
.bg-navy { background: var(--fb-navy) !important; color: #fff; }
.bg-sky { background: var(--fb-sky) !important; }
.text-muted { color: var(--fb-muted) !important; }

.form-control, .form-select { border-radius: 10px; border-color: var(--fb-border); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--fb-blue); box-shadow: 0 0 0 .2rem rgba(58,110,165,.15); }
.form-label { font-weight: 600; font-size: .8rem; color: var(--fb-navy-2); margin-bottom: .3rem; }
.form-section { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fb-blue); font-weight: 700; margin: 1.4rem 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--fb-sky); }
.form-section:first-child { margin-top: 0; }

.table { --bs-table-hover-bg: #f2f6fb; margin-bottom: 0; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fb-muted); font-weight: 600; border-bottom-width: 1px; background: #fafcfe; white-space: nowrap; }
.table td { vertical-align: middle; }

.stat-card { padding: 1.2rem 1.3rem; display: flex; flex-direction: row; align-items: center; gap: 1rem; height: 100%; }
.stat-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--fb-sky); color: var(--fb-navy-2); flex-shrink: 0; }
.stat-card.dark { background: var(--fb-navy); color: #fff; border-color: var(--fb-navy); }
.stat-card.dark .stat-icon { background: rgba(255,255,255,.12); color: #fff; }
.stat-card.dark .stat-label { color: #a9bdd6; }
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .75rem; color: var(--fb-muted); text-transform: uppercase; letter-spacing: .06em; }

.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--fb-sky); color: var(--fb-navy-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; background: var(--fb-navy); color: #fff; }

.badge-estado { font-weight: 600; font-size: .72rem; padding: .38em .7em; border-radius: 20px; color: #fff; }
.chip { display: inline-block; padding: .25rem .65rem; border-radius: 20px; background: var(--fb-sky); color: var(--fb-navy-2); font-size: .74rem; font-weight: 600; }

.hero {
    background: linear-gradient(120deg, var(--fb-navy) 0%, var(--fb-navy-3) 100%);
    color: #fff; border-radius: var(--fb-radius); padding: 1.5rem 1.75rem; position: relative; overflow: hidden;
}
.hero h2 { color: #fff; font-weight: 800; letter-spacing: .02em; }
.hero p { color: #c8d6e8; margin: 0; }
.hero .pulse { position: absolute; right: -10px; bottom: -6px; opacity: .14; width: 360px; }

.nav-tabs { border-bottom: 1px solid var(--fb-border); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.nav-tabs .nav-link { white-space: nowrap; }
.nav-tabs .nav-link { border: 0; color: var(--fb-muted); font-weight: 600; padding: .7rem 1rem; border-bottom: 3px solid transparent; }
.nav-tabs .nav-link.active { color: var(--fb-navy); border-bottom-color: var(--fb-navy); background: transparent; }

.dl-clinica dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fb-muted); font-weight: 600; }
.dl-clinica dd { margin-bottom: .9rem; white-space: pre-line; }

.timeline-item { border-left: 3px solid var(--fb-sky); padding: 0 0 1.2rem 1.1rem; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -8px; top: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--fb-navy-2); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--fb-navy-2); }

.eva { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; border-radius: 8px; font-weight: 700; font-size: .8rem; color: #fff; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--fb-muted); }
.empty i { font-size: 2.4rem; color: #c3cfdd; display: block; margin-bottom: .5rem; }

.alert { border-radius: 12px; border: 0; }
.alert-success { background: #e6f4ec; color: #1d6b43; }
.alert-warning { background: #fff5e0; color: #8a5a00; }
.alert-danger { background: #fdecec; color: #9b2c2c; }

.pagination { --bs-pagination-color: var(--fb-navy-2); --bs-pagination-active-bg: var(--fb-navy-2); --bs-pagination-active-border-color: var(--fb-navy-2); margin: 0; }

/* Controles en azul marino */
.btn-check:checked + .btn-outline-primary, .btn-outline-primary.active { background: var(--fb-navy-2); border-color: var(--fb-navy-2); color: #fff; }
.form-check-input:checked { background-color: var(--fb-navy-2); border-color: var(--fb-navy-2); }
.form-range::-webkit-slider-thumb { background: var(--fb-navy-2); }
.form-range::-moz-range-thumb { background: var(--fb-navy-2); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 .2rem rgba(19,49,92,.2); }
.progress-bar { background: var(--fb-navy-2); }

/* ---------- FullCalendar ---------- */
.fc { --fc-border-color: var(--fb-border); --fc-today-bg-color: #eef4fb; --fc-button-bg-color: var(--fb-navy-2); --fc-button-border-color: var(--fb-navy-2); --fc-button-hover-bg-color: var(--fb-navy); --fc-button-hover-border-color: var(--fb-navy); --fc-button-active-bg-color: var(--fb-navy); --fc-button-active-border-color: var(--fb-navy); }
.fc .fc-toolbar-title { font-size: 1.2rem; font-weight: 700; color: var(--fb-navy); text-transform: capitalize; }
.fc .fc-button { border-radius: 8px !important; font-size: .82rem; text-transform: capitalize; }
.fc .fc-col-header-cell-cushion { color: var(--fb-navy-2); font-weight: 600; text-transform: capitalize; }
.fc .fc-daygrid-day-number { color: var(--fb-navy-2); }
.fc-event { cursor: pointer; border-radius: 6px; font-size: .78rem; padding: 1px 3px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: linear-gradient(140deg, var(--fb-navy) 0%, var(--fb-navy-3) 100%); color: #fff; padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side h1 { color: #fff; font-weight: 800; font-size: 2.4rem; line-height: 1.15; }
.login-side p { color: #c8d6e8; font-size: 1.05rem; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.login-form .box { width: 100%; max-width: 380px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-side { padding: 2rem; } .login-side h1 { font-size: 1.7rem; } }

/* ---------- Impresión ---------- */
.print-only { display: none; }
@media print {
    .fb-sidebar, .fb-topbar, .fb-footer, .no-print, .btn, .alert { display: none !important; }
    .fb-main { margin: 0; }
    .fb-content { padding: 0; }
    .print-only { display: block; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    body { background: #fff; font-size: 11pt; }
    a { color: inherit; }
}
