/* ============================================
   LeadMarket - Custom Styles
   Plataforma de Leads para Asesores Financieros
   ============================================ */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2440;
    --accent: #38a169;
    --accent-light: #48bb78;
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #38a169;
    --topbar-height: 56px;
}

/* ---- General ---- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
}

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

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

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 2rem 1rem;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.auth-logo i {
    font-size: 1.8rem;
    color: #fff;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: #64748b;
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.auth-footer p {
    margin: 0;
    color: #64748b;
}

.role-btn {
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-check:checked + .role-btn {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--accent);
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(56, 161, 105, 0.15);
    border-left-color: var(--sidebar-active);
}

.sidebar-link.active i {
    color: var(--sidebar-active);
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: #e2e8f0;
}

.sidebar-user i {
    font-size: 1.5rem;
    color: var(--accent);
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: #64748b;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

.content-wrapper {
    padding: 2rem;
    max-width: 1400px;
}

/* ---- Topbar (mobile) ---- */
.topbar {
    background: #fff;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-brand {
    font-weight: 700;
    color: var(--primary);
}

/* ---- Page Header ---- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

/* ---- Stat Cards ---- */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-left: 4px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card-primary { border-left-color: var(--primary); }
.stat-card-success { border-left-color: #38a169; }
.stat-card-warning { border-left-color: #d69e2e; }
.stat-card-danger { border-left-color: #e53e3e; }
.stat-card-info { border-left-color: #3182ce; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon { background: #ebf4ff; color: var(--primary); }
.stat-card-success .stat-icon { background: #f0fff4; color: #38a169; }
.stat-card-warning .stat-icon { background: #fffff0; color: #d69e2e; }
.stat-card-danger .stat-icon { background: #fff5f5; color: #e53e3e; }
.stat-card-info .stat-icon { background: #ebf8ff; color: #3182ce; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
}

/* ---- Quick Action Cards (Admin) ---- */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    border: 2px solid transparent;
}

.quick-action-card:hover {
    color: var(--primary);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.quick-action-card i {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* ---- Lead Cards ---- */
.lead-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.lead-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.lead-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.lead-price-big {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.lead-card-owned {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--accent);
}

.lead-item-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

/* ---- Detail Items ---- */
.detail-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.detail-item span {
    font-size: 0.95rem;
}

/* ---- Wallet ---- */
.wallet-balance-card {
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.15);
}

.amount-btn.active {
    background-color: #38a169;
    border-color: #38a169;
    color: #fff;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.empty-state i {
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* ---- Tables ---- */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

/* ---- Buttons ---- */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

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

.btn-success {
    background-color: var(--accent);
    border-color: var(--accent);
}

.btn-success:hover {
    background-color: var(--accent-light);
    border-color: var(--accent-light);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-lg {
    padding: 0.65rem 1.5rem;
}

/* ---- Alerts ---- */
.alert {
    border: none;
    border-radius: 10px;
}

/* ---- Form Controls ---- */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.input-group-text {
    border-radius: 8px;
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* ---- Badges ---- */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* ---- Contact Info (purchased leads) ---- */
.contact-info a {
    color: var(--primary);
    font-weight: 500;
}

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

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* ---- Scrollbar ---- */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
