/* ============================================================
   POS Mundial — Paleta basada en el logo oficial
   Navy #0B2F55 · Teal #00A8B5 · Cyan #00C9D4 · Gray #6B7280
   ============================================================ */

:root {
    --navy: #0B2F55;
    --navy-deep: #072440;
    --navy-soft: #123A66;
    --teal: #00A8B5;
    --teal-dark: #008C97;
    --cyan: #00C9D4;
    --gray: #6B7280;
    --gray-soft: #9CA3AF;
    --bg: #F4F7FA;
    --bg-soft: #EEF3F7;
    --surface: #FFFFFF;
    --surface-2: #F8FBFD;
    --line: #D7E0EA;
    --text: #0B2F55;
    --muted: #6B7280;
    --accent: #00A8B5;
    --accent-2: #008C97;
    --accent-grad: linear-gradient(135deg, #00C9D4 0%, #00A8B5 55%, #008C97 100%);
    --danger: #D6455D;
    --success: #00A8B5;
    --radius: 14px;
    --shadow: 0 16px 40px rgba(11, 47, 85, 0.10);
    --shadow-sm: 0 6px 18px rgba(11, 47, 85, 0.08);
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.muted {
    color: var(--muted);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== AUTH (solo login / auth layout) ========== */
.auth-body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #ffffff;
    padding: 24px;
    overflow: hidden;
}

/* Fondo difuminado + velo blanco (no afecta .app-body)
   La imagen se inyecta por style inline desde templates/auth.php */
.auth-bg {
    position: fixed;
    inset: -24px;
    z-index: 0;
    background-color: #e8eef5;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(8px);
    transform: scale(1.08);
    pointer-events: none;
}

.auth-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 620px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(215, 224, 234, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(11, 47, 85, 0.14);
    padding: 64px 48px 52px;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.auth-brand {
    text-align: center;
    margin-bottom: 34px;
}

.auth-logo-img {
    width: 280px;
    height: auto;
    margin: 0 auto 14px;
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
}

.auth-brand .tagline {
    margin: 4px 0 0;
    color: var(--gray);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-brand p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.auth-form {
    display: grid;
    gap: 24px;
}

.auth-form .form-group {
    gap: 10px;
}

.auth-form .form-group input {
    padding: 15px 18px;
    font-size: 1.05rem;
    min-height: 52px;
}

.auth-form .btn-primary {
    margin-top: 6px;
    padding: 15px 18px;
    font-size: 1.08rem;
    min-height: 52px;
}

.form-group {
    display: grid;
    gap: 7px;
}

.form-group label {
    font-size: 0.88rem;
    color: var(--navy-soft);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.98rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.form-group input:focus {
    border-color: var(--teal);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 168, 181, 0.18);
}

.form-group input::placeholder {
    color: var(--gray-soft);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 58px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.82rem;
    padding: 6px 8px;
    font-weight: 600;
}

.toggle-password:hover {
    color: var(--teal);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s, filter .15s, opacity .15s, background .15s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 168, 181, 0.28);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-block {
    width: 100%;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.alert {
    border-radius: 10px;
    padding: 11px 13px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.alert-error {
    background: rgba(214, 69, 93, 0.08);
    border: 1px solid rgba(214, 69, 93, 0.28);
    color: #A33245;
}

.alert-success {
    background: rgba(0, 168, 181, 0.10);
    border: 1px solid rgba(0, 168, 181, 0.30);
    color: #066E78;
}

.auth-hint {
    margin: 28px 0 0;
    text-align: center;
    color: var(--gray-soft);
    font-size: 0.8rem;
}

/* ========== APP SHELL ========== */
.app-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    align-items: start;
    background: var(--bg);
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 55%, #0E3A63 100%);
    border-right: 0;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    color: #E8F1F8;
    box-shadow: 4px 0 24px rgba(11, 47, 85, 0.12);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.sidebar-brand strong {
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    color: #fff;
}

.sidebar-brand small {
    color: rgba(232, 241, 248, 0.72);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    align-content: flex-start;
    justify-content: flex-start;
}

.nav-item {
    display: block;
    flex: 0 0 auto;
    align-self: stretch;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(232, 241, 248, 0.78);
    border: 1px solid transparent;
    line-height: 1.3;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-item.active {
    background: rgba(0, 168, 181, 0.22);
    border-color: rgba(0, 201, 212, 0.35);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--cyan);
}

.sidebar-footer {
    display: grid;
    gap: 10px;
}

.user-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
}

.user-chip span {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    color: #fff;
}

.user-chip small {
    color: rgba(232, 241, 248, 0.7);
}

.main-content {
    padding: 28px;
    min-width: 0;
    width: 100%;
}

/* Asegura que [hidden] oculte elementos aunque haya display en clases */
[hidden] {
    display: none !important;
}

.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    color: var(--navy);
}

.page-header p {
    margin: 6px 0 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: var(--navy);
}

.info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

.info-list li span {
    color: var(--muted);
}

.info-list li strong {
    color: var(--navy);
}

.dash-session {
    margin-bottom: 22px;
    background:
        linear-gradient(180deg, rgba(0, 168, 181, 0.06), transparent 42%),
        var(--surface);
}

.info-list-inline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.info-list-inline li {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border: 1px solid rgba(0, 168, 181, 0.22);
    border-radius: 14px;
    border-bottom: 1px solid rgba(0, 168, 181, 0.22);
    background: #fff;
    box-shadow: 0 6px 16px rgba(7, 36, 64, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.info-list-inline li:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(7, 36, 64, 0.12);
    border-color: var(--teal);
}

.dash-info-card {
    min-width: 0;
}

.dash-info-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #0A7A84;
    background: rgba(0, 168, 181, 0.14);
    animation: dashIconFloat 2.8s ease-in-out infinite;
}

.dash-info-icon svg {
    width: 22px;
    height: 22px;
}

.dash-info-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.dash-info-text span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dash-info-text strong {
    color: var(--navy);
    font-size: 0.98rem;
    line-height: 1.25;
    word-break: break-word;
}

.dash-info-user .dash-info-icon { animation-delay: 0s; }
.dash-info-mail .dash-info-icon { animation-delay: 0.25s; color: #1F6F8B; background: rgba(31, 111, 139, 0.14); }
.dash-info-role .dash-info-icon { animation-delay: 0.5s; color: #244870; background: rgba(36, 72, 112, 0.12); }
.dash-info-biz .dash-info-icon { animation-delay: 0.75s; color: #0A7A84; background: rgba(0, 168, 181, 0.16); }

.dash-mail-flap {
    transform-origin: 12px 7px;
    animation: dashMailFlap 2.6s ease-in-out infinite;
}

.dash-shield-check {
    stroke-dasharray: 18;
    stroke-dashoffset: 18;
    animation: dashCheckDraw 2.8s ease-in-out infinite;
}

.dash-biz-pulse {
    opacity: 0.55;
    animation: dashBizPulse 2.4s ease-in-out infinite;
}

@keyframes dashIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes dashMailFlap {
    0%, 70%, 100% { transform: rotate(0deg); }
    80% { transform: rotate(-8deg); }
    90% { transform: rotate(4deg); }
}

@keyframes dashCheckDraw {
    0%, 15% { stroke-dashoffset: 18; }
    40%, 70% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 18; }
}

@keyframes dashBizPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .dash-info-icon,
    .dash-mail-flap,
    .dash-shield-check,
    .dash-biz-pulse {
        animation: none !important;
    }
}

.dash-modules-section {
    margin-top: 6px;
}

.dash-modules-header {
    margin-bottom: 14px;
}

.dash-modules-header h2 {
    margin: 0;
    color: var(--navy);
    font-size: 1.15rem;
}

.dash-modules-header p {
    margin: 4px 0 0;
}

.dash-modules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dash-module-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-module-card:hover {
    transform: translateY(-3px);
    border-color: var(--mod-accent, var(--teal));
    box-shadow: 0 10px 24px rgba(7, 36, 64, 0.12);
}

.dash-module-card:active {
    transform: translateY(-1px);
}

.dash-module-accent {
    display: block;
    height: 5px;
    background: var(--mod-accent, var(--teal));
    transform-origin: left center;
    transition: transform 0.25s ease;
}

.dash-module-card:hover .dash-module-accent {
    transform: scaleX(1.02);
}

.dash-module-body {
    display: grid;
    gap: 8px;
    padding: 18px 18px 16px;
}

.dash-module-body strong {
    color: var(--navy);
    font-size: 1.12rem;
}

.dash-module-body span {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.dash-module-body em {
    margin-top: 4px;
    font-style: normal;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--mod-accent, var(--teal-dark));
    transition: letter-spacing 0.2s ease;
}

.dash-module-card:hover .dash-module-body em {
    letter-spacing: 0.02em;
}

.roadmap {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 8px;
}

.roadmap .done {
    color: var(--teal-dark);
    font-weight: 600;
}

@media (max-width: 900px) {
    .app-body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        min-height: auto;
        max-height: none;
        border-right: 0;
    }

    .dashboard-grid,
    .dash-modules-grid,
    .info-list-inline {
        grid-template-columns: 1fr;
    }
}
