/* ==========================================================================
   CRM CONTABLE ASPI - ESTILOS E IDENTIDAD VISUAL PREMIUM
   ========================================================================== */

:root {
    /* Colores Corporativos */
    --primary-slate: #0f172a; /* Slate 900 */
    --primary-light: #1e293b; /* Slate 800 */
    --accent-blue: #2563eb;    /* Royal Blue */
    --accent-hover: #1d4ed8;
    
    /* WhatsApp Chat Simulator Colors */
    --wa-bg: #efeae2;
    --wa-header: #075e54;
    --wa-green: #d9fdd3;
    --wa-white: #ffffff;
    --wa-text: #111b21;
    --wa-muted: #667781;
    --wa-input-bg: #f0f2f5;

    /* Semantic States (Kanban Columns) */
    --color-new: #3b82f6;       /* Blue */
    --color-preview: #f59e0b;   /* Amber */
    --color-done: #10b981;      /* Emerald */
    --color-confirmed: #6366f1; /* Indigo */
    
    /* Alert system */
    --time-ok: #10b981;
    --time-warning: #f59e0b;
    --time-alert: #ef4444;      /* Red */
    
    /* UI Neutrals */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --border-light: #e2e8f0;
    
    /* Typography */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* System Constants */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.app-header {
    background-color: var(--primary-slate);
    color: #ffffff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--accent-blue);
    z-index: 10;
    box-shadow: var(--shadow-medium);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

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

.header-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1;
}

.logo-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 600;
}

.logo-text span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 600;
}

.stats-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: var(--primary-light);
    padding: 6px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-count {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-new);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}

.stat-divider {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--primary-light);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-danger-outline {
    background-color: transparent;
    color: var(--time-alert);
    border-color: rgba(239, 68, 68, 0.2);
    padding: 8px 10px;
}

.btn-danger-outline:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--time-alert);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ==========================================================================
   SPLIT SCREEN MAIN LAYOUT
   ========================================================================== */
.app-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ==========================================================================
   LEFT COLUMN: WHATSAPP CHAT SIMULATOR (30%)
   ========================================================================== */
.chat-section {
    width: 32%;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    background-color: var(--wa-bg);
    position: relative;
}

.chat-header {
    background-color: #f0f2f5;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background-color: #075e54;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar i {
    width: 20px;
    height: 20px;
}

.chat-info {
    flex: 1;
}

.chat-info h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--wa-text);
}

.status-online {
    font-size: 0.72rem;
    color: #25d366;
    font-weight: 500;
    display: block;
}

.mode-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background-color: #0f172a;
    color: #3b82f6;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid #1e293b;
    letter-spacing: 0.5px;
}

.mode-badge.gemini {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
    border-color: rgba(37, 99, 235, 0.2);
}

/* Chat History Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-bubble {
    max-width: 85%;
    padding: 8px 12px 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.06);
    word-break: break-word;
}

.message-user {
    align-self: flex-end;
    background-color: var(--wa-green);
    color: var(--wa-text);
    border-top-right-radius: 2px;
}

.message-bot {
    align-self: flex-start;
    background-color: var(--wa-white);
    color: var(--wa-text);
    border-top-left-radius: 2px;
}

.message-time {
    display: block;
    text-align: right;
    font-size: 0.65rem;
    color: var(--wa-muted);
    margin-top: 4px;
}

/* Test Chips Styles */
.test-chips-container {
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border-light);
    padding: 8px 12px;
}

.chips-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

.chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.chips-scroll::-webkit-scrollbar {
    height: 4px;
}

.chips-scroll::-webkit-scrollbar-thumb {
    background-color: var(--border-light);
    border-radius: 4px;
}

