/* =========================================================
   AUDIOPLUS | SISTEMA DE GESTIÓN
   DISEÑO GENERAL Y VARIABLES
========================================================= */

:root {
    --primary: #2da1ac;
    --primary-dark: #176f78;
    --primary-deep: #0f5961;
    --primary-soft: #e8f6f7;
    --primary-pale: #f3fbfb;

    --sidebar: #082f36;
    --sidebar-dark: #06262c;
    --sidebar-border: rgba(255, 255, 255, 0.10);

    --background: #f4f7f8;
    --surface: #ffffff;
    --surface-soft: #f8fafb;

    --text: #20323d;
    --text-secondary: #697982;
    --text-light: #93a0a6;

    --border: #e4ebed;

    --success: #2f9d5b;
    --success-bg: #e5f5eb;

    --warning: #d98a1d;
    --warning-bg: #fff4df;

    --danger: #d9534f;
    --danger-bg: #fdeaea;

    --info: #3569a8;
    --info-bg: #e8f0fb;

    --shadow-sm: 0 4px 14px rgba(18, 44, 52, 0.05);
    --shadow: 0 10px 30px rgba(18, 44, 52, 0.08);
    --shadow-lg: 0 25px 70px rgba(10, 34, 40, 0.18);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --transition: 0.22s ease;
}


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--background);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}


/* =========================================================
   LOGIN AUDIOPLUS
========================================================= */

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(400px, 0.9fr);
    background: #ffffff;
}


/* PANEL DE MARCA */

.login-brand {
    position: relative;
    min-height: 100vh;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 50px 9% 40px;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(45, 161, 172, 0.32),
            transparent 28%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(45, 161, 172, 0.16),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #06282e,
            #0a3d44 55%,
            #0d5961
        );
}

.login-brand::before {
    content: "";
    position: absolute;

    width: 420px;
    height: 420px;

    border-radius: 50%;

    border: 1px solid rgba(255, 255, 255, 0.05);

    top: -190px;
    right: -170px;
}

.login-brand::after {
    content: "";

    position: absolute;

    width: 350px;
    height: 350px;

    border-radius: 50%;

    border: 1px solid rgba(45, 161, 172, 0.18);

    bottom: -210px;
    left: -100px;
}

.brand-content,
.brand-footer {
    position: relative;
    z-index: 2;
}


/* LOGO */

.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-icon,
.mobile-logo-icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 17px;

    background: rgba(45, 161, 172, 0.16);

    border: 1px solid rgba(45, 161, 172, 0.35);

    color: #56d0da;
}

.brand-icon span,
.mobile-logo-icon span {
    font-size: 42px;
    line-height: 1;
    font-weight: bold;
}

.brand-text h1 {
    font-size: 26px;
    letter-spacing: 1.5px;
}

.brand-text p {
    margin-top: 4px;

    font-size: 14px;

    color: rgba(255, 255, 255, 0.68);
}


/* PRESENTACIÓN */

.brand-presentation {
    max-width: 600px;

    margin-top: 120px;
}

.system-label,
.welcome-label {
    display: inline-flex;

    padding: 7px 12px;

    border-radius: 30px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.system-label {
    color: #74dce4;

    background: rgba(45, 161, 172, 0.12);

    border: 1px solid rgba(45, 161, 172, 0.25);
}

.brand-presentation h2 {
    margin-top: 24px;

    font-size: clamp(38px, 4vw, 58px);

    line-height: 1.12;

    letter-spacing: -1.5px;
}

.brand-presentation h2 span {
    color: #58d2db;
}

.brand-presentation > p {
    max-width: 560px;

    margin-top: 22px;

    font-size: 17px;
    line-height: 1.75;

    color: rgba(255, 255, 255, 0.70);
}


/* CARACTERÍSTICAS */

.brand-features {
    display: grid;
    gap: 18px;

    margin-top: 50px;
}

.feature-item {
    display: flex;
    align-items: center;

    gap: 15px;
}

.feature-icon {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    color: #ffffff;

    background: rgba(45, 161, 172, 0.18);

    border: 1px solid rgba(45, 161, 172, 0.30);
}

.feature-item strong,
.feature-item span {
    display: block;
}

.feature-item strong {
    font-size: 15px;
}

.feature-item span {
    margin-top: 3px;

    font-size: 13px;

    color: rgba(255, 255, 255, 0.58);
}

.brand-footer {
    padding-top: 25px;

    border-top: 1px solid rgba(255, 255, 255, 0.10);

    font-size: 13px;

    color: rgba(255, 255, 255, 0.48);
}


/* PANEL DERECHO */

.login-section {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;

    background:
        radial-gradient(
            circle at 85% 10%,
            rgba(45, 161, 172, 0.08),
            transparent 24%
        ),
        #f8fafb;
}

.login-card {
    width: 100%;
    max-width: 440px;
}


/* LOGO MÓVIL */

.mobile-logo {
    display: none;

    align-items: center;
    gap: 12px;

    margin-bottom: 50px;
}

.mobile-logo h2 {
    font-size: 20px;
    letter-spacing: 1px;

    color: var(--text);
}

.mobile-logo p {
    margin-top: 3px;

    font-size: 13px;

    color: var(--text-secondary);
}


/* CABECERA LOGIN */

.login-header {
    margin-bottom: 35px;
}

.welcome-label {
    color: var(--primary-dark);

    background: var(--primary-soft);
}

.login-header h2 {
    margin-top: 16px;

    font-size: 36px;
    line-height: 1.15;

    color: var(--text);
}

.login-header p {
    margin-top: 12px;

    color: var(--text-secondary);

    line-height: 1.6;
}


/* FORMULARIO */

.input-group {
    margin-bottom: 22px;
}

.input-group label {
    display: block;

    margin-bottom: 9px;

    font-size: 14px;
    font-weight: 600;

    color: var(--text);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;

    left: 16px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 16px;

    filter: grayscale(1);

    opacity: 0.65;

    pointer-events: none;
}

.input-group input {
    width: 100%;
    height: 54px;

    padding: 0 16px 0 48px;

    border: 1px solid var(--border);
    border-radius: 12px;

    outline: none;

    background: #ffffff;

    color: var(--text);

    font-size: 15px;

    transition: var(--transition);
}

.input-group input::placeholder {
    color: #a8b2b7;
}

.input-group input:hover {
    border-color: #cbd7da;
}

.input-group input:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 4px rgba(45, 161, 172, 0.10);
}


