/*
 * app.css
 *
 * Tema visual del repositorio: rojo institucional, blanco, tarjetas,
 * sombras suaves y animaciones hover.
 */

:root {
    --red: #b51227;
    --red-dark: #850b1b;
    --red-soft: #fff1f3;
    --ink: #27303a;
    --line: #eadde0;
}

* {
    box-sizing: border-box;
}

body {
    background: #f8f9fb;
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}


/* Barra superior */
.app-navbar {
    background: linear-gradient(115deg, var(--red-dark), var(--red));
    box-shadow: 0 4px 18px #700b1b33;
}

.navbar-brand {
    letter-spacing: 0.1px;
}

.navbar-brand small {
    font-size: 0.68rem;
}

.navbar-logo,
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--red);
    background: #fff;
    border-radius: 14px;
    font-size: 1.45rem;
}

.user-pill {
    padding: 0.43rem 0.8rem;
    color: #fff;
    background: #ffffff1c;
    border: 1px solid #ffffff40;
    border-radius: 30px;
    font-size: 0.9rem;
}

/* Encabezados y navegación */
.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.eyebrow {
    color: var(--red);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.display-title {
    color: #242b33;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    font-weight: 800;
}

.custom-breadcrumb {
    padding: 0.72rem 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 2px 8px #7f10200d;
}

.custom-breadcrumb a {
    color: var(--red);
    font-weight: 600;
    text-decoration: none;
}

/* Explorador y tarjetas */
.explorer-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #f0e6e8;
}

.item-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 170px;
    padding: 1.2rem 0.65rem 0.8rem;
    overflow: hidden;
    color: inherit;
    background: #fff;
    border: 1px solid #ece9ea;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.22s ease;
}

.item-card:hover {
    border-color: #e1aab1;
    box-shadow: 0 12px 25px #8e14201c;
    transform: translateY(-5px);
}

.item-link {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.item-icon {
    margin: 1rem 0 0.8rem;
    font-size: 3.5rem;
    line-height: 1;
    transition: transform 0.22s ease;
}

.item-card:hover .item-icon {
    transform: scale(1.1);
}

.folder-icon {
    color: var(--red);
    filter: drop-shadow(0 4px 3px #b5122733);
}

.item-name {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.item-meta {
    margin-top: 0.35rem;
    color: #89929c;
    font-size: 0.72rem;
}

.item-actions {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    display: flex;
    gap: 0.2rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.item-card:hover .item-actions {
    opacity: 1;
}

.item-actions button {
    border: 1px solid #e9e3e4;
}

.back-card {
    justify-content: center;
    color: var(--red);
}

.back-card .item-icon {
    margin: 0.4rem 0 0.8rem;
}

.empty-state {
    padding: 5rem 1rem;
    text-align: center;
}

.empty-state i {
    color: #dca4ac;
    font-size: 4rem;
}

/* Autenticación */
.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fff 0%, #fff4f5 48%, #f4f6f8 100%);
}

.auth-card {
    width: min(100%, 440px);
    padding: 2.2rem;
    border-radius: 24px;
}

.auth-card .brand-mark {
    width: 64px;
    height: 64px;
    margin: auto;
    box-shadow: 0 8px 22px #b5122730;
    font-size: 2rem;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 0.25rem #b5122720;
}

/* Componentes Bootstrap personalizados */
.modal-red {
    color: #fff;
    background: linear-gradient(110deg, var(--red-dark), var(--red));
}

.badge-factor {
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid #f0cbd0;
}

.table thead th {
    color: #717b85;
    background: #fff8f9;
    border-bottom-color: var(--line);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table td,
.table th {
    padding: 1rem;
}

.alert-info {
    color: #14537e;
    background: #eef7ff;
}

.btn-danger {
    background: var(--red);
    border-color: var(--red);
}

.btn-danger:hover,
.btn-danger:focus {
    background: var(--red-dark);
    border-color: var(--red-dark);
}

.btn-outline-danger {
    color: var(--red);
    border-color: var(--red);
}

.btn-outline-danger:hover {
    background: var(--red);
    border-color: var(--red);
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 700px) {
    .page-heading {
        align-items: start;
        flex-direction: column;
    }

    .page-heading .d-flex {
        width: 100%;
        justify-content: start;
    }

    .user-pill {
        display: none;
    }

    .item-card {
        min-height: 150px;
    }

    .item-icon {
        font-size: 3rem;
    }

    .item-actions {
        opacity: 1;
    }

    .table {
        min-width: 690px;
    }
}


/* ============================================================
   Franja institucional con logos (parte superior del index)
   ============================================================ */
.institution-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 4px 14px #7f10200d;
}

.logo-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 78px;            /* altura uniforme para todos */
    max-width: 160px;        /* ancho máximo uniforme */
    flex: 0 0 auto;
}

.logo-badge img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.06));
}

/* Responsive: en pantallas pequeñas se hace una cuadrícula 2x2 */
@media (max-width: 700px) {
    .institution-strip {
        padding: 1rem 0.75rem;
    }
    .logo-row {
        gap: 1.25rem 2rem;
    }
    .logo-badge {
        height: 60px;
        max-width: 120px;
    }
}

@media (max-width: 420px) {
    .logo-badge {
        height: 52px;
        max-width: 100px;
    }
}