:root {
    --bg: #0e0e0f;
    --card: #161618;
    --card2: #1c1c1f;
    --card3: #202024;
    --border: rgba(255, 255, 255, 0.06);
    --border2: rgba(255, 255, 255, 0.1);
    --text: #f2f2f5;
    --muted: #6b6b7b;
    --muted-light: #9a9aa8;
    --amber: #e2913f;
    --amber-dark: #b8651f;
    --amber-dim: rgba(226, 145, 63, 0.13);
    --amber-glow: rgba(226, 145, 63, 0.35);
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.12);
    --red: #f43f5e;
    --red-dim: rgba(244, 63, 94, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 85%, rgba(226, 145, 63, 0.07), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.045), transparent 28%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    font-size: 13px;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: 64px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(20, 20, 22, 0.82);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 8px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--amber), var(--amber-dark));
    box-shadow: 0 8px 18px rgba(226, 145, 63, 0.18);
    color: #fff;
    font-family: "Bebas Neue", sans-serif;
    font-size: 15px;
    letter-spacing: 1px;
}

.brand-name {
    font-family: "Bebas Neue", sans-serif;
    font-size: 20px;
    letter-spacing: 3px;
}

.security-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--border2);
    border-radius: 20px;
    background: var(--card2);
    color: var(--muted-light);
    font-size: 11px;
    font-weight: 600;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.65);
}

.login-layout {
    width: min(1180px, calc(100% - 48px));
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    align-items: center;
    gap: clamp(48px, 8vw, 112px);
    margin: 0 auto;
    padding: 52px 0;
}

.welcome-panel {
    min-width: 0;
}

.eyebrow,
.card-kicker,
.preview-label {
    color: var(--amber);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.welcome-copy h1 {
    max-width: 660px;
    margin-top: 12px;
    font-size: clamp(44px, 5.2vw, 70px);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -3px;
}

.welcome-text {
    max-width: 560px;
    margin-top: 20px;
    color: var(--muted-light);
    font-size: 15px;
    line-height: 1.7;
}

.dashboard-preview {
    max-width: 680px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
}

.preview-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16);
}

.preview-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 58%);
    pointer-events: none;
}

.preview-main {
    grid-column: 1 / -1;
    min-height: 230px;
}

.preview-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.preview-card-head strong {
    display: block;
    margin-top: 5px;
    font-size: 16px;
}

.preview-badge {
    padding: 4px 9px;
    border-radius: 20px;
    background: var(--green-dim);
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 25px;
}

.metric-block {
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    background: var(--card2);
}

.metric-value {
    display: block;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -1px;
}

.metric-label {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.chart-bars {
    height: 64px;
    display: flex;
    align-items: end;
    gap: 9px;
    margin-top: 21px;
    padding: 0 3px;
    border-bottom: 1px solid var(--border2);
}

.chart-bars span {
    height: var(--bar);
    flex: 1;
    min-width: 8px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--amber), rgba(226, 145, 63, 0.26));
    opacity: 0.86;
}

.preview-small {
    min-height: 138px;
}

.small-value {
    display: block;
    margin-top: 12px;
    font-size: 30px;
    letter-spacing: -1px;
}

.progress-track {
    height: 5px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
}

.progress-track span {
    display: block;
    width: 74%;
    height: 100%;
    border-radius: inherit;
    background: var(--amber);
}

.preview-card small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 10px;
}

.avatar-stack {
    display: flex;
    align-items: center;
    margin: 17px 0 14px 7px;
}

.avatar-stack span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    margin-left: -7px;
    border: 2px solid var(--card);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber), #f43f5e);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
}

.avatar-stack span:nth-child(2) { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.avatar-stack span:nth-child(3) { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.avatar-stack span:nth-child(4) { background: var(--card3); color: var(--muted-light); }

.login-card {
    position: relative;
    width: 100%;
    padding: 30px;
    border: 1px solid var(--border2);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 95%, transparent);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(226, 145, 63, 0.75), transparent);
}

.login-heading {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid rgba(226, 145, 63, 0.25);
    border-radius: 12px;
    background: var(--amber-dim);
    color: var(--amber);
}