/* OPCIONES */

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 2px 0 26px;
}

.remember-option {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    font-size: 13px;

    color: var(--text-secondary);

    cursor: pointer;
}

.remember-option input {
    width: 16px;
    height: 16px;

    accent-color: var(--primary);
}


/* BOTÓN LOGIN */

.login-button {
    width: 100%;
    min-height: 55px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 21px;

    border: none;
    border-radius: 12px;

    color: #ffffff;

    background: linear-gradient(
        135deg,
        var(--primary),
        #248e99
    );

    font-size: 15px;
    font-weight: 700;

    box-shadow: 0 10px 22px rgba(45, 161, 172, 0.20);

    transition: var(--transition);
}

.login-button:hover {
    transform: translateY(-2px);

    background: linear-gradient(
        135deg,
        #238e99,
        var(--primary-dark)
    );

    box-shadow: 0 15px 28px rgba(45, 161, 172, 0.28);
}

.login-button:active {
    transform: translateY(0);
}

.button-arrow {
    font-size: 22px;
}


/* MENSAJE */

#mensaje {
    min-height: 20px;

    margin-top: 16px;

    text-align: center;

    font-size: 14px;

    color: var(--danger);
}


/* PIE LOGIN */

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-top: 38px;
    padding-top: 24px;

    border-top: 1px solid var(--border);

    color: var(--text-light);

    font-size: 12px;
}

.secure-icon {
    font-size: 13px;
}


/* =========================================================
   COMPATIBILIDAD CON LOGIN ANTERIOR
========================================================= */

.login-container {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: linear-gradient(
        135deg,
        var(--primary-dark),
        var(--primary)
    );
}

.login-container .login-card {
    max-width: 420px;

    padding: 45px 40px;

    border-radius: var(--radius-lg);

    background: #ffffff;

    box-shadow: var(--shadow-lg);
}

.logo-area {
    text-align: center;

    margin-bottom: 35px;
}

.logo-icon {
    width: 70px;
    height: 70px;

    margin: 0 auto 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    color: #ffffff;

    background: var(--primary);

    font-size: 26px;
    font-weight: bold;
}

.logo-area h1 {
    color: var(--primary-dark);

    font-size: 28px;

    letter-spacing: 2px;
}

.logo-area p {
    margin-top: 8px;

    color: var(--text-secondary);

    font-size: 15px;
}

.footer-login {
    margin-top: 30px;

    text-align: center;

    color: var(--text-light);

    font-size: 13px;
}


/* =========================================================
   ESTRUCTURA GENERAL DEL SISTEMA
========================================================= */

.sistema {
    min-height: 100vh;

    display: flex;

    background: var(--background);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: sticky;
    top: 0;

    width: 260px;
    height: 100vh;

    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    padding: 24px 14px;

    color: #ffffff;

    background:
        linear-gradient(
            180deg,
            #082f36,
            #06272d
        );

    border-right: 1px solid rgba(255,255,255,0.04);

    z-index: 100;
}


/* LOGO SIDEBAR */

.sidebar-logo {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 8px 10px 26px;

    margin-bottom: 20px;

    border-bottom: 1px solid var(--sidebar-border);
}

.mini-logo {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    color: #ffffff;

    background: linear-gradient(
        135deg,
        var(--primary),
        #1b7d87
    );

    font-size: 18px;
    font-weight: bold;
}

.sidebar-logo h2 {
    font-size: 18px;

    letter-spacing: 1.5px;
}

.sidebar-logo span {
    display: block;

    margin-top: 4px;

    font-size: 11px;

    color: #9fc4c7;
}


/* MENÚ */

.menu {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.menu a,
.sidebar-bottom a {
    min-height: 50px;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 0 14px;

    border-radius: 11px;

    text-decoration: none;

    color: #c5d5d7;

    font-size: 15px;

    transition: var(--transition);
}

.menu a:hover,
.sidebar-bottom a:hover {
    color: #ffffff;

    background: rgba(255,255,255,0.07);
}

.menu a.activo {
    color: #ffffff;

    background: linear-gradient(
        135deg,
        rgba(45, 161, 172, 0.96),
        rgba(31, 132, 143, 0.96)
    );

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;

    gap: 5px;

    margin-top: auto;

    padding-top: 20px;

    border-top: 1px solid var(--sidebar-border);
}

.logout {
    color: #ffb8b8 !important;
}


/* =========================================================
   CONTENIDO PRINCIPAL
========================================================= */

.contenido {
    flex: 1;

    min-width: 0;

    padding: 32px;

    overflow: auto;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 25px;

    margin-bottom: 28px;
}

.topbar h1 {
    color: var(--text);

    font-size: 32px;

    line-height: 1.15;
}

.topbar p {
    margin-top: 8px;

    color: var(--text-secondary);
}

.usuario {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 8px 14px 8px 9px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface);

    box-shadow: var(--shadow-sm);
}

.usuario small {
    display: block;

    margin-top: 3px;

    color: var(--text-secondary);
}

.avatar {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: #ffffff;

    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-dark)
    );

    font-weight: bold;
}


/* =========================================================
   BIENVENIDA
========================================================= */

