* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #1e1e1e;
    color: #ffffff;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #0f0f0f;
    padding: 30px 20px;
}

.sidebar h1 {
    font-size: 52px;
    letter-spacing: 2px;
}

.sidebar p {
    margin-bottom: 40px;
    font-weight: bold;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar a {
    color: #ffffff;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
}

.sidebar a:hover {
    background: #d32f2f;
}

.main-content {
    flex: 1;
    padding: 35px;
}

.header {
    margin-bottom: 30px;
}

.header h2 {
    font-size: 34px;
}

.header p {
    color: #cfcfcf;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.card {
    background: #ffffff;
    color: #111111;
    padding: 25px;
    border-radius: 16px;
}

.card span {
    font-size: 14px;
    color: #555555;
}

.card h3 {
    font-size: 38px;
    margin-top: 10px;
}

.card.warning {
    border-left: 8px solid orange;
}

.card.danger {
    border-left: 8px solid #d32f2f;
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
}

.search-form input,
.form-card input,
.form-card textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    outline: none;
}

.search-form button,
.btn-primary,
.form-card button {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.client-card,
.form-card {
    background: #ffffff;
    color: #111111;
    padding: 24px;
    border-radius: 16px;
}

.client-card h3 {
    margin-bottom: 8px;
}

.alias {
    color: #d32f2f;
    font-weight: bold;
    margin-bottom: 12px;
}

.client-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.client-actions a {
    background: #111111;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

.form-card {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.client-card {
    border-top: 6px solid #555;
}

.client-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #111111;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    letter-spacing: 1px;
}

.status-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

.status-badge.neutral {
    background: #eeeeee;
    color: #333333;
}

.status-badge.active {
    background: #dff5e1;
    color: #1b7f2a;
}

.status-badge.warning {
    background: #fff3cd;
    color: #9a6a00;
}

.status-badge.danger {
    background: #fde2e2;
    color: #b42318;
}

.client-info {
    margin-bottom: 18px;
}

.client-info p {
    margin-bottom: 8px;
}

.client-actions {
    border-top: 1px solid #eeeeee;
    padding-top: 14px;
}

button {
    font: inherit;
}

body.modal-open {
    overflow: hidden;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.is-open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    color: #111111;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.modal-header {
    margin-bottom: 22px;
}

.modal-header h2 {
    font-size: 28px;
    margin-bottom: 4px;
}

.modal-header p {
    color: #666666;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: 0;
    background: transparent;
    color: #555555;
    font-size: 32px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 700;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cccccc;
    border-radius: 9px;
    background: #ffffff;
    color: #111111;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}

.form-group textarea {
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    border: 1px solid #cccccc;
    background: #eeeeee;
    color: #222222;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

.form-message {
    min-height: 20px;
    margin-top: 4px;
    font-weight: bold;
}

.form-message.error {
    color: #c62828;
}

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 700px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .modal-content {
        padding: 24px 18px;
    }
}

.btn-client-action {
    background: #111111;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.btn-client-action:hover,
.client-actions a:hover {
    background: #d32f2f;
}

.btn-desactivar-cliente {
    background: #6b7280;
}

.btn-desactivar-cliente:hover {
    background: #b42318;
}

.form-group select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cccccc;
    border-radius: 9px;
    background: #ffffff;
    color: #111111;
    outline: none;
}

.form-group select:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}

.benefit-text {
    color: #b42318;
    font-weight: 700;
}

.modal-pago-content {
    width: min(560px, 100%);
}

.payment-summary {
    background: #f4f4f4;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
}

.payment-summary > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.payment-summary > div:last-child {
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px solid #d5d5d5;
}

.payment-summary strong {
    font-size: 20px;
}

#fila-precio-especial {
    display: none;
}

#fila-precio-especial input {
    width: 150px;
    padding: 9px;
    border: 1px solid #cccccc;
    border-radius: 8px;
}

.client-card {
    border-top: 6px solid #666666;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.client-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.client-card-active {
    border-top-color: #2e9d46;
}