.test-chip {
    white-space: nowrap;
    background-color: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.test-chip:hover {
    background-color: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Input text area styling */
.chat-input-area {
    background-color: var(--wa-input-bg);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border-light);
}

.chat-attach-btn {
    background: none;
    border: none;
    color: var(--wa-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transition: all 0.2s;
    border-radius: 50%;
}

.chat-attach-btn:hover {
    color: var(--wa-text);
    background-color: rgba(0,0,0,0.05);
}

.chat-attach-btn i {
    width: 20px;
    height: 20px;
}

.chat-input-area textarea {
    flex: 1;
    background-color: white;
    border: none;
    outline: none;
    border-radius: var(--radius-lg);
    padding: 10px 18px;
    font-size: 0.88rem;
    resize: none;
    max-height: 100px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background-color: var(--wa-header);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-send-btn:hover {
    background-color: #128c7e;
    transform: scale(1.05);
}

.chat-send-btn i {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   RIGHT COLUMN: CRM KANBAN BOARD (70%)
   ========================================================================== */
.crm-section {
    width: 68%;
    display: flex;
    flex-direction: column;
    background-color: #f1f5f9;
}

.kanban-board {
    flex: 1;
    display: flex;
    padding: 16px;
    gap: 16px;
    overflow-x: auto;
    height: 100%;
}

.kanban-column {
    flex: 1;
    min-width: 250px;
    background-color: #f8fafc;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    box-shadow: var(--shadow-soft);
}

.column-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-light);
}

.column-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.col-indicator-new { background-color: var(--color-new); }
.col-indicator-preview { background-color: var(--color-preview); }
.col-indicator-done { background-color: var(--color-done); }
.col-indicator-confirmed { background-color: var(--color-confirmed); }

.column-header h3 {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary-slate);
}

.column-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--border-light);
    padding: 3px 8px;
    border-radius: 20px;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Kanban Cards styling */
.ticket-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: #cbd5e1;
}

/* Card Header */
.card-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-main);
    padding-bottom: 6px;
}

.ticket-id {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.ticket-time {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ticket-time i {
    width: 12px;
    height: 12px;
}

/* Card Body */
.card-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--primary-slate);
    line-height: 1.3;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.meta-item {
    font-size: 0.72rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-item strong {
    color: var(--text-main);
}

.ticket-monto-box {
    margin-top: 6px;
    background-color: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px dashed var(--border-light);
}

.monto-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.monto-val {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-slate);
}

/* Alert Tags in Cards */
.card-alerts-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.alert-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.alert-tag-cfdi {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-tag-rfc {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Card Actions / Footer */
.card-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    margin-top: 4px;
}

.action-icon-btn {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background-color: var(--bg-main);
    color: var(--primary-slate);
    border-color: #cbd5e1;
}

.action-icon-btn.primary {
    background-color: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

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

.action-icon-btn.success {
    background-color: var(--color-done);
    color: white;
    border-color: var(--color-done);
}

.action-icon-btn.success:hover {
    background-color: #059669;
}

.action-icon-btn.danger-icon {
    color: var(--time-alert);
}

.action-icon-btn.danger-icon:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Empty Column Message */
.empty-col-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    text-align: center;
    gap: 8px;
    opacity: 0.65;
    height: 100%;
}

.empty-col-msg i {
    width: 24px;
    height: 24px;
}

.empty-col-msg span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==========================================================================
   SETTINGS DRAWER & DIALOGS
   ========================================================================== */
.settings-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background-color: white;
    box-shadow: -4px 0 30px rgba(0,0,0,0.15);
    z-index: 100;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.settings-drawer.open {
    right: 0;
}

.drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-slate);
}

.btn-close-drawer {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.drawer-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-slate);
}

.form-control {
    padding: 10px 14px;
    font-size: 0.85rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--accent-blue);
}

.key-status-box {
    background-color: var(--bg-main);
    border: 1px solid var(--border-light);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.active { background-color: var(--time-ok); }
.status-indicator.inactive { background-color: var(--time-warning); }

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 90;
    display: none;
}