.bienvenida {
    margin-bottom: 28px;

    padding: 28px 32px;

    border-radius: var(--radius-lg);

    color: #ffffff;

    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(255,255,255,0.10),
            transparent 22%
        ),
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    box-shadow: 0 14px 35px rgba(45, 161, 172, 0.18);
}

.bienvenida h2 {
    margin-bottom: 8px;

    font-size: 25px;
}

.bienvenida p {
    color: rgba(255,255,255,0.84);
}


/* =========================================================
   TARJETAS DE RESUMEN
========================================================= */

.tarjetas,
.agenda-resumen {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 20px;

    margin-bottom: 28px;
}

.card,
.agenda-card {
    min-height: 118px;

    display: flex;
    align-items: center;

    gap: 16px;

    padding: 21px;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: var(--surface);

    box-shadow: var(--shadow-sm);

    transition: var(--transition);
}

.card:hover,
.agenda-card:hover {
    transform: translateY(-3px);

    box-shadow: var(--shadow);
}

.card-icon,
.agenda-icono {
    width: 54px;
    height: 54px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background: var(--primary-soft);

    color: var(--primary-dark);

    font-size: 24px;
}

.card p,
.agenda-card span {
    margin-bottom: 5px;

    color: var(--text-secondary);

    font-size: 14px;
}

.card h2,
.agenda-card strong {
    color: var(--text);

    font-size: 27px;
}

.agenda-card div:last-child {
    display: flex;
    flex-direction: column;

    gap: 3px;
}


/* =========================================================
   PANELES
========================================================= */

.panel-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 24px;
}

.panel,
.tabla-contenedor {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow: var(--shadow-sm);
}

.panel {
    min-height: 250px;

    padding: 24px;
}

.panel-header,
.tabla-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding-bottom: 18px;

    border-bottom: 1px solid var(--border);
}

.tabla-header {
    margin-bottom: 20px;
}

.panel-header h2,
.tabla-header h2 {
    color: var(--text);

    font-size: 19px;
}

.panel-header button {
    width: auto;

    padding: 10px 15px;

    border: 1px solid #cfe3e5;
    border-radius: 9px;

    color: var(--primary-dark);

    background: var(--primary-pale);

    font-size: 13px;
    font-weight: 700;

    transition: var(--transition);
}

.panel-header button:hover {
    color: #ffffff;

    background: var(--primary);

    border-color: var(--primary);
}

.empty {
    min-height: 150px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-light);
}


/* =========================================================
   PACIENTES
========================================================= */

.pacientes-header {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}

.buscador {
    flex: 1;

    min-height: 52px;

    display: flex;
    align-items: center;

    padding: 0 16px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: var(--shadow-sm);
}

.buscador span {
    margin-right: 10px;

    font-size: 18px;
}

.buscador input {
    width: 100%;

    padding: 15px 5px;

    border: none;
    outline: none;

    background: transparent;

    color: var(--text);

    font-size: 15px;
}


/* BOTÓN PRINCIPAL */

.btn-principal {
    min-height: 52px;

    width: auto;

    padding: 0 22px;

    border: none;
    border-radius: 11px;

    color: #ffffff;

    background: var(--primary);

    font-size: 15px;
    font-weight: 700;

    box-shadow: 0 8px 18px rgba(45, 161, 172, 0.18);

    transition: var(--transition);
}

.btn-principal:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);
}


/* =========================================================
   TABLAS
========================================================= */

.tabla-contenedor {
    padding: 24px;
}

.contador {
    padding: 8px 12px;

    border-radius: 30px;

    color: var(--primary-dark);

    background: var(--primary-soft);

    font-size: 13px;
    font-weight: 600;
}

.tabla-responsive {
    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
}

table th {
    padding: 14px 15px;

    text-align: left;

    color: var(--text-secondary);

    background: var(--surface-soft);

    font-size: 12px;
    font-weight: 700;
}

table th:first-child {
    border-radius: 9px 0 0 9px;
}

table th:last-child {
    border-radius: 0 9px 9px 0;
}

table td {
    padding: 16px 15px;

    color: #43545d;

    border-bottom: 1px solid var(--border);

    font-size: 14px;
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:not(.sin-registros):hover {
    background: #f8fbfb;
}


/* ESTADOS VACÍOS */

.sin-registros,
.sin-citas {
    padding: 60px 20px !important;

    text-align: center;

    border: none !important;
}

.empty-icon {
    margin-bottom: 10px;

    font-size: 45px;
}

.sin-registros h3,
.sin-citas h3 {
    margin: 10px 0;

    color: var(--text);
}

.sin-registros p,
.sin-citas p {
    margin-bottom: 25px;

    color: var(--text-light);
}


/* =========================================================
   MODALES GENERALES
========================================================= */

.modal,
.modal-cita,
.modal-detalle-cita {
    position: fixed;
    inset: 0;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(6, 39, 45, 0.58);

    backdrop-filter: blur(3px);

    z-index: 9999;
}

.modal {
    z-index: 1000;
}

.modal-detalle-cita {
    z-index: 10000;
}

.modal-contenido,
.modal-cita-contenido,
.detalle-cita-contenido {
    width: 100%;

    max-height: 90vh;

    overflow-y: auto;

    background: #ffffff;

    border-radius: 20px;

    box-shadow: var(--shadow-lg);
}

.modal-contenido {
    max-width: 850px;

    padding: 30px;
}

.modal-cita-contenido {
    max-width: 760px;
}

.detalle-cita-contenido {
    max-width: 720px;
}


/* CABECERAS */

.modal-header,
.modal-cita-header,
.detalle-cita-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 20px;

    padding: 28px 32px 22px;

    border-bottom: 1px solid var(--border);
}

.modal-header {
    padding: 0 0 20px;

    margin-bottom: 25px;
}

.modal-header h2,
.modal-cita-header h2,
.detalle-cita-header h2 {
    color: var(--text);

    font-size: 23px;
}