.client-card-warning {
    border-top-color: #f59e0b;
}

.client-card-danger {
    border-top-color: #d32f2f;
}

.client-card-neutral {
    border-top-color: #6b7280;
}

.debt-text {
    color: #b42318;
    font-weight: 700;
}
.attendance-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.attendance-checkin,
.attendance-today {
    background: #ffffff;
    color: #111111;
    border-radius: 18px;
    padding: 24px;
}

.attendance-search-box {
    position: relative;
}

.attendance-search-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.attendance-search-box input {
    width: 100%;
    padding: 15px;
    border: 1px solid #cccccc;
    border-radius: 12px;
    font-size: 17px;
}

.attendance-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.attendance-result-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eeeeee;
    background: #ffffff;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
}

.attendance-result-item:hover {
    background: #f4f4f4;
}

.attendance-result-main {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 5px;
}

.attendance-result-main span {
    color: #666666;
    font-style: italic;
}

.attendance-result-item small {
    color: #555555;
}

.attendance-empty-result {
    padding: 15px;
    margin: 0;
    color: #666666;
}

.selected-client {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #dddddd;
}

.selected-client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}

.selected-client-header h3 {
    font-size: 25px;
}

.selected-client-header p {
    margin-top: 3px;
    color: #666666;
    font-style: italic;
}

.selected-client-info {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.attendance-alert {
    margin-bottom: 18px;
    padding: 14px;
    border-left: 5px solid #f59e0b;
    border-radius: 8px;
    background: #fff4d6;
    color: #7a4700;
}

.attendance-alert p + p {
    margin-top: 8px;
}

.attendance-main-button {
    width: 100%;
    padding: 15px;
    font-size: 17px;
}

.attendance-today-header {
    margin-bottom: 16px;
}

.attendance-today-item {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 0;
    border-bottom: 1px solid #dddddd;
}

.attendance-today-item span {
    display: block;
    margin-top: 3px;
    color: #666666;
    font-size: 14px;
    font-style: italic;
}

.attendance-time {
    white-space: nowrap;
    font-weight: 700;
}

.form-message.success {
    color: #197233;
}

@media (max-width: 950px) {
    .attendance-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .attendance-result-main,
    .selected-client-header {
        flex-direction: column;
        gap: 5px;
    }
}

.payment-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.payment-kpi {
    background: #ffffff;
    color: #111111;
    padding: 20px;
    border-radius: 16px;
    border-left: 6px solid #2e9d46;
}

.payment-kpi-warning {
    border-left-color: #f59e0b;
}

.payment-kpi span {
    display: block;
    margin-bottom: 8px;
    color: #666666;
}

.payment-kpi strong {
    font-size: 28px;
}

.payment-filters {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(180px, 0.7fr) auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 24px;
    padding: 20px;
    background: #ffffff;
    color: #111111;
    border-radius: 16px;
}

.payment-filters .form-group {
    margin: 0;
}

.payment-filter-actions {
    display: flex;
    gap: 10px;
}

.payment-clear-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.payment-history {
    display: grid;
    gap: 16px;
}

.payment-history-card {
    background: #ffffff;
    color: #111111;
    padding: 20px;
    border-radius: 16px;
}

.payment-history-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}

.payment-history-main h3 {
    font-size: 21px;
}

.payment-history-main h3 span {
    margin-left: 8px;
    color: #666666;
    font-size: 15px;
    font-style: italic;
    font-weight: 500;
}

.payment-concept {
    margin-top: 4px;
    color: #555555;
}

.payment-status {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.payment-status-paid {
    background: #dff5e5;
    color: #197233;
}

.payment-status-partial {
    background: #fff0ca;
    color: #8a5600;
}

.payment-status-pending {
    background: #fde1e1;
    color: #a61b1b;
}

.payment-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.payment-amounts div {
    padding: 13px;
    background: #f4f4f4;
    border-radius: 10px;
}

.payment-amounts span {
    display: block;
    margin-bottom: 5px;
    color: #666666;
    font-size: 14px;
}

.payment-amounts strong {
    font-size: 18px;
}

.payment-debt {
    color: #b42318;
}

.payment-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding-top: 14px;
    border-top: 1px solid #dddddd;
    color: #555555;
    font-size: 14px;
}

