/* =========================================
   AUDIOPLUS - SISTEMA DE GESTIÓN
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #243746;
}


/* =========================================
   LOGIN
========================================= */

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 55% 45%;
}


/* PANEL IZQUIERDO */

.login-brand {
    min-height: 100vh;
    padding: 55px 70px;
    background:
        linear-gradient(
            135deg,
            #183744,
            #315f67
        );

    color: white;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


/* LOGO LOGIN */

.brand-logo {
    width: 230px;
    overflow: hidden;
}

.brand-logo img {
    width: 100%;
    max-width: 230px;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    display: block;
}


/* CONTENIDO LOGIN */

.brand-content {
    max-width: 560px;
}

.badge {
    display: inline-block;

    padding: 10px 20px;

    border-radius: 30px;

    background:
        rgba(255, 255, 255, 0.08);

    border:
        1px solid rgba(255, 255, 255, 0.15);

    font-size: 14px;

    margin-bottom: 30px;
}

.brand-content h1 {
    font-size: 54px;
    line-height: 1.1;
    margin-bottom: 25px;
}

.brand-content p {
    font-size: 18px;
    line-height: 1.7;

    color:
        rgba(255, 255, 255, 0.75);

    max-width: 560px;
}

.brand-footer {
    font-size: 13px;

    color:
        rgba(255, 255, 255, 0.65);
}


/* PANEL DERECHO LOGIN */

.login-form-section {
    min-height: 100vh;

    background: white;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 40px;
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.welcome {
    display: block;

    color: #35636c;

    font-size: 13px;

    font-weight: bold;

    letter-spacing: 2px;

    margin-bottom: 6px;
}

.login-header h2 {
    font-size: 30px;

    margin-bottom: 5px;
}

.login-header p {
    color: #63737f;

    margin-bottom: 28px;
}


/* FORMULARIO */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    font-size: 14px;

    font-weight: 600;

    margin-bottom: 8px;
}

.form-group input {
    width: 100%;

    padding: 16px;

    border-radius: 12px;

    border:
        1px solid #d5dde1;

    background: #f7f9fa;

    font-size: 15px;

    outline: none;
}

.form-group input:focus {
    border-color: #2da1ac;
}


/* OPCIONES LOGIN */

.form-options {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 25px;
}

.remember {
    display: flex;

    align-items: center;

    gap: 6px;

    font-size: 14px;

    color: #64737d;
}

.forgot-password {
    font-size: 14px;

    color: #2d8794;

    text-decoration: none;

    font-weight: 600;
}


/* BOTÓN LOGIN */

.login-button {
    width: 100%;

    padding: 17px;

    border: none;

    border-radius: 12px;

    background: #4696a1;

    color: white;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;
}

.login-button:hover {
    background: #347f89;
}


/* =========================================
   DASHBOARD GENERAL
========================================= */

.dashboard {
    min-height: 100vh;

    display: flex;

    background: #f4f6f8;
}


/* =========================================
   SIDEBAR
========================================= */

.sidebar {
    width: 260px;

    min-height: 100vh;

    background:
        linear-gradient(
            180deg,
            #183844,
            #294f57
        );

    padding: 35px 16px 20px;

    display: flex;
    flex-direction: column;

    flex-shrink: 0;
}


/* LOGO SIDEBAR */

.sidebar-logo {
    width: 155px;

    margin: 10px auto 55px;
}

.sidebar-logo img {
    width: 100%;
    height: auto;

    display: block;

    object-fit: contain;
}


/* MENÚ */

.menu {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.menu-item {
    display: flex;

    align-items: center;

    gap: 15px;

    padding: 14px 18px;

    border-radius: 11px;

    color:
        rgba(255, 255, 255, 0.78);

    text-decoration: none;

    font-size: 15px;

    transition: 0.2s;
}

.menu-item:hover {
    background:
        rgba(255, 255, 255, 0.08);

    color: white;
}

.menu-item.active {
    background:
        linear-gradient(
            90deg,
            #3d8995,
            #54a0ad
        );

    color: white;

    font-weight: bold;
}


/* PARTE INFERIOR */

.sidebar-bottom {
    margin-top: auto;

    padding-top: 20px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.08);

    display: flex;
    flex-direction: column;

    gap: 8px;
}

.logout {
    color: #f0f3f4;
}


/* =========================================
   CONTENIDO PRINCIPAL
========================================= */

.main-content {
    flex: 1;

    min-width: 0;

    padding: 35px 45px 50px;
}


/* =========================================
   TOPBAR
========================================= */

.topbar {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 38px;
}

.topbar h1 {
    font-size: 34px;

    margin-top: 5px;

    color: #263a48;
}


/* USUARIO */

.user-info {
    display: flex;

    align-items: center;

    gap: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #4b98a4;

    color: white;

    font-size: 18px;

    font-weight: bold;
}

.user-info strong {
    display: block;

    font-size: 15px;

    margin-bottom: 3px;
}

.user-info span {
    font-size: 13px;

    color: #70808c;
}


/* =========================================
   TARJETAS DE ESTADÍSTICAS
========================================= */

.stats {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 22px;

    margin-bottom: 25px;
}

.stat-card {
    background: white;

    border-radius: 16px;

    padding: 25px 22px;

    display: flex;

    align-items: center;

    gap: 16px;

    box-shadow:
        0 8px 25px
        rgba(20, 50, 70, 0.08);
}

.stat-icon {
    width: 54px;
    height: 54px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background:
        rgba(45, 161, 172, 0.10);

    font-size: 25px;
}

.stat-title {
    display: block;

    color: #6f7e89;

    font-size: 14px;

    margin-bottom: 5px;
}

.stat-card h2 {
    font-size: 25px;

    margin-bottom: 4px;
}

.stat-card small {
    color: #7c8992;
}


/* =========================================
   GRID DASHBOARD
========================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        1.2fr 1fr;

    gap: 25px;

    margin-bottom: 25px;
}


/* =========================================
   TARJETAS DE CONTENIDO
========================================= */

.content-card {
    background: white;

    border-radius: 18px;

    padding: 25px;

    box-shadow:
        0 8px 25px
        rgba(20, 50, 70, 0.08);
}

.card-header {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 20px;

    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 20px;

    margin-bottom: 6px;
}

.card-header p {
    color: #72808a;

    font-size: 14px;
}

.card-header a {
    color: #2d8794;

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;
}


/* ESTADO VACÍO */

.empty-state {
    min-height: 210px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;
}

.empty-icon {
    width: 58px;
    height: 58px;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        #eef4f5;

    border-radius: 50%;

    font-size: 27px;

    margin-bottom: 15px;
}

.empty-state h3 {
    margin-bottom: 7px;

    font-size: 17px;
}

.empty-state p {
    color: #7b8790;

    font-size: 14px;
}


/* =========================================
   ACCIONES RÁPIDAS
========================================= */

.quick-actions {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 12px;
}

.quick-action {
    min-height: 110px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 12px;

    border:
        1px solid #dde5e8;

    border-radius: 12px;

    text-decoration: none;

    color: #3d4d58;

    font-size: 14px;

    font-weight: 600;

    transition: 0.2s;
}

.quick-action:hover {
    background: #f2f8f9;

    border-color: #4b98a4;
}

.quick-action span {
    font-size: 25px;
}


/* ACTIVIDAD */

.activity-card {
    margin-bottom: 30px;
}


/* =========================================
   PÁGINA DE PACIENTES
========================================= */

.page-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 30px;

    margin-bottom: 30px;
}

.page-header h1 {
    margin: 5px 0;

    font-size: 36px;

    color: #243746;
}