.modal-header p,
.modal-cita-header p {
    margin-top: 6px;

    color: var(--text-secondary);

    font-size: 14px;
}

.cerrar-modal,
.cerrar-modal-cita {
    width: 40px;
    height: 40px;

    flex-shrink: 0;

    border: none;
    border-radius: 10px;

    background: #f1f5f6;

    color: var(--text);

    font-size: 24px;

    transition: var(--transition);
}

.cerrar-modal:hover,
.cerrar-modal-cita:hover {
    background: #e3ecee;
}


/* FORMULARIOS */

.form-grid,
.form-cita-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.form-grid .input-group {
    margin-bottom: 0;
}

.full-width,
.form-cita-grupo.full-width {
    grid-column: 1 / -1;
}

.form-grid input,
.form-grid textarea,
.form-cita-grupo input,
.form-cita-grupo select,
.form-cita-grupo textarea {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #d9e3e5;
    border-radius: 10px;

    outline: none;

    background: #ffffff;

    color: var(--text);

    font-size: 14px;

    transition: var(--transition);
}

.form-grid textarea,
.form-cita-grupo textarea {
    min-height: 100px;

    resize: vertical;
}

.form-grid input:focus,
.form-grid textarea:focus,
.form-cita-grupo input:focus,
.form-cita-grupo select:focus,
.form-cita-grupo textarea:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 3px rgba(45, 161, 172, 0.10);
}

.form-cita-grupo {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.form-cita-grupo label {
    font-size: 14px;
    font-weight: 600;

    color: var(--text);
}

#formCita,
.detalle-cita-body {
    padding: 30px 32px;
}

.form-acciones,
.form-cita-acciones {
    display: flex;

    justify-content: flex-end;

    gap: 12px;

    margin-top: 28px;

    padding-top: 20px;

    border-top: 1px solid var(--border);
}

.btn-cancelar,
.btn-cancelar-cita {
    padding: 13px 22px;

    border: none;
    border-radius: 10px;

    color: #52646b;

    background: #eef2f3;

    font-weight: 600;
}

.btn-cancelar:hover,
.btn-cancelar-cita:hover {
    background: #e0e8ea;
}

.btn-eliminar {
    padding: 13px 18px;

    border: 1px solid #efcaca;
    border-radius: 10px;

    color: #c94b4b;

    background: #fff5f5;

    font-weight: 700;
}

.btn-eliminar:hover {
    background: #ffe8e8;
}


/* =========================================================
   FICHA DEL PACIENTE
========================================================= */

#modalFicha .modal-contenido {
    max-width: 950px;

    padding: 0;

    overflow: hidden;

    background: #f8fbfb;
}

#modalFicha .modal-header {
    margin: 0;

    padding: 28px 32px;

    background: #ffffff;
}

#contenidoFicha {
    max-height: 58vh;

    overflow-y: auto;

    padding: 28px 32px;
}

.ficha-nombre {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-bottom: 24px;

    padding: 22px 25px;

    border: 1px solid #d9eaeb;
    border-radius: 15px;

    background: linear-gradient(
        135deg,
        var(--primary-soft),
        #f9fcfc
    );
}

.ficha-nombre h2 {
    color: var(--text);

    font-size: 25px;

    text-transform: capitalize;
}

.estado-activo {
    display: inline-flex;
    align-items: center;

    padding: 7px 14px;

    border-radius: 30px;

    color: #26734d;

    background: var(--success-bg);

    font-size: 13px;
    font-weight: 700;
}

.ficha-seccion {
    margin-bottom: 18px;

    padding: 22px 24px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: #ffffff;

    box-shadow: var(--shadow-sm);
}

.ficha-seccion h3 {
    margin-bottom: 18px;

    padding-bottom: 12px;

    border-bottom: 1px solid var(--border);

    color: var(--text);

    font-size: 18px;
}

.ficha-seccion p {
    margin: 9px 0;

    color: var(--text-secondary);

    font-size: 15px;
    line-height: 1.5;
}

.ficha-seccion p strong {
    color: var(--text);
}

#modalFicha .form-acciones {
    margin: 0;

    padding: 20px 32px;

    background: #ffffff;
}


/* =========================================================
   AGENDA Y CITAS
========================================================= */

#fechaActual {
    margin-top: 5px;

    color: var(--text-secondary);

    font-size: 14px;
}

.paciente-cita {
    display: flex;
    align-items: center;

    gap: 12px;
}

.avatar-paciente {
    width: 40px;
    height: 40px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: var(--primary-dark);

    background: var(--primary-soft);

    font-weight: 700;
}

.estado-cita {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 7px 13px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 700;
}

.estado-programada {
    color: var(--primary-dark);

    background: var(--primary-soft);
}

.estado-confirmada {
    color: #2d8659;

    background: var(--success-bg);
}

.estado-completada {
    color: var(--info);

    background: var(--info-bg);
}

.estado-cancelada {
    color: #c64b4b;

    background: var(--danger-bg);
}

.acciones-cita {
    display: flex;
    align-items: center;

    gap: 8px;
}

.btn-accion {
    padding: 8px 11px;

    border: none;
    border-radius: 9px;

    font-size: 14px;

    transition: var(--transition);
}

.btn-ver {
    color: var(--primary-dark);

    background: var(--primary-soft);
}

.btn-ver:hover {
    background: #d8eeee;
}

.btn-completar {
    color: #2f8a58;

    background: var(--success-bg);
}

.btn-completar:hover {
    background: #d3ecdd;
}

.btn-eliminar-cita {
    color: #c94c4c;

    background: var(--danger-bg);
}

.btn-eliminar-cita:hover {
    background: #f9dada;
}


/* BÚSQUEDA DE PACIENTE EN CITAS */

.paciente-busqueda {
    position: relative;
}

.buscador-paciente {
    height: 50px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 0 15px;

    border: 1px solid #dce5e8;
    border-radius: 12px;

    background: #ffffff;
}

