:root {
    --bg: #050b18;
    --bg-soft: #0d1628;
    --panel: #101b2d;
    --panel-2: #121f33;
    --panel-3: #16253b;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f3f6fa;
    --text-soft: #c8d2dc;
    --text-soft-2: #97a8bc;
    --orange: #ff7a00;
    --orange-2: #ff8a00;
    --orange-dark: #d96b00;
    --green: #25d366;
    --red: #ff4d4f;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --radius-sm: 12px;
    --topbar-h: 56px;
    --page-gap: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

input,
textarea,
select {
    width: 100%;
    background: #0d1a2d;
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--orange-2);
}

button {
    border: none;
    border-radius: 10px;
    background: var(--orange);
    color: #fff;
    cursor: pointer;
    transition: 0.2s ease;
}

button:hover {
    background: var(--orange-dark);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border-radius: 14px;
    overflow: hidden;
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 13px;
}

th {
    color: #ffb066;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.02);
}

tr:last-child td {
    border-bottom: none;
}

.error-box,
.chat-error-box {
    margin-top: 10px;
    background: rgba(255, 77, 79, 0.12);
    border: 1px solid rgba(255, 77, 79, 0.3);
    color: #ffd8d8;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.layout,
.sidebar,
.user-box {
    display: none !important;
}

/* ============================================================
   LOGIN BASE
   ============================================================ */

.login-body {
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    background: #050b18;
}

.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

.login-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle at center, black 48%, transparent 100%);
}

.login-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.22;
}

.login-bg-glow-1 {
    width: 320px;
    height: 320px;
    background: rgba(255, 122, 0, 0.9);
    top: -80px;
    left: -40px;
}

.login-bg-glow-2 {
    width: 380px;
    height: 380px;
    background: rgba(255, 122, 0, 0.55);
    bottom: -120px;
    right: -60px;
}

.login-bg-lines {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, transparent 0%, transparent 46%, rgba(255,122,0,0.08) 50%, transparent 54%, transparent 100%),
        linear-gradient(45deg, transparent 0%, transparent 47%, rgba(255,255,255,0.03) 50%, transparent 53%, transparent 100%);
}

.login-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(12, 22, 36, 0.88);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-logo-mark {
    width: 50px;
    height: 50px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.login-logo-mark span {
    display: block;
    border-radius: 8px;
    background: linear-gradient(180deg, #ff8a00 0%, #ff6400 100%);
}

.login-brand-small {
    color: #ffb066;
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
}

.login-brand-big {
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.login-subtitle {
    margin-top: 12px;
    margin-bottom: 16px;
    color: var(--text-soft);
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-field {
    position: relative;
}

.login-field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffb066;
    font-size: 13px;
    pointer-events: none;
}

.login-field input {
    padding-left: 36px;
    height: 46px;
}

.login-button {
    height: 46px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
    border-radius: 12px;
}


/* ============================================================
   LOGIN IA MODERNO | GRUPO SKR
   ============================================================ */

.ai-login-body {
    margin: 0;
    min-height: 100vh;
    background: #020611;
    overflow: hidden;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: #ffffff;
}

.login-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        radial-gradient(circle at center, rgba(255, 122, 0, 0.18), transparent 32%),
        radial-gradient(circle at 70% 30%, rgba(0, 140, 255, 0.16), transparent 35%),
        #020611;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-orbit {
    position: relative;
    width: 110px;
    height: 110px;
}

.loader-core {
    position: absolute;
    inset: 36px;
    border-radius: 50%;
    background: #ff7a00;
    box-shadow:
        0 0 20px rgba(255, 122, 0, 0.9),
        0 0 55px rgba(255, 122, 0, 0.55);
    animation: corePulse 1.5s infinite ease-in-out;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid transparent;
}

.ring-1 {
    border-top-color: #ff7a00;
    animation: spinRing 1.2s linear infinite;
}

.ring-2 {
    inset: 13px;
    border-right-color: #2aa8ff;
    animation: spinRingReverse 1.8s linear infinite;
}

.ring-3 {
    inset: 25px;
    border-bottom-color: #31ff82;
    animation: spinRing 2.2s linear infinite;
}

.loader-brand {
    text-align: center;
}

.loader-logo {
    display: grid;
    grid-template-columns: repeat(2, 18px);
    gap: 5px;
    justify-content: center;
    margin-bottom: 10px;
}

.loader-logo span {
    width: 18px;
    height: 18px;
    background: #ff7a00;
    border-radius: 7px;
    box-shadow: 0 0 18px rgba(255, 122, 0, 0.6);
}

.loader-brand h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 2px;
}

.loader-brand p {
    margin: 7px 0 0;
    color: #b9c6d8;
    font-size: 14px;
}

.loader-bar {
    width: 260px;
    height: 5px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
}

.loader-bar-fill {
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, transparent, #ff7a00, #2aa8ff, transparent);
    animation: loaderBar 1.4s infinite ease-in-out;
}

.ai-login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(120deg, rgba(255, 122, 0, 0.08), transparent 25%),
        linear-gradient(240deg, rgba(0, 140, 255, 0.12), transparent 35%),
        #020611;
}