.page-description {
    margin: 0;

    color: #6b7b88;

    font-size: 16px;
}


/* BOTÓN PRINCIPAL */

.primary-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 14px 22px;

    background:
        linear-gradient(
            135deg,
            #2da1ac,
            #4d97a5
        );

    color: white;

    text-decoration: none;

    border-radius: 10px;

    font-weight: 600;

    transition: 0.2s ease;

    white-space: nowrap;
}

.primary-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 20px
        rgba(45, 161, 172, 0.25);
}


/* RESUMEN PACIENTES */

.patient-summary {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 20px;

    margin-bottom: 25px;
}

.summary-card {
    display: flex;

    align-items: center;

    gap: 18px;

    background: white;

    padding: 22px;

    border-radius: 16px;

    box-shadow:
        0 8px 25px
        rgba(20, 50, 70, 0.08);
}

.summary-icon {
    width: 52px;
    height: 52px;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        rgba(45, 161, 172, 0.12);

    border-radius: 14px;

    font-size: 24px;
}

.summary-card span {
    display: block;

    font-size: 14px;

    color: #70808c;

    margin-bottom: 5px;
}

.summary-card strong {
    display: block;

    font-size: 26px;

    color: #243746;
}


/* LISTA PACIENTES */

.patients-card {
    padding: 28px;
}

.patients-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 25px;

    margin-bottom: 25px;
}

.patients-header h2 {
    margin: 0 0 5px;

    font-size: 22px;

    color: #243746;
}

.patients-header p {
    margin: 0;

    color: #71808c;
}


/* BUSCADOR */

.search-box {
    display: flex;

    align-items: center;

    gap: 10px;

    width: 280px;

    padding: 12px 15px;

    background: #f4f7f8;

    border:
        1px solid #e1e8eb;

    border-radius: 10px;
}

.search-box input {
    width: 100%;

    border: none;

    outline: none;

    background: transparent;

    font-size: 14px;

    color: #243746;
}


/* TABLA PACIENTES */

.table-responsive {
    width: 100%;

    overflow-x: auto;
}

.patients-table {
    width: 100%;

    border-collapse: collapse;
}

.patients-table th {
    text-align: left;

    padding: 15px;

    font-size: 13px;

    color: #6f7e89;

    background: #f6f8f9;

    border-bottom:
        1px solid #e6ecef;
}

.patients-table td {
    padding: 18px 15px;

    color: #344653;

    border-bottom:
        1px solid #edf1f3;
}

.empty-row td {
    padding: 0;

    border: none;
}

.patients-empty {
    padding: 55px 20px;

    text-align: center;
}

.patients-empty .empty-icon {
    width: 65px;
    height: 65px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin: 0 auto 18px;

    background:
        rgba(45, 161, 172, 0.10);

    border-radius: 50%;

    font-size: 30px;
}

.patients-empty h3 {
    margin: 0 0 8px;

    font-size: 20px;

    color: #344653;
}