.buscador-paciente input {
    width: 100%;

    border: none;
    outline: none;

    background: transparent;

    color: var(--text);

    font-size: 15px;
}

.resultados-pacientes {
    position: absolute;

    top: 78px;
    left: 0;
    right: 0;

    display: none;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #ffffff;

    box-shadow: var(--shadow);

    z-index: 1000;
}

.resultado-paciente {
    display: flex;
    flex-direction: column;

    gap: 3px;

    padding: 12px 15px;

    cursor: pointer;

    border-bottom: 1px solid var(--border);

    transition: var(--transition);
}

.resultado-paciente:last-child {
    border-bottom: none;
}

.resultado-paciente:hover {
    background: var(--primary-pale);
}

.resultado-paciente strong {
    color: var(--text);

    font-size: 14px;
}

.resultado-paciente span,
.sin-resultados {
    color: var(--text-secondary);

    font-size: 12px;
}

.sin-resultados {
    padding: 15px;

    text-align: center;
}


/* =========================================================
   RESPONSIVE TABLET
========================================================= */

@media (max-width: 1100px) {

    .login-page {
        grid-template-columns: minmax(360px, 0.85fr) 1fr;
    }

    .login-brand {
        padding-left: 7%;
        padding-right: 7%;
    }

    .brand-presentation {
        margin-top: 90px;
    }

    .brand-presentation h2 {
        font-size: 42px;
    }

    .tarjetas,
    .agenda-resumen {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   RESPONSIVE 900PX
========================================================= */

@media (max-width: 900px) {

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand {
        display: none;
    }

    .login-section {
        min-height: 100vh;
    }

    .mobile-logo {
        display: flex;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   RESPONSIVE MÓVIL
========================================================= */

@media (max-width: 700px) {

    .login-section {
        padding: 25px;
    }

    .mobile-logo {
        margin-bottom: 38px;
    }

    .login-header h2 {
        font-size: 30px;
    }

    .sidebar {
        width: 76px;

        padding: 20px 10px;
    }

    .sidebar-logo {
        justify-content: center;

        padding-left: 0;
        padding-right: 0;
    }

    .sidebar-logo h2,
    .sidebar-logo span,
    .menu a span,
    .sidebar-bottom a span {
        display: none;
    }

    .menu a,
    .sidebar-bottom a {
        justify-content: center;

        padding: 0;

        font-size: 19px;
    }

    .contenido {
        padding: 20px 15px;
    }

    .topbar {
        align-items: center;

        margin-bottom: 22px;
    }

    .topbar h1 {
        font-size: 25px;
    }

    .topbar p {
        font-size: 13px;
    }

    .usuario {
        padding: 7px;
    }

    .usuario div:last-child {
        display: none;
    }

    .tarjetas,
    .agenda-resumen,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .pacientes-header {
        flex-direction: column;
    }

    .btn-principal {
        width: 100%;
    }

    .tabla-contenedor,
    .panel {
        padding: 17px;
    }

    .modal,
    .modal-cita,
    .modal-detalle-cita {
        padding: 10px;
    }

    .modal-contenido {
        padding: 22px;

        max-height: 95vh;
    }

    .modal-cita-contenido,
    .detalle-cita-contenido {
        max-height: 95vh;
    }

    .form-grid,
    .form-cita-grid,
    .detalle-grid {
        grid-template-columns: 1fr;
    }

    .full-width,
    .form-cita-grupo.full-width {
        grid-column: auto;
    }

    .form-acciones,
    .form-cita-acciones {
        flex-direction: column-reverse;
    }

    .form-acciones button,
    .form-cita-acciones button {
        width: 100%;
    }

    .modal-cita-header,
    #formCita,
    .detalle-cita-header,
    .detalle-cita-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    #modalFicha .modal-header {
        padding: 22px;
    }

    #contenidoFicha {
        padding: 20px;

        max-height: 60vh;
    }

    .ficha-nombre {
        flex-direction: column;
        align-items: flex-start;
    }

    #modalFicha .form-acciones {
        padding: 18px 20px;
    }

}


/* =========================================================
   RESPONSIVE MÓVIL PEQUEÑO
========================================================= */

@media (max-width: 480px) {

    .login-section {
        padding: 20px;
    }

    .login-header h2 {
        font-size: 27px;
    }

    .login-card {
        max-width: 100%;
    }

    .mobile-logo-icon {
        width: 50px;
        height: 50px;
    }

    .tarjetas,
    .agenda-resumen {
        gap: 14px;
    }

    .card,
    .agenda-card {
        padding: 18px;
    }

}
/* =========================================================
   DASHBOARD PROFESIONAL AUDIOPLUS
   Agregar al FINAL del style.css
========================================================= */

/* ---------- VARIABLES DEL DASHBOARD ---------- */

:root {
    --ap-primary: #2da1ac;
    --ap-primary-dark: #176f78;
    --ap-primary-deep: #0f5961;
    --ap-sidebar: #082f36;
    --ap-bg: #f4f7f8;
    --ap-card: #ffffff;
    --ap-text: #20303c;
    --ap-muted: #71808c;
    --ap-border: #e4ebee;
    --ap-success: #2f9b59;
    --ap-warning: #e6a321;
    --ap-danger: #df4d4d;
}


/* =========================================================
   ESTRUCTURA GENERAL
========================================================= */

.sistema {
    min-height: 100vh;
    display: flex;
    background: var(--ap-bg);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 260px;
    min-width: 260px;
    min-height: 100vh;
    background: var(--ap-sidebar);
    color: #ffffff;
    padding: 28px 14px 22px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 8px 10px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    margin-bottom: 26px;
}

.audioplus-symbol {
    width: 52px;
    height: 52px;
    color: #2da1ac;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audioplus-symbol svg {
    width: 100%;
    height: 100%;
}

.sidebar-brand-text h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 1px;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-brand-text span {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,255,0.68);
    font-size: 13px;
}