.ai-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(circle at center, black, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 75%);
    opacity: 0.55;
}

.ai-glow {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: floatGlow 9s infinite ease-in-out;
}

.ai-glow-orange {
    left: -120px;
    top: 10%;
    background: rgba(255, 122, 0, 0.35);
}

.ai-glow-blue {
    right: -130px;
    top: 12%;
    background: rgba(0, 102, 255, 0.35);
    animation-delay: 1.5s;
}

.ai-glow-green {
    left: 38%;
    bottom: -220px;
    background: rgba(0, 255, 120, 0.18);
    animation-delay: 3s;
}

.ai-wave {
    position: absolute;
    width: 120%;
    height: 220px;
    left: -10%;
    border-radius: 50%;
    border-top: 1px solid rgba(49, 255, 130, 0.35);
    transform: rotate(-10deg);
    opacity: 0.65;
}

.ai-wave-1 {
    top: 28%;
    animation: waveMove 7s infinite ease-in-out;
}

.ai-wave-2 {
    top: 36%;
    border-top-color: rgba(42, 168, 255, 0.35);
    animation: waveMove 9s infinite ease-in-out reverse;
}

.ai-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 122, 0, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 122, 0, 0.9);
    animation: particleFloat 7s infinite linear;
}

.ai-particles span:nth-child(1) { left: 12%; top: 20%; animation-delay: 0s; }
.ai-particles span:nth-child(2) { left: 25%; top: 70%; animation-delay: 1s; }
.ai-particles span:nth-child(3) { left: 42%; top: 18%; animation-delay: 2s; }
.ai-particles span:nth-child(4) { left: 64%; top: 76%; animation-delay: 3s; }
.ai-particles span:nth-child(5) { left: 82%; top: 25%; animation-delay: 1.4s; }
.ai-particles span:nth-child(6) { left: 90%; top: 58%; animation-delay: 2.4s; }
.ai-particles span:nth-child(7) { left: 7%; top: 55%; animation-delay: 3.6s; }
.ai-particles span:nth-child(8) { left: 35%; top: 88%; animation-delay: 4.2s; }
.ai-particles span:nth-child(9) { left: 75%; top: 12%; animation-delay: 5s; }
.ai-particles span:nth-child(10) { left: 55%; top: 44%; animation-delay: 5.5s; }

.ai-side-visual {
    position: absolute;
    right: 7%;
    top: 50%;
    width: 390px;
    height: 340px;
    transform: translateY(-50%);
    opacity: 0.85;
}

.ai-face {
    position: absolute;
    left: 0;
    top: 60px;
    width: 145px;
    height: 205px;
    border-radius: 80px 40px 45px 80px;
    background:
        radial-gradient(circle at 38% 38%, rgba(42, 168, 255, 0.9), transparent 12%),
        linear-gradient(90deg, rgba(255,255,255,0.16), rgba(42,168,255,0.05));
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        inset 0 0 35px rgba(42, 168, 255, 0.2),
        0 0 60px rgba(42, 168, 255, 0.2);
    animation: aiFaceFloat 5s infinite ease-in-out;
}

