/* parlepaty - Estilos principales (tema oscuro morado) */

:root {
    --bg-primary: #09091A;
    --bg-secondary: #12122A;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --accent: #7B5EF8;
    --accent-hover: #6c4ef0;
    --accent-soft: rgba(123, 94, 248, 0.18);
    --success: #4ADE80;
    --error: #FF5252;
    --warning: #F59E0B;
    --whatsapp: #25D366;
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--text-primary);
}

.topbar .logo-mark {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.topbar .user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar .user-name {
    color: var(--text-secondary);
    font-size: 14px;
}

.topbar .user-name strong {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar .role-badge {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.topbar .logout {
    color: var(--text-tertiary);
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.topbar .logout:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ===== LOGIN ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
}

.login-logo {
    width: 56px;
    height: 56px;
    background: var(--accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: white;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 28px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input,
.form-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.15s, background 0.15s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    text-decoration: none;
    color: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: white;
    width: 100%;
}

.btn-whatsapp:hover {
    background: #1eba59;
    color: white;
}

.btn-danger {
    background: rgba(255, 82, 82, 0.15);
    color: var(--error);
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 82, 82, 0.25);
    color: var(--error);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-row {
    display: flex;
    gap: 8px;
}

.btn-row .btn {
    flex: 1;
}

.error-message {
    background: rgba(255, 82, 82, 0.12);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #ffb3b3;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.success-message {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #a3f0bc;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ===== DASHBOARD ===== */
.page {
    padding: 30px 0 60px;
    flex: 1;
}

.page-header {
    margin-bottom: 24px;
}

.page-greeting {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
    margin: 24px 0 10px;
    font-weight: 600;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}

.stat-card.accent {
    background: var(--accent-soft);
    border-color: rgba(123, 94, 248, 0.3);
}

.stat-card.success {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.3);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-value.success {
    color: var(--success);
}

/* Menu cards (admin nav) */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.menu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    color: inherit;
}

.menu-card-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    background: var(--accent-soft);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-card-text strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.menu-card-text small {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Listas (sellers, history) */
.list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.list-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--bg-card-hover);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.list-item-main {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 14px;
    font-weight: 500;
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.list-item-actions {
    display: flex;
    gap: 6px;
}

/* Status indicator */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

.status-dot.inactive {
    background: var(--text-tertiary);
}

/* Crear sala (vendedor) */
.create-room-card {
    background: var(--accent);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 28px;
}

.create-room-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.create-room-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.lang-select-row {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.lang-select-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    display: block;
}

.lang-select {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.lang-select option {
    background: #2a2a4a;
    color: white;
}

.create-room-button {
    width: 100%;
    padding: 14px;
    background: white;
    color: var(--accent);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: transform 0.05s;
}

.create-room-button:active {
    transform: scale(0.98);
}

/* Sala creada (esperando) */
.waiting-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.waiting-card {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.waiting-pulse {
    width: 100px;
    height: 100px;
    background: var(--accent-soft);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: pulse 2s ease-out infinite;
}

.waiting-pulse-inner {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(123, 94, 248, 0.5); }
    70% { box-shadow: 0 0 0 25px rgba(123, 94, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(123, 94, 248, 0); }
}

.waiting-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.waiting-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.code-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 18px;
}

.code-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.code-value {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 8px;
    margin-bottom: 6px;
}

.code-langs {
    font-size: 12px;
    color: var(--text-tertiary);
}

.code-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.cancel-link {
    color: var(--text-tertiary);
    font-size: 13px;
}

/* Recientes */
.recent-list {
    margin-top: 16px;
}

.recent-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
    color: inherit;
}

.recent-item:hover {
    background: var(--bg-card-hover);
    color: inherit;
}

.recent-flag {
    font-size: 22px;
}

.recent-info {
    flex: 1;
}

.recent-langs {
    font-size: 14px;
    font-weight: 500;
}

.recent-when {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Pantalla invitado: choose language */
.guest-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.guest-card {
    width: 100%;
    max-width: 420px;
}

.guest-badge {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.guest-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.guest-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 22px;
}

.lang-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.lang-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.lang-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
}

.lang-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.lang-option input[type="radio"] {
    display: none;
}

.lang-option-flag {
    width: 36px;
    height: 36px;
    background: var(--accent-soft);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.lang-option-text {
    flex: 1;
}

.lang-option-name {
    font-size: 15px;
    font-weight: 600;
}

.lang-option-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.lang-option-check {
    color: var(--accent);
    font-size: 18px;
    opacity: 0;
}

.lang-option.selected .lang-option-check {
    opacity: 1;
}

/* Llamada (placeholder en S2) */
.call-page {
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
}

.call-topbar {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.call-langs {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.call-lang-pill {
    background: rgba(123, 94, 248, 0.45);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.call-timer {
    color: var(--success);
    font-size: 13px;
    font-weight: 500;
}

.call-main {
    flex: 1;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.call-placeholder {
    text-align: center;
}

.call-placeholder-icon {
    font-size: 60px;
    opacity: 0.3;
    margin-bottom: 12px;
}

.call-placeholder-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.call-self {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 90px;
    height: 120px;
    background: #2a2a4a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
    font-size: 30px;
}

.call-controls {
    background: rgba(0, 0, 0, 0.85);
    padding: 16px;
    display: flex;
    justify-content: center;
    gap: 18px;
    align-items: center;
}

.call-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    border: none;
    font-size: 20px;
    transition: background 0.15s;
}

.call-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.call-btn.hangup {
    background: var(--error);
    width: 60px;
    height: 60px;
}

.call-btn.hangup:hover {
    background: #d63a3a;
}

/* Generar password card (admin) */
.password-display {
    background: var(--bg-secondary);
    border: 2px dashed var(--accent);
    padding: 18px;
    border-radius: 12px;
    margin: 16px 0;
}

.password-display-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.password-display-value {
    font-size: 22px;
    font-weight: 600;
    font-family: "Courier New", monospace;
    letter-spacing: 2px;
    color: var(--accent);
    user-select: all;
}

.password-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #ffd699;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin: 14px 0;
}

/* Tabla simple */
table.data-table {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    border-collapse: collapse;
}

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

.data-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.data-table tr:hover {
    background: var(--bg-card-hover);
}

/* Inline form actions (botones pequeños inline) */
.inline-form {
    display: inline;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.4;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .page-title { font-size: 22px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .code-value { font-size: 28px; letter-spacing: 5px; }
    .topbar .role-badge { display: none; }
    .topbar .user-name { display: none; }
}