/* TITULOS DEL MENÚ */

.sidebar-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.52);
    padding: 0 12px;
    margin: 0 0 12px;
}


/* MENU */

.menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.menu a,
.sidebar-system a {
    height: 54px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 15px;
    border-radius: 11px;
    color: rgba(255,255,255,0.76);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: 0.2s ease;
    box-sizing: border-box;
}

.menu a svg,
.sidebar-system a svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.menu a:hover,
.sidebar-system a:hover {
    background: rgba(45,161,172,0.12);
    color: #ffffff;
}

.menu a.activo {
    background: linear-gradient(
        135deg,
        #218f9b,
        #2da1ac
    );
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(0,0,0,0.16);
}


/* SISTEMA */

.sidebar-system {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.09);
}

.sidebar-system .sidebar-section-title {
    margin-bottom: 12px;
}

.logout {
    margin-top: 7px;
}

.logout:hover {
    background: rgba(220,70,70,0.10) !important;
    color: #ff8b8b !important;
}


/* FOOTER SIDEBAR */

.sidebar-footer {
    margin-top: auto;
    padding: 24px 10px 0;
    border-top: 1px solid rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-logo-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.sidebar-footer strong {
    display: block;
    color: #ffffff;
    font-size: 15px;
}

.sidebar-footer span {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
}


/* =========================================================
   CONTENIDO PRINCIPAL
========================================================= */

.dashboard-contenido {
    width: calc(100% - 260px);
    min-height: 100vh;
    margin-left: 260px;
    padding: 0 34px 35px;
    box-sizing: border-box;
    background: var(--ap-bg);
}


/* =========================================================
   TOPBAR
========================================================= */

.dashboard-topbar {
    min-height: 125px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    padding: 20px 0;
    box-sizing: border-box;
}

.dashboard-title {
    display: flex;
    align-items: flex-start;
    gap: 22px;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    margin-top: 3px;
    border: none;
    background: transparent;
    color: var(--ap-text);
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-title h1 {
    margin: 0 0 14px;
    font-size: 30px;
    color: var(--ap-text);
    line-height: 1;
}

.dashboard-title .saludo {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--ap-text);
}

.dashboard-title span {
    color: var(--ap-muted);
    font-size: 15px;
}


/* ACCIONES SUPERIORES */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.global-search {
    width: 325px;
    height: 45px;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--ap-border);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(26,52,61,0.04);
    overflow: hidden;
}

.global-search input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 14px;
    background: transparent;
    color: var(--ap-text);
    font-size: 14px;
}

.global-search button {
    width: 46px;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-search svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #52636e;
    stroke-width: 2;
    stroke-linecap: round;
}


/* NOTIFICACIONES */

.notification-button {
    width: 47px;
    height: 47px;
    position: relative;
    border: 1px solid var(--ap-border);
    border-radius: 11px;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(26,52,61,0.05);
}

.notification-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: var(--ap-text);
    stroke-width: 1.8;
}

.notification-button span {
    position: absolute;
    top: -7px;
    right: -5px;
    width: 21px;
    height: 21px;
    background: var(--ap-primary);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* USUARIO */

.top-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 165px;
}

.top-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--ap-primary-dark),
        var(--ap-primary)
    );
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.top-user-info strong {
    display: block;
    font-size: 15px;
    color: var(--ap-text);
}

.top-user-info span {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    color: var(--ap-muted);
}

.user-arrow {
    font-size: 21px;
    margin-left: auto;
    color: var(--ap-text);
}


/* FECHA */

.dashboard-date {
    min-width: 175px;
    padding: 12px 15px;
    background: #ffffff;
    border: 1px solid var(--ap-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 3px 12px rgba(26,52,61,0.04);
}

.dashboard-date svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: #51616c;
    stroke-width: 1.8;
}

.dashboard-date strong {
    display: block;
    font-size: 14px;
    color: var(--ap-text);
}

.dashboard-date span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--ap-muted);
}


/* =========================================================
   TARJETAS RESUMEN
========================================================= */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 24px;
}

.dashboard-stat-card {
    min-height: 134px;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--ap-card);
    border: 1px solid var(--ap-border);
    border-radius: 18px;
    box-shadow: 0 7px 25px rgba(29,56,65,0.07);
}

.stat-icon {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-icon-citas {
    background: #e2f3f5;
}

.stat-icon-citas svg {
    stroke: var(--ap-primary-dark);
}

.stat-icon-pacientes {
    background: #e8eefb;
}

.stat-icon-pacientes svg {
    stroke: #3162b7;
}

.stat-icon-stock {
    background: #fff4dc;
}

.stat-icon-stock svg {
    stroke: #d78b16;
}

.stat-icon-ventas {
    background: #e2f4e7;
}

.stat-icon-ventas svg {
    stroke: #278441;
}

.stat-content p {
    margin: 0 0 6px;
    color: #53636e;
    font-size: 14px;
}

.stat-content strong {
    display: block;
    font-size: 32px;
    line-height: 1.1;
    color: var(--ap-text);
}

.stat-change {
    display: block;
    margin-top: 8px;
    font-size: 13px;
}

.stat-change b {
    font-weight: 600;
}

.stat-change.positive {
    color: #477b55;
}

.stat-change.positive::first-letter {
    color: var(--ap-success);
}

.stat-change.negative {
    color: #66727b;
}


/* =========================================================
   GRIDS DEL DASHBOARD
========================================================= */

.dashboard-middle-grid {
    display: grid;
    grid-template-columns: 1.12fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.95fr;
    gap: 24px;
}


/* =========================================================
   PANELES GENERALES
========================================================= */

.dashboard-panel {
    background: var(--ap-card);
    border: 1px solid var(--ap-border);
    border-radius: 18px;
    box-shadow: 0 7px 25px rgba(29,56,65,0.06);
    overflow: hidden;
}

.dashboard-panel-header {
    min-height: 63px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ap-border);
}

