/* ======================================================
   RESET BÁSICO
====================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: Cambria, serif;
    background: #f4f4f4;
    color: #333;
}

/* ======================================================
   CONTENEDORES GENERALES
====================================================== */
.login-wrapper,
.panel-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-box,
.panel-box {
    width: 100%;
    max-width: 900px; /* suficiente para tablas en desktop */
    background: #ffffff;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}

/* ======================================================
   LOGO
====================================================== */
.logo {
    max-width: 220px;
    width: 100%;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
}

/* ======================================================
   TITULOS Y TEXTO
====================================================== */
h1, h2 {
    margin-bottom: 20px;
    font-weight: normal;
}

p {
    margin-bottom: 15px;
    line-height: 1.4;
}

/* ======================================================
   FORMULARIOS
====================================================== */
form {
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

/* ======================================================
   BOTONES Y ENLACES DE ACCIÓN
====================================================== */
button,
.btn {
    display: inline-block;
    width: 100%;
    padding: 10px;
    background: #9c2f2a; /* rojo teja */
    color: #d4af37;      /* gualda */
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

button:hover,
.btn:hover {
    opacity: 0.9;
}

/* ======================================================
   MENSAJES
====================================================== */
.msg {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.msg.error {
    background: #f8d7da;
    color: #721c24;
}

.msg.success {
    background: #d4edda;
    color: #155724;
}

/* ======================================================
   TABLAS (FACTURAS / ADMIN)
====================================================== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* evita scroll innecesario con pocas columnas */
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

th {
    background: #f0f0f0;
    font-weight: bold;
}

/* enlaces dentro de tablas (PDF, acciones) */
table a {
    padding: 6px 12px;
    background: #9c2f2a;
    color: #d4af37;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}

table a:hover {
    opacity: 0.9;
}

/* ======================================================
   CABECERA ADMIN
====================================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #ddd;
}

.header img {
    height: 45px;
}

/* ======================================================
   FOOTER
====================================================== */
.footer {
    text-align: center;
    font-size: 13px;
    color: #777;
    margin-top: 30px;
}

/* ======================================================
   RESPONSIVE TABLET
====================================================== */
@media (max-width: 1023px) {

    .login-box,
    .panel-box {
        max-width: 95%;
        padding: 25px;
    }

    table {
        min-width: 550px;
    }
}

/* ======================================================
   RESPONSIVE SMARTPHONE
====================================================== */
@media (max-width: 640px) {

    .login-box,
    .panel-box {
        padding: 20px;
    }

    .logo {
        max-width: 180px;
    }

    form {
        max-width: 100%;
    }

    table {
        min-width: 500px;
    }

    button,
    .btn {
        font-size: 14px;
        padding: 10px;
    }
}
