/* =====================================================================
   Tema "calma" (versión compacta): fondo gris azulado suave, tarjetas blancas
   redondeadas, acento teal. Colores de marca desde configuracion_negocio:
   --brand / --brand-rgb / --brand-dark (inyectadas en el <head>).
   ===================================================================== */

@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('../vendor/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('../vendor/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-link-hover-color-rgb: var(--brand-rgb);
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-font-size: .875rem;
    --bs-body-color: #2b3744;
    --bs-border-color: #e3e9f0;
    --bs-border-radius: .55rem;
    --bs-border-radius-lg: .8rem;

    --app-bg: #f1f4f8;
    --card-border: #e6ebf1;
    --muted-bg: #f5f7fa;
    --brand-soft: rgba(var(--brand-rgb), .10);
    --brand-soft-2: rgba(var(--brand-rgb), .18);
    --sidebar-w: 232px;
    --ctl-h: 36px;                      /* alto de botones e inputs */
}
@media (pointer: coarse) { :root { --ctl-h: 42px; } }   /* táctil: objetivos más cómodos */

body { background: var(--app-bg); -webkit-text-size-adjust: 100%; letter-spacing: -.003em; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.012em; }
h1, .h1 { font-size: 1.5rem; } h2, .h2 { font-size: 1.3rem; } h3, .h3 { font-size: 1.15rem; }
h4, .h4 { font-size: 1.05rem; } h5, .h5 { font-size: .98rem; } h6, .h6 { font-size: .9rem; }
.text-muted { color: #7a8794 !important; }
.small, small { font-size: .8rem; }

/* ---------- Botones ---------- */
.btn { border-radius: .55rem; font-weight: 500; min-height: var(--ctl-h); padding: .35rem .9rem; font-size: .875rem; }
.btn-sm { min-height: 30px; padding: .2rem .6rem; font-size: .8rem; border-radius: .5rem; }
.btn-lg { min-height: calc(var(--ctl-h) + 6px); padding: .45rem 1.1rem; font-size: .95rem; border-radius: .65rem; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: rgba(var(--brand-rgb), .45);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.btn-outline-secondary { --bs-btn-color: #5b6877; --bs-btn-border-color: #d6dde6; --bs-btn-hover-bg: #eef2f6; --bs-btn-hover-color: #2b3744; --bs-btn-hover-border-color: #d6dde6; }
.text-bg-primary, .bg-primary { background-color: var(--brand) !important; }
.text-primary { color: var(--brand) !important; }

/* ---------- Formularios ---------- */
.form-control, .form-select { min-height: var(--ctl-h); padding: .3rem .7rem; font-size: .875rem; border-color: #dce3eb; border-radius: .55rem; background-color: #fff; }
.form-control-color { padding: .2rem; width: 3rem; }
.form-label { font-weight: 500; font-size: .8rem; color: #4a5766; margin-bottom: .2rem; }
.form-text { font-size: .75rem; margin-top: .2rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: rgba(var(--brand-rgb), .65);
    box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .15);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-group-text { background: var(--muted-bg); border-color: #dce3eb; color: #7a8794; padding: .3rem .7rem; }
.g-3 { --bs-gutter-x: 1rem; --bs-gutter-y: .8rem; }

/* ---------- Tarjetas ---------- */
.card { border: 1px solid var(--card-border); border-radius: .9rem; box-shadow: 0 1px 6px rgba(30, 50, 80, .04); background: #fff; }
.card-header { background: transparent; font-weight: 600; font-size: .9rem; border-bottom: 1px solid #eef1f5; padding: .65rem 1rem; }
.card-header i { color: var(--brand); }
.card-body { padding: 1rem; }
.card-footer { border-top: 1px solid #eef1f5; padding: .65rem 1rem; }

.stat-card .card-body { padding: .85rem 1rem; gap: .8rem !important; }
.stat-card .stat-icon {
    width: 40px; height: 40px; border-radius: .75rem; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-size: 1.05rem; flex: none;
}
.stat-card .h4, .stat-card .h5 { font-size: 1.15rem; line-height: 1.2; }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; font-size: .85rem; }
.table > :not(caption) > * > * { padding: .55rem .85rem; border-bottom-color: #eef1f5; }
.table thead th { background: var(--muted-bg) !important; color: #6a7684; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; border-bottom: 0; padding-top: .5rem; padding-bottom: .5rem; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(var(--brand-rgb), .045); }
.card > .table-responsive:last-child .table tbody tr:last-child > * { border-bottom: 0; }

.badge { font-weight: 500; font-size: .72rem; border-radius: .4rem; padding: .3em .55em; }
.alert { border: 0; border-radius: .7rem; padding: .6rem .9rem; font-size: .85rem; }

/* ---------- Layout: menú lateral claro ---------- */
.app-sidebar {
    background: #fff; color: #4a5868; --bs-offcanvas-width: var(--sidebar-w);
    --bs-offcanvas-bg: #fff; border-right: 1px solid var(--card-border);
}
.app-sidebar .offcanvas-header { border-bottom: 1px solid #eef1f5; padding: .75rem 1rem; }

@media (min-width: 992px) {
    .app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1020; overflow-y: auto; }
    .app-main { margin-left: var(--sidebar-w); }
}

.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: .95rem 1rem .8rem; color: #26323f; }
.sidebar-logo { width: 38px; height: 38px; object-fit: contain; background: #fff; border: 1px solid var(--card-border); border-radius: .7rem; padding: 3px; flex: none; }
.sidebar-logo-ph {
    width: 38px; height: 38px; border-radius: .7rem; display: grid; place-items: center; flex: none;
    background: var(--brand-soft); color: var(--brand); font-size: 1rem;
}
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sidebar-brand-text strong { font-size: .82rem; font-weight: 600; }
.sidebar-brand-text small { color: #7a8794; font-size: .7rem; }

.sidebar-nav { padding: .35rem .65rem; gap: .1rem; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .65rem; color: #566475;
    padding: .5rem .75rem; border-radius: .6rem; font-size: .85rem; font-weight: 500;
}
.sidebar-nav .nav-link i { color: #8a97a5; transition: color .15s; font-size: .9rem; }
.sidebar-nav .nav-link:hover { background: var(--muted-bg); color: #26323f; }
.sidebar-nav .nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sidebar-nav .nav-link.active i { color: var(--brand); }
.sidebar-nav .nav-link.disabled { opacity: .5; cursor: not-allowed; }
.sidebar-nav .badge { font-size: .58rem; background: #eef1f5 !important; color: #7a8794 !important; }
@media (pointer: coarse) { .sidebar-nav .nav-link { padding: .65rem .8rem; } }
.sidebar-footer { padding: .7rem 1rem; color: #a0abb7; font-size: .72rem; border-top: 1px solid #eef1f5; }

.app-topbar {
    position: sticky; top: 0; z-index: 1010; display: flex; align-items: center; gap: .6rem;
    padding: .45rem .85rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--card-border); min-height: 52px;
}
.app-topbar h1 { font-size: 1rem; }
.app-content { padding: .85rem; }
@media (min-width: 992px) { .app-content { padding: 1.15rem 1.5rem; } .app-topbar { padding: .5rem 1.5rem; } }
.app-topbar .btn-light { background: #fff; border-color: var(--card-border) !important; padding: .2rem .6rem; }

.avatar {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--brand-soft-2); color: var(--brand-dark); font-size: .7rem; font-weight: 600;
}
.dropdown-menu { border: 1px solid var(--card-border); border-radius: .75rem; padding: .3rem; font-size: .85rem; }
.dropdown-item { border-radius: .5rem; padding: .45rem .7rem; }

/* ---------- Portada (hero) ---------- */
.hero { position: relative; margin-bottom: 2.6rem; min-height: 120px; }
.hero-bg {
    position: absolute; inset: 0; border-radius: 1rem; overflow: hidden; border: 1px solid var(--card-border);
    background-size: cover; background-position: center; background-color: #fff;
    background-image: linear-gradient(135deg, rgba(var(--brand-rgb), .10), rgba(var(--brand-rgb), .32));
}
.hero-bg::before, .hero-bg::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.35); pointer-events: none; }
.hero-bg::before { width: 170px; height: 170px; right: -50px; top: -65px; }
.hero-bg::after  { width: 90px; height: 90px; right: 110px; bottom: -40px; background: rgba(var(--brand-rgb), .10); }
.hero-bg.has-image::before, .hero-bg.has-image::after { display: none; }
.hero-inner { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: .9rem; padding: 1rem; min-height: 120px; }
.hero-logo {
    width: 84px; height: 84px; flex: none; margin-bottom: -1.6rem; background: #fff; border-radius: 1rem;
    display: grid; place-items: center; box-shadow: 0 4px 14px rgba(30, 50, 80, .13); padding: 6px; font-size: 1.8rem; color: var(--brand);
}
.hero-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: .7rem; }
.hero-text { margin-bottom: -2.1rem; min-width: 0; }
.hero-text h2 { font-size: 1.1rem; margin: 0; }
@media (max-width: 575.98px) {
    .hero { min-height: 100px; margin-bottom: 2.3rem; }
    .hero-inner { min-height: 100px; }
    .hero-logo { width: 68px; height: 68px; font-size: 1.4rem; margin-bottom: -1.3rem; }
    .hero-text { margin-bottom: -1.9rem; }
    .hero-text h2 { font-size: 1rem; }
}

/* ---------- Login ---------- */
.auth-body { background: var(--app-bg); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-shell {
    width: 100%; max-width: 800px; display: grid; grid-template-columns: 1fr; overflow: hidden;
    background: #fff; border: 1px solid var(--card-border); border-radius: 1.25rem;
    box-shadow: 0 14px 40px rgba(30, 50, 80, .08);
}
.auth-visual {
    position: relative; min-height: 130px; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.1rem;
    background-size: cover; background-position: center;
    background-image: linear-gradient(150deg, rgba(var(--brand-rgb), .16), rgba(var(--brand-rgb), .55));
    color: #fff; overflow: hidden;
}
.auth-visual::before, .auth-visual::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-visual::before { width: 240px; height: 240px; right: -90px; top: -90px; background: rgba(255,255,255,.18); }
.auth-visual::after  { width: 140px; height: 140px; left: -50px; bottom: -55px; background: rgba(255,255,255,.14); }
.auth-visual.has-image::before, .auth-visual.has-image::after { display: none; }
/* Con foto: encuadre hacia la derecha/centro vertical, donde suele estar el sujeto de la imagen */
.hero-bg.has-image, .auth-visual.has-image { background-position: 72% 62%; }
.auth-visual.has-image .auth-visual-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 30, 35, 0) 35%, rgba(10, 30, 35, .62)); }
.auth-visual > * { position: relative; z-index: 1; }
.auth-logo-card {
    width: 62px; height: 62px; background: #fff; border-radius: .95rem; display: grid; place-items: center;
    padding: 5px; margin-bottom: .75rem; color: var(--brand); font-size: 1.4rem; box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.auth-logo-card img { width: 100%; height: 100%; object-fit: contain; border-radius: .65rem; }
.auth-visual h2 { font-size: 1.1rem; margin: 0 0 .1rem; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.18); }
.auth-visual p { margin: 0; opacity: .92; font-size: .82rem; }
.auth-form { padding: 1.4rem 1.25rem 1.6rem; display: flex; flex-direction: column; justify-content: center; }
.auth-form .auth-inner { width: 100%; max-width: 330px; margin: 0 auto; }
@media (min-width: 768px) {
    .auth-shell { grid-template-columns: 1fr 1fr; min-height: 420px; }
    .auth-visual { padding: 1.6rem; min-height: 0; }
    .auth-form { padding: 1.75rem; }
}

/* ---------- Varios ---------- */
.logo-preview { max-height: 70px; max-width: 100%; object-fit: contain; background: #fff; border: 1px dashed #ced4da; border-radius: .65rem; padding: 5px; }
.banner-preview { width: 100%; max-height: 110px; object-fit: cover; border-radius: .65rem; border: 1px solid var(--card-border); }
[x-cloak] { display: none !important; }

/* ---------- Impresión (fichas, comprobantes) ---------- */
@media print {
    .app-sidebar, .app-topbar, .no-print, .alert { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---------- Pesta�as compactas ---------- */
.tabs-compact { border-bottom: 1px solid var(--card-border); flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; }
.tabs-compact::-webkit-scrollbar { display: none; }
.tabs-compact .nav-link { color: #6a7684; font-weight: 500; font-size: .85rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .55rem .9rem; background: none; }
.tabs-compact .nav-link:hover { color: #26323f; }
.tabs-compact .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: none; }
.tabs-compact .badge { font-size: .65rem; }

/* ---------- Datos clave/valor ---------- */
.kv-list { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .4rem .8rem; margin: 0; font-size: .85rem; }
.kv-list dt { color: #7a8794; font-weight: 500; }
.kv-list dd { margin: 0; word-break: break-word; }
/* Variante con renglones (una línea divisoria por fila, como las listas de las otras tarjetas) */
.kv-list.kv-lines { gap: 0; font-size: .875rem; }
.kv-list.kv-lines dt,
.kv-list.kv-lines dd { padding: .3rem 0; border-bottom: 1px solid var(--bs-border-color, #dee2e6); }
.kv-list.kv-lines dt { padding-right: .8rem; }
.avatar-lg { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft-2); color: var(--brand-dark); font-weight: 600; font-size: 1.05rem; }
.risk-strip { background: #fff7f0; border: 1px solid #fde1c8; border-radius: .7rem; padding: .5rem .8rem; }

/* ---------- Galer�a y visor ---------- */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.gal-item { position: relative; margin: 0; border-radius: .7rem; overflow: hidden; background: #eef1f5; border: 2px solid transparent; }
.gal-item.sel { border-color: var(--brand); }
.gal-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; }
.gal-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: .9rem .4rem .25rem; font-size: .68rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); pointer-events: none; }
.gal-tag { position: absolute; top: 6px; left: 6px; font-size: .64rem; font-weight: 600; padding: .15rem .45rem; border-radius: .4rem; color: #fff; background: #6c757d; }
.tag-antes { background: #d9822b; } .tag-despues { background: #2e8b57; }
.gal-check { position: absolute; top: 5px; right: 5px; background: rgba(255,255,255,.92); border-radius: .4rem; padding: 2px 5px; line-height: 1; cursor: pointer; }
.gal-check input { cursor: pointer; width: 1rem; height: 1rem; accent-color: var(--brand); }

body.gv-lock { overflow: hidden; }
.gv { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 20, 25, .93); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem .75rem 1rem; color: #fff; }
.gv > img { max-width: 100%; max-height: calc(100vh - 9rem); object-fit: contain; border-radius: .5rem; }
.gv-close { position: absolute; top: .6rem; right: .8rem; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; line-height: 1; }
.gv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 56px; border: 0; border-radius: .6rem; background: rgba(255,255,255,.14); color: #fff; font-size: 1.8rem; line-height: 1; }
.gv-prev { left: .5rem; } .gv-next { right: .5rem; }
.gv-caption { margin-top: .6rem; text-align: center; font-size: .82rem; max-width: 640px; }
.gv-caption a { color: #bfe6ea; }
.gv-bar { position: absolute; top: .6rem; left: .8rem; display: flex; gap: .4rem; }
.gv-bar .btn { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255,255,255,.35); --bs-btn-hover-bg: rgba(255,255,255,.18); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--brand); --bs-btn-active-color: #fff; }

.cmp-wrap { width: 100%; max-width: 920px; }
.cmp-box { position: relative; width: 100%; height: calc(100vh - 11rem); min-height: 240px; background: #000; border-radius: .6rem; overflow: hidden; user-select: none; }
.cmp-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cmp-box .cmp-a { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.6); transform: translateX(-1px); pointer-events: none; }
.cmp-label { position: absolute; top: .5rem; font-size: .72rem; font-weight: 600; padding: .2rem .5rem; border-radius: .4rem; background: rgba(0,0,0,.6); }
.cmp-label.l { left: .5rem; } .cmp-label.r { right: .5rem; }
.cmp-side { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; max-width: 1100px; }
.cmp-side figure { margin: 0; position: relative; }
.cmp-side img { width: 100%; height: calc(100vh - 11rem); min-height: 200px; object-fit: contain; background: #000; border-radius: .6rem; }
.cmp-side figcaption { text-align: center; font-size: .75rem; margin-top: .3rem; }
@media (max-width: 575.98px) { .cmp-side { grid-template-columns: 1fr; } .cmp-side img { height: 34vh; } }


/* =====================================================================
   Agenda de turnos
   ===================================================================== */
.min-w-0 { min-width: 0; }
.est-pendiente  { --ev: #e0a100; --ev-bg: #fff7de; }
.est-confirmado { --ev: var(--brand); --ev-bg: rgba(var(--brand-rgb), .12); }
.est-en_atencion { --ev: #2b8fd6; --ev-bg: #e5f2fc; }
.est-finalizado { --ev: #3f9d6b; --ev-bg: #e6f5ec; }
.est-cancelado  { --ev: #9aa5b1; --ev-bg: #f1f3f6; }

.ag-title { font-size: 1rem; font-weight: 600; min-width: 140px; }
.ag-legend { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .72rem; color: #7a8794; }
.ag-legend-item i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--ev); margin-right: .3rem; }

/* --- Mes --- */
.mes-head, .mes-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mes-head > div { padding: .45rem .4rem; font-size: .72rem; font-weight: 600; color: #7a8794; text-align: center; border-bottom: 1px solid #eef1f5; }
.mes-cell { position: relative; min-height: 104px; padding: .25rem .3rem; border-right: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; display: flex; flex-direction: column; gap: 2px; }
.mes-cell:nth-child(7n) { border-right: 0; }
.mes-cell.otro { background: #fafbfc; }
.mes-cell.otro .mes-num { color: #b3bcc6; }
.mes-cell.hoy { background: rgba(var(--brand-rgb), .06); }
.mes-num { font-size: .78rem; font-weight: 600; color: #46525f; text-decoration: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.mes-cell.hoy .mes-num { background: var(--brand); color: #fff; }
.mes-add { opacity: 0; color: var(--brand); font-size: .7rem; padding: 2px 4px; text-decoration: none; transition: opacity .12s; }
.mes-cell:hover .mes-add, .mes-add:focus { opacity: 1; }
.mes-chip { display: block; font-size: .7rem; line-height: 1.25; padding: 1px 5px; border-radius: .3rem; border-left: 3px solid var(--ev); background: var(--ev-bg); color: #2b3744; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mes-chip:hover { filter: brightness(.96); }
.est-cancelado.mes-chip { text-decoration: line-through; color: #8a95a1; }
.mes-mas { font-size: .68rem; color: var(--brand-dark); text-decoration: none; padding-left: 4px; }
.mes-count { display: none; }
@media (max-width: 767.98px) {
    .mes-cell { min-height: 54px; align-items: center; }
    .mes-chip, .mes-mas, .mes-add { display: none; }
    .mes-count { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--brand-soft-2); color: var(--brand-dark); font-size: .7rem; font-weight: 600; text-decoration: none; }
}

/* --- Semana (grilla horaria) --- */
.tg-scroll { overflow-x: auto; }
.tg { min-width: 760px; --ppm: 1.15; }
.tg-head, .tg-body { display: grid; grid-template-columns: 48px repeat(7, minmax(0, 1fr)); }
.tg-head { border-bottom: 1px solid #e3e9f0; position: sticky; top: 0; background: #fff; z-index: 3; border-radius: .9rem .9rem 0 0; }
.tg-dayhead { text-align: center; padding: .45rem .2rem; font-size: .75rem; color: #7a8794; text-decoration: none; border-left: 1px solid #eef1f5; text-transform: capitalize; }
.tg-dayhead b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: .15rem; font-size: .82rem; color: #2b3744; border-radius: 50%; }
.tg-dayhead.hoy b { background: var(--brand); color: #fff; }
.tg-dayhead:hover { background: var(--muted-bg); }
.tg-body { position: relative; }
.tg-hours { position: relative; }
.tg-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: .66rem; color: #9aa5b1; background: #fff; padding: 0 2px; }
.tg-hours span:first-child { transform: none; }
.tg-col { position: relative; border-left: 1px solid #eef1f5;
    background-image: linear-gradient(to bottom, #e6ebf1 1px, transparent 1px);
    background-size: 100% calc(var(--ppm) * 60px); }
.tg-col.hoy { background-color: rgba(var(--brand-rgb), .045); }
.tg-slot { position: absolute; left: 0; right: 0; z-index: 1; }
.tg-slot:hover { background: rgba(var(--brand-rgb), .10); }
.tg-ev { position: absolute; z-index: 2; overflow: hidden; padding: 1px 5px; font-size: .7rem; line-height: 1.25; color: #2b3744; text-decoration: none;
    border-left: 3px solid var(--ev); background: var(--ev-bg); border-radius: .35rem; box-shadow: 0 0 0 1px rgba(255,255,255,.9); }
.tg-ev small { display: block; color: #6a7684; font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ev:hover { filter: brightness(.95); z-index: 4; }
.tg-ev.est-cancelado { color: #8a95a1; text-decoration: line-through; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: #e5484d; z-index: 3; pointer-events: none; }
.tg-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; }

/* --- Día (lista por franjas) --- */
.slot-list { padding: .25rem 0; }
.slot-row { display: flex; gap: .6rem; padding: .15rem .8rem; border-top: 1px solid #f1f3f7; }
.slot-row:first-child { border-top: 0; }
.slot-row.ahora { background: rgba(var(--brand-rgb), .05); box-shadow: inset 3px 0 0 var(--brand); }
.slot-time { width: 46px; flex: none; font-size: .75rem; font-weight: 600; color: #7a8794; padding-top: .45rem; }
.slot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; padding: .25rem 0; position: relative; }
.slot-libre { font-size: .78rem; color: #a0abb7; text-decoration: none; padding: .15rem .3rem; border-radius: .4rem; align-self: flex-start; }
a.slot-libre:hover { background: rgba(var(--brand-rgb), .08); color: var(--brand-dark); }
.slot-cont { font-size: .72rem; color: #b3bcc6; padding: .2rem .3rem; font-style: italic; }
.slot-mas { position: absolute; right: 0; top: .3rem; color: #a0abb7; padding: 2px 6px; font-size: .7rem; text-decoration: none; }
.slot-mas:hover { color: var(--brand); }

/* --- Tarjeta de turno --- */
.tcard { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: .6rem; border: 1px solid #e8edf3; border-left: 4px solid var(--ev); background: var(--ev-bg); }
.tcard-hora { flex: none; width: 44px; text-align: center; line-height: 1.15; }
.tcard-hora b { display: block; font-size: .85rem; }
.tcard-hora small { color: #7a8794; font-size: .68rem; }
.tcard-info { flex: 1; min-width: 0; }
.tcard-nombre { font-weight: 600; color: #26323f; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard-nombre:hover { color: var(--brand-dark); }
.tcard.est-cancelado .tcard-nombre { text-decoration: line-through; color: #8a95a1; }
.tcard-acciones { display: flex; align-items: center; gap: .35rem; flex: none; }
.badge-btn { border: 0; font-weight: 500; font-size: .74rem; padding: .3rem .55rem; }
.badge-btn.text-bg-warning, .badge-btn.text-bg-info { color: #1d2b36 !important; }

/* --- Formulario de turno --- */
.pac-elegido { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border: 1px solid rgba(var(--brand-rgb), .35); background: var(--brand-soft); border-radius: .6rem; }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fff; color: var(--brand-dark); }
.pac-resultados { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: .2rem; max-height: 280px; overflow-y: auto; border-radius: .6rem; }

/* --- WhatsApp --- */
.wa-preview { white-space: pre-wrap; word-break: break-word; font-size: .84rem; background: #e7f6ec; border: 1px solid #cfe9d8; border-radius: .2rem .8rem .8rem .8rem; padding: .6rem .8rem; color: #243b2f; }
.rec-hora { width: 48px; flex: none; font-size: .95rem; }
.ag-prof { flex: 1 1 160px; min-width: 160px; }
@media (min-width: 768px) { .ag-prof { flex: 0 0 auto; min-width: 230px; } }

/* =====================================================================
   Finanzas
   ===================================================================== */
.fin-nav { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .15rem; scrollbar-width: thin; }
.fin-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .8rem; border-radius: 2rem; font-size: .84rem; font-weight: 500; white-space: nowrap;
           color: #5b6773; background: #fff; border: 1px solid #e3e9f0; text-decoration: none; }
.fin-tab i { color: var(--brand); font-size: .8rem; }
.fin-tab:hover { background: var(--brand-soft); color: var(--brand-dark); }
.fin-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.fin-tab.active i { color: #fff; }
@media (max-width: 575.98px) { .fin-tab span { display: none; } .fin-tab.active span { display: inline; } .fin-tab { padding: .45rem .75rem; } }

.card-link { transition: box-shadow .15s, transform .15s; }
a:hover > .card-link { box-shadow: 0 .4rem 1rem rgba(var(--brand-rgb), .15); transform: translateY(-1px); }

.mini-stat { background: #fff; border: 1px solid #e3e9f0; border-radius: .6rem; padding: .5rem .8rem; display: flex; flex-direction: column; line-height: 1.25; }
.mini-stat span { font-size: .72rem; color: #7a8794; }
.mini-stat strong { font-size: .98rem; }

/* Formulario de venta */
.item-row { display: grid; grid-template-columns: 1fr 70px 110px 110px 34px; gap: .5rem; align-items: center; padding: .5rem .6rem; border: 1px solid #e8edf3; border-radius: .6rem; background: #fbfcfd; }
.item-name { min-width: 0; font-weight: 500; font-size: .9rem; }
.item-name i { color: var(--brand); margin-right: .35rem; }
@media (max-width: 767.98px) {
    .item-row { grid-template-columns: 72px 1fr auto; grid-template-areas: "name name del" "qty price total"; align-items: end; }
    .item-name { grid-area: name; align-self: center; } .item-del { grid-area: del; width: 34px; justify-self: end; } .item-qty { grid-area: qty; } .item-price { grid-area: price; }
    .item-total { grid-area: total; white-space: nowrap; padding-bottom: .3rem; }
}
.pago-row { display: grid; grid-template-columns: 1fr 100px 34px; gap: .4rem; }
.pago-row .pago-ref { grid-column: 1 / -1; }
.totales { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; font-size: .88rem; }
.totales dt { font-weight: 400; color: inherit; } .totales dd { margin: 0; font-weight: 600; white-space: nowrap; }
.total-final { font-size: 1.1rem; padding-top: .35rem; border-top: 1px dashed #d7dee6; }
.total-final dt { font-weight: 600; }

/* Gráfico de 12 meses */
.chart-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .3rem; height: 170px; }
.chart-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; text-decoration: none; color: #7a8794; border-radius: .4rem; padding: .15rem; }
.chart-col:hover { background: var(--brand-soft); }
.chart-col.actual { background: var(--brand-soft-2); }
.chart-col .bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.chart-col .bar { display: block; width: 42%; max-width: 14px; border-radius: 3px 3px 0 0; }
.bar-in, .dot-in { background: #2e8b57; } .bar-out, .dot-out { background: #d9822b; }
.chart-col small { text-align: center; font-size: .66rem; text-transform: capitalize; margin-top: .2rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .25rem; }