/* =========================
   VARIABLES GLOBALES
   ========================= */

:root {
    --color-principal: #0d6efd;
    --color-principal-oscuro: #0a58ca;
    --color-danger: #dc3545;
    --color-fondo: #f5f6f8;
    --color-panel: #ffffff;
    --color-texto: #222;
    --color-borde: #d9d9d9;
    --radio: 8px;
    --alto-topbar: 60px;
    --alto-subbar: 42px;
}

/* =========================
   BASE
   ========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--color-fondo);
    color: var(--color-texto);
}

/* =========================
   BOTONES (COMUNES)
   ========================= */

button {
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--color-principal);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radio);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 8px 14px;
    border-radius: var(--radio);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radio);
}

.btn-full {
    width: 100%;
}

/* =========================
   FORMULARIOS (COMUNES)
   ========================= */

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

label {
    margin-bottom: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-borde);
    border-radius: var(--radio);
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

/* =========================
   TOPBAR (APP)
   ========================= */

.topbar {
    height: var(--alto-topbar);
    background: var(--color-principal);
    background-image: url('/imgs/fondo_cl.png');
    background-repeat: repeat;    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 40px;
    height: 40px;
}

.app-name {
    font-size: 1.4rem;
    font-weight: bold;
}

/* =========================
   SUBBAR (APP)
   ========================= */

.subbar {
    height: var(--alto-subbar);
    background: var(--color-principal-oscuro);
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
}

.screen-title {
    font-weight: 600;
}

/* =========================
   CONTENIDO APP
   ========================= */

.container {
    padding: 16px;
}

.form-card {
    background: var(--color-panel);
    border-radius: var(--radio);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-card h3 {
    margin-top: 0;
    color: var(--color-principal);
}

.form-card p {
    margin: 10px 0;
}

/* =========================
   LOGIN
   ========================= */

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-image: url('/imgs/fondo_cl.png');
    background-repeat: repeat;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--color-panel);
    border-radius: var(--radio);
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

.login-logo {
    display: block;
    width: 90px;
    height: 90px;
    margin: 0 auto 15px auto;
}

.login-title {
    text-align: center;
    margin: 0 0 20px 0;
    color: var(--color-principal);
}

.msg-error {
    background: #ffe4e4;
    color: #b00020;
    border: 1px solid #f5bcbc;
    padding: 10px;
    border-radius: var(--radio);
    margin-bottom: 15px;
}

/* =========================
   MENU EN CUADRÍCULA
   ========================= */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.menu-item {
    background: var(--color-principal);
    color: white;
    text-decoration: none;
    border-radius: var(--radio);
    padding: 20px;
    text-align: center;
    font-weight: bold;
    transition: 0.2s;
}

.menu-item:hover {
    background: var(--color-principal-oscuro);
}

/* =========================
   LISTADO ARCHIVOS
   ========================= */

.list-item {
    background: var(--color-panel);
    border-radius: var(--radio);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.file-title {
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--color-principal);
}

.file-meta {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.file-comment {
    font-size: 0.9rem;
    color: #444;
    margin-top: 6px;
}

.muted {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
}

.link-danger {
    color: var(--color-danger);
    margin-left: 10px;
    text-decoration: none;
}

.link-danger:hover {
    text-decoration: underline;
}
@media (max-width: 768px) {

    .login-card {
        padding: 10px;
    }

    .login-logo {
        width: 80px;
        height: 80px;
    }

    .btn-primary,
    .btn-danger,
    .btn-secondary {
        min-height: 30px;   /* recomendado táctil */
    }

}