.drawer-overlay.open {
    display: block;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   PORTAL DEL CLIENTE PWA — MOBILE NATIVE EXPERIENCE (index.html)
   ========================================================================== */

/* Fondo del viewport para cliente (desktop frame) */
.client-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* Enmarcado Celular Nativo en Desktop / Pantalla Completa en Móvil */
.mobile-app-shell {
    width: 100%;
    max-width: 420px;
    height: 90vh;
    max-height: 840px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    border-radius: 36px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 10px #1e293b,
        0 0 0 12px #334155;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .client-body {
        background: #ffffff;
        overflow: hidden;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        margin: 0 !important;
        padding: 0 !important;
    }
    .mobile-app-shell {
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        box-shadow: none;
        border: none;
        margin: 0 !important;
        padding: 0 !important;
        display: flex;
        flex-direction: column;
    }
}

/* Header Superior Fijo */
.mobile-header {
    background-color: #ffffff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    z-index: 20;
    flex-shrink: 0;
}

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

.mobile-avatar {
    width: 42px;
    height: 42px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.mobile-avatar-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.mobile-avatar-fallback {
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-avatar-fallback i {
    width: 20px;
    height: 20px;
}

.online-indicator-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 11px;
    height: 11px;
    background-color: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.mobile-header-text {
    display: flex;
    flex-direction: column;
}

.mobile-app-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.mobile-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 3px;
}

.status-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #059669;
    font-weight: 600;
}

.status-pulse-circle {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.status-divider {
    color: #cbd5e1;
    font-size: 0.6rem;
}

.client-phone-selector {
    color: #64748b;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.15s;
}

.client-phone-selector:hover {
    color: #2563eb;
    text-decoration: underline;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #f1f5f9;
    background-color: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mobile-action-btn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.mobile-action-btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.7;
}

/* Vistas de Tabs */
.mobile-tab-view {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
    background-color: #f8f9fa;
    position: relative;
    padding-bottom: 60px; /* Espacio para la barra nav inferior absoluta */
}

.mobile-tab-view.active {
    display: flex;
}

/* Área Central de Mensajes (Scrollable) */
.chat-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #f8f9fa;
}

/* Burbujas de Chat */
.chat-messages-scroll .message-bubble {
    max-width: 82%;
    padding: 10px 14px 8px 14px;
    font-size: 0.86rem;
    line-height: 1.45;
    position: relative;
    word-break: break-word;
}

.chat-messages-scroll .message-user {
    align-self: flex-end;
    background-color: #2563eb;
    color: #ffffff;
    border-radius: 16px 16px 3px 16px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.chat-messages-scroll .message-user .message-time {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.65rem;
    text-align: right;
    margin-top: 4px;
    display: block;
}

.chat-messages-scroll .message-bot {
    align-self: flex-start;
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 16px 16px 16px 3px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.chat-messages-scroll .message-bot .message-time {
    color: #94a3b8;
    font-size: 0.65rem;
    text-align: right;
    margin-top: 4px;
    display: block;
}

/* Barra de Ingreso de Texto */
.mobile-input-bar {
    background-color: #ffffff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #edf2f7;
    z-index: 10;
    flex-shrink: 0;
}

.input-clip-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.input-clip-btn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.input-clip-btn svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.6;
}

.input-field-wrapper {
    flex: 1;
    background-color: #f1f5f9;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 2px 14px;
    transition: all 0.15s ease;
}

.input-field-wrapper:focus-within {
    background-color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-field-wrapper textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.86rem;
    color: #0f172a;
    resize: none;
    max-height: 80px;
    padding: 7px 0;
    line-height: 1.35;
}

.input-field-wrapper textarea::placeholder {
    color: #94a3b8;
}

.input-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #0f172a;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.2);
}

.input-send-btn:hover {
    background-color: #2563eb;
    transform: scale(1.04);
}

.input-send-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.7;
    margin-left: 1px;
}

/* Barra de Navegación Inferior (Bottom Navigation Bar) */
.mobile-bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 4px 4px 6px 4px;
    z-index: 20;
}

.nav-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 6px 2px;
    transition: color 0.15s ease;
    color: #64748b;
    -webkit-tap-highlight-color: transparent; /* iOS tap flash */
}

/* Eliminar outline/caja negra en foco y clic */
.nav-tab-item:focus,
.nav-tab-item:focus-visible,
.nav-tab-item:active {
    outline: none;
    box-shadow: none;
    background: transparent;
}