.payment-observations {
    margin-top: 14px;
    padding: 12px;
    background: #fff8e8;
    border-radius: 9px;
    color: #614400;
}

.empty-state {
    padding: 35px;
    background: #ffffff;
    color: #111111;
    border-radius: 16px;
    text-align: center;
}

.empty-state p {
    margin-top: 7px;
    color: #666666;
}

@media (max-width: 850px) {
    .payment-kpis,
    .payment-amounts {
        grid-template-columns: 1fr;
    }

    .payment-filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .payment-history-main {
        flex-direction: column;
    }

    .payment-filter-actions {
        flex-direction: column;
    }
}

/* =========================================================
   CONFIGURACIÓN
========================================================= */

.settings-section {
    margin-top: 32px;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.settings-section-header h3 {
    margin-bottom: 4px;
    font-size: 24px;
}

.settings-section-header p {
    color: #bcbcbc;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(280px, 1fr)
    );
    gap: 18px;
}

.settings-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    border: 1px solid #343434;
    border-radius: 18px;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
}

.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.settings-card-header h4 {
    margin-bottom: 8px;
    font-size: 22px;
}

.plan-price,
.product-price {
    font-size: 24px;
    white-space: nowrap;
}

.settings-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.settings-status-active {
    background: #ddf7e4;
    color: #177534;
}

.settings-status-inactive {
    background: #e8e8e8;
    color: #666666;
}

.settings-card-info {
    display: grid;
    gap: 9px;
}

.settings-description {
    color: #5f5f5f;
    line-height: 1.45;
}

.plan-card .btn-secondary {
    margin-top: auto;
}


/* =========================================================
   INVENTARIO
========================================================= */

.product-card {
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: #21a04b;
}

.product-card-low-stock::before {
    background: #f59e0b;
}

.product-card-inactive {
    opacity: 0.72;
}

.product-card-inactive::before {
    background: #777777;
}

.inventory-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 13px;
    background: #f2f2f2;
}

.inventory-stock span {
    color: #666666;
}

.inventory-stock strong {
    font-size: 32px;
}

.stock-low {
    color: #c97900;
}

.low-stock-message {
    color: #a75b00;
    font-weight: 700;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: auto;
}

.btn-inventory,
.btn-product-state {
    border: 0;
    border-radius: 9px;
    padding: 10px 13px;
    font-weight: 700;
    cursor: pointer;
}

.btn-inventory {
    background: #111111;
    color: #ffffff;
}

.btn-inventory:hover {
    background: #333333;
}

.btn-product-state {
    background: #e8e8e8;
    color: #333333;
}

.btn-product-state:hover {
    background: #d8d8d8;
}


/* =========================================================
   HISTORIAL DE INVENTARIO
========================================================= */

.inventory-history {
    display: grid;
    gap: 12px;
}

.inventory-movement {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    background: #ffffff;
    color: #111111;
}

.inventory-movement-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #eeeeee;
    font-size: 20px;
}

.inventory-movement-info {
    display: grid;
    gap: 3px;
}

.inventory-movement-info span {
    color: #666666;
    font-size: 14px;
}

.inventory-movement-info small {
    margin-top: 4px;
    color: #777777;
}