.ai-face::after {
    content: "";
    position: absolute;
    right: -18px;
    top: 50px;
    width: 55px;
    height: 90px;
    border-radius: 50%;
    border-right: 2px solid rgba(255, 255, 255, 0.5);
    transform: rotate(-8deg);
}

.ai-face-glow {
    position: absolute;
    left: 28px;
    top: 62px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(42, 168, 255, 0.65);
    box-shadow: 0 0 45px rgba(42, 168, 255, 0.95);
    animation: eyePulse 1.8s infinite ease-in-out;
}

.ai-eye {
    position: absolute;
    left: 40px;
    top: 75px;
    width: 14px;
    height: 14px;
    background: #dff7ff;
    border-radius: 50%;
    box-shadow: 0 0 18px #2aa8ff;
}

.ai-head-line {
    position: absolute;
    height: 1px;
    background: rgba(42, 168, 255, 0.6);
    left: 15px;
    right: 15px;
}

.line-a { top: 42px; }
.line-b { top: 116px; }
.line-c { top: 158px; }

.ai-holo-panel {
    position: absolute;
    right: 0;
    top: 35px;
    width: 250px;
    height: 260px;
    border: 1px solid rgba(42, 168, 255, 0.35);
    border-radius: 24px;
    background: rgba(6, 18, 34, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        inset 0 0 40px rgba(42, 168, 255, 0.08),
        0 0 45px rgba(42, 168, 255, 0.18);
    animation: holoFloat 6s infinite ease-in-out;
}

.holo-header {
    display: flex;
    gap: 8px;
    padding: 18px;
}

.holo-header span {
    width: 36px;
    height: 7px;
    border-radius: 999px;
    background: rgba(42, 168, 255, 0.55);
}

.holo-shield {
    position: relative;
    width: 105px;
    height: 125px;
    margin: 10px auto;
    background: linear-gradient(160deg, rgba(42,168,255,0.25), rgba(255,255,255,0.03));
    clip-path: polygon(50% 0%, 95% 18%, 82% 82%, 50% 100%, 18% 82%, 5% 18%);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 0 35px rgba(42,168,255,0.25);
}

.shield-lock {
    position: absolute;
    left: 39px;
    top: 52px;
    width: 28px;
    height: 26px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.65);
}

.shield-lock::before {
    content: "";
    position: absolute;
    left: 5px;
    top: -17px;
    width: 14px;
    height: 17px;
    border-radius: 12px 12px 0 0;
    border: 2px solid rgba(255,255,255,0.65);
    border-bottom: none;
}

.holo-lines {
    padding: 12px 28px;
}

.holo-lines span {
    display: block;
    height: 7px;
    margin-bottom: 9px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(42,168,255,0.75), transparent);
}

.ai-login-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 12%;
}

.ai-login-card {
    position: relative;
    width: 370px;
    padding: 30px 28px 24px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(13, 24, 42, 0.92), rgba(6, 12, 24, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
    animation: cardEntrance 0.9s ease forwards;
}

.ai-card-border {
    position: absolute;
    inset: 0;
    border-radius: 26px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,122,0,0.85), transparent 35%, rgba(42,168,255,0.75));
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    pointer-events: none;
    opacity: 0.65;
}

.ai-login-card::before {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    right: -70px;
    top: -70px;
    border-radius: 50%;
    background: rgba(255, 122, 0, 0.18);
    filter: blur(20px);
}

.ai-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.ai-logo-mark {
    display: grid;
    grid-template-columns: repeat(2, 21px);
    gap: 6px;
    width: auto;
    height: auto;
}

.ai-logo-mark span {
    width: 21px;
    height: 21px;
    border-radius: 8px;
    background: #ff7a00;
    box-shadow: 0 0 18px rgba(255, 122, 0, 0.55);
}

.ai-login-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.ai-login-title p {
    margin: 7px 0 18px;
    color: #b9c6d8;
    font-size: 13px;
}

.ai-status-panel {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    margin-bottom: 17px;
    border-radius: 14px;
    background: rgba(49, 255, 130, 0.08);
    border: 1px solid rgba(49, 255, 130, 0.18);
    color: #d8ffe7;
    font-size: 12px;
}