.nav-tab-item:hover {
    color: #334155;
}

/* Estado activo: solo color de ícono + texto, fondo transparente */
.nav-tab-item.active {
    color: #2563eb;
    background: transparent;
}

.nav-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-tab-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.6;
}

.nav-tab-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1px;
}

.nav-tab-item.active .nav-tab-label {
    font-weight: 700;
}

/* Estilos de Contenido para Tabs (Mis Datos & Historial) */
.tab-view-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.card-icon-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-circle svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.6;
}

.card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0;
}

.card-subtitle {
    font-size: 0.72rem;
    color: #64748b;
    margin: 0;
}

.profile-data-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-data-row {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-field-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.profile-field-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
}

.section-card-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px 0;
}

.section-card-heading svg {
    width: 16px;
    height: 16px;
    color: #059669;
}

.section-info-text {
    font-size: 0.76rem;
    color: #475569;
    line-height: 1.45;
    margin: 0;
}

/* Historial de Tickets */
.history-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.history-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.history-count-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background-color: #e2e8f0;
    color: #475569;
    padding: 3px 8px;
    border-radius: 12px;
}

.history-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.03);
}

.history-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-folio-badge {
    font-size: 0.74rem;
    font-weight: 700;
    color: #2563eb;
}

.history-status-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

/* Amber/Naranja — CFDI Pendiente, Nuevos */
.history-status-pill.pending {
    background-color: #fffbeb;
    color: #d97706;
}

/* Verde esmeralda — Facturado, Timbrado, Completado */
.history-status-pill.success {
    background-color: #d1fae5;
    color: #059669;
}

/* Rojo — Requiere atención humana */
.history-status-pill.alert {
    background-color: #fef2f2;
    color: #b91c1c;
}

/* Emisor / Concepto (texto principal de la tarjeta de historial) */
.history-item-emisor {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.history-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 6px;
}

.history-item-amount {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.82rem;
}

/* Área de botónes de descarga (solo en tickets completados) */
.history-download-area {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.history-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #2563eb;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.history-download-btn:hover {
    background-color: #dbeafe;
    border-color: #93c5fd;
}

/* ==========================================================================
   ADMIN PORTAL â€” CORPORATE DESIGN SYSTEM (admin.html)
   ========================================================================== */