.inventory-movement-change {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.inventory-movement-change strong {
    font-size: 19px;
}

.inventory-movement-change span {
    color: #666666;
    font-size: 13px;
}

.movement-positive {
    color: #16833a;
}

.movement-negative {
    color: #c12f2f;
}

.inventory-movement time {
    color: #666666;
    font-size: 13px;
    white-space: nowrap;
}


/* =========================================================
   MODALES DE CONFIGURACIÓN
========================================================= */

.settings-modal {
    max-width: 620px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input {
    width: auto;
    accent-color: #dc2f34;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 850px) {
    .settings-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .settings-section-header .btn-primary {
        width: 100%;
    }

    .inventory-movement {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .inventory-movement time {
        grid-column: 2 / -1;
    }
}

@media (max-width: 600px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-card-header {
        flex-direction: column;
    }

    .product-actions {
        flex-direction: column;
    }

    .product-actions button {
        width: 100%;
    }

    .inventory-movement {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .inventory-movement-change,
    .inventory-movement time {
        grid-column: 2;
        justify-items: start;
    }
}

#horario-asistencia {
    width: 100%;
    padding: 13px;
    border: 1px solid #cccccc;
    border-radius: 10px;
    background: #ffffff;
    color: #111111;
    font-size: 15px;
    cursor: pointer;
}

#horario-asistencia:focus {
    border-color: #d32f2f;
    outline: none;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}

.schedule-suggestion {
    display: block;
    margin-top: 7px;
    color: #197233;
    font-weight: 700;
}

.attendance-class {
    display: block;
    margin-top: 5px;
    color: #555555;
    font-size: 13px;
    font-style: normal;
}
/* =========================================================
   REPORTES
========================================================= */

.report-mode-tabs {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 24px;
    padding: 5px;
    border-radius: 13px;
    background: #222222;
}

.report-mode-button,
.report-type-button {
    border: 0;
    border-radius: 9px;
    padding: 11px 17px;
    background: transparent;
    color: #cccccc;
    font-weight: 700;
    cursor: pointer;
}

.report-mode-button.active,
.report-type-button.active {
    background: #d72d35;
    color: #ffffff;
}

.report-period-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;
    margin-bottom: 24px;
    padding: 22px;
    border-radius: 17px;
    background: #ffffff;
    color: #111111;
}

.report-period-button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: #eeeeee;
    color: #111111;
    font-size: 32px;
    cursor: pointer;
}

.report-period-button:hover {
    background: #dddddd;
}

.report-current-period {
    min-width: 230px;
    text-align: center;
}

.report-current-period span {
    color: #666666;
    font-size: 13px;
}

.report-current-period h3 {
    margin-top: 4px;
    font-size: 28px;
}

.report-type-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.report-type-selector > span {
    font-weight: 700;
}

.report-type-selector > div {
    display: flex;
    gap: 7px;
    padding: 5px;
    border-radius: 12px;
    background: #222222;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(
        4,
        minmax(0, 1fr)
    );
    gap: 16px;
    margin-bottom: 24px;
}

.report-summary-card {
    padding: 20px;
    border-radius: 16px;
    border-left: 5px solid #d72d35;
    background: #ffffff;
    color: #111111;
}

.report-summary-card span {
    display: block;
    margin-bottom: 7px;
    color: #666666;
    font-size: 14px;
}

.report-summary-card strong {
    font-size: 25px;
}

.report-table-section {
    padding: 22px;
    border-radius: 17px;
    background: #ffffff;
    color: #111111;
}

.report-table-header {
    margin-bottom: 18px;
}

.report-table-header h3 {
    font-size: 23px;
}

.report-table-header p {
    margin-top: 4px;
    color: #666666;
}

.report-table-container {
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    padding: 14px;
    border-bottom: 1px solid #dddddd;
    text-align: left;
}

.report-table th {
    background: #f1f1f1;
    color: #555555;
    font-size: 13px;
    text-transform: uppercase;
}

.report-table tbody tr:hover {
    background: #f8f8f8;
}

.report-best-row {
    background: #fff5d8;
}

.report-best-badge {
    display: inline-flex;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f2b72b;
    color: #4c3400;
    font-size: 11px;
    font-weight: 700;
}

.report-loading,
.report-empty {
    padding: 30px;
    color: #666666;
    text-align: center;
}

.report-loading.error {
    color: #b42318;
}

