* {
    box-sizing: border-box;
}

:root {
    --bg-dark: #050816;
    --bg-dark-2: #0b1024;
    --violet: #8a2be2;
    --violet-soft: #b06cff;
    --cyan: #00d4ff;
    --cyan-soft: #69e7ff;
    --coral: #ff7a5c;
    --text-main: #ffffff;
    --text-muted: #aab3c5;
    --panel-bg: rgba(13, 18, 38, 0.82);
    --panel-border: rgba(255, 255, 255, 0.12);
    --assistant-msg: rgba(255, 255, 255, 0.08);
    --user-msg: linear-gradient(135deg, #8a2be2, #00d4ff);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Segoe UI', Arial, sans-serif;
    background:
        radial-gradient(circle at 50% 15%, rgba(138, 43, 226, 0.28), transparent 32%),
        radial-gradient(circle at 80% 75%, rgba(0, 212, 255, 0.18), transparent 34%),
        linear-gradient(180deg, var(--bg-dark-2), var(--bg-dark));
    color: var(--text-main);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: auto 0 0 0;
    height: 45vh;
    background:
        linear-gradient(to top, rgba(0, 212, 255, 0.14), transparent 70%),
        repeating-linear-gradient(
            0deg,
            rgba(0, 212, 255, 0.14) 0px,
            rgba(0, 212, 255, 0.14) 1px,
            transparent 1px,
            transparent 42px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(138, 43, 226, 0.12) 0px,
            rgba(138, 43, 226, 0.12) 1px,
            transparent 1px,
            transparent 42px
        );
    opacity: 0.55;
    transform: perspective(600px) rotateX(62deg);
    transform-origin: bottom;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.38));
    pointer-events: none;
    z-index: 0;
}

.page {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 44px 32px;
}

.hero {
    text-align: center;
    margin-top: 22px;
}

.hero h1 {
    font-size: clamp(34px, 4vw, 56px);
    margin: 0 0 14px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #ffffff, var(--violet-soft), var(--cyan-soft));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 35px rgba(0, 212, 255, 0.22);
}

.hero p {
    margin: 0;
    font-size: 18px;
    color: var(--text-muted);
}

.admin-link {
    display: inline-block;

    color: var(--cyan-soft);
    text-decoration: none;
    font-weight: 700;
    padding: 10px 10px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.06);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.12);
    transition: all 0.25s ease;
}

.admin-link:hover {
    color: #fff;
    border-color: rgba(176, 108, 255, 0.65);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.35);
    transform: translateY(-2px);
}

.robot-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 500px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.robot-container::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 180px;
    bottom: 24px;
    background: radial-gradient(ellipse, rgba(0, 212, 255, 0.24), transparent 68%);
    filter: blur(8px);
    z-index: -1;
}

.spline-wrapper {
    width: min(560px, 86vw);
    height: min(560px, 86vw);
    cursor: pointer;
    position: relative;
    z-index: 5;
    filter:
        drop-shadow(0 0 38px rgba(138, 43, 226, 0.38))
        drop-shadow(0 0 24px rgba(0, 212, 255, 0.18));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.spline-wrapper:hover {
    transform: scale(1.04) translateY(-4px);
    filter:
        drop-shadow(0 0 46px rgba(138, 43, 226, 0.52))
        drop-shadow(0 0 34px rgba(0, 212, 255, 0.28));
}

.spline-wrapper {
    width: min(560px, 86vw);
    height: min(560px, 86vw);
    cursor: pointer;
    position: relative;
    z-index: 5;
    filter:
        drop-shadow(0 0 38px rgba(138, 43, 226, 0.38))
        drop-shadow(0 0 24px rgba(0, 212, 255, 0.18));
    transition: transform 0.3s ease, filter 0.3s ease;

    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.spline-wrapper spline-viewer,
.spline-wrapper canvas,
.spline-wrapper iframe {
    width: 100%;
    height: 100%;
    display: block;

    pointer-events: none;
}

.chat-panel {
      position: fixed;
    right: 30px;
    bottom: 30px;

    width: 480px;
    height: 82vh;

    display: flex;
    flex-direction: column;

    background: rgba(7, 12, 36, 0.92);
    border: 1px solid rgba(0, 212, 255, 0.18);

    border-radius: 28px;

    overflow: hidden;

    backdrop-filter: blur(18px);

    box-shadow:
        0 0 50px rgba(0, 212, 255, 0.12),
        0 0 120px rgba(138, 43, 226, 0.10);

    z-index: 1000;
}

.chat-panel {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chat-panel.visible {
    opacity: 1;
    transform: translateY(0);
}



.hidden {
    display: none;
}

.chat-header {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.95), rgba(0, 212, 255, 0.82));
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.26);
}