.ai-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #31ff82;
    box-shadow: 0 0 16px rgba(49, 255, 130, 0.9);
    animation: statusPulse 1.6s infinite ease-in-out;
}

.ai-login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-login-field {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(232, 240, 254, 0.96);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 11px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.ai-login-field:focus-within {
    border-color: rgba(255, 122, 0, 0.9);
    box-shadow:
        0 0 0 3px rgba(255, 122, 0, 0.18),
        0 0 24px rgba(255, 122, 0, 0.16);
    transform: translateY(-1px);
}

.ai-field-icon {
    position: static;
    transform: none;
    width: 42px;
    text-align: center;
    color: #ff7a00;
    font-size: 13px;
    flex: 0 0 42px;
}

.ai-login-field input {
    flex: 1;
    height: 44px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #06101f;
    padding: 0 12px 0 0;
}

.ai-login-field input::placeholder {
    color: #516070;
}

.ai-login-button {
    position: relative;
    height: 46px;
    border: none;
    border-radius: 12px;
    margin-top: 2px;
    background: linear-gradient(135deg, #ff7a00, #ff8f1f);
    color: #ffffff;
    font-weight: 900;
    letter-spacing: 0.8px;
    cursor: pointer;
    box-shadow:
        0 14px 35px rgba(255, 122, 0, 0.32),
        inset 0 1px 0 rgba(255,255,255,0.25);
    transition: all 0.25s ease;
    overflow: hidden;
}

.ai-login-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: 0.5s;
}

.ai-login-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ff8f1f, #ff7a00);
    box-shadow:
        0 18px 45px rgba(255, 122, 0, 0.45),
        0 0 20px rgba(255, 122, 0, 0.25);
}

.ai-login-button:hover::before {
    left: 120%;
}

.ai-login-button.loading .btn-text {
    opacity: 0;
}

.btn-loader {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 19px;
    height: 19px;
    margin-left: -9.5px;
    margin-top: -9.5px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.45);
    border-top-color: #ffffff;
    animation: spinRing 0.8s linear infinite;
}

.ai-login-button.loading .btn-loader {
    display: block;
}

.ai-login-footer {
    margin-top: 18px;
    text-align: center;
    color: #7f8fa6;
    font-size: 11px;
}

.ai-error-box {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 67, 67, 0.14);
    border: 1px solid rgba(255, 67, 67, 0.28);
    color: #ffb8b8;
    font-size: 13px;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

@keyframes spinRingReverse {
    to { transform: rotate(-360deg); }
}

@keyframes corePulse {
    0%, 100% { transform: scale(0.9); opacity: 0.75; }
    50% { transform: scale(1.12); opacity: 1; }
}

@keyframes loaderBar {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(260%); }
}

@keyframes floatGlow {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-24px) scale(1.08); }
}

@keyframes waveMove {
    0%, 100% { transform: translateX(-25px) rotate(-10deg); }
    50% { transform: translateX(25px) rotate(-7deg); }
}

@keyframes particleFloat {
    0% { transform: translateY(0) scale(1); opacity: 0.25; }
    50% { opacity: 1; }
    100% { transform: translateY(-80px) scale(0.6); opacity: 0; }
}

@keyframes aiFaceFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

@keyframes holoFloat {
    0%, 100% { transform: translateY(0) rotateY(0deg); }
    50% { transform: translateY(12px) rotateY(-5deg); }
}

@keyframes eyePulse {
    0%, 100% { opacity: 0.55; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(25px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes statusPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

@media (max-width: 1050px) {
    .ai-login-shell {
        justify-content: center;
        padding-left: 0;
    }

    .ai-side-visual {
        opacity: 0.28;
        right: 50%;
        transform: translate(50%, -50%);
    }
}

@media (max-width: 560px) {
    .ai-login-shell {
        padding: 20px;
    }

    .ai-login-card {
        width: 100%;
        max-width: 370px;
        padding: 26px 22px 22px;
    }

    .ai-side-visual {
        display: none;
    }

    .loader-bar {
        width: 220px;
    }
}