@media (max-width: 950px) {
    .report-summary-grid {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}

@media (max-width: 650px) {
    .report-mode-tabs {
        display: flex;
        flex-direction: column;
    }

    .report-mode-button {
        width: 100%;
    }

    .report-type-selector {
        align-items: stretch;
        flex-direction: column;
    }

    .report-type-selector > div {
        flex-direction: column;
    }

    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-period-selector {
        gap: 12px;
    }

    .report-current-period {
        min-width: 0;
    }

    .report-current-period h3 {
        font-size: 21px;
    }
}

/* =========================================================
   HORARIOS EN CONFIGURACIÓN
========================================================= */

.horarios-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(270px, 1fr)
    );
    gap: 20px;
    margin-top: 20px;
}

.dia-card {
    min-height: 220px;
    padding: 22px;
    border-radius: 18px;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.dia-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e5e5;
}

.dia-card-header h4 {
    margin: 0;
    color: #111111;
    font-size: 22px;
}

.dia-total {
    padding: 5px 10px;
    border-radius: 999px;
    background: #eeeeee;
    color: #555555;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.lista-horarios {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.horario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 11px 0;
    border-bottom: 1px solid #ededed;
    color: #111111;
}

.horario-item:last-child {
    border-bottom: 0;
}

.horario-time {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #111111;
}

.horario-time strong {
    color: #111111;
    font-size: 15px;
}

.horario-time span {
    color: #777777;
}

.horario-item-inactive {
    opacity: 0.58;
}

.horarios-empty {
    margin: 0;
    padding: 24px 0;
    color: #777777;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 650px) {
    .horarios-grid {
        grid-template-columns: 1fr;
    }

    .dia-card-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.horario-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-editar-horario {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #eeeeee;
    color: #111111;
    cursor: pointer;
}

.btn-editar-horario:hover {
    background: #dcdcdc;
    transform: translateY(-1px);
}

/* =========================================================
   DASHBOARD 2.0
========================================================= */

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(
        4,
        minmax(0, 1fr)
    );
    gap: 18px;
    margin-bottom: 24px;
}

.dashboard-kpi {
    padding: 22px;
    border-left: 6px solid #249447;
    border-radius: 17px;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dashboard-kpi-warning {
    border-left-color: #f0a51a;
}

.dashboard-kpi-danger {
    border-left-color: #d73339;
}

.dashboard-kpi-attendance {
    border-left-color: #2979c9;
}

.dashboard-kpi span {
    display: block;
    color: #666666;
    font-size: 14px;
    font-weight: 700;
}

.dashboard-kpi strong {
    display: block;
    margin: 8px 0 5px;
    font-size: 34px;
}

.dashboard-kpi small {
    color: #777777;
}

.dashboard-main-grid,
.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 22px;
    margin-bottom: 22px;
}

.dashboard-panel {
    display: flex;
    flex-direction: column;
    min-height: 330px;
    padding: 22px;
    border-radius: 18px;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.dashboard-panel-header h3 {
    margin-bottom: 4px;
    font-size: 21px;
}

.dashboard-panel-header p {
    color: #777777;
    font-size: 14px;
}

.dashboard-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-count-badge.warning {
    background: #fff0c8;
    color: #875200;
}

.dashboard-count-badge.danger {
    background: #fde0e0;
    color: #a82222;
}

.dashboard-list {
    display: grid;
}

.dashboard-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid #eeeeee;
}

.dashboard-list-item:last-child {
    border-bottom: 0;
}

.dashboard-list-item > div:first-child {
    display: grid;
    gap: 3px;
}

.dashboard-list-item small {
    color: #777777;
}

.dashboard-alias {
    color: #666666;
    font-size: 13px;
    font-style: italic;
}

.dashboard-list-status {
    padding: 6px 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.dashboard-list-status.warning {
    background: #fff2cd;
    color: #875200;
}

.dashboard-list-status.danger {
    background: #fde2e2;
    color: #a82222;
}

.dashboard-panel-link {
    display: inline-flex;
    margin-top: auto;
    padding-top: 17px;
    color: #c92d34;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-panel-link:hover {
    text-decoration: underline;
}

.dashboard-empty {
    display: grid;
    place-items: center;
    min-height: 150px;
    color: #777777;
    text-align: center;
}

.dashboard-empty span {
    font-size: 30px;
}

.dashboard-schedule-list,
.dashboard-inventory-list {
    display: grid;
}

.dashboard-schedule-item,
.dashboard-inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid #eeeeee;
}