.dashboard-panel-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #30414d;
    font-size: 18px;
}

.dashboard-panel-header h2 svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: #456170;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.panel-outline-button {
    padding: 9px 16px;
    border: 1px solid #b8d5d9;
    border-radius: 9px;
    text-decoration: none;
    color: var(--ap-primary-dark);
    background: #f8fcfc;
    font-size: 13px;
    font-weight: 600;
}

.panel-outline-button:hover {
    background: #eaf7f8;
}


/* =========================================================
   PRÓXIMAS CITAS
========================================================= */

.citas-table {
    width: 100%;
}

.citas-table-header,
.cita-dashboard-row {
    display: grid;
    grid-template-columns: 0.75fr 1.65fr 1.2fr 0.9fr;
    align-items: center;
    column-gap: 15px;
    padding-left: 22px;
    padding-right: 22px;
}

.citas-table-header {
    min-height: 42px;
    background: #fafcfc;
    color: #566771;
    font-size: 13px;
    font-weight: 600;
}

.cita-dashboard-row {
    min-height: 71px;
    border-top: 1px solid var(--ap-border);
    color: var(--ap-text);
    font-size: 13px;
}

.cita-hora {
    font-weight: 500;
}

.dashboard-paciente {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paciente-avatar {
    width: 39px;
    height: 39px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-1 {
    background: #b1795c;
}

.avatar-2 {
    background: #7d9bad;
}

.avatar-3 {
    background: #52616b;
}

.avatar-4 {
    background: #c8845c;
}

.dashboard-paciente strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-paciente span,
.cita-servicio span {
    display: block;
    margin-top: 3px;
    color: var(--ap-muted);
    font-size: 12px;
}

.cita-servicio {
    font-weight: 500;
    line-height: 1.4;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-status.confirmed {
    background: #e3f3e7;
    color: #347244;
}

.badge-status.pending {
    background: #fff4df;
    color: #a66d1c;
}


/* FOOTER DE PANELES */

.panel-footer-link {
    min-height: 48px;
    padding: 0 22px;
    border-top: 1px solid var(--ap-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    text-decoration: none;
    color: var(--ap-primary-dark);
    font-size: 13px;
    font-weight: 600;
}

.panel-footer-link span {
    font-size: 26px;
    line-height: 1;
    color: #334751;
}


/* =========================================================
   ALERTAS
========================================================= */

.alerts-list {
    min-height: 239px;
}

.alert-item {
    min-height: 78px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--ap-border);
}

.alert-icon {
    width: 43px;
    height: 43px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 700;
}

.alert-danger {
    background: #fde8e8;
    color: var(--ap-danger);
}

.alert-warning {
    background: #fff4de;
    color: #d9941b;
}

.alert-success {
    background: #e2f4e6;
    color: #258040;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    margin-bottom: 4px;
    color: #33434e;
    font-size: 14px;
    font-weight: 600;
}

.alert-content span {
    display: block;
    color: var(--ap-muted);
    font-size: 12px;
}

.alert-arrow {
    color: #2e404b;
    font-size: 27px;
}


/* =========================================================
   GRÁFICO DE VENTAS
========================================================= */

.chart-select {
    height: 38px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--ap-border);
    border-radius: 8px;
    outline: none;
    color: #50606a;
    background: #ffffff;
    font-size: 13px;
}

.sales-chart {
    min-height: 265px;
    padding: 20px 20px 15px;
    display: flex;
    box-sizing: border-box;
}

.chart-y-axis {
    width: 58px;
    height: 195px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #60717b;
    font-size: 11px;
    text-align: right;
    padding-right: 10px;
    box-sizing: border-box;
}

.chart-area {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 230px;
}

.chart-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 195px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-lines span {
    display: block;
    width: 100%;
    border-top: 1px solid #e9eef0;
}

.chart-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 195px;
}

.chart-labels {
    position: absolute;
    top: 205px;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    color: #65747d;
    font-size: 11px;
    text-align: center;
}


/* =========================================================
   INVENTARIO
========================================================= */

.inventory-content {
    min-height: 225px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-sizing: border-box;
}

.inventory-chart {
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-chart {
    width: 170px;
    height: 170px;
    border-radius: 50%;

    background:
        conic-gradient(
            #3d9c59 0deg 226deg,
            #f0aa22 226deg 300deg,
            #df4e4e 300deg 337deg,
            #3f75b9 337deg 360deg
        );

    position: relative;
    flex-shrink: 0;
}

.donut-chart::before {
    content: "";
    position: absolute;
    inset: 28px;
    background: #ffffff;
    border-radius: 50%;
}

.donut-center {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-center strong {
    font-size: 27px;
    color: #30424d;
}

.donut-center span {
    margin-top: 3px;
    color: var(--ap-muted);
    font-size: 12px;
}

.inventory-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 13px;
}

.legend-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #55656e;
}

.legend-item strong {
    font-size: 12px;
    color: #4c5b65;
    font-weight: 500;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.available {
    background: #3d9c59;
}

.legend-dot.low-stock {
    background: #f0aa22;
}

.legend-dot.unavailable {
    background: #df4e4e;
}

.legend-dot.maintenance {
    background: #3f75b9;
}


/* =========================================================
   RESPONSIVE TABLET
========================================================= */

@media (max-width: 1400px) {

    .dashboard-date {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .topbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

}


@media (max-width: 1150px) {

    .dashboard-middle-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }

    .global-search {
        width: 250px;
    }

}


/* =========================================================
   RESPONSIVE TABLET PEQUEÑA
========================================================= */

@media (max-width: 900px) {

    .sidebar {
        width: 80px;
        min-width: 80px;
        padding: 20px 10px;
    }

    .sidebar-brand-text,
    .sidebar-section-title,
    .menu a span,
    .sidebar-system a span,
    .sidebar-footer > div:last-child {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .audioplus-symbol {
        width: 45px;
        height: 45px;
    }

    .menu a,
    .sidebar-system a {
        justify-content: center;
        padding: 0;
    }

    .sidebar-footer {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .dashboard-contenido {
        width: calc(100% - 80px);
        margin-left: 80px;
        padding: 0 22px 30px;
    }

    .dashboard-topbar {
        align-items: flex-start;
    }

    .top-user-info,
    .user-arrow {
        display: none;
    }

    .top-user {
        min-width: auto;
    }

    .global-search {
        width: 210px;
    }

}


/* =========================================================
   RESPONSIVE MÓVIL
========================================================= */

@media (max-width: 700px) {

    .sidebar {
        width: 68px;
        min-width: 68px;
        padding: 15px 8px;
    }

    .audioplus-symbol {
        width: 40px;
        height: 40px;
    }

    .menu a,
    .sidebar-system a {
        height: 50px;
    }

    .menu a svg,
    .sidebar-system a svg {
        width: 21px;
        height: 21px;
    }

    .footer-logo-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .dashboard-contenido {
        width: calc(100% - 68px);
        margin-left: 68px;
        padding: 0 14px 25px;
    }

    .dashboard-topbar {
        min-height: auto;
        padding: 20px 0;
        flex-direction: column;
    }

    .dashboard-title {
        gap: 8px;
    }

    .dashboard-title h1 {
        font-size: 26px;
        margin-bottom: 10px;
    }

    .dashboard-title .saludo {
        font-size: 16px;
    }

    .dashboard-title span {
        font-size: 13px;
    }

    .menu-toggle {
        display: none;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .global-search {
        flex: 1;
        width: auto;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .dashboard-stat-card {
        min-height: 110px;
        padding: 18px;
    }

    .stat-icon {
        width: 58px;
        height: 58px;
    }

    .stat-content strong {
        font-size: 27px;
    }

    .dashboard-middle-grid,
    .dashboard-bottom-grid {
        gap: 16px;
        margin-bottom: 16px;
    }

    .citas-table {
        overflow-x: auto;
    }

    .citas-table-header,
    .cita-dashboard-row {
        min-width: 620px;
    }

    .inventory-content {
        flex-direction: column;
    }

    .inventory-legend {
        width: 100%;
    }

}


/* =========================================================
   MÓVIL MUY PEQUEÑO
========================================================= */

@media (max-width: 480px) {

    .dashboard-contenido {
        padding-left: 10px;
        padding-right: 10px;
    }

    .sidebar {
        width: 58px;
        min-width: 58px;
        padding-left: 5px;
        padding-right: 5px;
    }

    .dashboard-contenido {
        width: calc(100% - 58px);
        margin-left: 58px;
    }

    .notification-button {
        width: 42px;
        height: 42px;
    }

    .top-avatar {
        width: 42px;
        height: 42px;
    }

    .dashboard-panel-header {
        padding-left: 15px;
        padding-right: 15px;
    }

    .dashboard-panel-header h2 {
        font-size: 15px;
    }

    .panel-outline-button {
        padding: 8px 10px;
        font-size: 11px;
    }

}
/* =========================================================
   CORRECCIÓN FINAL DEL ANCHO DEL DASHBOARD
   AUDIOPLUS
========================================================= */

html,
body {
    width: 100%;
    overflow-x: hidden;
}


/* CONTENEDOR PRINCIPAL */

.sistema {
    width: 100%;
    min-width: 0;
}


/* =========================================================
   CORREGIR CONTENIDO DEL DASHBOARD
========================================================= */

.dashboard-contenido {
    flex: 1;
    width: auto !important;
    min-width: 0;

    margin-left: 0 !important;

    padding: 0 34px 35px;

    overflow-x: hidden;
}


/* =========================================================
   TOPBAR
========================================================= */

.dashboard-topbar {
    width: 100%;
    min-width: 0;
}

.dashboard-title {
    min-width: 0;
}

.topbar-actions {
    min-width: 0;
}


/* =========================================================
   TARJETAS DEL DASHBOARD
========================================================= */

.dashboard-stats {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;
}


.dashboard-stat-card {
    min-width: 0;

    padding: 22px;

    gap: 16px;
}


.stat-content {
    min-width: 0;
}


.stat-content p,
.stat-content strong,
.stat-change {
    overflow-wrap: break-word;
}


/* =========================================================
   PANELES
========================================================= */

.dashboard-middle-grid,
.dashboard-bottom-grid {
    width: 100%;
    min-width: 0;
}


.dashboard-panel {
    min-width: 0;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1400px) {

    .dashboard-stats {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .dashboard-stat-card {
        padding: 18px;
        gap: 13px;
    }

    .stat-icon {
        width: 60px;
        height: 60px;
    }

    .stat-content strong {
        font-size: 28px;
    }

}


@media (max-width: 1150px) {

    .dashboard-contenido {
        padding: 0 25px 30px;
    }

    .dashboard-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-middle-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 900px) {

    .dashboard-contenido {
        flex: 1;
        width: auto !important;

        margin-left: 0 !important;

        padding: 0 22px 30px;
    }

}


@media (max-width: 700px) {

    .dashboard-contenido {
        width: auto !important;

        margin-left: 0 !important;

        padding: 0 14px 25px;
    }

    .dashboard-topbar {
        flex-direction: column;

        align-items: stretch;
    }

    .topbar-actions {
        width: 100%;

        flex-wrap: wrap;
    }

    .global-search {
        flex: 1;

        width: auto;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 480px) {

    .dashboard-contenido {
        width: auto !important;

        margin-left: 0 !important;

        padding-left: 10px;
        padding-right: 10px;
    }

}