* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f6fa;
    color: #1f2937;
}

.topbar {
    background: #111827;
    color: #fff;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 18px;
    font-weight: bold;
}

.topbar nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
}

.topbar nav a:hover {
    text-decoration: underline;
}

.container {
    width: 96%;
    margin: 25px auto;
}

h1 {
    margin-top: 0;
    margin-bottom: 20px;
}

.filters {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.filters input,
.filters select {
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    min-width: 160px;
}

.check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

button,
.btn-secondary {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-size: 20px;
    text-align: center;
}

button {
    background: #2563eb;
    color: #fff;
}

.btn-login {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-size: 44px;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.card span {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.card strong {
    font-size: 22px;
}

.table-wrap {
    background: #fff;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    /* min-width: 1200px; */
}

thead th {
    background: #1f2937;
    color: #fff;
    padding: 11px 8px;
    text-align: left;
    position: sticky;
    top: 0;
}

tbody td {
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
}

tbody tr:hover {
    background: #f9fafb;
}

.num {
    text-align: right;
    white-space: nowrap;
}

.strong {
    font-weight: bold;
}

.empty {
    text-align: center;
    padding: 25px;
    color: #6b7280;
}

.footer {
    text-align: center;
    color: #6b7280;
    padding: 25px;
    font-size: 13px;
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .topbar nav a {
        margin-left: 0;
        margin-right: 15px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .filters input,
    .filters select {
        width: 100%;
    }
}

.btn-excel {
    background: #198754;
    color: #fff;
}

.card small {
    display: block;
    margin-top: 8px;
    font-size: 15px;
    color: #198754;
    font-weight: bold;
}

.login-body {
    background: #111827;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.login-box {
    background: #fff;
    padding: 35px;
    border-radius: 14px;
    width: 80%;
    height: 300px;
    font-size: large;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 25px;
}

.login-box input {
    width: 100%;
    height: 44px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #cbd5e1;
    font-size: 40px;
    border-radius: 8px;
}

.login-box button {
    width: 100%;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* ======================================
   TABLETS
====================================== */

@media (max-width: 992px) {

    .container {
        width: 98%;
        padding: 0 10px;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

}

/* ======================================
   CELULARES
====================================== */

@media (max-width: 768px) {

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }

    .topbar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .topbar nav a {
        margin: 0;
    }

    h1 {
        font-size: 22px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 15px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters input,
    .filters select,
    .filters button,
    .filters .btn-secondary,
    .filters .btn-excel {
        width: 100%;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 1200px;
    }

    .login-box {
        width: 95%;
        padding: 25px;
    }

}

/* ======================================
   TELEFONOS PEQUEÑOS
====================================== */

@media (max-width: 480px) {

    body {
        font-size: 14px;
    }

    .card strong {
        font-size: 18px;
    }

    .login-box {
        padding: 20px;
    }

}

@media (max-width: 768px) {

    th:nth-child(4),
    td:nth-child(4),
    th:nth-child(6),
    td:nth-child(6),
    th:nth-child(7),
    td:nth-child(7),
    th:nth-child(8),
    td:nth-child(8),
    th:nth-child(9),
    td:nth-child(9),
    th:nth-child(10),
    td:nth-child(10) {
        display: none;
    }

}

.vencido-rojo td {
    color: #ff0000 !important;
}

.vencido-naranja td {
    color: #cc6504 !important;
}

.vencido-amarillo td {
    color: #e5e905 !important;
}

.al-corriente td {
    color: #000000 !important;
}

.vencido-rojo:hover td,
.vencido-naranja:hover td,
.vencido-amarillo:hover td,
.al-corriente:hover td {
    filter: brightness(0.98);
}

.dias-vencidos{
    width: 100% !important;
    padding: 0px !important;
    border-radius: 0px !important;
    text-align: center !important;
    min-width: none !important;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin-bottom: 25px;
}

.chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.chart-card h2 {
    margin-top: 0;
    font-size: 18px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}