/* ==========================================================================
ARKIAOS STUDIO - THEME SYSTEM (CSS VARIABLES)
========================================================================== */
:root {
    /* Paleta Oficial ArkiaOS */
    --arkia-green-start: #88c843;
    --arkia-green-end: #2ca58d;
    --arkia-blue: #4d7cff;
    --arkia-blue-light: #38bdf8;
    
    /* Superficies y Fondos */
    --bg-dark-base: #090d16;
    --bg-dark-surface: #121826;
    --bg-dark-card: #1e293b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #38bdf8;
    
    /* Textos */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Gradiente Emblema */
    --arkia-gradient: linear-gradient(135deg, var(--arkia-green-start), var(--arkia-green-end));
    --arkia-glow: 0 0 20px rgba(136, 200, 67, 0.25);
}

/* Reset Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scrollbar-gutter: stable;
}

body {
    background: var(--bg-dark-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Solo en desktop el layout es fijo a la altura del viewport;
   en mobile (ver media query 900px) la página necesita poder scrollear normal. */
@media (min-width: 901px) {
    html, body {
        height: 100vh;
        overflow: hidden;
    }
}

/* ==========================================================================
HEADER PRINCIPAL (ARKIA BRANDING)
========================================================================== */
header.arkia-header {
    background: var(--bg-dark-surface);
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

.brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.brand-title span.os {
    color: var(--arkia-blue);
}

.badge-version {
    background: rgba(56, 189, 248, 0.1);
    color: var(--arkia-blue-light);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================================================
ESTRUCTURA DEL EDITOR
========================================================================== */
.app-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Panel Izquierdo (Controles) */
.controls-panel {
    width: 460px;
    background: var(--bg-dark-surface);
    padding: 24px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.controls-panel::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track {
    background: transparent;
}

.controls-panel::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.28);
}

/* Pestañas Arkia Styling */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    background: var(--bg-dark-base);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* Tabs fijos (sticky) al scrollear el panel */
.tabs {
    position: sticky;
    top: -24px;
    z-index: 100;
    background: var(--bg-dark-surface);
    margin-top: -24px;
    padding-top: 24px;
    padding-bottom: 6px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 9px 6px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--arkia-gradient);
    color: #ffffff;
    box-shadow: var(--arkia-glow);
}

/* Formularios & Inputs */
.section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--arkia-green-start);
    letter-spacing: 1px;
    margin: 20px 0 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.form-group label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark-base);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
}

/* Fila de input de archivo + botón de eliminar */
.file-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-input-row .form-control {
    flex: 1;
    min-width: 0;
}

.btn-remove-file {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 38px;
    height: 38px;
    min-width: 38px;
    flex-shrink: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-remove-file:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-remove-file:active {
    transform: scale(0.95);
}

/* ==========================================================================
SECCIÓN COLAPSABLE (ACORDEÓN)
========================================================================== */
.section-title.collapsible-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.section-title.collapsible-toggle:hover {
    opacity: 0.85;
}

.collapsible-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    color: var(--text-secondary);
}

.section-title.collapsible-toggle[aria-expanded="true"] .collapsible-chevron {
    transform: rotate(180deg);
}

.collapsible-content {
    display: none;
}

.collapsible-content.expanded {
    display: block;
}

/* ==========================================================================
GRID DE FONDOS PREHECHOS
========================================================================== */
.bg-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.bg-preset-swatch {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
}

.bg-preset-swatch:hover {
    transform: translateY(-2px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.25);
}

.bg-preset-swatch.selected {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.bg-preset-swatch .swatch-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--arkia-blue-light);
    color: #06131f;
    display: none;
    align-items: center;
    justify-content: center;
}

.bg-preset-swatch.selected .swatch-check {
    display: flex;
}

/* Botón Principal con Gradiente ArkiaOS */
.btn-export {
    width: 100%;
    background: var(--arkia-gradient);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--arkia-glow);
    transition: transform 0.1s, opacity 0.2s;
}