.chat-header button {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 24px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-header button:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;

    overflow-y: auto;

    padding: 20px;

    display: flex;
    flex-direction: column;
    gap: 16px;

    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.32);
    border-radius: 999px;
}

.message {
    max-width: 88%;
    padding: 16px 18px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 15px;
}

.message.user {
    background: var(--user-msg);
    color: white;
    margin-left: 44px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 212, 255, 0.16);
}

.message.assistant {
    background: var(--assistant-msg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-right: 44px;
    border-bottom-left-radius: 6px;
    color: #eef3ff;
}

.chat-input {
    display: flex;
    gap: 14px;
    padding: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.chat-input textarea {
    flex: 1;

    min-height: 70px;
    max-height: 180px;

    resize: none;

    padding: 16px;

    border-radius: 18px;

    background: rgba(255,255,255,0.06);

    border: 1px solid rgba(255,255,255,0.08);

    color: white;

    font-size: 15px;

    outline: none;
}

.chat-input textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input textarea:focus {
    border-color: rgba(0, 212, 255, 0.62);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}

.chat-input button,
.admin-actions button {
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(0, 212, 255, 0.18);
    transition: all 0.22s ease;
}

.chat-input button:hover,
.admin-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(138, 43, 226, 0.28);
}

.typing {
    display: flex;
    gap: 6px;
    padding: 6px 2px;
}

.typing span {
    width: 8px;
    height: 8px;
    background: var(--cyan-soft);
    border-radius: 50%;
    animation: bounce 1.2s infinite;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.4);
        opacity: 0.45;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Consola de administración */

.admin-page {
    min-height: 100vh;
    padding: 50px 24px;
    position: relative;
    z-index: 1;
}

.admin-card {
    max-width: 920px;
    margin: auto;
    background: rgba(13, 18, 38, 0.84);
    color: white;
    padding: 34px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.52),
        0 0 45px rgba(138, 43, 226, 0.14);
    backdrop-filter: blur(18px);
}

.admin-card h1 {
    margin-top: 0;
    font-size: 34px;
    background: linear-gradient(90deg, #ffffff, var(--violet-soft), var(--cyan-soft));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-card p {
    color: var(--text-muted);
}

.admin-actions {
    display: flex;
    gap: 12px;
    margin: 26px 0;
    flex-wrap: wrap;
    align-items: center;
}

.admin-actions input[type="file"] {
    color: var(--text-muted);
    padding: 12px;
    border: 1px dashed rgba(0, 212, 255, 0.42);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.admin-message {
    margin: 18px 0;
    font-weight: 700;
    color: var(--cyan-soft);
}

#fileList {
    list-style: none;
    padding: 0;
    margin: 18px 0;
}

#fileList li {
    padding: 13px 15px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #eef3ff;
}

/* Robot CSS anterior, por si en algún momento no se usa Spline */

.robot {
    cursor: pointer;
    width: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: float 3s ease-in-out infinite;
}

.robot-head {
    width: 130px;
    height: 100px;
    background: #101010;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.robot-eye {
    width: 18px;
    height: 18px;
    border: 4px solid white;
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    position: absolute;
    top: 35px;
}

.robot-eye.left {
    left: 33px;
}

.robot-eye.right {
    right: 33px;
}

.robot-smile {
    width: 42px;
    height: 22px;
    border-bottom: 5px solid white;
    border-radius: 0 0 50px 50px;
    position: absolute;
    left: 44px;
    top: 52px;
}

.robot-body {
    width: 95px;
    height: 110px;
    background: #151515;
    border-radius: 30px 30px 45px 45px;
    margin-top: 8px;
    position: relative;
}

