/* Client Portal - Estilo consistente con CRM principal */

/* Variables del CRM */
:root {
    --primary-blue: #1e40af;
    --primary-blue-light: #3b82f6;
    --primary-blue-dark: #1e3a8a;
    --secondary-gray: #64748b;
    --secondary-gray-light: #94a3b8;
    --secondary-gray-dark: #475569;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Aliases for CRM compatibility */
    --primary-color: var(--primary-blue);
    --primary-light: rgba(30, 64, 175, 0.1);
    --card-bg: var(--bg-primary);
    --border-color: var(--border-light);
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --success-color: var(--success);
    --success-light: rgba(16, 185, 129, 0.1);
    --danger-color: var(--danger);
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning-color: var(--warning);
    --warning-light: rgba(245, 158, 11, 0.1);
    --bg-hover: rgba(248, 250, 252, 0.8);
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout principal */
.client-portal-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* Sidebar del Client Portal */
.client-sidebar {
    width: 280px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
}

.client-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.client-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.client-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.client-logo-text {
    display: flex;
    flex-direction: column;
}

.client-logo-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1.2;
}

.client-logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Navegación del sidebar */
.client-sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.client-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.client-nav-item {
    margin: 0.25rem 1rem;
}

.client-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.client-nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.client-nav-link.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    color: white;
    box-shadow: var(--shadow-sm);
}

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