/* Layout base */
.admin-body {
    background-color: #f7f9fb;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* â”€â”€ Header â”€â”€ */
.admin-header {
    background-color: #ffffff;
    border-bottom: 1px solid #d8dadc;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    z-index: 10;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.admin-header-divider {
    width: 1px;
    height: 28px;
    background-color: #d8dadc;
}

.admin-module-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.admin-header-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.stat-pill span:first-child {
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-pill-blue {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.stat-pill-red {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-simulate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background-color: #2563eb;
    color: #ffffff;
    transition: background-color 0.18s, transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 6px rgba(37,99,235,0.25);
}

.btn-simulate:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}

.btn-simulate .btn-icon { width: 15px; height: 15px; }

.btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background-color: transparent;
    color: #dc2626;
    cursor: pointer;
    transition: background-color 0.18s;
}

.btn-reset:hover { background-color: #fef2f2; }
.btn-reset .btn-icon { width: 15px; height: 15px; }

/* â”€â”€ Main + Kanban â”€â”€ */
.admin-main {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.kanban-board {
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
}

/* â”€â”€ Columnas â”€â”€ */
.kanban-column {
    flex: 1;
    min-width: 260px;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #d8dadc;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
}

.column-header {
    padding: 0 16px;
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid #d8dadc;
    position: relative;
}

/* Barra de color superior de cada columna */
.column-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.col-header-new::before    { background-color: #3b82f6; }
.col-header-preview::before { background-color: #f59e0b; }
.col-header-done::before   { background-color: #10b981; }
.col-header-confirmed::before { background-color: #6b7280; }

.column-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-accent {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.col-accent-new       { background-color: #3b82f6; }
.col-accent-preview   { background-color: #f59e0b; }
.col-accent-done      { background-color: #10b981; }
.col-accent-confirmed { background-color: #6b7280; }

.column-header h3 {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a2035;
}

.column-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    background-color: #f3f4f6;
    border: 1px solid #d8dadc;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f7f9fb;
}

/* â”€â”€ Tarjetas â”€â”€ */
.kanban-card {
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #d8dadc;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    cursor: default;
    user-select: none;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border-color: #bfc2c6;
}

.kanban-card.alert-critical {
    border-left: 3px solid #ef4444;
}

/* Card: fila superior — folio + tiempo */
.card-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.card-meta-row .card-time {
    margin-left: auto;
}

.card-folio {
    font-size: 0.72rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 0.3px;
}

.card-time {
    font-size: 0.68rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-time i { width: 1em; height: 1em; vertical-align: middle; }

/* Card: nombre cliente */
.card-client-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a2035;
    line-height: 1.3;
    text-transform: capitalize;
    margin-bottom: 10px;
}

/* Card: grid de datos fiscales */
.card-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin-bottom: 12px;
}

.card-data-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.card-data-item.span-full {
    grid-column: span 2;
}

.data-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: none;
}

.data-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a2035;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card: monto â€” separado con línea sólida tenue */
.card-amount-row {
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 6px;
}

.amount-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: #9ca3af;
}

.amount-value {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #1a2035;
    letter-spacing: -0.3px;
}

/* Card: banner de alerta */
.card-alert-banner {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.card-alert-banner:hover { background-color: #fee2e2; }
.card-alert-banner i { width: 12px; height: 12px; flex-shrink: 0; }

.card-alert-banner.banner-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

/* Card: acciónes */
.card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

/* Regla global de íconos dentro de botónes de acción de tarjeta */
/* Lucide reemplaza <i> con <svg> en runtime — el selector correcto es svg */
.card-btn-ghost svg,
.card-btn-primary svg,
.card-btn-success svg,
.card-delete-corner svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    stroke-width: 1.5;
    vertical-align: middle;
}

/* Botón ghost (retroceder) — muy sutil, casi invisible */
.card-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    font-size: 0.73rem;
    font-weight: 500;
    border-radius: 7px;
    border: 1px solid #e5e7eb;
    background-color: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.card-btn-ghost:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: #6b7280;
}

/* Botón primario sólido (avanzar) */
.card-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    background-color: #2563eb;
    color: #ffffff;
    transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.card-btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37,99,235,0.25);
}

/* Botón verde (timbrar) */
.card-btn-success {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    background-color: #059669;
    color: #ffffff;
    transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.card-btn-success:hover {
    background-color: #047857;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(5,150,105,0.25);
}

/* Botón deshabilitado — cuando hay alerta activa: gris apagado, sin interacción */
.card-btn-primary:disabled,
.card-btn-success:disabled {
    background-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Botón eliminar — esquina superior derecha, ghost (gris) → rojo en hover */
.card-delete-corner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: none;
    background-color: transparent;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.card-delete-corner:hover {
    color: #dc2626;
    background-color: #fef2f2;
}

.card-delete-corner i { width: 12px; height: 12px; }

/* Columna vacía */
.empty-col-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #d1d5db;
    text-align: center;
    gap: 8px;
    height: 100%;
}

.empty-col-msg i { width: 22px; height: 22px; }
.empty-col-msg span { font-size: 0.75rem; font-weight: 500; color: #9ca3af; }


/* ==========================================================================
   CAPA 2: INTERACCIONES AVANZADAS (Slide-Over, SLA, Lock)
   ========================================================================== */

/* --- ALERTA SLA: TIEMPOS EXCEDIDOS --- */
.kanban-card.sla-warning {
    border: 1px solid #f59e0b !important;
}

.kanban-card.sla-critical {
    border: 1px solid #ef4444 !important;
    animation: pulse-shadow 2.5s infinite ease-in-out;
}

@keyframes pulse-shadow {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- BLOQUEO MULTI-USUARIO (LOCK) --- */
.kanban-card.is-locked {
    opacity: 0.6;
    pointer-events: none; /* Inhabilita clics en la tarjeta completa */
}

/* Indicador de candado superior derecho */
.card-lock-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px 6px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    z-index: 5;
    pointer-events: auto; /* Para tooltip si se desea */
}

.card-lock-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.card-lock-indicator svg {
    width: 10px;
    height: 10px;
    color: #64748b;
    stroke-width: 2;
}

/* Correcci�n de enlaces de WhatsApp en banners de alerta para que no hereden estilos azules */
a.card-alert-banner {
    text-decoration: none;
    cursor: pointer;
}
a.card-alert-banner:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* --- SLIDE-OVER (PANEL LATERAL) --- */
.slide-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.slide-over-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.slide-over-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 40%;
    min-width: 320px;
    max-width: 500px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.slide-over-panel.open {
    transform: translateX(0);
}

.slide-over-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.slide-over-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-close-slide {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.btn-close-slide:hover {
    background: #f1f5f9;
    color: #475569;
}

.slide-over-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slide-over-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.slide-over-label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.slide-over-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

/* One-Click Copy Button */
.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #f1f5f9;
    color: #2563eb;
    border-color: #e2e8f0;
}

.btn-copy svg {
    width: 16px;
    height: 16px;
}

/* Zona Drag & Drop */
.dnd-zone {
    margin: auto 24px 24px 24px;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.dnd-zone:hover, .dnd-zone.drag-active {
    background: #eff6ff;
    border-color: #93c5fd;
}

.dnd-zone svg {
    width: 32px;
    height: 32px;
    color: #94a3b8;
    margin-bottom: 12px;
}

.dnd-zone:hover svg, .dnd-zone.drag-active svg {
    color: #3b82f6;
}

.dnd-zone p {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}
/* SPLASH SCREEN CSS */
.splash-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash-client { background-color: #ffffff; }
.splash-admin { background-color: #f8fafc; }
.splash-dash { background-color: #0f172a; }
.splash-screen.fade-out { opacity: 0; visibility: hidden; }
.splash-logo { width: 320px; max-width: 90vw; animation: pulse-splash 1.5s infinite alternate; }
@keyframes pulse-splash {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.05); opacity: 1; }
}

/* PWA Install Banner Style */
.pwa-install-banner {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    z-index: 10;
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 500;
}
.pwa-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-blue);
}
.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pwa-btn-primary {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}
.pwa-btn-primary:hover {
    background-color: var(--accent-hover);
}
.pwa-btn-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pwa-btn-close svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================
   PIN LOCK SCREEN
   ========================================================== */
.pin-lock-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #0f172a; display: flex; flex-direction: column;
    justify-content: center; align-items: center; z-index: 9999;
}
.pin-card {
    background: #1e293b; padding: 2.5rem; border-radius: 16px; 
    border: 1px solid #334155; text-align: center; width: 90%; max-width: 360px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
}
.pin-logo { width: 60px; height: 60px; object-fit: contain; margin-bottom: 1.5rem; filter: brightness(1.2); }
.pin-title { color: #f8fafc; font-size: 1.25rem; margin-bottom: 0.5rem; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; }
.pin-subtitle { color: #94a3b8; font-size: 0.875rem; margin-bottom: 1.5rem; }
.pin-input-single {
    width: 100%; text-align: center; font-size: 2rem; letter-spacing: 0.75rem; 
    background: #0f172a; color: white; border: 1px solid #334155; 
    border-radius: 8px; padding: 0.75rem; margin-bottom: 1rem;
    font-family: monospace;
}
.pin-input-single:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3); }
.pin-error { color: #ef4444; font-size: 0.875rem; margin-bottom: 1rem; display: none; }
.pin-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #3b82f6; color: white; display: flex;
    justify-content: center; align-items: center;
    font-weight: 600; font-size: 0.8rem; margin-right: 0.75rem;
    cursor: default;
}


@keyframes spin { 100% { transform: rotate(360deg); } }