.robot-light {
    width: 38px;
    height: 38px;
    border: 8px solid var(--cyan);
    border-radius: 50%;
    position: absolute;
    top: 24px;
    left: 28px;
    box-shadow: 0 0 18px var(--cyan);
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.delete-file-btn {
    background: rgba(255, 90, 90, 0.16);
    color: #ffb3b3;
    border: 1px solid rgba(255, 90, 90, 0.45);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.delete-file-btn:hover {
    background: rgba(255, 90, 90, 0.28);
}

.file-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.download-file-btn {
    background: rgba(0, 212, 255, 0.14);
    color: #9eefff;
    border: 1px solid rgba(0, 212, 255, 0.45);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.download-file-btn:hover {
    background: rgba(0, 212, 255, 0.25);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@media (max-width: 768px) {
    .page {
        padding: 20px 12px 90px;
    }

    .hero {
        margin-top: 8px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 15px;
        padding: 0 8px;
    }

    .admin-link {
        font-size: 14px;
        padding: 9px 12px;
    }

    .robot-container {
        min-height: 250px;
        margin-top: 8px;
    }

    .spline-wrapper {
        width: min(260px, 72vw);
        height: min(260px, 72vw);
    }

    .chat-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;
        height: 72vh;
        max-height: 72vh;

        border-radius: 22px 22px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;

        z-index: 10000;
    }

    .chat-header {
        padding: 14px 16px;
    }

    .collection-filter {
        padding: 10px 12px;
    }

    .collection-options {
        gap: 6px;
    }

    .collection-check {
        font-size: 11px;
        padding: 6px 9px;
    }

    .chat-messages {
        padding: 14px;
        gap: 12px;
    }

    .message {
        max-width: 94%;
        font-size: 14px;
        line-height: 1.5;
        padding: 14px 15px;
    }

    .message.user {
        margin-left: 10px;
    }

    .message.assistant {
        margin-right: 10px;
    }

    .chat-input {
        padding: 12px;
        gap: 10px;
        align-items: flex-end;
    }

    .chat-input textarea {
        min-height: 54px;
        max-height: 120px;
        font-size: 14px;
        padding: 12px 14px;
    }

    .chat-input button {
        min-width: 74px;
        padding: 12px 14px;
        font-size: 13px;
    }

    .user-menu {
        top: 14px;
        right: 12px;
    }

    .user-menu-button {
        padding: 7px 10px;
        font-size: 13px;
    }
}


.login-card {
    max-width: 460px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.login-form label {
    color: var(--text-muted);
    font-weight: 700;
}

.login-form input {
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.07);
    color: white;
    outline: none;
}

.login-form input:focus {
    border-color: rgba(0, 212, 255, 0.62);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}

.login-form button {
    margin-top: 10px;
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    color: white;
    border: none;
    padding: 13px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
}

.error-message {
    color: #ffb3b3;
}


.chips-container {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.chip-collection {
    background: rgba(138, 92, 255, 0.2);
    color: #cbb6ff;
    border: 1px solid rgba(138, 92, 255, 0.4);
}

.chip-source {
    background: rgba(0, 212, 255, 0.2);
    color: #a8f1ff;
    border: 1px solid rgba(0, 212, 255, 0.4);
}


.collection-filter {
    padding: 12px 16px;
    background: rgba(5, 8, 22, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-filter span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.collection-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.collection-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(138, 43, 226, 0.15);
    border: 1px solid rgba(138, 43, 226, 0.35);
    color: #d9c7ff;
    font-size: 12px;
    cursor: pointer;
}

.collection-check input {
    accent-color: var(--cyan);
}

.collection-empty {
    color: var(--text-muted);
    font-size: 12px;
}


.collection-admin {
    width: 100%;
    margin-bottom: 18px;
}

.collection-admin label {
    display: block;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.collection-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.collection-row select,
.new-collection-box input {
    min-width: 240px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(255, 255, 255, 0.07);
    color: white;
    outline: none;
}

.collection-row select option {
    background: #0b1024;
    color: white;
}

.collection-row button,
.new-collection-box button {
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
}

.new-collection-box {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.new-collection-box.hidden {
    display: none;
}


.user-form {
    margin-top: 26px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label {
    display: block;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.form-grid input,
.form-grid select {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(255, 255, 255, 0.07);
    color: white;
    outline: none;
}

.form-grid select option {
    background: #0b1024;
    color: white;
}

.form-wide {
    grid-column: 1 / -1;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 18px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
}

.users-table th,
.users-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.users-table th {
    color: var(--cyan-soft);
    background: rgba(255, 255, 255, 0.06);
}

.users-table td {
    color: #eef3ff;
}

.role-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.role-admin {
    color: #ffd6f6;
    background: rgba(255, 77, 210, 0.14);
    border: 1px solid rgba(255, 77, 210, 0.35);
}

.role-manager {
    color: #d9c7ff;
    background: rgba(138, 43, 226, 0.14);
    border: 1px solid rgba(138, 43, 226, 0.35);
}

.role-user {
    color: #a8f1ff;
    background: rgba(0, 212, 255, 0.14);
    border: 1px solid rgba(0, 212, 255, 0.35);
}

.table-btn {
    padding: 7px 10px;
    margin-right: 6px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.edit-user-btn {
    background: rgba(0, 212, 255, 0.14);
    color: #9eefff;
    border: 1px solid rgba(0, 212, 255, 0.45);
}

.delete-user-btn {
    background: rgba(255, 90, 90, 0.16);
    color: #ffb3b3;
    border: 1px solid rgba(255, 90, 90, 0.45);
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}


.face-user-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #9eefff;
    border: 1px solid rgba(0, 212, 255, 0.4);
    backdrop-filter: blur(6px);
    transition: all 0.25s ease;
}


.user-info {
    position: absolute;
    top: 20px;
    right: 30px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(138, 43, 226, 0.15);
    border: 1px solid rgba(138, 43, 226, 0.35);
    color: #d9c7ff;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(6px);
}


.user-menu {
   position: absolute;
    z-index: 99999;
    top: 22px;
    right: 30px;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(13, 18, 38, 0.78);
    color: white;
    cursor: pointer;
    font-weight: 700;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.12);
}

.user-menu-button:hover {
    border-color: rgba(176, 108, 255, 0.65);
    box-shadow: 0 0 28px rgba(138, 43, 226, 0.25);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    text-transform: uppercase;
}

.user-role {
    font-size: 11px;
    color: var(--cyan-soft);
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.25);
}

.user-dropdown {
    position: absolute;

    top: calc(100% + 12px);
    right: 0;

    min-width: 280px;

    background: rgba(10, 16, 45, 0.96);

    border: 1px solid rgba(0, 212, 255, 0.18);

    border-radius: 20px;

    backdrop-filter: blur(18px);

    box-shadow:
        0 0 30px rgba(0, 212, 255, 0.12),
        0 0 60px rgba(138, 43, 226, 0.10);

    overflow: hidden;

    z-index: 99999;
}

.user-dropdown.hidden {
    display: none;
}

.user-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-dropdown-header strong {
    display: block;
    color: white;
}

.user-dropdown-header small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.user-dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #eef3ff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.user-dropdown-item:hover {
    background: rgba(0, 212, 255, 0.12);
    color: white;
}

.user-dropdown-item.danger {
    color: #ffb3b3;
}

.user-dropdown-item.danger:hover {
    background: rgba(255, 90, 90, 0.14);
}




.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 26px 0;
}

.metric-card {
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(0, 212, 255, 0.18);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.08);
}

.metric-card small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-weight: 700;
}


.metric-card span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.metric-card strong {
    font-size: 32px;
    color: var(--cyan-soft);
}

.metrics-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.metric-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.metric-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    margin-bottom: 9px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #eef3ff;
}

.metric-list li span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-list li strong {
    color: var(--cyan-soft);
}

@media (max-width: 900px) {
    .metrics-grid,
    .metrics-sections {
        grid-template-columns: 1fr;
    }
}


.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 26px 0;
}

.chart-card {
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(0, 212, 255, 0.18);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.08);
}