.patients-empty p {
    margin: 0 0 22px;

    color: #75838d;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {

    .stats {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 900px) {

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: auto;

        padding: 40px;
    }

    .sidebar {
        width: 220px;
    }

    .main-content {
        padding: 30px;
    }

    .patient-summary {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;

        align-items: flex-start;
    }

    .patients-header {
        flex-direction: column;

        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

}


@media (max-width: 700px) {

    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;

        min-height: auto;
    }

    .sidebar-logo {
        margin-bottom: 25px;
    }

    .menu {
        display: grid;

        grid-template-columns:
            repeat(2, 1fr);
    }

    .sidebar-bottom {
        display: none;
    }

    .main-content {
        padding: 20px;
    }

    .topbar {
        flex-direction: column;

        align-items: flex-start;

        gap: 20px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .brand-content h1 {
        font-size: 38px;
    }

}

/* Historia clínica estructurada */
.clinical-form { padding: 0; overflow: hidden; }
.clinical-form fieldset { margin: 0; padding: 28px; border: 0; border-bottom: 1px solid #e5ecee; }
.clinical-form fieldset:last-of-type { border-bottom: 0; }
.clinical-form legend { width: 100%; padding: 0 0 16px; color: #173746; font-size: 18px; font-weight: 800; }
.clinical-form input:not([type="radio"]):not([type="checkbox"]), .clinical-form select, .clinical-form textarea { width: 100%; padding: 12px 14px; border: 1px solid #cfdbdf; border-radius: 9px; background: #f8fafb; color: #173746; font: inherit; }
.clinical-form textarea { resize: vertical; }
.clinical-form input:focus, .clinical-form select:focus, .clinical-form textarea:focus { outline: 3px solid rgba(70,150,161,.14); border-color: #4696a1; background: #fff; }
.clinical-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.clinical-panel, .ear-card { padding: 18px; border: 1px solid #dfe8ea; border-radius: 12px; background: #f9fbfb; }
.clinical-panel h3, .logo-audiometry h3 { margin: 0 0 15px; color: #315f67; font-size: 15px; }
.clinical-panel > label, .ear-card > label { display: block; margin-top: 13px; color: #334b57; font-size: 13px; font-weight: 700; }
.clinical-panel > label input, .clinical-panel > label textarea { margin-top: 7px; }
.check-row { display: flex; flex-wrap: wrap; gap: 9px; }
.check-row.vertical { display: grid; grid-template-columns: 1fr 1fr; }
.check-row label, .clinical-question label { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; border: 1px solid #d7e2e5; border-radius: 9px; background: #fff; color: #40545f; cursor: pointer; font-size: 13px; }
.check-row input, .clinical-question input { width: 17px; height: 17px; accent-color: #3495a2; }
.clinical-question { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 11px 0; }
.clinical-question > span { flex: 1 0 170px; color: #334b57; font-size: 13px; font-weight: 700; }
.clear-choice { padding: 7px 9px; border: 0; background: transparent; color: #71808c; cursor: pointer; font-size: 12px; text-decoration: underline; }
.ear-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ear-card { position: relative; background: #fff; }
.ear-badge { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e2f2f4; color: #216f7a; font-weight: 800; }
.ear-card textarea { margin-top: 9px; }
.logo-audiometry { margin-top: 20px; padding: 18px; border-radius: 12px; background: #edf7f8; }
.inline-measures { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.inline-measures label { color: #536871; font-size: 12px; font-weight: 700; }
.inline-measures input { margin-top: 5px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; padding: 18px 28px; border-top: 1px solid #dfe7ea; background: rgba(255,255,255,.96); box-shadow: 0 -8px 25px rgba(24,55,68,.07); }
.print-toolbar { display: flex; justify-content: center; gap: 10px; }
.secondary-print { background: #657781; }
.detailed-report > header span { color: #2d8794; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
.report-patient-wide { grid-template-columns: 2fr repeat(5,1fr); }
.report-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 10px 0 15px; }
.report-facts > div { padding: 11px 13px; border-radius: 8px; background: #f5f8f9; }
.report-facts span, .report-facts small { display: block; color: #71808c; font-size: 11px; }
.report-facts strong { display: block; margin: 4px 0; font-size: 13px; }
.report-ears { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.report-ears > div { padding: 14px; border: 1px solid #dfe7ea; border-radius: 8px; }
.report-result { margin-top: 10px; padding: 12px 14px; border-left: 3px solid #65aab3; background: #f7f9fa; break-inside: avoid; }
.report-result p { margin-top: 4px; }
.signature-line { width: 220px; margin-top: 55px; padding-top: 8px; border-top: 1px solid #75848b; text-align: center; font-size: 12px; }
@media print { .print-toolbar { display: none; } .clinical-report { font-size: 11px; } .report-section { break-inside: avoid; } .detailed-report { padding: 28px 36px; } }
@media (max-width: 900px) { .clinical-grid, .ear-grid { grid-template-columns: 1fr; } .report-patient-wide { grid-template-columns: 1fr 1fr; } }

/* Ventas y caja */
.sale-status { display: inline-block; padding: 6px 9px; border-radius: 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.sale-pendiente { background: #fff5dc; color: #806018; }
.sale-parcial { background: #e9f1ff; color: #315f91; }
.sale-pagada { background: #e6f6ed; color: #17633d; }
.sale-anulada { background: #fff0f2; color: #8b2635; }
.compact-form { max-width: 980px; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.sale-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.65fr); gap: 24px; align-items: start; }
.sale-totals { width: min(360px,100%); margin: 22px 0 0 auto; }
.sale-totals p { display: flex; justify-content: space-between; padding: 7px 0; color: #60717b; }
.sale-totals .grand-total { margin-top: 7px; padding-top: 13px; border-top: 2px solid #dbe5e8; color: #173746; font-size: 20px; }
.payment-card { position: sticky; top: 20px; }
.payment-card h2 { margin: 25px 0 18px; font-size: 18px; }
.payment-card select, .payment-card textarea { width: 100%; padding: 12px 14px; border: 1px solid #cfdbdf; border-radius: 9px; background: #f8fafb; font: inherit; }
.balance-display { display: grid; gap: 4px; padding: 18px; border-radius: 12px; background: #f4f8f9; }
.balance-display small { margin-top: 7px; color: #71808c; }
.balance-display strong { font-size: 23px; }
.balance-display .paid { color: #258057; }
.balance-display .due { color: #a13e4b; }
.payment-submit { width: 100%; }
.paid-message { margin-top: 20px; padding: 15px; border-radius: 10px; background: #e6f6ed; color: #17633d; font-weight: 800; text-align: center; }
.cash-open { padding: 9px 13px; border-radius: 20px; background: #e6f6ed; color: #17633d; font-size: 13px; font-weight: 800; }
.cash-open-card { max-width: 620px; }
.cash-open-card h2 { margin: 5px 0 8px; }
.cash-open-card form { margin-top: 22px; }
.cash-open-card textarea, .cash-grid select { width: 100%; padding: 12px; border: 1px solid #cfdbdf; border-radius: 9px; background: #f8fafb; font: inherit; }
.cash-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.5fr); gap: 24px; margin-bottom: 24px; align-items: start; }
.cash-grid h2 { margin-bottom: 18px; }
.cash-movement-form { display: grid; grid-template-columns: 140px 140px 1fr auto; gap: 10px; align-items: end; padding-bottom: 20px; border-bottom: 1px solid #e5ecee; }
.cash-movement-form .form-group { margin: 0; }
.close-card { position: sticky; top: 20px; }
.close-card > p { margin: 10px 0 22px; color: #61727c; line-height: 1.5; }
@media (max-width: 950px) { .sale-layout, .cash-grid { grid-template-columns: 1fr; } .payment-card, .close-card { position: static; } .cash-movement-form { grid-template-columns: 1fr 1fr; } .cash-movement-form .wide { grid-column: 1/-1; } }
@media (max-width: 600px) { .cash-movement-form { grid-template-columns: 1fr; } .cash-movement-form .wide { grid-column: auto; } }
.receipt-report { min-height: 800px; }
.receipt-report > header span { color: #2d8794; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.receipt-amount { margin: 30px 0; padding: 25px; border-radius: 12px; background: linear-gradient(135deg,#183744,#315f67); color: white; text-align: center; }
.receipt-amount span, .receipt-amount small { display: block; opacity: .75; }
.receipt-amount strong { display: block; margin: 7px 0; font-size: 42px; }
.receipt-balance { margin: 25px 0 0 auto; width: min(370px,100%); }
.receipt-balance p { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #e4eaed; }

/* Reportes y metas */
.report-filters { display: flex; align-items: end; gap: 14px; margin-bottom: 22px; padding: 18px 22px; }
.report-filters .form-group { margin: 0; }
.report-filters input { padding: 11px 12px; border: 1px solid #cfdbdf; border-radius: 9px; background: #f8fafb; }
.export-menu { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-left: auto; color: #71808c; font-size: 13px; }
.export-menu a { color: #287c88; font-weight: 700; text-decoration: none; }
.report-kpis { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.report-kpis article { padding: 18px; border-radius: 14px; background: white; box-shadow: 0 8px 24px rgba(26,55,70,.06); }
.report-kpis span, .report-kpis small { display: block; color: #71808c; font-size: 12px; }
.report-kpis strong { display: block; margin: 7px 0; color: #173746; font-size: 23px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; align-items: start; }
.bar-chart { display: grid; gap: 13px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 48px 1fr 90px; align-items: center; gap: 10px; }
.bar-row time { color: #71808c; font-size: 12px; }
.bar-row > div { height: 12px; overflow: hidden; border-radius: 20px; background: #edf2f4; }
.bar-row i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#3d919d,#62b4bd); }
.bar-row strong { text-align: right; font-size: 12px; }
.goal-list { display: grid; gap: 14px; }
.goal-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; padding: 15px; border: 1px solid #e1e9eb; border-radius: 11px; }
.goal-item strong, .goal-item small { display: block; }
.goal-item small { margin-top: 4px; color: #71808c; }
.goal-item > span { color: #287c88; font-weight: 800; }
.goal-track { grid-column: 1/-1; height: 9px; overflow: hidden; border-radius: 20px; background: #edf2f4; }
.goal-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#3495a2,#61b6a0); }
.goal-item p { color: #62737c; font-size: 12px; }
.goal-item form { text-align: right; }
.goal-item form button { border: 0; background: transparent; cursor: pointer; }
.goal-disabled { opacity: .55; background: #f6f7f8; }
.goal-admin { grid-template-columns: minmax(300px,.65fr) minmax(0,1.35fr); }
.goal-admin > form h2 { margin-bottom: 20px; }
@media (max-width: 1100px) { .report-kpis { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 800px) { .report-grid, .goal-admin { grid-template-columns: 1fr; } .report-filters { align-items: stretch; flex-direction: column; } .export-menu { margin-left: 0; } }
@media (max-width: 550px) { .report-kpis { grid-template-columns: 1fr 1fr; } }
.goal-motivation { grid-column: 1/-1; padding: 10px 12px; border-radius: 8px; background: #eef8f5; color: #247052 !important; font-size: 13px !important; font-weight: 700; }
.opportunity-section { margin-bottom: 24px; }
.opportunity-section .card-header { align-items: flex-start; }
.opportunity-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.opportunity-card { padding: 17px; border: 1px solid #dfe8ea; border-radius: 12px; background: linear-gradient(180deg,#fff,#f9fbfb); }
.opportunity-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.opportunity-value { color: #247052; font-weight: 800; }
.opportunity-card h3 { margin: 14px 0 4px; color: #173746; font-size: 17px; }
.opportunity-state { color: #2d8794; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.opportunity-advice { min-height: 44px; margin: 12px 0; color: #536771; font-size: 13px; line-height: 1.5; }
.opportunity-card small { color: #71808c; }
.opportunity-card .needs-action { color: #a36a20; font-weight: 700; }
.opportunity-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; padding-top: 13px; border-top: 1px solid #e5ecee; }
.opportunity-actions a { padding: 7px 9px; border-radius: 7px; background: #eaf4f5; color: #287c88; font-size: 12px; font-weight: 700; text-decoration: none; }
@media (max-width: 1050px) { .opportunity-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 650px) { .opportunity-grid { grid-template-columns: 1fr; } }

/* CRM y seguimiento comercial */
.crm-overview { border-left-color: #d5963d; background: #fff8eb; }
.crm-summary { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin-bottom: 22px; }
.crm-summary a { display: flex; justify-content: space-between; align-items: center; padding: 16px; border: 1px solid #e1e8ea; border-radius: 12px; background: white; color: #50636d; text-decoration: none; }
.crm-summary a.active { border-color: #4696a1; background: #edf7f8; color: #226e78; }
.crm-summary span { font-size: 12px; }
.crm-summary strong { font-size: 20px; }
.crm-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(310px,.55fr); gap: 24px; align-items: start; }
.crm-layout > aside { display: grid; gap: 24px; }
.crm-patient-list { display: grid; }
.crm-patient-list > article { display: grid; grid-template-columns: minmax(200px,1fr) minmax(180px,.7fr) auto; gap: 18px; align-items: center; padding: 17px 0; border-bottom: 1px solid #e7edef; }
.crm-patient-list > article:last-child { border-bottom: 0; }
.crm-patient-main h3 { margin: 7px 0 4px; font-size: 16px; }
.crm-patient-main p, .crm-patient-value small { color: #71808c; font-size: 12px; }
.crm-patient-value span, .crm-patient-value small { display: block; }
.crm-patient-value span { margin-bottom: 5px; color: #247052; font-weight: 800; }
.crm-patient-value small + small { margin-top: 3px; }
.overdue-text { color: #a13e4b !important; font-weight: 700; }
.crm-patient-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.crm-patient-actions a { padding: 7px 9px; border-radius: 7px; background: #edf5f6; color: #287c88; font-size: 11px; font-weight: 700; text-decoration: none; }
.crm-task-list { display: grid; gap: 10px; }
.crm-task-list article { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border-left: 4px solid #8ba6ae; border-radius: 8px; background: #f7f9fa; }
.crm-task-list .priority-alta { border-left-color: #c75563; }
.crm-task-list .priority-baja { border-left-color: #63a77d; }
.crm-task-list .task-overdue { background: #fff3f4; }
.crm-task-list strong, .crm-task-list small { display: block; }
.crm-task-list small { margin-top: 4px; color: #71808c; }
.crm-task-list p { margin-top: 7px; color: #596b74; font-size: 12px; }
.crm-task-list button { width: 31px; height: 31px; border: 0; border-radius: 50%; background: #dff2e7; color: #17633d; cursor: pointer; font-weight: 800; }
.crm-recent { max-height: 420px; overflow: auto; }
.crm-form { max-width: 1100px; }
.task-toggle { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; color: #315f67; font-weight: 800; }
.task-toggle input { width: 18px; height: 18px; accent-color: #3495a2; }
@media (max-width: 1080px) { .crm-summary { grid-template-columns: repeat(3,1fr); } .crm-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .crm-summary { grid-template-columns: 1fr 1fr; } .crm-patient-list > article { grid-template-columns: 1fr; } .crm-patient-actions { justify-content: flex-start; } }

/* Cotización visual por gamas */
.visual-quote-builder { grid-template-columns: minmax(0,1.8fr) minmax(310px,.62fr); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 28px 0 16px; }
.section-heading h2 { margin: 0; }
.tier-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.tier-legend span, .tier-badge { display: inline-block; padding: 6px 9px; border-radius: 20px; background: #edf2f4; color: #53656e; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.tier-legend .tier-esencial { background: #edf4f7; color: #476a78; }
.tier-legend .tier-confort { background: #e8f5ef; color: #297052; }
.tier-legend .tier-avanzada { background: #e9effb; color: #3d5791; }
.tier-legend .tier-premium { background: #f5eeda; color: #85651f; }
.visual-items { gap: 16px; }
.quote-product-card { overflow: hidden; border: 1px solid #dfe8ea; border-radius: 14px; background: #fff; }
.quote-visual { display: grid; grid-template-columns: 210px 1fr; min-height: 190px; background: linear-gradient(135deg,#f5f9fa,#fff); }
.product-image-stage { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 190px; background: radial-gradient(circle,#fff 0,#edf4f5 70%); }
.product-image-stage img { display: none; width: 88%; height: 175px; object-fit: contain; transition: transform .2s ease; }
.product-image-stage.has-image .product-image-main { display: block; }
.product-image-stage.show-pair .product-image-main { display: none; }
.product-image-pair { display: none; grid-template-columns: 1fr 1fr; align-items: center; width: 100%; }
.product-image-stage.show-pair .product-image-pair { display: grid; }
.product-image-stage.show-pair .product-image-pair img { display: block; width: 115%; height: 155px; }
.product-image-pair img:first-child { transform: translateX(10%) scaleX(-1); }
.product-image-pair img:last-child { transform: translateX(-10%); }
.product-image-main.ear-left { transform: scaleX(-1); }
.product-placeholder { color: #829098; font-size: 12px; text-align: center; }
.product-image-stage.has-image .product-placeholder { display: none; }
.product-meta { display: flex; flex-direction: column; justify-content: center; padding: 22px; }
.product-meta .tier-badge { align-self: flex-start; background: #e8f3f5; color: #29717b; }
.product-meta h3 { margin: 10px 0 6px; color: #173746; font-size: 22px; }
.product-meta p { color: #596c75; line-height: 1.5; }
.product-meta small { margin-top: 12px; color: #72828a; text-transform: capitalize; }
.quote-product-card .quote-row { grid-template-columns: minmax(250px,2fr) minmax(135px,.8fr) 72px 100px 34px; padding: 13px; border-top: 1px solid #e2e9eb; background: #f8fafb; }
.quote-main > fieldset { margin-top: 24px; padding: 22px 0 0; border: 0; border-top: 1px solid #e2e9eb; }
.quote-main > fieldset legend { padding-right: 12px; color: #315f67; font-weight: 800; }
@media (max-width: 1100px) { .visual-quote-builder { grid-template-columns: 1fr; } .visual-quote-builder .quote-summary { position: static; } }
@media (max-width: 720px) { .section-heading { align-items: flex-start; flex-direction: column; } .quote-visual { grid-template-columns: 1fr; } .product-image-stage { min-height: 220px; } .quote-product-card .quote-row { grid-template-columns: 1fr 1fr; } .quote-product-card .quote-product { grid-column: 1/-1; } }
.proposal-products { display: grid; gap: 12px; }
.proposal-products > article { display: grid; grid-template-columns: 135px 1fr auto; align-items: center; gap: 18px; padding: 14px; border: 1px solid #dfe8ea; border-radius: 11px; break-inside: avoid; }
.proposal-products h2 { margin: 7px 0 4px; font-size: 17px; }
.proposal-products p, .proposal-products small { color: #687982; font-size: 11px; }
.proposal-products > article > strong { color: #173746; font-size: 17px; }
.proposal-device-images { display: grid; place-items: center; grid-template-columns: 1fr; height: 100px; overflow: hidden; }
.proposal-device-images img { grid-area: 1/1; width: 100%; height: 95px; object-fit: contain; }
.proposal-device-images img:nth-child(2) { display: none; }
.proposal-device-images.ear-izquierdo img:first-child { transform: scaleX(-1); }
.proposal-device-images.ear-bilateral { grid-template-columns: 1fr 1fr; }
.proposal-device-images.ear-bilateral img { display: block; grid-area: auto; width: 120%; }
.proposal-device-images.ear-bilateral img:first-child { transform: translateX(10%) scaleX(-1); }
.proposal-device-images.ear-bilateral img:nth-child(2) { transform: translateX(-10%); }
@media print { .proposal-products > article { padding: 9px; } .proposal-device-images { height: 75px; } .proposal-device-images img { height: 72px; } }

/* COMPONENTES FUNCIONALES */
.alert { padding: 14px 16px; margin-bottom: 18px; border-radius: 10px; font-size: 14px; }
.alert-error { color: #8b2635; background: #fff0f2; border: 1px solid #f2c5cc; }
.alert-success { color: #17633d; background: #ecfaf3; border: 1px solid #bde8d0; }
.menu-item.disabled { opacity: .48; cursor: not-allowed; }
.sidebar-user { display: flex; align-items: center; gap: 10px; color: white; padding: 10px 12px 18px; }
.sidebar-user .user-avatar { width: 38px; height: 38px; flex: 0 0 38px; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user small { color: rgba(255,255,255,.6); margin-top: 3px; }
.sidebar-bottom form { margin: 0; }
.logout-button { width: 100%; border: 0; background: transparent; cursor: pointer; font-family: inherit; text-align: left; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters select, .patient-form select, .patient-form textarea { border: 1px solid #d5dde1; background: #f7f9fa; border-radius: 10px; padding: 12px; font: inherit; color: #243746; }
.secondary-button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid #cbd7dc; border-radius: 10px; padding: 12px 17px; background: white; color: #34515e; text-decoration: none; font-weight: 600; cursor: pointer; }
.text-link { color: #2d8794; text-decoration: none; font-weight: 600; }
.status { display: inline-block; padding: 6px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.status-activo { color: #17633d; background: #e6f6ed; }
.status-inactivo { color: #68757e; background: #edf0f2; }
.table-actions { display: flex; gap: 12px; align-items: center; }
.table-actions a, .table-actions button { border: 0; background: transparent; color: #2d8794; text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.table-actions button { color: #a13e4b; }
.patient-form { max-width: 980px; }
.patient-form fieldset { border: 0; margin: 0 0 28px; }
.patient-form legend { width: 100%; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid #e4eaed; font-size: 18px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
.patient-form input, .patient-form select, .patient-form textarea { width: 100%; }
.patient-form textarea { resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.primary-button { border: 0; cursor: pointer; font-family: inherit; font-size: 14px; }
.activity-list { display: flex; flex-direction: column; }
.activity-list a { display: flex; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid #edf1f3; color: #344653; text-decoration: none; }
.activity-list small { color: #7b8790; }
.narrow-form { max-width: 680px; }
.field-help { display: block; margin-top: 7px; color: #75838d; }
.role-badge { display: inline-block; padding: 6px 10px; border-radius: 8px; background: #e8f3f5; color: #2b6872; font-size: 12px; font-weight: 700; white-space: nowrap; }
.patient-code { color: #315f67; font-family: Consolas, monospace; font-weight: 700; white-space: nowrap; }
.commercial-tag { display: inline-block; padding: 6px 9px; border-radius: 8px; background: #eef2f4; color: #53636e; font-size: 12px; font-weight: 700; white-space: nowrap; }
.commercial-venta_segura, .commercial-adaptado { background: #e6f6ed; color: #17633d; }
.commercial-indeciso, .commercial-consulta_familia, .commercial-familia_decide { background: #fff5dc; color: #806018; }
.commercial-quiere_credito, .commercial-cotizado { background: #e9f1ff; color: #315f91; }
.commercial-no_interesado { background: #fff0f2; color: #8b2635; }
.admin-overview { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: -5px 0 25px; padding: 16px 20px; border-left: 4px solid #4696a1; border-radius: 10px; background: #edf7f8; }
.admin-overview.clinical { border-left-color: #6b79b8; background: #f1f2fa; }
.admin-overview span, .admin-overview strong { display: block; }
.admin-overview > div > span { color: #61727c; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.admin-overview > div > strong { font-size: 14px; }
.admin-overview > a { text-decoration: none; }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 24px; align-items: start; }
.calendar-card { padding: 20px; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.calendar-toolbar a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #dce5e8; border-radius: 9px; color: #315f67; text-decoration: none; font-weight: 700; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-head span { padding: 10px 5px; color: #71808c; text-align: center; font-size: 12px; font-weight: 700; }
.calendar-day { min-height: 110px; padding: 9px; border-top: 1px solid #e7edef; border-left: 1px solid #e7edef; color: #344653; text-decoration: none; overflow: hidden; }
.calendar-day:nth-child(7n), .calendar-day:last-child { border-right: 1px solid #e7edef; }
.calendar-day.today > strong { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #4696a1; color: white; }
.calendar-day.selected { background: #f0f8f9; box-shadow: inset 0 0 0 2px #62a8b2; }
.calendar-day.outside { background: #fafbfb; }
.calendar-event { display: block; margin-top: 5px; padding: 4px 5px; overflow: hidden; border-radius: 4px; background: #e8f3f5; color: #2b6872; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.calendar-event.event-cancelada { text-decoration: line-through; background: #f2f2f2; color: #7c858b; }
.calendar-event.event-atendida { background: #e6f6ed; color: #17633d; }
.more-events { display: block; margin-top: 5px; color: #63737f; font-size: 10px; }
.day-panel { position: sticky; top: 20px; }
.empty-state.compact { min-height: 180px; }
.appointment-list { display: flex; flex-direction: column; gap: 10px; }
.appointment-list > a { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 12px; border: 1px solid #e4eaed; border-radius: 10px; color: #344653; text-decoration: none; }
.appointment-list time { color: #2d8794; font-weight: 700; }
.appointment-list strong, .appointment-list small { display: block; }
.appointment-list small { color: #71808c; margin: 3px 0 8px; }
.status-programada { background: #e9f1ff; color: #315f91; }
.status-confirmada { background: #e8f3f5; color: #2b6872; }
.status-atendida { background: #e6f6ed; color: #17633d; }
.status-ausente, .status-cancelada { background: #fff0f2; color: #8b2635; }
.inventory-summary { grid-template-columns: repeat(4,1fr); }
.inventory-section { margin-bottom: 24px; }
.inventory-grids { grid-template-columns: 1fr 1fr; }
.stock-low { color: #a13e4b; font-weight: 800; }
.compact-list { display: flex; flex-direction: column; }
.compact-list > a, .compact-list > div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid #edf1f3; color: #344653; text-decoration: none; }
.compact-list strong, .compact-list small { display: block; }
.compact-list small { color: #71808c; margin-top: 4px; }
.device-status { padding: 6px 8px; border-radius: 7px; background: #eef2f4; color: #53636e; font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.device-disponible { background: #e6f6ed; color: #17633d; }
.device-reservado, .device-en_prueba { background: #fff5dc; color: #806018; }
.device-adaptado, .device-vendido { background: #e9f1ff; color: #315f91; }
.device-en_mantenimiento, .device-en_reparacion, .device-baja { background: #fff0f2; color: #8b2635; }
.movement-qty { font-style: normal; font-weight: 800; }
.movement-qty.positive { color: #17633d; }
.movement-qty.negative { color: #a13e4b; }
.trial-result { display: inline-block; padding: 6px 9px; border-radius: 8px; background: #eef2f4; color: #53636e; font-size: 12px; font-weight: 700; }
.result-seleccionado { background: #e6f6ed; color: #17633d; }
.result-pendiente { background: #fff5dc; color: #806018; }
.result-devuelto, .result-descartado { background: #f0f1f2; color: #68757e; }
.controls-card { max-width: 980px; margin-top: 24px; }
.repair-status { display: inline-block; padding: 6px 9px; border-radius: 8px; background: #eef2f4; color: #53636e; font-size: 11px; font-weight: 700; white-space: nowrap; }
.repair-recibido, .repair-en_diagnostico { background: #e9f1ff; color: #315f91; }
.repair-esperando_repuesto { background: #fff5dc; color: #806018; }
.repair-en_reparacion { background: #f0ebff; color: #63459b; }
.repair-listo, .repair-entregado { background: #e6f6ed; color: #17633d; }
.repair-cancelado { background: #fff0f2; color: #8b2635; }
.admin-overview.service { border-left-color: #8060a8; background: #f5f1fa; }
.quote-status { display: inline-block; padding: 6px 9px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.quote-borrador { background: #eef2f4; color: #53636e; }
.quote-presentada { background: #e9f1ff; color: #315f91; }
.quote-aceptada { background: #e6f6ed; color: #17633d; }
.quote-rechazada, .quote-vencida { background: #fff0f2; color: #8b2635; }
.saving-text { color: #17633d; font-weight: 700; }
.quote-builder { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(300px,.7fr); gap: 24px; align-items: start; }
.quote-main h2 { margin: 10px 0 15px; }
.quote-items { display: grid; gap: 10px; margin-bottom: 15px; }
.quote-row { display: grid; grid-template-columns: minmax(240px,2fr) minmax(130px,1fr) 85px 100px 34px; gap: 8px; align-items: center; }
.quote-row select, .quote-row input { min-width: 0; width: 100%; padding: 10px; border: 1px solid #d5dde1; border-radius: 8px; background: #f7f9fa; }
.quote-line { text-align: right; }
.remove-row { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #fff0f2; color: #8b2635; cursor: pointer; font-size: 20px; }
.quote-summary { position: sticky; top: 20px; overflow: hidden; }
.quote-summary h2 { margin-bottom: 25px; }
.price-breakdown { display: grid; gap: 14px; }
.price-breakdown > div, .price-breakdown label { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.price-breakdown input { width: 125px; padding: 9px; border: 1px solid #d5dde1; border-radius: 8px; text-align: right; }
.price-breakdown small { margin-top: -10px; color: #71808c; text-align: right; }
.price-breakdown .saving { margin-top: 8px; padding-top: 15px; border-top: 1px solid #e4eaed; color: #17633d; }
.final-price { margin: 22px -25px -25px; padding: 25px; background: linear-gradient(135deg,#183744,#315f67); color: white; text-align: center; }
.final-price span, .final-price small { display: block; opacity: .75; }
.final-price strong { display: block; margin: 8px 0; font-size: 42px; }
.quote-submit { width: 100%; margin-top: 20px; }
.quotation-report > header span { color: #2d8794; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.quote-customer { display: flex; justify-content: space-between; gap: 25px; padding: 28px 0; }
.quote-customer span { color: #71808c; font-size: 11px; text-transform: uppercase; }
.quote-customer h2 { margin: 5px 0; }
.proposal-table { width: 100%; border-collapse: collapse; }
.proposal-table th { padding: 12px; background: #edf5f6; color: #315f67; text-align: left; font-size: 12px; }
.proposal-table td { padding: 15px 12px; border-bottom: 1px solid #e4eaed; }
.proposal-price { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 30px; }
.proposal-discounts { padding: 20px; background: #f6f8f9; border-radius: 12px; }
.proposal-discounts > span { color: #71808c; }
.old-price { display: block; margin: 5px 0 15px; font-size: 23px; text-decoration: line-through; color: #7b8790; }
.proposal-discounts p { display: flex; justify-content: space-between; margin-top: 7px; }
.proposal-saving { margin-top: 17px; padding: 10px; border-radius: 7px; background: #e6f6ed; color: #17633d; font-weight: 800; text-align: center; }
.proposal-total { display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 12px; background: linear-gradient(135deg,#2da1ac,#35636c); color: white; }
.proposal-total strong { margin: 8px 0; font-size: 44px; }
.proposal-note { margin-top: 25px; padding: 20px; border-left: 4px solid #4696a1; background: #f4f8f9; }
.proposal-note h2 { margin-bottom: 7px; font-size: 16px; }
.inline-limit { display: flex; align-items: center; gap: 8px; }
.inline-limit input { width: 110px; padding: 10px; border: 1px solid #d5dde1; border-radius: 8px; }
.checkbox-field { padding-top: 28px; }
.checkbox-field label { display: flex; align-items: center; gap: 9px; }
.checkbox-field input { width: auto; }
.patient-name-link { color: #344653; text-decoration: none; }
.patient-name-link:hover { color: #2d8794; }
.table-subtitle { display: block; margin-top: 4px; color: #7b8790; }
.diagnosis-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.patient-profile-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; margin-bottom: 24px; }
.profile-details h2, .patient-profile-grid h2 { margin-bottom: 20px; }
.profile-details dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.profile-details dt { color: #71808c; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 5px; }
.profile-details dd { margin: 0; line-height: 1.5; }
.notes-block { color: #52636e; line-height: 1.7; }
.timeline-card { margin-bottom: 24px; }
.clinical-timeline { border-left: 2px solid #d6e5e8; margin-left: 90px; }
.clinical-timeline a { position: relative; display: grid; grid-template-columns: 86px 1fr; gap: 20px; padding: 0 0 26px; color: #344653; text-decoration: none; }
.clinical-timeline a::before { content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #4696a1; border: 3px solid white; }
.clinical-timeline time { margin-left: -105px; color: #71808c; font-size: 13px; }
.clinical-timeline strong, .clinical-timeline small { display: block; }
.clinical-timeline small { margin-top: 5px; color: #71808c; }
.muted { color: #7b8790; }
.clinical-form textarea { min-height: 105px; line-height: 1.5; }
.document-list { display: grid; gap: 10px; margin-top: 10px; }
.document-list a { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #e1e8eb; border-radius: 10px; color: #344653; text-decoration: none; }
.document-list small { color: #71808c; }
.report-body { padding: 30px; background: #e9edef; }
.clinical-report { max-width: 850px; min-height: 1050px; margin: auto; padding: 55px 65px; background: white; box-shadow: 0 10px 35px rgba(20,50,70,.12); }
.clinical-report > header { display: flex; justify-content: space-between; gap: 30px; padding-bottom: 25px; border-bottom: 3px solid #4696a1; }
.clinical-report > header img { width: 180px; height: 60px; object-fit: contain; }
.clinical-report > header h1 { font-size: 24px; }
.clinical-report > header p { margin-top: 6px; color: #71808c; }
.report-patient { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 15px; padding: 22px 0; border-bottom: 1px solid #dfe7ea; }
.report-patient span, .clinical-report footer span { display: block; color: #71808c; font-size: 11px; text-transform: uppercase; margin-bottom: 4px; }
.report-section { margin-top: 25px; }
.report-section h2 { margin-bottom: 8px; color: #315f67; font-size: 16px; }
.report-section p { line-height: 1.6; }
.clinical-report footer { margin-top: 50px; padding-top: 25px; border-top: 1px solid #dfe7ea; }
.clinical-report footer p { margin-top: 25px; color: #7b8790; font-size: 11px; }
.print-button { display: block; margin: 20px auto; padding: 13px 20px; border: 0; border-radius: 9px; background: #4696a1; color: white; cursor: pointer; font-weight: 700; }
@media print { .report-body { padding: 0; background: white; } .clinical-report { max-width: none; min-height: 0; box-shadow: none; padding: 25px; } .print-button { display: none; } }
@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
    .filters { align-items: stretch; }
    .filters .search-box, .filters select, .filters .secondary-button { width: 100%; }
    .sidebar-bottom { display: block; }
    .agenda-layout { grid-template-columns: 1fr; }
    .calendar-day { min-height: 72px; padding: 5px; }
    .calendar-event { font-size: 0; width: 7px; height: 7px; padding: 0; display: inline-block; border-radius: 50%; }
    .day-panel { position: static; }
    .patient-profile-grid { grid-template-columns: 1fr; }
    .profile-details dl { grid-template-columns: 1fr; }
    .clinical-timeline { margin-left: 0; border-left: 0; }
    .clinical-timeline a { grid-template-columns: 1fr; gap: 4px; border-bottom: 1px solid #e4eaed; margin-bottom: 18px; }
    .clinical-timeline a::before { display: none; }
    .clinical-timeline time { margin-left: 0; }
    .report-patient { grid-template-columns: 1fr 1fr; }
    .inventory-summary, .inventory-grids { grid-template-columns: 1fr; }
    .quote-builder { grid-template-columns: 1fr; }
    .quote-summary { position: static; }
    .quote-row { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid #e1e8eb; border-radius: 10px; }
    .quote-row .quote-product { grid-column: 1 / -1; }
    .proposal-price { grid-template-columns: 1fr; }
}

/* Historia clínica: navegación y resultados guiados */
.clinical-nav{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 22px;padding:12px;background:#e9f3f3;border:1px solid #d5e7e8;border-radius:16px}
.clinical-nav a{padding:10px 13px;border-radius:10px;color:#28545c;text-decoration:none;font-size:13px;font-weight:700}
.clinical-nav a:hover,.clinical-nav a:focus-visible{background:#fff;color:#126b76;outline:2px solid #78bbc1}
.clinical-form{background:transparent!important;box-shadow:none!important;overflow:visible;border:0!important}
.clinical-form fieldset{min-width:0;margin:0 0 20px!important;padding:24px!important;border:1px solid #dde8eb!important;border-radius:18px;background:white;box-shadow:0 5px 20px #163b4910;scroll-margin-top:20px}
.clinical-form legend{float:left;margin:0 0 20px!important;padding:0 0 14px!important;color:#174853;font-size:18px}
.clinical-form legend+*{clear:both}
.clinical-form .clinical-grid,.clinical-form .ear-grid{align-items:start;gap:16px}
.clinical-form .clinical-panel{background:#f8fbfb;border-color:#e1ecec;border-radius:13px;padding:18px}
.clinical-form .clinical-panel h3{font-size:15px;color:#236773}
.clinical-form .check-row label,.clinical-form .clinical-question label{justify-content:flex-start;gap:7px}
.clinical-form input[type=checkbox],.clinical-form input[type=radio]{flex:0 0 17px;margin:0!important}
.clinical-form .check-row label:has(input:checked),.clinical-form .clinical-question label:has(input:checked){background:#e6f5f3;border-color:#499d9f;color:#155c62}
.clinical-form .ear-card:first-child{border-top:3px solid #c87579}
.clinical-form .ear-card:last-child{border-top:3px solid #668ec4}
.clinical-form .ear-card:first-child .ear-badge{background:#faecec;color:#a34350}
.clinical-form .ear-card:last-child .ear-badge{background:#edf2fc;color:#3e66a4}
.clinical-form textarea{min-height:90px;background:#fcfdfd!important}
.clinical-intro{font-size:14px;line-height:1.65;color:#526c76;margin:0 0 20px;max-width:780px}
.clinical-intro a{color:#166d78;text-decoration:underline}
.clinical-tests{display:grid;gap:12px}
.clinical-test{border:1px solid #dce7e9;border-radius:13px;overflow:hidden;background:#fff}
.clinical-test[open]{border-color:#8abec1;box-shadow:0 3px 12px #245d6a0a}
.clinical-test summary{display:flex;align-items:center;gap:14px;padding:18px;cursor:pointer;list-style:none;background:#f7fafa}
.clinical-test summary::-webkit-details-marker{display:none}
.clinical-test summary:focus-visible{outline:3px solid #328f9c;outline-offset:-3px}
.test-symbol{display:grid;place-items:center;flex:0 0 34px;height:34px;background:#e0efef;border-radius:10px;color:#26717b;font-size:22px}
.clinical-test[open] .test-symbol{transform:rotate(45deg)}
.test-title{flex:1;min-width:0}.test-title strong{display:block;color:#214c58;font-size:15px}.test-title small{display:block;color:#637b84;font-size:13px;margin-top:5px;line-height:1.5}
.test-status{font-size:12px;color:#365f66;background:#eaf2f2;border-radius:20px;padding:6px 10px;white-space:nowrap}
.test-body{padding:20px}.test-body label{font-size:14px;font-weight:700;color:#264f5a}.test-body p{font-size:13px;color:#59717b;line-height:1.6;margin:8px 0 12px}
.clinical-form .logo-audiometry{margin-top:22px;background:#edf6f6;border:1px solid #dceced;border-radius:14px;padding:20px}
.clinical-form .inline-measures{gap:14px}.clinical-form .inline-measures label{line-height:1.5}
.clinical-form .sticky-actions{background:#fff;border:1px solid #dce7e9;border-radius:14px;padding:18px 24px;box-shadow:0 4px 20px #1737460d}
@media(max-width:650px){.clinical-form fieldset{padding:17px!important}.clinical-nav{gap:4px}.clinical-nav a{padding:8px;font-size:12px}.test-status{font-size:11px;padding:5px 7px}.clinical-test summary{padding:13px;gap:9px}.test-title small{font-size:12px}.test-body{padding:15px}.clinical-form .inline-measures{grid-template-columns:1fr}.clinical-form .sticky-actions{position:static}}


/* Cotización Audioplus: presentación comercial */
.quote-page-header{padding:28px 30px;border-radius:20px;background:linear-gradient(115deg,#143b46,#235d65);color:#fff;position:relative;overflow:hidden;margin-bottom:24px}
.quote-page-header h1{color:#fff;font-size:32px;letter-spacing:-1px;margin:8px 0}
.quote-page-header .welcome{color:#b6dbd8;font-size:10px;letter-spacing:2px}
.quote-page-header .page-description{color:#d3e5e5;line-height:1.6;max-width:640px}
.quote-page-header .secondary-button{background:#ffffff0d;border-color:#ffffff40;color:white}
#quote-form{grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}
#quote-form .quote-main{min-width:0;padding:26px;background:#fff;border:1px solid #e3e9e9;border-radius:20px;box-shadow:0 8px 30px #17374608}
.quote-section-title{display:flex;align-items:center;gap:13px;margin-bottom:22px}
.quote-section-title>span{display:grid;place-items:center;width:36px;height:36px;border-radius:12px;background:#eaf3f2;color:#34756f;font-size:12px;font-weight:800}
#quote-form .quote-section-title h2{margin:0;font-size:19px;letter-spacing:-.4px}.quote-section-title p{font-size:12px;color:#70868b;margin:5px 0 0}
#quote-form .form-grid{gap:18px}
#quote-form .form-group{min-width:0}
#quote-form input:not([type=hidden]),#quote-form select,#quote-form textarea{box-sizing:border-box;min-width:0;width:100%;font:inherit;font-size:13px;color:#244551;background:#f8faf9;border:1px solid #d6e2e2;border-radius:10px;padding:12px;line-height:1.5}
#quote-form select,#quote-form input:not([type=hidden]){min-height:44px}
#quote-form textarea{resize:vertical;min-height:92px}
#quote-form input:focus-visible,#quote-form select:focus-visible,#quote-form textarea:focus-visible{outline:3px solid #4ba89f30;border-color:#398b88;background:#fff}
#quote-form label{font-size:12px;font-weight:600;color:#385863}
#quote-form .section-heading{margin:30px 0 18px;display:flex;flex-wrap:wrap;align-items:center;gap:12px}
#quote-form .section-heading .welcome{font-size:10px;letter-spacing:1.7px;color:#56847f}
#quote-form .section-heading h2{font-size:23px;letter-spacing:-.6px;margin:8px 0 0}
#quote-form .tier-legend{display:flex;flex-wrap:wrap;gap:5px}
#quote-form .tier-legend span{font-size:9px;padding:5px 8px;border-radius:6px}
#quote-form .quote-items{gap:18px}
#quote-form .quote-product-card{border-radius:16px;border:1px solid #d8e5e3;box-shadow:0 4px 16px #193c4505}
#quote-form .quote-visual{grid-template-columns:42% minmax(0,1fr);min-height:225px;background:#fcfdfc}
#quote-form .product-image-stage{min-height:225px;background:radial-gradient(ellipse at 50% 40%,#fff 10%,#eaf1ee 85%)}
#quote-form .product-image-stage img{height:200px;max-width:100%}
#quote-form .product-meta{padding:22px 18px;min-width:0;overflow-wrap:anywhere}
#quote-form .product-meta h3{font-size:24px;letter-spacing:-.8px;line-height:1.2;margin:14px 0 9px}
#quote-form .product-meta p{font-size:13px;line-height:1.7;margin:0}
#quote-form .product-meta small{font-size:11px;color:#6a8085;line-height:1.6}
#quote-form .tier-badge{background:#e8f2ef;color:#36685e;letter-spacing:.7px;font-size:9px;border-radius:6px;padding:6px 9px}
#quote-form .quote-product-card .quote-row{display:grid;grid-template-columns:minmax(0,1fr) 78px 34px;gap:12px;padding:16px;background:#f7faf9;align-items:end}
#quote-form .quote-model-label{grid-column:1/-1}
#quote-form .quote-ear-label{grid-column:1}
#quote-form .quote-quantity-label{grid-column:2}
#quote-form .quote-row label>span,#quote-form .quote-line-label>span{display:block;font-size:10px;letter-spacing:.3px;color:#668079;margin-bottom:6px}
#quote-form .quote-line-label{grid-column:1/3;grid-row:3;display:flex;align-items:center;justify-content:space-between;border-top:1px solid #dfe9e6;padding-top:12px}
#quote-form .quote-line-label>span{margin:0;font-size:12px}
#quote-form .quote-line{font-size:17px;color:#25584e}
#quote-form .remove-row{grid-column:3;grid-row:2;background:#fff;border:1px solid #dfdedc;border-radius:9px;color:#8b6c65;width:34px;height:44px;padding:0;cursor:pointer}
#quote-form .remove-row:disabled{opacity:.35;cursor:default}
#quote-form #add-row{width:100%;border:1px dashed #a6c6bf;background:#f3f9f6;color:#30685e;justify-content:center;min-height:46px;border-radius:12px;font-size:12px}
#quote-form .quote-main>fieldset{margin:28px 0 0;padding:20px 0 0;min-width:0}
#quote-form .quote-main>fieldset legend{font-size:12px;letter-spacing:.4px}
#quote-form .quote-summary{padding:0;border:1px solid #dfe8e5;border-radius:20px;box-shadow:0 12px 32px #173c4510;position:sticky;top:20px;background:#fff}
.quote-summary-heading{padding:28px 24px 22px;background:#f5f8f4;border-bottom:1px solid #e2e9de}
#quote-form .quote-summary-heading .welcome{font-size:9px;letter-spacing:1.8px;color:#6d8163}
#quote-form .quote-summary-heading h2{font-size:26px;line-height:1.2;letter-spacing:-.7px;margin:12px 0;color:#244b43}
.quote-summary-heading p{font-size:12px;color:#74867d;line-height:1.6;margin:0}
#quote-form .price-breakdown{padding:24px;margin:0;font-size:13px}
#quote-form .price-breakdown>div{gap:10px}
#quote-form .price-breakdown>label{display:grid;grid-template-columns:1fr 110px;align-items:center;gap:12px;margin-top:17px;line-height:1.5}
#quote-form .price-breakdown input{padding:9px;font-size:12px;min-height:40px}
#quote-form .price-breakdown>small{font-size:10px;line-height:1.5;margin-top:5px}
#quote-form .price-breakdown .saving{padding-top:18px;margin-top:22px;color:#2d765a;border-top:1px solid #dfebe5;font-size:13px}
#quote-form .final-price{margin:0;padding:26px 24px;background:linear-gradient(135deg,#19463f,#28665e);color:#fff;text-align:left}
#quote-form .final-price>span{font-size:12px;color:#cbe3d9}
#quote-form .final-price>strong{display:block;font-size:42px;letter-spacing:-1.5px;margin:9px 0;overflow-wrap:anywhere;line-height:1.15}
#quote-form .final-price>small{font-size:10px;line-height:1.6;color:#cee2db}
#quote-form .quote-submit{display:flex;align-items:center;justify-content:space-between;width:calc(100% - 40px);margin:20px 20px 0;padding:15px 18px;border-radius:11px;background:#245e57;color:#fff;box-shadow:0 4px 10px #23584f18;font-size:13px}
#quote-form .quote-submit:hover{background:#19473f}
.quote-save-help{font-size:10px;line-height:1.6;text-align:center;color:#75847e;margin:10px 24px 20px}
@media(min-width:1500px){#quote-form{grid-template-columns:minmax(0,1fr) 360px}#quote-form .quote-visual{min-height:270px}#quote-form .product-image-stage{min-height:270px}#quote-form .product-image-stage img{height:240px}}
@media(max-width:1150px){#quote-form{grid-template-columns:minmax(0,1fr)}#quote-form .quote-summary{position:static}#quote-form .quote-summary-heading h2 br{display:none}}
@media(max-width:600px){.quote-page-header{padding:22px;display:block}.quote-page-header h1{font-size:27px}.quote-page-header .header-actions{margin-top:16px;flex-wrap:wrap}#quote-form .quote-main{padding:18px}#quote-form .quote-visual{grid-template-columns:1fr}#quote-form .product-image-stage{min-height:190px}#quote-form .form-grid{grid-template-columns:minmax(0,1fr)}#quote-form .product-meta{padding:20px}#quote-form .quote-row{border:0;border-radius:0}}


/* Búsqueda compartida de pacientes y cotizaciones */
.patient-search-box{margin:0 0 8px;min-width:0;width:100%}
.patient-search-box input[type=search]{box-sizing:border-box;width:100%;min-height:44px;padding:11px 13px!important;border:1px solid #a7c8c6!important;border-radius:10px;background:#f4faf9!important;color:#244b53;font:inherit;font-size:13px!important}
.patient-search-box input:focus-visible{outline:3px solid #4ba89f30}
.patient-search-help{display:block;font-size:11px!important;line-height:1.5;color:#526e74;margin:7px 0 12px;font-weight:400}
select[data-search-ready]{width:100%;max-width:100%;min-width:0}
select[data-search-ready][size]:not([size="1"]){height:auto!important;min-height:84px;padding:6px!important;background:#fff!important}
select[data-search-ready] option{padding:8px}