.btn-export:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* ==========================================================================
SELECTORES DE COLOR MEJORADOS
========================================================================== */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.color-picker-btn {
    width: 48px;
    height: 38px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.color-picker-btn:hover {
    transform: scale(1.05);
    border-color: var(--border-focus);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.color-picker-btn:active {
    transform: scale(0.95);
}

.color-hex-value {
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    background: var(--bg-dark-base);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    min-width: 90px;
    text-align: center;
}

/* ==========================================================================
VISTA PREVIA Y MOCKUP CELULAR
========================================================================== */
.preview-panel {
    flex: 1;
    background: var(--bg-dark-base);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    position: relative;
}

.phone-mockup {
    width: 375px;
    height: 720px;
    background: #000;
    border-radius: 44px;
    border: 10px solid #1e293b;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.05);
    overflow: hidden;
    position: relative;
    transition: transform 0.05s linear;
    transform-origin: center center;
}

.zoom-indicator {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.zoom-indicator.visible {
    opacity: 1;
}

.preview-card {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: #1e293b;
    color: #ffffff;
    /* Scrollbar invisible (look mobile): el scroll funciona con rueda/táctil */
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* Edge legacy */
}

.preview-card::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;               /* Chrome / Safari / Edge */
}

/* ==========================================================================
FASE 1: TARJETA PROFESIONAL (ESTILO BHYBRID)
========================================================================== */

/* --- Banner superior --- */
.card-banner {
    height: 170px;
    background: linear-gradient(135deg, var(--arkia-green-end), var(--arkia-green-start));
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0;
}

.card-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    max-height: 36px;
    max-width: 120px;
    object-fit: contain;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* --- Hero: avatar flotante + identidad --- */
.card-hero {
    padding: 0 24px;
    text-align: center;
}

.avatar-wrap {
    position: relative;
    z-index: 2;
    width: 116px;
    height: 116px;
    margin: -58px auto 12px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Formas del avatar */
.avatar-wrap.shape-rounded { border-radius: 50%; }
.avatar-wrap.shape-square-soft { border-radius: 24px; }
.avatar-wrap.shape-square { border-radius: 8px; }

/* Alineaciones del hero */
.card-hero.align-left { text-align: left; }
.card-hero.align-left .avatar-wrap { margin-left: 0; margin-right: auto; }
.card-hero.align-right { text-align: right; }
.card-hero.align-right .avatar-wrap { margin-left: auto; margin-right: 0; }

/* Jerarquía tipográfica profesional */
.profile-name {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.name-accent {
    color: var(--accent, #88c843);
    margin-left: 6px;
}

.profile-title {
    font-size: 15px;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 4px;
}

.profile-tagline {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 2px;
    font-style: italic;
}

/* --- Botones circulares de acción rápida --- */
.quick-actions {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin: 22px 0 6px;
}

.card-hero.align-left .quick-actions { justify-content: flex-start; }
.card-hero.align-right .quick-actions { justify-content: flex-end; }

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.action-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--accent, #88c843);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.action-btn:active {
    transform: scale(0.94);
}

.action-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Botón apagado cuando no hay dato cargado */
.action-item.is-empty .action-btn {
    opacity: 0.3;
    pointer-events: none;
}

.action-item.is-empty .action-label {
    opacity: 0.4;
}

/* --- Cuerpo: botones CTA --- */
.card-body {
    padding: 12px 24px 20px;
}

.cta-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    color: #ffffff;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

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

.cta-primary {
    background: #2ca58d;
}

.cta-secondary {
    background: rgba(255, 255, 255, 0.12);
}

/* --- Footer: compartir --- */
.card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 16px 24px 22px;
}

.footer-title {
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 12px;
}

.share-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.share-btn {
    flex: 1;
    max-width: 140px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ==========================================================================
RESPONSIVE / ADAPTATIVO PARA CELULAR
========================================================================== */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    .preview-panel {
        order: 1;
        padding: 24px 16px;
    }
    
    .controls-panel {
        order: 2;
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 480px) {
    header.arkia-header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .brand-title {
        font-size: 14px;
    }
    
    .brand-logo {
        height: 30px;
    }
    
    .badge-version {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .controls-panel {
        padding: 16px;
    }
    
    .tabs {
        gap: 4px;
        padding: 3px;
        top: -16px;
        margin-top: -16px;
        padding-top: 16px;
    }
    
    .tab-btn {
        flex-direction: column;
        gap: 3px;
        font-size: 10px;
        padding: 8px 2px;
        line-height: 1.1;
    }
    
    .preview-panel {
        padding: 16px 8px;
    }
    
    .phone-mockup {
        width: 100%;
        max-width: 340px;
        height: 640px;
        border-width: 8px;
        border-radius: 32px;
    }
}

@media (max-width: 360px) {
    .phone-mockup {
        max-width: 300px;
        height: 580px;
    }
    
    .tab-btn {
        font-size: 9px;
    }
}

/* Smooth scroll para el panel de controles */
.controls-panel {
    scroll-behavior: smooth;
}

/* Highlight visual cuando se llega a una sección */
.section-title:target,
.section-title.highlight {
    color: var(--arkia-blue-light);
    transition: color 0.3s ease;
}

/* ==========================================================================
NAV DEL SITIO - ESTILOS LOCALES (AUTOCONTENIDO)
Con esto el editor ya NO depende de main.css / obsidian.css del sitio
========================================================================== */
.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--text-primary);
}

.main-nav a.active {
    color: var(--arkia-green-start);
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

.main-nav a.btn-contact {
    background: var(--arkia-gradient);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 8px;
    box-shadow: var(--arkia-glow);
    transition: transform 0.1s ease, opacity 0.2s ease;
}

.main-nav a.btn-contact:hover {
    color: #ffffff;
    opacity: 0.95;
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .main-nav { gap: 14px; }
}

@media (max-width: 480px) {
    .main-nav { gap: 10px; }
    .main-nav a { font-size: 11px; }
    .main-nav a.btn-contact { padding: 7px 12px; }
}

/* ==========================================================================
BARRA DE GUARDADO (STICKY INFERIOR)
========================================================================== */
.save-bar {
    position: sticky;
    bottom: -24px;
    margin: 24px -24px -24px;
    padding: 12px 24px;
    background: var(--bg-dark-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 90;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.35);
}

.save-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.save-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.2s ease;
}

.save-dot.dirty { background: #f59e0b; }
.save-dot.saved { background: var(--arkia-green-start); }

.save-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-reset {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-reset:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-save {
    background: var(--arkia-gradient);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--arkia-glow);
    transition: transform 0.1s ease, opacity 0.2s ease;
}

.btn-save:hover { opacity: 0.95; transform: translateY(-1px); }
.btn-save:active { transform: scale(0.97); }

@media (max-width: 480px) {
    .save-bar {
        bottom: -16px;
        margin: 24px -16px -16px;
        padding: 10px 16px;
    }
}

/* ==========================================================================
FASE 2: BARRA DE NAVEGACIÓN INFERIOR (ESTILO APP NATIVA)
========================================================================== */
.card-bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    background: var(--accent, #88c843);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0 9px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.bnav-item:active {
    transform: scale(0.95);
}

.bnav-item svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
FASE 2: SECCIÓN DE VIDEO EMBEBIDO
========================================================================== */
.card-section {
    padding: 4px 24px 16px;
}

.section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 8px;
    text-align: center;
}

.video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
FASE 2: DOCUMENTOS / CATÁLOGO (PDFs)
========================================================================== */
.docs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.1s ease;
}

.doc-row:hover { background: rgba(255, 255, 255, 0.14); }
.doc-row:active { transform: scale(0.98); }

.doc-row > svg {
    width: 20px;
    height: 20px;
    color: var(--accent, #88c843);
    flex-shrink: 0;
}

.doc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.doc-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-size {
    font-size: 10px;
    opacity: 0.6;
}

/* Lista del panel de controles */
.docs-list-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-dark-base);
    padding: 10px;
    border-radius: 8px;
    min-height: 44px;
}

.doc-row-panel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-row-panel .doc-info { flex: 1; }

.btn-doc-del {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-doc-del:hover { background: rgba(239, 68, 68, 0.2); }
.btn-doc-del svg { width: 14px; height: 14px; }

.docs-empty {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    margin: 4px 0;
}

/* ==========================================================================
FASE 2: URL PERSONALIZADA (ESTILO BHYBRID)
========================================================================== */
.url-preview {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--arkia-blue-light);
    background: var(--bg-dark-base);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 9px 12px;
    word-break: break-all;
}

.card-public-url {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--accent, #88c843);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    opacity: 0.9;
}

.card-public-url:hover {
    text-decoration: underline;
}

/* ==========================================================================
FASE 3: REDES SOCIALES (GRILLA DE ICONOS)
========================================================================== */
.social-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 8px 0;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.social-link:hover {
    background: var(--accent, #88c843);
    transform: scale(1.08);
}

.social-link:active {
    transform: scale(0.95);
}

.social-link svg {
    width: 22px;
    height: 22px;
}

/* Lista del panel de controles */
.social-list-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-dark-base);
    padding: 12px;
    border-radius: 8px;
    min-height: 60px;
}