.chart-card h2 {
    margin-top: 0;
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}


.wordcloud-card {
    margin: 26px 0;
}

.wordcloud-image {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}


.audit-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.audit-success {
    color: #a8f1ff;
    background: rgba(0, 212, 255, 0.14);
    border: 1px solid rgba(0, 212, 255, 0.35);
}

.audit-error {
    color: #ffb3b3;
    background: rgba(255, 90, 90, 0.16);
    border: 1px solid rgba(255, 90, 90, 0.45);
}


.message-metadata {
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.confidence-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    width: auto;
    min-width: unset;
    max-width: fit-content;
    line-height: 1;
}

.confidence-high {
    background: rgba(0, 212, 255, 0.14);
    border: 1px solid rgba(0, 212, 255, 0.35);
    color: #9eefff;
}

.confidence-medium {
    background: rgba(255, 193, 7, 0.14);
    border: 1px solid rgba(255, 193, 7, 0.35);
    color: #ffe28a;
}

.confidence-low {
    background: rgba(255, 90, 90, 0.14);
    border: 1px solid rgba(255, 90, 90, 0.35);
    color: #ffb3b3;
}


.tenant-badge {
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.28);
    color: var(--cyan-soft);
    font-size: 12px;
    font-weight: 800;
}


.settings-textarea {
    width: 100%;
    min-height: 130px;
    resize: vertical;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(255, 255, 255, 0.07);
    color: #eef3ff;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
}

