/* ========================================
   CRM STUDIO - Estilos Corporativos Futuristas
   Paleta: Azul oscuro + Cian
======================================== */

:root {
    /* Colores base */
    --bg-primary: #060B1A;
    --bg-secondary: #0A1428;
    --bg-tertiary: #0F1B33;
    --bg-card: #101E3C;
    --bg-hover: #172A4E;
    --bg-input: #0B1730;

    /* Bordes */
    --border-color: rgba(0, 229, 255, 0.12);
    --border-strong: rgba(0, 229, 255, 0.25);

    /* Textos */
    --text-primary: #E7F1FF;
    --text-secondary: #8FA6C7;
    --text-muted: #5A6E8F;

    /* Acentos */
    --accent-cyan: #00E5FF;
    --accent-cyan-dim: #00B8D4;
    --accent-blue: #2979FF;
    --accent-glow: rgba(0, 229, 255, 0.4);

    /* Estados */
    --success: #00E676;
    --warning: #FFB300;
    --danger: #FF5252;
    --info: #40C4FF;

    /* Sombras */
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 30px rgba(0, 229, 255, 0.15);

    /* Fuentes */
    --font-main: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 72px;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.4); }

/* ============ LOGIN ============ */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, #0A1B3D 0%, #050912 60%);
    overflow: hidden;
    z-index: 1000;
}

.login-bg-animation { position: absolute; inset: 0; overflow: hidden; }
.grid-lines {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
    from { transform: translate(0, 0); }
    to { transform: translate(50px, 50px); }
}
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}
.glow-orb-1 { width: 500px; height: 500px; background: #00E5FF; top: -100px; left: -100px; animation: float 8s ease-in-out infinite; }
.glow-orb-2 { width: 400px; height: 400px; background: #2979FF; bottom: -100px; right: -100px; animation: float 10s ease-in-out infinite reverse; }
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.login-card {
    position: relative;
    z-index: 2;
    background: rgba(16, 30, 60, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 229, 255, 0.1);
}

.login-header { text-align: center; margin-bottom: 36px; }
.login-logo {
    width: 56px; height: 56px;
    margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.login-logo-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.login-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #fff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}
.login-subtitle { color: var(--text-secondary); font-size: 13px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }
.input-group {
    position: relative;
    display: flex; align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.input-group:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}
.input-group i { padding: 0 14px; color: var(--text-muted); font-size: 14px; }
.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 14px 14px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-main);
    outline: none;
}
.input-group input::placeholder { color: var(--text-muted); }

.btn-login {
    margin-top: 12px;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 13px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 229, 255, 0.3);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 229, 255, 0.45); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.6; cursor: wait; }

.login-error {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    min-height: 20px;
    padding-top: 6px;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============ MAIN APP ============ */
.main-app {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0; top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand > i {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 10px;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.25);
}
.brand-logo {
    width: 34px; height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.brand-name {
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 14px;
    background: linear-gradient(135deg, #fff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-sub { font-size: 11px; color: var(--text-muted); }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: var(--transition);
    position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.15), transparent);
    color: var(--accent-cyan);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%; bottom: 20%;
    width: 3px;
    background: var(--accent-cyan);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 10px var(--accent-cyan);
}
.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 14px 8px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}
.user-chip {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-tertiary);
    padding: 10px;
    border-radius: var(--radius-sm);
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    color: #fff;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--text-muted); }
.btn-logout {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}
.btn-logout:hover { background: rgba(255,82,82,0.15); color: var(--danger); }

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* TOPBAR */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.search-global {
    flex: 1;
    max-width: 640px;
    position: relative;
    display: flex; align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition);
}
.search-global:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}
.search-global > i { padding: 0 14px; color: var(--text-muted); }
.search-global input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 0;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: var(--font-main);
}
.search-global input::placeholder { color: var(--text-muted); }
.search-hint {
    padding: 0 12px;
    color: var(--text-muted);
    font-size: 11px;
    display: flex; gap: 4px;
}
.search-hint kbd {
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 10px;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
    z-index: 60;
}
.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; gap: 12px;
}
.search-result-item:hover { background: var(--bg-hover); }
.search-result-item:last-child { border-bottom: none; }
.search-result-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.search-result-info { flex: 1; }
.search-result-name { font-weight: 600; font-size: 13px; }
.search-result-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
    width: 40px; height: 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--accent-cyan); }
.badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}
.topbar-clock {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

/* MODULE CONTAINER */
.module-container { padding: 28px; }

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.module-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}
.module-title p { color: var(--text-secondary); font-size: 13px; }
.module-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* BUTTONS */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 229, 255, 0.4); }
.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.btn-danger {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 82, 82, 0.3);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px 10px; }

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

/* STATS GRID (dashboard) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-cyan);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}
.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
}
.stat-change {
    font-size: 12px;
    margin-top: 8px;
    color: var(--text-muted);
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* TABLE */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.table-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.table-search {
    flex: 1;
    min-width: 240px;
    position: relative;
    display: flex; align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.table-search i { padding: 0 12px; color: var(--text-muted); }
.table-search input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 9px 0;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-main);
    font-size: 13px;
}
.table-scroll { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead {
    background: var(--bg-tertiary);
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .actions-cell { white-space: nowrap; }
.action-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 4px;
    transition: var(--transition);
}
.action-btn:hover { background: var(--bg-hover); color: var(--accent-cyan); border-color: var(--border-color); }
.action-btn.danger:hover { color: var(--danger); background: rgba(255,82,82,0.1); }

/* BADGES */
.badge-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}
.badge-active { background: rgba(0, 230, 118, 0.15); color: var(--success); }
.badge-inactive { background: rgba(90, 110, 143, 0.15); color: var(--text-muted); }
.badge-pending { background: rgba(255, 179, 0, 0.15); color: var(--warning); }
.badge-complete { background: rgba(0, 229, 255, 0.15); color: var(--accent-cyan); }
.badge-cancel { background: rgba(255, 82, 82, 0.15); color: var(--danger); }

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input, .form-select, .form-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}
.form-textarea { resize: vertical; min-height: 80px; font-family: var(--font-main); }

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}
.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 8px;
    transition: var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--danger); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: flex-end; gap: 10px;
}