.social-row-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.social-row-panel .social-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.social-row-panel .social-info {
    flex: 1;
    min-width: 0;
}

.social-row-panel .social-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.social-row-panel .social-url {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-social-del {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-social-del:hover { background: rgba(239, 68, 68, 0.2); }
.btn-social-del svg { width: 14px; height: 14px; }

.social-empty {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    margin: 8px 0;
}

/* ==========================================================================
FASE 3: MODAL QR + IMPRESIÓN
========================================================================== */
.qr-modal {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 22, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(3px);
}

.qr-modal-box {
    background: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.qr-modal-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.qr-modal-box img {
    width: 200px;
    height: 200px;
    background: #ffffff;
    padding: 8px;
    border-radius: 10px;
}

.qr-modal-url {
    font-size: 11px;
    color: var(--arkia-blue-light);
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

/* Impresión: solo la tarjeta, sin editor */
@media print {
    body * {
        visibility: hidden;
    }
    .phone-mockup,
    .phone-mockup * {
        visibility: visible;
    }
    .phone-mockup {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        transform: none !important;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    .card-bottom-nav {
        display: none !important;
    }
}

/* ── Botones de documentación en la barra superior ── */
.header-docs { display: flex; gap: 8px; margin-left: 12px; align-items: center; }
.doc-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #cbd5e1; font-size: 12px; font-weight: 600;
    padding: 6px 12px; border-radius: 999px; cursor: pointer;
    font-family: inherit; transition: background .2s, color .2s;
}
.doc-btn:hover { background: rgba(136,200,67,0.15); color: #88c843; border-color: rgba(136,200,67,0.4); }
.doc-modal {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(9,13,22,0.8); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.doc-modal-box {
    background: #121826; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; max-width: 560px; width: 100%;
    max-height: 80vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.doc-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.doc-modal-head h2 { font-size: 15px; font-weight: 800; color: #fff; }
.doc-modal-close {
    background: transparent; border: 1px solid rgba(255,255,255,0.15);
    color: #94a3b8; font-size: 11px; font-weight: 600;
    padding: 6px 12px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.doc-modal-content { padding: 18px 22px; overflow-y: auto; font-size: 13px; line-height: 1.65; color: #cbd5e1; }
.doc-modal-content h3 {
    font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
    color: #88c843; margin: 16px 0 6px;
}
.doc-modal-content h3:first-child { margin-top: 0; }
.doc-modal-content p { margin-bottom: 8px; }
.doc-modal-content ul { margin: 0 0 10px 18px; }
.doc-modal-content li { margin-bottom: 4px; }
.doc-modal-content strong { color: #fff; }
@media (max-width: 720px) { .doc-btn { font-size: 11px; padding: 4px 9px; } }

/* ── Divisores entre secciones del panel lateral ── */
.tab-content .section-title {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 26px;
    padding-top: 20px;
}
.tab-content .section-title:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* Línea de acento verde antes del botón Exportar (cierre del flujo) */
#exportBtn {
    position: relative;
    margin-top: 30px;
}
#exportBtn::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    border-top: 2px solid rgba(136, 200, 67, 0.3);
}
.btn-nueva-tarjeta {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.btn-nueva-tarjeta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

@media (max-width: 768px) {
    .btn-nueva-tarjeta {
        display: none; /* Opcional: ocultar en móviles si no hay espacio */
    }
}