/* ============================================================
   REDWORK — APP SHELL MÓVIL/TABLET
   Agregar al final de public/css/responsive.css
   ============================================================ */

/* ── Variables de color del proyecto ── */
:root {
    --rw-navy:        #0f172a;
    --rw-navy-mid:    #1e293b;
    --rw-navy-light:  #334155;
    --rw-orange:      #f97316;
    --rw-orange-dim:  rgba(249,115,22,.15);
    --rw-text:        #e2e8f0;
    --rw-text-muted:  #94a3b8;
    --rw-drawer-w:    280px;
    --rw-topbar-h:    58px;
    --rw-bottom-h:    64px;
}

/* ── Ocultar topbar/drawer/bottom en desktop ──
   (ya controlado con d-lg-none pero por si acaso) */
@media (min-width: 992px) {
    .rw-topbar,
    .rw-drawer,
    .rw-overlay,
    .rw-bottom-nav { display: none !important; }
    /* Restaurar padding-top normal del navbar desktop */
    .rw-content-spacer { padding-top: 80px; }
}

/* ── Espaciador de contenido en móvil ── */
@media (max-width: 991.98px) {
    .rw-content-spacer {
        padding-top: calc(var(--rw-topbar-h) - 10px);
        /* Espacio abajo para que el bottom nav no tape contenido */
        padding-bottom: calc(var(--rw-bottom-h) + 8px);
    }
    /* Quitar el padding-top del div legacy inline (navbar bootstrap hidden) */
    .navbar.d-none { display: none !important; }
}

/* ══════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════ */
.rw-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--rw-topbar-h);
    background: var(--rw-navy);
    border-bottom: 1px solid var(--rw-navy-light);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 1040;
    gap: 8px;
}

.rw-topbar-btn {
    background: none;
    border: none;
    color: var(--rw-text);
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}
.rw-topbar-btn:active { background: var(--rw-navy-light); }

.rw-topbar-brand {
    flex: 1;
    text-align: center;
    color: var(--rw-orange);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-decoration: none;
}
.rw-topbar-brand i { color: var(--rw-orange); margin-right: 4px; font-size: 1.2rem; }

.rw-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 40px;
    justify-content: flex-end;
}

/* ══════════════════════════════════════════
   OVERLAY
══════════════════════════════════════════ */
.rw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1045;
    opacity: 0;
    transition: opacity .25s;
}
.rw-overlay.rw-visible {
    display: block;
    opacity: 1;
}

/* ══════════════════════════════════════════
   DRAWER LATERAL
══════════════════════════════════════════ */
.rw-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--rw-drawer-w);
    background: var(--rw-navy);
    border-right: 1px solid var(--rw-navy-light);
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}
.rw-drawer.rw-open {
    transform: translateX(0);
}

/* Header del drawer */
.rw-drawer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--rw-navy-light);
    flex-shrink: 0;
}
.rw-drawer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--rw-orange-dim);
    border: 2px solid var(--rw-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rw-orange);
    font-size: 22px;
    flex-shrink: 0;
}
.rw-drawer-user {
    flex: 1;
    min-width: 0;
}
.rw-drawer-name {
    display: block;
    color: var(--rw-text);
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rw-drawer-role {
    display: block;
    color: var(--rw-orange);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 1px;
}
.rw-drawer-close {
    background: none;
    border: none;
    color: var(--rw-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color .15s;
}
.rw-drawer-close:active { color: var(--rw-text); }

/* Alerta de verificación */
.rw-drawer-verify-alert {
    margin: 10px 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rw-drawer-verify-alert a {
    text-decoration: none;
    font-weight: 500;
}
.rw-verify-danger  { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3); }
.rw-verify-danger a, .rw-verify-danger i  { color: #f87171; }
.rw-verify-warning { background: rgba(251,191,36,.1);  border: 1px solid rgba(251,191,36,.3);  }
.rw-verify-warning a, .rw-verify-warning i { color: #fbbf24; }
.rw-verify-info    { background: var(--rw-orange-dim); border: 1px solid rgba(249,115,22,.3);  }
.rw-verify-info a, .rw-verify-info i    { color: var(--rw-orange); }

/* Navegación del drawer */
.rw-drawer-nav {
    padding: 8px 0 16px;
    flex: 1;
}

.rw-drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    color: var(--rw-text-muted);
    text-decoration: none;
    font-size: .95rem;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.rw-drawer-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.rw-drawer-link span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rw-drawer-link:hover {
    background: rgba(255,255,255,.04);
    color: var(--rw-text);
}
.rw-drawer-link.rw-active {
    color: var(--rw-orange);
    background: var(--rw-orange-dim);
    border-left-color: var(--rw-orange);
}
.rw-drawer-link.rw-active i { color: var(--rw-orange); }

/* Logout */
.rw-drawer-logout {
    color: #f87171;
}
.rw-drawer-logout:hover {
    color: #fca5a5;
    background: rgba(248,113,113,.08);
}

/* Divisor */
.rw-drawer-divider {
    height: 1px;
    background: var(--rw-navy-light);
    margin: 8px 16px;
}

/* Badge en solicitudes */
.rw-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
}

/* ══ BOTTOM NAV ══ */
.rw-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 74px;
    background: var(--rw-navy);
    border-top: 1px solid var(--rw-navy-light);
    z-index: 1035;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 16px;
}
.rw-bottom-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .4px;
    border-radius: 14px;
    padding: 10px 8px;
    height: 100%;
    transition: opacity .15s, transform .1s;
    position: relative;
}
.rw-bottom-item i { font-size: 1.45rem; line-height: 1; flex-shrink: 0; }
.rw-bottom-item:active { opacity: .82; transform: scale(.96); }





.rw-bottom-urgentes {
    background: var(--rw-orange);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(249,115,22,.4);
}
.rw-bottom-urgentes i { color: #fff; }
.rw-bottom-urgentes.rw-bottom-active { background: #ea6c0a; }

.rw-bottom-badge {
    position: absolute; top: 6px; right: 8px;
    min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; background: #ef4444;
    color: #fff; font-size: .65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* Hamburger con borde */
.rw-topbar-btn {
    background: #1e293b;
    border: 1.5px solid #334155;
    color: var(--rw-text);
    font-size: 18px;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, border-color .15s;
}
.rw-topbar-btn:active { background: #334155; border-color: var(--rw-orange); }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .rw-bottom-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        height: calc(74px + env(safe-area-inset-bottom));
    }
    @media (max-width: 991.98px) {
        .rw-content-spacer {
            padding-bottom: calc(74px + env(safe-area-inset-bottom) + 12px);
        }
    }
}

@media (min-width: 768px) { .w-md-auto { width: auto !important; } }





.rw-bottom-buscar {
    background: #1e293b;
    border: 2px solid #e2e8f0;
    color: #ffffff;
}
.rw-bottom-buscar i { color: #ffffff; }
.rw-bottom-buscar span { color: #ffffff; }
.rw-bottom-buscar.rw-bottom-active {
    border-color: var(--rw-orange);
    color: var(--rw-orange);
}
.rw-bottom-buscar.rw-bottom-active i { color: var(--rw-orange); }