.login-heading h2 {
    margin-top: 4px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.7px;
}

.login-description {
    margin-top: 19px;
    color: var(--muted-light);
    font-size: 13px;
    line-height: 1.65;
}

.provider-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.provider-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card2);
    color: var(--muted-light);
    font-size: 10px;
    font-weight: 700;
}

.provider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.provider-dot.odoo { background: #a24689; }
.provider-dot.supabase { background: #3ecf8e; }

#login-form {
    margin-top: 22px;
}

.field-group {
    margin-bottom: 15px;
}

.field-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted-light);
    font-size: 11px;
    font-weight: 700;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    display: grid;
    place-items: center;
    color: var(--muted);
    pointer-events: none;
    transition: color 0.15s ease;
}

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 43px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    outline: none;
    background: var(--card2);
    color: var(--text);
    font-size: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-wrap input::placeholder {
    color: var(--muted);
}

.input-wrap:focus-within .field-icon {
    color: var(--amber);
}

.input-wrap input:focus {
    border-color: rgba(226, 145, 63, 0.62);
    background: #1e1e21;
    box-shadow: 0 0 0 3px rgba(226, 145, 63, 0.09);
}

.toggle-password {
    position: absolute;
    right: 12px;
    display: grid;
    place-items: center;
    padding: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    color: var(--amber);
    outline: none;
}

.input-wrap input[type="password"]::-ms-reveal,
.input-wrap input[type="password"]::-ms-clear {
    display: none;
}

.field-error {
    min-height: 16px;
    padding-top: 5px;
    color: var(--red);
    font-size: 10px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 23px;
    margin-bottom: 16px;
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted-light);
    cursor: pointer;
    user-select: none;
    font-size: 11px;
}

.remember-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-ui {
    position: relative;
    width: 17px;
    height: 17px;
    border: 1px solid var(--border2);
    border-radius: 5px;
    background: var(--card2);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.remember-row input:focus-visible + .checkbox-ui {
    outline: 2px solid rgba(226, 145, 63, 0.35);
    outline-offset: 2px;
}

.remember-row input:checked + .checkbox-ui {
    border-color: var(--amber);
    background: var(--amber);
}

.remember-row input:checked + .checkbox-ui::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

.form-alert {
    display: none;
    margin-bottom: 15px;
    padding: 10px 12px;
    border: 1px solid rgba(244, 63, 94, 0.22);
    border-radius: 9px;
    background: var(--red-dim);
    color: #fb7185;
    font-size: 11px;
    line-height: 1.45;
}

.form-alert:not(:empty) {
    display: block;
}

.form-alert.success {
    border-color: rgba(34, 197, 94, 0.22);
    background: var(--green-dim);
    color: #4ade80;
}

.login-button {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--amber), var(--amber-dark));
    box-shadow: 0 12px 28px rgba(226, 145, 63, 0.18);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 32px rgba(226, 145, 63, 0.25);
    filter: brightness(1.04);
}

.login-button:focus-visible {
    outline: 3px solid rgba(226, 145, 63, 0.25);
    outline-offset: 3px;
}