.dashboard-schedule-item:last-child,
.dashboard-inventory-item:last-child {
    border-bottom: 0;
}

.dashboard-schedule-time {
    display: flex;
    align-items: center;
    gap: 7px;
}

.dashboard-schedule-time strong {
    font-size: 17px;
}

.dashboard-schedule-time span {
    color: #777777;
}

.dashboard-schedule-count,
.dashboard-stock-value {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.dashboard-schedule-count strong,
.dashboard-stock-value strong {
    font-size: 22px;
}

.dashboard-schedule-count span,
.dashboard-stock-value span {
    color: #777777;
    font-size: 13px;
}

.dashboard-inventory-item > div:first-child {
    display: grid;
    gap: 3px;
}

.dashboard-inventory-item small {
    color: #777777;
}

.dashboard-inventory-low {
    margin: 0 -10px;
    padding: 13px 10px;
    border-radius: 10px;
    background: #fff3d6;
}

.dashboard-inventory-low
.dashboard-stock-value strong {
    color: #b36a00;
}

.dashboard-stock-alert {
    margin-top: 15px;
    padding: 12px;
    border-left: 5px solid #f0a51a;
    border-radius: 8px;
    background: #fff3d6;
    color: #7d4c00;
    font-size: 14px;
    font-weight: 700;
}


/* =========================================================
   DASHBOARD RESPONSIVE
========================================================= */

@media (max-width: 1050px) {
    .dashboard-kpis {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}

@media (max-width: 850px) {
    .dashboard-main-grid,
    .dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dashboard-kpis {
        grid-template-columns: 1fr;
    }

    .dashboard-list-item,
    .dashboard-schedule-item,
    .dashboard-inventory-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-list-status {
        text-align: left;
    }
}

/* =========================================================
   BASE RESPONSIVE
========================================================= */

.mobile-header {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.sidebar-close {
    display: none;
}


/* =========================================================
   VISTA TABLET Y TELÉFONO
========================================================= */

@media (max-width: 850px) {
    body {
        min-width: 0;
        overflow-x: hidden;
    }

    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 900;
        display: flex;
        align-items: center;
        gap: 14px;
        min-height: 64px;
        padding: 10px 16px;
        background: #111111;
        border-bottom: 1px solid #292929;
        color: #ffffff;
    }

    .mobile-menu-button {
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 10px;
        background: #d72d35;
        color: #ffffff;
        font-size: 24px;
        cursor: pointer;
    }

    .mobile-brand {
        display: flex;
        align-items: baseline;
        gap: 8px;
    }

    .mobile-brand strong {
        font-size: 24px;
    }

    .mobile-brand span {
        color: #d0d0d0;
        font-size: 12px;
        letter-spacing: 1px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1100;
        width: min(82vw, 310px);
        height: 100dvh;
        padding: 22px;
        transform: translateX(-105%);
        transition: transform 0.24s ease;
        overflow-y: auto;
        box-shadow: 12px 0 30px rgba(0, 0, 0, 0.35);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 15px;
    }

    .sidebar-close {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 10px;
        background: #2a2a2a;
        color: #ffffff;
        font-size: 28px;
        cursor: pointer;
    }

    .sidebar nav {
        display: grid;
        gap: 8px;
        margin-top: 24px;
    }

    .sidebar nav a {
        display: flex;
        align-items: center;
        min-height: 46px;
        padding: 12px 14px;
        border-radius: 10px;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: block;
        background: rgba(0, 0, 0, 0.58);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
    }

    .sidebar-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 24px 18px 36px;
    }

    .header {
        margin-bottom: 22px;
    }

    .header h2 {
        font-size: clamp(26px, 8vw, 36px);
    }

    .header p {
        line-height: 1.5;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .actions > *,
    .actions button,
    .actions .btn-primary {
        width: 100%;
    }

    .search-form {
        display: flex;
        width: 100%;
        gap: 8px;
    }

    .search-form input {
        min-width: 0;
        flex: 1;
    }

    .search-form button {
        width: auto;
        flex: 0 0 auto;
    }

    input,
    select,
    textarea,
    button,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        font-size: 16px;
    }

    .modal-content {
        width: calc(100% - 24px);
        max-width: none;
        max-height: calc(100dvh - 24px);
        margin: 12px;
        padding: 22px 18px;
        overflow-y: auto;
    }

    .modal-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .modal-actions button {
        width: 100%;
    }
}


/* =========================================================
   TELÉFONOS PEQUEÑOS
========================================================= */

@media (max-width: 520px) {
    .main-content {
        padding: 20px 12px 30px;
    }

    .mobile-header {
        padding-inline: 12px;
    }

    .mobile-brand span {
        display: none;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form button {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .client-grid,
    .settings-grid,
    .dashboard-kpis,
    .dashboard-main-grid,
    .dashboard-secondary-grid,
    .payment-kpis,
    .report-summary-grid,
    .horarios-grid {
        grid-template-columns: 1fr;
    }

    .client-card,
    .settings-card,
    .dashboard-panel,
    .payment-history-card,
    .report-table-section,
    .attendance-checkin,
    .attendance-today {
        border-radius: 14px;
        padding: 17px;
    }

    .client-top,
    .client-actions,
    .settings-card-header,
    .product-actions,
    .payment-history-main,
    .selected-client-header,
    .dashboard-list-item,
    .dashboard-schedule-item,
    .dashboard-inventory-item {
        align-items: stretch;
        flex-direction: column;
    }

    .client-actions a,
    .client-actions button,
    .product-actions button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .payment-amounts {
        grid-template-columns: 1fr;
    }

    .attendance-layout {
        grid-template-columns: 1fr;
    }

    .attendance-today {
        max-height: none;
    }

    .attendance-result-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .report-mode-tabs,
    .report-type-selector > div {
        display: grid;
        width: 100%;
        grid-template-columns: 1fr;
    }

    .report-mode-button,
    .report-type-button {
        width: 100%;
    }

    .report-period-selector {
        gap: 8px;
        padding: 16px 10px;
    }

    .report-period-button {
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
    }

    .report-current-period h3 {
        font-size: 20px;
    }

    .report-table-container,
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .report-table,
    .tabla {
        min-width: 680px;
    }

    .inventory-movement {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 12px;
    }

    .inventory-movement-change,
    .inventory-movement time {
        grid-column: 2;
        justify-items: start;
    }

    .dia-card {
        min-height: auto;
        padding: 17px;
    }

    .horario-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .horario-actions {
        width: 100%;
        justify-content: space-between;
    }
}
/* =========================================================
   CORRECCIÓN FINAL DEL MENÚ MÓVIL
   Debe permanecer al final de styles.css
========================================================= */

@media (max-width: 850px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow-x: hidden;
    }

    body {
        display: block !important;
    }

    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 1200;
        display: flex !important;
        width: 100%;
        min-height: 64px;
        box-sizing: border-box;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

        z-index: 1400 !important;

        width: min(82vw, 310px) !important;
        height: 100dvh !important;

        margin: 0 !important;

        transform: translateX(-110%) !important;
        transition: transform 0.24s ease;

        overflow-y: auto;
    }

    .sidebar.is-open {
        transform: translateX(0) !important;
    }

    .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        z-index: 1300 !important;
    }

    .main-content {
        display: block !important;

        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;

        margin: 0 !important;
        margin-left: 0 !important;

        padding: 24px 18px 36px !important;

        box-sizing: border-box;
    }
}

@media (max-width: 520px) {
    .main-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 20px 12px 30px !important;
    }
}