* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #eef2f6;
    color: #1f2933;
}

/* LOGIN */
.fondo-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.12);
}

.logo-login {
    text-align: center;
    margin-bottom: 22px;
}

.logo-login img {
    border-radius: 18px;
    max-width: 210px;
    width: 80%;
}

.login-box label {
    display: block;
    margin: 14px 0 6px;
    font-size: 14px;
    font-weight: bold;
}

.login-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #c9d2dc;
    border-radius: 10px;
    font-size: 15px;
}

.login-box input:focus {
    outline: none;
    border-color: #1f4e79;
    box-shadow: 0 0 0 3px rgba(31,78,121,0.15);
}

.login-box button {
    width: 100%;
    margin-top: 22px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: #1f4e79;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.login-box button:hover {
    background: #153a5c;
}

.mensaje-error {
    background: #ffe0e0;
    color: #9b1c1c;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* DASHBOARD */
.dashboard-body {
    min-height: 100vh;
}

.topbar {
    background: #102a43;
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
}

.topbar a {
    color: white;
    text-decoration: none;
    background: #ef4444;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.contenedor {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 18px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.card h2,
.card h3 {
    margin-top: 0;
}

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

.info-box {
    background: #f8fafc;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.info-box b {
    display: block;
    margin-bottom: 6px;
    color: #475569;
}

.ok {
    color: #16a34a;
    font-weight: bold;
}

.alerta {
    color: #d97706;
    font-weight: bold;
}

.error {
    color: #dc2626;
    font-weight: bold;
}



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

.form-grid label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #334155;
    font-size: 14px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: #1f4e79;
    box-shadow: 0 0 0 3px rgba(31,78,121,0.12);
}

.btn-form {
    padding: 11px 18px;
    border: none;
    border-radius: 10px;
    background: #1f4e79;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.btn-form:hover {
    background: #153a5c;
}

/*----------------------------------------------------------------------------------------*/

.empresa-topbar {
    background: #102a43;
    color: white;
    padding: 14px 24px;
    display: grid;
    grid-template-columns: 180px 1fr 260px;
    align-items: center;
    gap: 18px;
}

.empresa-logo-box {
    width: 150px;
    height: 70px;
    background: white;
    border-radius: 14px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empresa-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.empresa-fecha-hora {
    text-align: center;
}

#fechaActual {
    font-size: 15px;
    text-transform: capitalize;
    opacity: 0.9;
}

#horaActual {
    font-size: 26px;
    font-weight: bold;
    margin-top: 3px;
}

.empresa-user-box {
    text-align: right;
}