.login-button:disabled {
    opacity: 0.58;
    cursor: wait;
    transform: none;
    filter: none;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 23px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@media (max-width: 960px) {
    .login-layout {
        width: min(760px, calc(100% - 40px));
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 42px 0;
    }

    .welcome-copy {
        text-align: center;
    }

    .welcome-copy h1,
    .welcome-text {
        margin-left: auto;
        margin-right: auto;
    }

    .welcome-copy h1 {
        font-size: clamp(42px, 9vw, 62px);
    }

    .dashboard-preview {
        display: none;
    }

    .login-card {
        width: min(430px, 100%);
        margin: 0 auto;
    }
}

@media (max-width: 560px) {
    .app-topbar {
        height: 58px;
        min-height: 58px;
        padding: 0 16px;
    }

    .brand-name {
        font-size: 18px;
        letter-spacing: 2.5px;
    }

    .security-status span:last-child {
        display: none;
    }

    .security-status {
        width: 31px;
        height: 31px;
        justify-content: center;
        padding: 0;
    }

    .login-layout {
        width: calc(100% - 28px);
        align-items: start;
        gap: 26px;
        padding: 34px 0 28px;
    }

    .welcome-copy h1 {
        font-size: 42px;
        letter-spacing: -2px;
    }

    .welcome-text {
        margin-top: 15px;
        font-size: 13px;
    }

    .login-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .login-heading h2 {
        font-size: 23px;
    }

    .provider-row {
        flex-wrap: wrap;
    }

    .login-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-height: 740px) and (min-width: 961px) {
    .login-layout {
        padding: 28px 0;
    }

    .welcome-copy h1 {
        font-size: 54px;
    }

    .welcome-text {
        margin-top: 14px;
    }

    .dashboard-preview {
        margin-top: 24px;
    }

    .preview-main {
        min-height: 195px;
    }

    .metric-row {
        margin-top: 17px;
    }

    .chart-bars {
        height: 45px;
        margin-top: 15px;
    }

    .preview-small {
        min-height: 112px;
    }
}


/* V36 · selector de tema */
.login-topbar-actions{display:flex;align-items:center;gap:10px}
.login-theme-toggle{position:relative;display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--border2);border-radius:12px;background:var(--card2);color:var(--muted-light);cursor:pointer}
.login-theme-toggle svg{position:absolute;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:.18s}
html[data-theme="dark"] .login-theme-sun{opacity:1;transform:scale(1)}html[data-theme="dark"] .login-theme-moon{opacity:0;transform:scale(.65)}
html[data-theme="light"] .login-theme-sun{opacity:0;transform:scale(.65)}html[data-theme="light"] .login-theme-moon{opacity:1;transform:scale(1)}
html[data-theme="light"]{--bg:#f2f4f7;--card:#fff;--card2:#f7f8fa;--card3:#eef1f4;--border:rgba(15,23,42,.08);--border2:rgba(15,23,42,.14);--text:#20242c;--muted:#667085;--muted-light:#475467}
html[data-theme="light"] body{background:radial-gradient(circle at 18% 85%,rgba(226,145,63,.10),transparent 30%),radial-gradient(circle at 85% 15%,rgba(139,92,246,.05),transparent 28%),var(--bg)}
html[data-theme="light"] .app-topbar{background:rgba(255,255,255,.88);box-shadow:0 1px 0 rgba(15,23,42,.03),0 8px 24px rgba(15,23,42,.07)}
html[data-theme="light"] .preview-card,html[data-theme="light"] .login-card{box-shadow:0 20px 45px rgba(15,23,42,.08)}
html[data-theme="light"] input{color-scheme:light}
@media(max-width:640px){.security-status span:last-child{display:none}}


/* V37 · correcciones de modo claro del acceso */
.login-brand-logo{display:flex;align-items:center}.login-brand-logo .brand-logo{height:30px;width:auto;display:block;object-fit:contain}.login-brand-logo .brand-logo-light{display:none}
html[data-theme="light"] .login-brand-logo .brand-logo-dark{display:none}html[data-theme="light"] .login-brand-logo .brand-logo-light{display:block}
html[data-theme="light"] .login-card{background:rgba(255,255,255,.96)!important;border-color:rgba(15,23,42,.13);color:#20242c}
html[data-theme="light"] .login-card::before{background:linear-gradient(90deg,transparent,rgba(226,145,63,.8),transparent)}
html[data-theme="light"] .input-wrap{background:#fff;border-color:rgba(15,23,42,.14)}html[data-theme="light"] .input-wrap input{color:#20242c;background:transparent}
html[data-theme="light"] .progress-track{background:rgba(15,23,42,.08)}html[data-theme="light"] .preview-card::before{background:linear-gradient(135deg,rgba(15,23,42,.018),transparent 58%)}

/* V38 · el logotipo del acceso siempre conserva un área visible */
.login-brand-logo{min-width:250px;min-height:42px}
.login-brand-logo .brand-logo{height:38px;max-width:min(360px,42vw);object-fit:contain;object-position:left center}
@media(max-width:640px){.login-brand-logo{min-width:150px}.login-brand-logo .brand-logo{height:30px;max-width:46vw}}