.settings-textarea:focus {
    border-color: rgba(176, 108, 255, 0.75);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.22);
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(255, 255, 255, 0.07);
}

.color-picker-row input[type="color"] {
    width: 44px;
    height: 34px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.color-picker-row span {
    color: #eef3ff;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.checkbox-group {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.16);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #eef3ff;
    font-weight: 800;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--cyan);
}

/*
.spline-wrapper {
    position: relative;
    overflow: hidden;
}
.spline-wrapper::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 220px;
    height: 90px;
    background: radial-gradient(
        circle at bottom right,
        rgba(0, 35, 55, 1),
        rgba(4, 8, 24, 0.92) 55%,
        rgba(4, 8, 24, 0) 100%
    );
    pointer-events: none;
    z-index: 20;
}*/


.robot-fallback {
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 150px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(138, 43, 226, 0.25),
        rgba(0, 212, 255, 0.08),
        transparent 70%
    );
    filter: drop-shadow(0 0 35px rgba(0, 212, 255, 0.35));
}



.platform-login-card {
    max-width: 520px;
    margin: 80px auto;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.25);
    margin-bottom: 20px;
}

.login-footer {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
}



.tenant-status-btn {
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #eef3ff;
}

.tenant-status-btn[data-activo="false"] {
    color: #ffb3b3;
    border-color: rgba(255, 90, 90, 0.45);
    background: rgba(255, 90, 90, 0.12);
}

.tenant-status-btn[data-activo="false"]:hover {
    background: rgba(255, 90, 90, 0.22);
}

.tenant-status-btn[data-activo="true"] {
    color: #9eefff;
    border-color: rgba(0, 212, 255, 0.45);
    background: rgba(0, 212, 255, 0.12);
}

.tenant-status-btn[data-activo="true"]:hover {
    background: rgba(0, 212, 255, 0.22);
}

.platform-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}


.info-help-btn {
    margin: 12px 0 22px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(0, 212, 255, 0.10);
    color: var(--cyan-soft);
    font-weight: 800;
    cursor: pointer;
}

.info-help-btn:hover {
    background: rgba(0, 212, 255, 0.18);
    box-shadow: 0 0 22px rgba(0, 212, 255, 0.15);
}

.info-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.info-modal.hidden {
    display: none;
}

.info-modal-card {
    width: min(920px, 96vw);
    border-radius: 28px;
    padding: 26px;
    background: rgba(10, 16, 45, 0.96);
    border: 1px solid rgba(0, 212, 255, 0.22);
    box-shadow:
        0 0 40px rgba(0, 212, 255, 0.16),
        0 0 90px rgba(138, 43, 226, 0.18);
}

.info-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.info-modal-header h2 {
    margin: 0;
    color: #fff;
}

.info-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.info-item {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.14);
}

.info-item h3 {
    margin-top: 0;
    color: var(--cyan-soft);
}

.info-item p {
    color: var(--text-muted);
    line-height: 1.55;
}

@media (max-width: 800px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}



.tenant-edit-btn {
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    color: #ffe28a;
    border: 1px solid rgba(255, 193, 7, 0.45);
    background: rgba(255, 193, 7, 0.12);
}

.tenant-edit-btn:hover {
    background: rgba(255, 193, 7, 0.22);
}


.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 26px 0;
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}


.support-badge {
    color: #ffe28a;
    border-color: rgba(255, 193, 7, 0.45);
    background: rgba(255, 193, 7, 0.12);
}


@media (max-width: 768px) {
    body.chat-open .robot-container {
        opacity: 0.18;
        transform: scale(0.96);
        pointer-events: none;
        transition: all 0.25s ease;
    }
}