.empresa-nombre {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

.empresa-user-box a {
    display: inline-block;
    color: white;
    text-decoration: none;
    background: #ef4444;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

/*---------------------------------------------------------------------------------------*/


.empresa-nombre-linea {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

.btn-config-empresa {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ffffff !important;
    color: #102a43 !important;
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    padding: 0 !important;
}

.btn-config-empresa:hover {
    background: #dbeafe !important;
}

.btn-cerrar {
    display: inline-block;
    color: white;
    text-decoration: none;
    background: #ef4444;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

/*---------------------------------------------------------------------------------------*/

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

.accion-card {
    display: block;
    padding: 18px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #1f2937;
    transition: 0.2s ease;
}

.accion-card:hover {
    background: #eef4fb;
    border-color: #1f4e79;
    transform: translateY(-2px);
}

.accion-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
    color: #102a43;
}

.accion-card span {
    display: block;
    font-size: 14px;
    color: #64748b;
}

/*---------------------------------------------------------------------------------------*/
.btn-secundario {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 9px;
    text-decoration: none;
    margin-top: 10px;
    font-size: 14px;
    font-weight: bold;
    background: #e5e7eb;
    color: #111827;
}

.btn-secundario:hover {
    background: #d1d5db;
}

/*---------------------------------------------------------------------------------------*/

.tabla {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.tabla thead {
    background: #102a43;
    color: white;
}

.tabla th {
    text-align: left;
    padding: 14px 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tabla td {
    padding: 14px 12px;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.tabla tbody tr:hover {
    background: #f8fafc;
}

.tabla td:last-child {
    text-align: center;
}


.btn-mini {
    display: inline-block;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    background: #1f4e79;
    color: white;
}

.btn-mini:hover {
    background: #153a5c;
}
/*---------------------------------------------------------------------------------------*/
.header-config-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.header-config-top h2 {
    margin: 0;
}

.breadcrumb {
    margin-top: 12px;
    font-size: 14px;
    color: #64748b;
}

.breadcrumb a {
    color: #1f4e79;
    text-decoration: none;
    font-weight: bold;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 6px;
}
/*---------------------------------------------------------------------------------------*/

.btn-warning {
    background: #d97706 !important;
}

.btn-warning:hover {
    background: #b45309 !important;
}

.btn-success {
    background: #16a34a !important;
}

.btn-success:hover {
    background: #15803d !important;
}

.btn-danger {
    background: #dc2626 !important;
}

.btn-danger:hover {
    background: #b91c1c !important;
}

/*---------------------------------------------------------------------------------------*/
.acciones-botones {
    white-space: nowrap;
}

.acciones-botones a {
    margin-right: 6px;
}

.check-line {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
}

.check-line input {
    width: auto !important;
}

/*---------------------------------------------------------------------------------------*/

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.tabla-card {
    overflow-x: auto;
}

.tabla-admin {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabla-admin th,
.tabla-admin td {
    padding: 12px 10px;
    border-bottom: 1px solid #dce3eb;
    text-align: left;
    vertical-align: middle;
}

.tabla-admin th {
    color: #0b2545;
    font-weight: 700;
    background: #f3f6fa;
}

.acciones-tabla {
    white-space: nowrap;
}

.btn-mini {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 8px;
    background: #0b2545;
    color: white;
    text-decoration: none;
    font-size: 13px;
    margin: 2px;
}

.btn-warning {
    background: #d97706;
}

.btn-success {
    background: #15803d;
}

.estado {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.estado-activa {
    background: #dcfce7;
    color: #166534;
}

.estado-suspendida {
    background: #fef3c7;
    color: #92400e;
}

.estado-vencida {
    background: #fee2e2;
    color: #991b1b;
}


/* =========================
   ADMIN - TABLAS Y FORMULARIOS
========================= */

.tabla-card {
    overflow-x: auto;
}

.tabla-admin {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabla-admin th,
.tabla-admin td {
    padding: 12px 10px;
    border-bottom: 1px solid #dce3eb;
    text-align: left;
    vertical-align: middle;
}

.tabla-admin th {
    color: #0b2545;
    font-weight: 700;
    background: #f3f6fa;
}

.acciones-tabla {
    white-space: nowrap;
}

.btn-mini {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 8px;
    background: #0b2545;
    color: white;
    text-decoration: none;
    font-size: 13px;
    margin: 2px;
}

.btn-mini:hover {
    opacity: 0.85;
}

.btn-warning {
    background: #d97706;
}

.btn-success {
    background: #15803d;
}

.btn-secundario {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: #64748b;
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-secundario:hover {
    opacity: 0.85;
}

.estado {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.estado-activa {
    background: #dcfce7;
    color: #166534;
}

.estado-suspendida {
    background: #fef3c7;
    color: #92400e;
}

.estado-vencida {
    background: #fee2e2;
    color: #991b1b;
}

.input,
select.input {
    width: 100%;
    padding: 11px 12px;
    margin: 6px 0 14px 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.input:focus,
select.input:focus {
    outline: none;
    border-color: #0b2545;
}

label {
    font-weight: 700;
    color: #0b2545;
    display: block;
    margin-top: 8px;
}

.ok {
    color: #15803d;
    font-weight: 700;
}

.error {
    color: #b91c1c;
    font-weight: 700;
}
.alerta {
    color: #d97706;
    font-weight: bold;
}
.mensaje-card {
    border-left: 6px solid #0b2545;
}

.mensaje-info {
    background: #f8fafc;
}

.mensaje-aviso {
    background: #fff7ed;
    border-left-color: #d97706;
}

.mensaje-urgente {
    background: #fef2f2;
    border-left-color: #dc2626;
}

.campanita-mensajes {
    position: relative;
    display: inline-block;
    font-size: 24px;
    margin-left: 15px;
}

.campanita-mensajes span {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #dc2626;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 999px;
}

.card-compacta {
    padding: 16px 18px;
}

.encabezado-linea {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.encabezado-linea h2,
.encabezado-linea p {
    margin: 0;
}

.encabezado-linea p {
    margin-top: 4px;
    color: #64748b;
}

.form-linea {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.input-linea {
    margin: 0;
}

.mensaje-inline {
    margin: 10px 0 0 0;
}

.fila-categoria {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fila-categoria .input {
    margin: 0;
    flex: 1;
}

.fila-categoria .btn-mini {
    margin: 0;
    white-space: nowrap;
}




/* RESPONSIVE */
@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

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

    .contenedor {
        margin-top: 18px;
    }

    .card {
        padding: 18px;
    }

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

    .grid-2 {
        grid-template-columns: 1fr;
    }
}