/* TOAST */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 380px;
}
.toast.show { transform: translateX(0); }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent-cyan); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast-icon { font-size: 18px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--accent-cyan); }
.toast.warning .toast-icon { color: var(--warning); }
.toast-message { font-size: 13px; }

/* LOADER */
.loader {
    position: fixed;
    inset: 0;
    background: rgba(6, 11, 26, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 3000;
}
.loader-spinner {
    width: 56px; height: 56px;
    border: 3px solid rgba(0, 229, 255, 0.15);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: var(--text-secondary); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }

/* CLIENT PROFILE (Ficha) */
.profile-header {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.profile-avatar {
    width: 80px; height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 229, 255, 0.3);
}
.profile-info { flex: 1; min-width: 240px; }
.profile-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.profile-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 8px;
}
.profile-meta > div { display: flex; align-items: center; gap: 6px; }
.profile-meta i { color: var(--accent-cyan); }

.profile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
}
.profile-tab {
    padding: 12px 18px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}
.profile-tab.active { color: var(--accent-cyan); border-bottom-color: var(--accent-cyan); }
.profile-tab:hover { color: var(--text-primary); }

/* TIMELINE */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px; top: 8px; bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-cyan), transparent);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px; top: 6px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2);
}
.timeline-date {
    font-size: 11px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-weight: 600;
}
.timeline-title { font-weight: 600; margin-top: 4px; }
.timeline-desc { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }

/* EMPTY STATE */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state h4 { font-size: 15px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* PASSWORD MASK */
.password-mask {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
}
.password-mask .value { min-width: 100px; letter-spacing: 2px; }
.password-mask button {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition);
}
.password-mask button:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }

/* NOTIFICATION LIST */
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex; gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-cyan);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notif-icon.warning { background: rgba(255, 179, 0, 0.1); color: var(--warning); }
.notif-icon.danger { background: rgba(255, 82, 82, 0.1); color: var(--danger); }
.notif-body { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.notif-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: var(--font-mono); }

/* RESPONSIVE */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .search-hint { display: none; }
    .topbar-clock { display: none; }
    .module-container { padding: 16px; }
}

/* CHECKBOX */
.checkbox-group { display: flex; align-items: center; gap: 8px; }
.checkbox-group input[type="checkbox"] {
    accent-color: var(--accent-cyan);
    width: 16px; height: 16px;
}

/* GRID LAYOUTS */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* MINI CARDS */
.mini-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: var(--transition);
}
.mini-card:hover { border-color: var(--accent-cyan); }
.mini-card-title { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.mini-card-value { font-size: 18px; font-weight: 700; }

/* CREDENCIALES - Copiar todo */
.cred-copyall-btn {
    width: 100%;
    justify-content: center;
}
.cred-copyall-btn:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* CREDENCIALES - Recuadro "Otro" tipo personalizado */
#otroTipoBox, #otroTipoDocBox {
    background: rgba(0, 229, 255, 0.05);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 14px;
    animation: otroFadeIn 0.2s ease-out;
}
@keyframes otroFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ DOCUMENTOS - DRAG & DROP ============ */
.drop-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    position: relative;
    overflow: hidden;
}
.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 229, 255, 0.04) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}
.drop-zone:hover::before { opacity: 1; }
.drop-zone:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.03);
}
.drop-zone-active {
    border-color: var(--accent-cyan) !important;
    background: rgba(0, 229, 255, 0.08) !important;
    box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.1), 0 0 20px rgba(0, 229, 255, 0.15);
    transform: scale(1.01);
}
.drop-zone-active .drop-zone-icon {
    color: var(--accent-cyan);
    transform: scale(1.15) translateY(-4px);
}
.drop-zone-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.drop-zone-icon {
    font-size: 42px;
    color: var(--text-muted);
    transition: var(--transition);
    margin-bottom: 4px;
}
.drop-zone:hover .drop-zone-icon { color: var(--accent-cyan-dim); }
.drop-zone-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}
.drop-zone-link {
    color: var(--accent-cyan);
    text-decoration: underline;
    cursor: pointer;
}
.drop-zone-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============ ESTADO DE SUBIDA ============ */
.upload-status {
    flex-direction: column;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    animation: otroFadeIn 0.25s ease-out;
}
.upload-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.upload-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.upload-file-icon {
    font-size: 28px;
    color: var(--accent-cyan);
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 229, 255, 0.08);
    border-radius: 10px;
}
.upload-file-details {
    flex: 1;
    min-width: 0;
}
.upload-file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-file-size {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.upload-spinner {
    color: var(--accent-cyan);
    font-size: 18px;
}
.upload-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

/* ============ TOGGLES (Tipo Doc / IGV) ============ */
.doc-type-toggle, .igv-toggle {
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    padding: 3px;
    gap: 3px;
}
.doc-type-btn, .igv-btn {
    padding: 8px 18px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.doc-type-btn:hover, .igv-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.doc-type-btn.active, .igv-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.3);
}

/* ============ COTIZACIONES - Totales ============ */
.totals-box {
    min-width: 260px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
}