/* Manager card en sidebar */
.client-manager-card {
    margin: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.client-manager-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.client-manager-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.client-manager-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.client-manager-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.client-manager-contact {
    margin-top: 0.75rem;
}

.client-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.client-contact-btn:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

/* Contenido principal */
.client-main-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header del Client Portal */
.client-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.client-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.client-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.client-breadcrumb-item {
    color: var(--text-secondary);
    font-weight: 500;
}

.client-breadcrumb-item.current {
    color: var(--primary-blue);
    font-weight: 600;
}

.client-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-header-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-header-btn:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

.client-header-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.client-header-btn.secondary:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

/* User dropdown en header */
.client-user-dropdown {
    position: relative;
}

.client-user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-user-btn:hover {
    background: var(--border-light);
}

.client-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.client-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.client-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.client-user-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Contenido principal */
.client-main-content {
    flex: 1;
    padding: 2rem;
    width: 100%;
}

/* Welcome section */
.client-welcome {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.client-welcome-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-welcome-text h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.client-welcome-text p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Stats Grid - CRM Widget Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Variantes de widgets para íconos y barra superior, estilo como imagen adjunta */
.stat-card.balance-card::before { background: linear-gradient(90deg, #4f46e5, #3b82f6); }
.stat-card.accounts-card::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.profit-card::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.trades-card::before { background: linear-gradient(90deg, #0ea5e9, #14b8a6); }

.balance-card .stat-icon { background: #e0e7ff; color: #1e40af; }
.accounts-card .stat-icon { background: #fef3c7; color: #b45309; }
.profit-card .stat-icon { background: #d1fae5; color: #065f46; }
.trades-card .stat-icon { background: #cffafe; color: #0e7490; }

.stat-card .stat-content h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.stat-change.negative {
    color: var(--danger-color);
}

.stat-change.neutral {
    color: var(--text-muted);
}

/* Section Headers - CRM Style */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.section-title i {
    color: var(--primary-color);
}

.section-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Accounts Summary Cards */
.accounts-summary {
    margin-bottom: 2rem;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.account-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Barra superior al estilo de widgets del CRM */
.account-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    border-radius: 12px 12px 0 0;
}

.account-card.account-live::before {
    background: linear-gradient(90deg, #4f46e5, #3b82f6);
}

.account-card.account-demo::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Variante premium: apariencia similar a las tarjetas de Desks */
.account-card.premium {
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.account-card.premium:hover { box-shadow: var(--shadow-lg); }
.account-card.premium::before { display: none; }

.account-card-header.premium {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--gradient-secondary);
    border-bottom: 1px solid var(--border-light);
    /* extender la cabecera a los bordes del card */
    margin: -1rem -1rem 0;
    border-radius: 12px 12px 0 0;
}

.account-card.premium .type-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fff;
    color: var(--primary-blue);
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.account-card.premium.account-demo .type-icon { color: #b45309; }
.account-card.premium.account-live .type-icon { color: #1e40af; }

.account-card.premium .account-id .type-name { font-size: 1.02rem; }
.account-card.premium .account-card-body { padding-top: .5rem; }

.account-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.type-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1rem;
}

.account-card.account-demo .type-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.account-card.account-live .type-icon {
    background: rgba(30, 64, 175, 0.12);
    color: #1e40af;
}

.account-id .type-name {
    font-weight: 600;
    color: var(--text-primary);
}

.account-id .account-number {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    color: var(--text-secondary);
}

.account-card-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
}

.balance .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.balance .value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 6px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.balance-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-light));
    width: 0;
    transition: width 0.6s ease;
}

.account-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}

/* Botones de acción modernos (portal cliente) */
.btn-action,
.client-action-btn,
.account-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    text-decoration: none;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-action i,
.client-action-btn i,
.account-action-btn i { font-size: 0.9rem; }
.btn-size-sm { padding: 0.375rem 0.625rem; font-size: 0.8125rem; }

/* Variantes verdes y rojas para depósito/retiro */
.btn-deposit,
.client-action-btn.deposit,
.account-action-btn.deposit {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    color: #fff;
    border-color: rgba(22, 163, 74, 0.4);
}
.btn-deposit:hover,
.client-action-btn.deposit:hover,
.account-action-btn.deposit:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
}

.btn-withdraw,
.client-action-btn.withdraw,
.account-action-btn.withdraw {
    background: linear-gradient(180deg, #ef4444, #dc2626);
    color: #fff;
    border-color: rgba(220, 38, 38, 0.4);
}
.btn-withdraw:hover,
.client-action-btn.withdraw:hover,
.account-action-btn.withdraw:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.35);
}

.client-action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.client-action-btn.secondary:hover {
    background: var(--border-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Chips KPI dentro de tarjetas de cuenta */
.account-kpis { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
}
.kpi-chip i { font-size: 0.8rem; opacity: 0.9; }
.kpi-chip.status.ok { background: var(--success-light); color: var(--success-color); border-color: rgba(16, 185, 129, 0.25); }
.kpi-chip.status.bad { background: var(--danger-light); color: var(--danger-color); border-color: rgba(239, 68, 68, 0.25); }

@media (max-width: 768px) {
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* Tables - CRM Style */
.accounts-table-container,
.documents-table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accounts-table,
.documents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.accounts-table thead th,
.documents-table thead th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accounts-table tbody td,
.documents-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.accounts-table tbody tr:hover,
.documents-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Status Badges - CRM Style */
.status-badge,
.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-active,
.doc-badge.approved {
    background: var(--success-light);
    color: var(--success-color);
}

.status-badge.status-inactive,
.doc-badge.rejected {
    background: var(--danger-light);
    color: var(--danger-color);
}

.doc-badge.pending {
    background: var(--warning-light);
    color: var(--warning-color);
}

/* Action Buttons - CRM Style */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.action-btn-small {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.action-btn-small:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Support Cards - CRM Widget Style */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.support-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.support-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.support-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.support-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.support-card p {
    color: var(--text-muted);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

/* Verification Section - CRM Style */
.verification-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.verification-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 120px;
}

.verification-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.step.completed .step-icon {
    background: var(--success-color);
    color: white;
}

.step.pending .step-icon {
    background: var(--warning-light);
    color: var(--warning-color);
}

/* Additional styles for enhanced form and table elements */

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Priority and Status Badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-badge.low {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.priority-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-badge.open {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.status-badge.in-progress {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-badge.closed {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Ticket ID styling */
.ticket-id {
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 600;
    color: var(--primary-color);
}

.ticket-subject-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ticket-subject-link:hover {
    color: var(--primary-color);
}

/* Support Card */
.support-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Enhanced Action Buttons */
.action-btn-small.edit {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.action-btn-small.edit:hover {
    background: rgba(245, 158, 11, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .client-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .client-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .client-main-wrapper {
        margin-left: 0;
    }
    
    .client-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .client-main-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .client-header {
        padding: 1rem;
    }
    
    .client-header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .client-welcome {
        padding: 1.5rem;
    }
    
    .client-welcome-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .client-section-header {
        padding: 1rem;
    }
    
    .client-section-content {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .documents-table th:nth-child(5),
    .documents-table th:nth-child(6),
    .documents-table td:nth-child(5),
    .documents-table td:nth-child(6) {
        display: none;
    }
}

/* Sidebar overlay (para el layout móvil del portal cliente) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 998;
    display: none;
}
.sidebar-overlay.active {
    display: block;
}

/* WebTrader Button Styles */
.client-action-btn.webtrader {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    position: relative;
    overflow: hidden;
}

.client-action-btn.webtrader:hover {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
}

.client-action-btn.webtrader:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.client-action-btn.webtrader:hover:before {
    left: 100%;
}

.client-action-btn.webtrader i {
    margin-right: 0.5rem;
    font-size: 1.1em;
}
.btn-action i,
.client-action-btn i,
.account-action-btn i { font-size: 0.9rem; }
.btn-size-sm { padding: 0.375rem 0.625rem; font-size: 0.8125rem; }

/* Variantes verdes y rojas para depósito/retiro */
.btn-deposit,
.client-action-btn.deposit,
.account-action-btn.deposit {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    color: #fff;
    border-color: rgba(22, 163, 74, 0.4);
}
.btn-deposit:hover,
.client-action-btn.deposit:hover,
.account-action-btn.deposit:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
}

.btn-withdraw,
.client-action-btn.withdraw,
.account-action-btn.withdraw {
    background: linear-gradient(180deg, #ef4444, #dc2626);
    color: #fff;
    border-color: rgba(220, 38, 38, 0.4);
}
.btn-withdraw:hover,
.client-action-btn.withdraw:hover,
.account-action-btn.withdraw:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.35);
}

.client-action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.client-action-btn.secondary:hover {
    background: var(--border-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Chips KPI dentro de tarjetas de cuenta */
.account-kpis { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
}
.kpi-chip i { font-size: 0.8rem; opacity: 0.9; }
.kpi-chip.status.ok { background: var(--success-light); color: var(--success-color); border-color: rgba(16, 185, 129, 0.25); }
.kpi-chip.status.bad { background: var(--danger-light); color: var(--danger-color); border-color: rgba(239, 68, 68, 0.25); }

@media (max-width: 768px) {
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* Tables - CRM Style */
.accounts-table-container,
.documents-table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accounts-table,
.documents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.accounts-table thead th,
.documents-table thead th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accounts-table tbody td,
.documents-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.accounts-table tbody tr:hover,
.documents-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Status Badges - CRM Style */
.status-badge,
.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-active,
.doc-badge.approved {
    background: var(--success-light);
    color: var(--success-color);
}

.status-badge.status-inactive,
.doc-badge.rejected {
    background: var(--danger-light);
    color: var(--danger-color);
}

.doc-badge.pending {
    background: var(--warning-light);
    color: var(--warning-color);
}

/* Action Buttons - CRM Style */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.action-btn-small {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.action-btn-small:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Support Cards - CRM Widget Style */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.support-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.support-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.support-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.support-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.support-card p {
    color: var(--text-muted);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

/* Verification Section - CRM Style */
.verification-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.verification-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 120px;
}

.verification-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.step.completed .step-icon {
    background: var(--success-color);
    color: white;
}

.step.pending .step-icon {
    background: var(--warning-light);
    color: var(--warning-color);
}

/* Additional styles for enhanced form and table elements */

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Priority and Status Badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-badge.low {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.priority-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-badge.open {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.status-badge.in-progress {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-badge.closed {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Ticket ID styling */
.ticket-id {
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 600;
    color: var(--primary-color);
}

.ticket-subject-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ticket-subject-link:hover {
    color: var(--primary-color);
}

/* Support Card */
.support-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Enhanced Action Buttons */
.action-btn-small.edit {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.action-btn-small.edit:hover {
    background: rgba(245, 158, 11, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .client-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .client-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .client-main-wrapper {
        margin-left: 0;
    }
    
    .client-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .client-main-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .client-header {
        padding: 1rem;
    }
    
    .client-header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .client-welcome {
        padding: 1.5rem;
    }
    
    .client-welcome-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .client-section-header {
        padding: 1rem;
    }
    
    .client-section-content {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .documents-table th:nth-child(5),
    .documents-table th:nth-child(6),
    .documents-table td:nth-child(5),
    .documents-table td:nth-child(6) {
        display: none;
    }
}

/* Sidebar overlay (para el layout móvil del portal cliente) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 998;
    display: none;
}
.sidebar-overlay.active {
    display: block;
}