/* ============================================
   CRM Manager FR — Premium Dark Fintech Theme
   ============================================ */

/* ── CSS Variables ── */
:root {
    /* Dark theme (default) */
    --bg-primary: #0a0e17;
    --bg-secondary: #0f1421;
    --bg-card: #141a2a;
    --bg-card-hover: #1a2236;
    --bg-sidebar: #0c1220;
    --bg-input: #111827;
    --bg-table-row: #0f1421;
    --bg-table-hover: #1a2236;
    --bg-modal: #141a2a;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    --border-color: #1e293b;
    --border-light: #1e293b50;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #f1f5f9;

    --accent-green: #00d4aa;
    --accent-green-glow: rgba(0, 212, 170, 0.15);
    --accent-green-hover: #00e6bb;
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.15);
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-green: 0 0 20px rgba(0, 212, 170, 0.2);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.2);

    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-input: #f1f5f9;
    --bg-table-row: #ffffff;
    --bg-table-hover: #f8fafc;
    --bg-modal: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.3);
    --border-color: #e2e8f0;
    --border-light: #e2e8f050;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-heading: #0f172a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ── Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-green);
}

/* ── Scrollbar ── */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--bg-primary);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ── App Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left var(--transition-slow);
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: var(--shadow-glow-green);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    display: block;
    padding: 8px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--accent-green);
    background: var(--accent-green-glow);
}

.nav-link.active i {
    color: var(--accent-green);
}

.nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.user-name-sm {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role-sm {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 99;
}

/* ── Top Bar ── */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb .active {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-search {
    position: relative;
    width: 260px;
}

.topbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.topbar-search input {
    width: 100%;
    padding: 8px 14px 8px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    transition: all var(--transition);
    outline: none;
}

.topbar-search input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-glow);
}

.topbar-search input::placeholder {
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition);
}

.topbar-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
}

.topbar-user:hover {
    background: var(--bg-card);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 6px;
}

.topbar-user:hover .user-dropdown {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--accent-red);
}

.main-content {
    flex: 1;
    padding: 24px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
}

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.kpi-card.green::before {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
}

.kpi-card.blue::before {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
}

.kpi-card.orange::before {
    background: linear-gradient(90deg, var(--accent-orange), #ef4444);
}

.kpi-card.purple::before {
    background: linear-gradient(90deg, var(--accent-purple), #ec4899);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

.kpi-card.green .kpi-icon {
    background: var(--accent-green-glow);
    color: var(--accent-green);
}

.kpi-card.blue .kpi-icon {
    background: var(--accent-blue-glow);
    color: var(--accent-blue);
}

.kpi-card.orange .kpi-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.kpi-card.purple .kpi-icon {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.1;
    letter-spacing: -1px;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 20px;
}

.kpi-change.up {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.kpi-change.down {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ── Charts Grid ── */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* ── Data Table ── */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.table-search {
    position: relative;
    width: 280px;
}

.table-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.table-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
}

.table-search input:focus {
    border-color: var(--accent-green);
}

.table-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-table-hover);
}

.data-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table .client-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-initials {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.client-details {
    display: flex;
    flex-direction: column;
}

.client-details .name {
    font-weight: 600;
    color: var(--text-heading);
}

.client-details .email {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
}

.badge-primary {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
    letter-spacing: 0.2px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, var(--accent-green));
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-heading);
    border-color: var(--text-muted);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13.5px;
    outline: none;
    transition: all var(--transition);
}

.form-control:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ── Filter Bar ── */
.filter-select {
    padding: 7px 32px 7px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 12.5px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2364748b' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition);
}

.filter-select:focus {
    border-color: var(--accent-green);
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ── Timeline ── */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--accent-green);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
}

.timeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.timeline-type {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
}

.timeline-user {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.timeline-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ── Tags ── */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--accent-blue-glow);
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 600;
}

.tag.vip {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange);
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: toastSlideIn 0.4s ease;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.warning {
    border-left: 3px solid var(--warning);
}

.toast.info {
    border-left: 3px solid var(--info);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast-message {
    font-size: 13px;
    color: var(--text-primary);
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    text-decoration: none;
}

.page-btn:hover,
.page-btn.active {
    background: var(--accent-green);
    color: #fff;
    border-color: var(--accent-green);
}

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-green-glow), transparent 70%);
    top: -100px;
    right: -100px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-blue-glow), transparent 70%);
    bottom: -100px;
    left: -100px;
    pointer-events: none;
}

.login-box {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    font-size: 28px;
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
}

/* ── Client Detail ── */
.client-profile {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    align-items: start;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    position: sticky;
    top: calc(var(--topbar-height) + 24px);
}

.profile-header {
    padding: 32px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--accent-green-glow), transparent);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 14px;
    box-shadow: var(--shadow-glow-green);
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
}

.profile-email {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.profile-body {
    padding: 20px 24px;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-field-value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.ftd-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-green);
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Stats Row ── */
.stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-pill .num {
    font-weight: 800;
    color: var(--accent-green);
}

/* ── Loading Spinner ── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

/* ── Table Responsive Scrollbar ── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: auto;
    scrollbar-color: var(--text-secondary) var(--bg-card);
}

/* Thicker, more visible horizontal scrollbar for tables */
.table-responsive::-webkit-scrollbar {
    height: 14px;
    /* Thicker horizontal scrollbar */
    width: 14px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 8px;
    border-top: 1px solid var(--border-color);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 8px;
    border: 3px solid var(--bg-card);
    /* Creates a padded look */
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
    /* Brighter on hover */
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .client-profile {
        grid-template-columns: 1fr;
    }

    .profile-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar-search {
        display: none;
    }

    .user-info {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Utils ── */
.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-green {
    color: var(--accent-green) !important;
}

.fw-700 {
    font-weight: 700;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.d-flex {
    display: flex;
}

.gap-8 {
    gap: 8px;
}

.gap-16 {
    gap: 16px;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* ── Notification Bell ── */
.notif-wrapper {
    position: relative;
}

.notif-bell {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    animation: notifPulse 2s ease-in-out infinite;
}

@keyframes notifPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: -40px;
    width: 380px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    overflow: hidden;
}

.notif-dropdown.open {
    display: block;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-heading);
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-dropdown-body {
    overflow-y: auto;
    max-height: 400px;
}

.notif-empty {
    padding: 32px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.notif-item:hover {
    background: var(--bg-card-hover);
}

.notif-item.rappel {
    border-left: 3px solid var(--danger);
}

.notif-item.solde {
    border-left: 3px solid var(--accent-orange);
}

.notif-item.ftd_manquant {
    border-left: 3px solid var(--accent-blue);
}

.notif-item.escalade {
    border-left: 3px solid var(--accent-purple);
}

.notif-link {
    flex: 1;
    min-width: 0;
    text-decoration: none !important;
}

.notif-message {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.notif-dismiss {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: all var(--transition);
}

.notif-dismiss:hover {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

/* ── Last Contact Colors ── */
.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.contact-badge.green {
    color: var(--success);
    background: rgba(16, 185, 129, 0.12);
}

.contact-badge.orange {
    color: var(--accent-orange);
    background: rgba(245, 158, 11, 0.12);
}

.contact-badge.red {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.12);
}

.badge-rappel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--danger);
    animation: notifPulse 2s ease-in-out infinite;
    white-space: nowrap;
}

/* ── Callback Dashboard Section ── */
.callback-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.callback-section .card-header {
    padding: 18px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.callback-filters {
    display: flex;
    gap: 6px;
}

.callback-filters .filter-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.callback-filters .filter-btn.active,
.callback-filters .filter-btn:hover {
    background: var(--accent-green-glow);
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.btn-callback {
    padding: 5px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--accent-green);
    background: var(--accent-green-glow);
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}

.btn-callback:hover {
    background: var(--accent-green);
    color: #fff;
}

/* ══════════════════════════════════════════════
   Timeline V2 — Enhanced Interactions
   ══════════════════════════════════════════════ */
.timeline-v2 {
    position: relative;
    padding: 16px 0 16px 28px;
}

.timeline-v2::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.tl-item {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    gap: 14px;
    animation: fadeInUp 0.3s ease both;
}

.tl-item:last-child {
    margin-bottom: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tl-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
    background: var(--primary-color);
    border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--border-color);
    z-index: 1;
}

/* Color-coded dots by type */
.tl-type-appel_entrant .tl-dot,
.tl-type-appel_sortant .tl-dot {
    background: #10b981;
}

.tl-type-email .tl-dot {
    background: #3b82f6;
}

.tl-type-whatsapp .tl-dot {
    background: #25d366;
}

.tl-type-note .tl-dot {
    background: #f59e0b;
}

.tl-type-reunion .tl-dot,
.tl-type-rdv .tl-dot {
    background: #8b5cf6;
}

.tl-type-autre .tl-dot {
    background: #6b7280;
}

.tl-body {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 16px;
    transition: border-color 0.2s;
}

.tl-body:hover {
    border-color: var(--primary-color);
}

.tl-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.tl-label {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
}

.tl-duree {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.tl-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tl-agent {
    color: var(--primary-color);
    font-weight: 600;
}

.tl-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.tl-prochain {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tl-prochain.future {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.tl-prochain.past {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Tooltip (Dernier Contact) ── */
.tooltip-wrap {
    position: relative;
    cursor: default;
}

.tooltip-wrap .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--card-bg);
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}

.tooltip-wrap:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Sortable header */
.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-th:hover {
    color: var(--primary-color);
}

.sort-icon {
    font-size: 10px;
    margin-left: 3px;
    opacity: 0.5;
}

.sort-icon.active {
    opacity: 1;
    color: var(--primary-color);
}

/* Badge rappel dépassé */
.badge-rappel-depasse {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* ═══════════════════════════════════════════
   Quick Filters Bar — Premium
   ═══════════════════════════════════════════ */
.quick-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 22px;
    margin-bottom: 16px;
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.qf-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.qf-header i {
    font-size: 14px;
    color: var(--primary-color);
}

.qf-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qf-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.qf-btn i {
    font-size: 16px;
    opacity: 0.8;
    color: var(--text-muted);
    transition: all .2s;
}

.qf-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-heading);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qf-btn:hover i {
    opacity: 1;
    color: var(--text-heading);
}

/* Active state — default (primary) */
.qf-btn.active {
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.qf-btn.active i {
    opacity: 1;
    color: #fff;
}

.qf-btn.active .qf-badge {
    background: #fff;
    color: var(--accent-blue);
}

/* ── Color variants — hover/idle tints ── */
.qf-btn-danger {
    border-left: 3px solid rgba(239, 68, 68, 0.4);
}

.qf-btn-danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

.qf-btn-danger.active {
    background: linear-gradient(135deg, #ef4444, #f87171);
    border-color: #ef4444;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.qf-btn-warning {
    border-left: 3px solid rgba(245, 158, 11, 0.4);
}

.qf-btn-warning:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}

.qf-btn-warning.active {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border-color: #f59e0b;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.qf-btn-purple {
    border-left: 3px solid rgba(139, 92, 246, 0.4);
}

.qf-btn-purple:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.06);
}

.qf-btn-purple.active {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    border-color: #8b5cf6;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.qf-btn-info {
    border-left: 3px solid rgba(6, 182, 212, 0.4);
}

.qf-btn-info:hover {
    border-color: #06b6d4;
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.06);
}

.qf-btn-info.active {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
    border-color: #06b6d4;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.qf-btn-muted {
    border-left: 3px solid rgba(148, 163, 184, 0.4);
}

.qf-btn-muted:hover {
    border-color: #94a3b8;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.06);
}

.qf-btn-muted.active {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    border-color: #64748b;
    box-shadow: 0 4px 14px rgba(100, 116, 139, 0.3);
}

/* ── Badge counters ── */
.qf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: #ef4444;
    line-height: 1;
    animation: badgePop .3s cubic-bezier(.4, 0, .2, 1);
}

.qf-badge-orange {
    background: #f59e0b;
}

.qf-badge-purple {
    background: #8b5cf6;
}

.qf-badge-grey {
    background: #94a3b8;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    margin-left: 8px;
    vertical-align: middle;
}

.btn-icon-sm:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}


/* ═══════════════════════════════════════════
   Call Badge (Dernier Appel column)
   ═══════════════════════════════════════════ */
.call-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.call-badge i {
    font-size: 12px;
}

.call-badge.green {
    color: #fff;
    background: var(--success);
}

.call-badge.orange {
    color: #fff;
    background: var(--accent-orange);
}

.call-badge.red {
    color: #fff;
    background: var(--danger);
}

.call-badge.grey {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.12);
}

.contact-badge.grey {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.12);
}


/* ═══════════════════════════════════════════
   Priority Badge & Bar
   ═══════════════════════════════════════════ */
.priority-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    width: fit-content;
}

.priority-badge.prio-high {
    color: #fff;
    background: #ef4444;
}

.priority-badge.prio-medium {
    color: #fff;
    background: #f59e0b;
}

.priority-badge.prio-low {
    color: #fff;
    background: #10b981;
}

.priority-bar {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.15);
    overflow: hidden;
}

.priority-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .5s ease;
}


/* ═══════════════════════════════════════════
   Sortable Column Headers
   ═══════════════════════════════════════════ */
.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background .15s ease;
    white-space: nowrap;
}

.sortable-th:hover {
    background: rgba(99, 102, 241, 0.06);
}

.sortable-th.sort-active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
}

.sortable-th .sort-icon {
    font-size: 12px;
    opacity: 0.4;
    margin-left: 3px;
    vertical-align: middle;
}

.sortable-th .sort-icon.active {
    opacity: 1;
    color: var(--primary-color);
}

/* Inactivity sort button */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}


/* ── Premium Tabs (Segmented) ── */
.tabs {
    display: inline-flex;
    background: var(--bg-input);
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    gap: 4px;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tabs .tab {
    position: relative;
    padding: 8px 18px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    white-space: nowrap;
}

.tabs .tab i {
    font-size: 15px;
    opacity: 0.7;
    transition: all 0.2s;
}

.tabs .tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tabs .tab.active {
    background: var(--bg-card);
    color: var(--text-heading);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    font-weight: 700;
}

.tabs .tab.active i {
    color: var(--accent-blue);
    opacity: 1;
}

/* ══════════════════════════════════════ */
/* KYC SYSTEM                            */
/* ══════════════════════════════════════ */

/* ── Progress Bar ── */
.kyc-progress-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.kyc-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.kyc-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    transition: width 0.5s ease;
}

.kyc-progress-sections {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.kyc-section-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.kyc-section-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ── KYC Card & Tabs ── */
.kyc-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    width: 100%;
    clear: both;
}

.kyc-header-indicator .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 10px;
}

.kyc-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.kyc-tab-icon {
    font-size: 12px;
    margin-right: 2px;
}

/* ── KYC Forms ── */
.kyc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.kyc-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 16px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.kyc-section-title i {
    color: var(--accent-blue);
    font-size: 16px;
}

.kyc-form-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* ── Checkbox Group ── */
.kyc-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kyc-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.kyc-checkbox:hover {
    border-color: var(--accent-blue);
}

.kyc-checkbox input:checked+span,
.kyc-checkbox:has(input:checked) {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

/* ── Upload Zone ── */
.kyc-upload-zone {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.kyc-upload-zone:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.04);
}

.kyc-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.kyc-upload-zone i {
    font-size: 28px;
}

.kyc-file-preview {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Quiz ── */
.quiz-question-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.quiz-question-text {
    font-size: 14px;
    color: var(--text-heading);
    margin-bottom: 10px;
    line-height: 1.5;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: all var(--transition);
}

.quiz-option:hover {
    border-color: var(--accent-blue);
}

.quiz-option:has(input:checked) {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

.kyc-quiz-score {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px;
    border-radius: var(--radius);
    border: 2px solid;
    gap: 4px;
}

.kyc-quiz-score.success {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.08);
}

.kyc-quiz-score.failed {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.08);
}

.kyc-quiz-score .score-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-heading);
}

.kyc-quiz-score .score-label {
    font-size: 13px;
    font-weight: 600;
}

/* ── Scenario Cards ── */
.kyc-scenario-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kyc-scenario-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.scenario-question {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 10px;
}

.scenario-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scenario-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: all var(--transition);
}

.scenario-option:hover {
    border-color: var(--accent-blue);
}

.scenario-option:has(input:checked) {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

/* ── Risk Gauge ── */
.risk-gauge-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.risk-gauge-segment {
    flex: 1;
}

.risk-gauge-label {
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Mini Progress (recap table) ── */
.mini-progress {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}

.mini-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
}

/* ── KYC Reject Note ── */
.kyc-reject-note {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* ── KYC History ── */
.kyc-history-list {
    max-height: 300px;
    overflow-y: auto;
}

.kyc-history-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.kyc-history-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Badge Variants ── */
.badge-muted {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* ── Utility ── */
.mb-16 {
    margin-bottom: 16px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-12 {
    margin-top: 12px;
}

.mt-8 {
    margin-top: 8px;
}

.mb-8 {
    margin-bottom: 8px;
}

.gap-12 {
    gap: 12px;
}

.flex-wrap {
    flex-wrap: wrap;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

/* ── KYC Responsive ── */
@media (max-width: 768px) {
    .kyc-form-grid {
        grid-template-columns: 1fr;
    }

    .kyc-progress-sections {
        flex-direction: column;
        gap: 8px;
    }

    .kyc-tabs {
        flex-direction: column;
    }
}

/* ══════════════════════════════════════ */
/* 2FA & SETTINGS                        */
/* ══════════════════════════════════════ */

/* ── Settings Page ── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 800px;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.profile-info-value {
    font-size: 14px;
    color: var(--text-heading);
    font-weight: 600;
}

/* ── 2FA Login Form ── */
.twofa-info {
    text-align: center;
    padding: 20px 0;
}

.twofa-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.twofa-icon i {
    font-size: 28px;
    color: var(--accent-blue);
}

.twofa-info p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.twofa-input {
    text-align: center;
    font-size: 24px !important;
    letter-spacing: 8px;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.twofa-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.twofa-link {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.twofa-link:hover {
    color: var(--accent-blue);
}

/* ── Login Success ── */
.login-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── 2FA Settings ── */
.twofa-status-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
}

.twofa-status-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.twofa-status-icon.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: #10b981;
}

.twofa-status-icon.inactive {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.15), rgba(100, 116, 139, 0.05));
    color: #64748b;
}

.twofa-status-text h4 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--text-heading);
}

.twofa-status-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Setup Wizard ── */
.twofa-setup-header {
    margin-bottom: 20px;
}

.twofa-step-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 10px;
}

.twofa-setup-header h4 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--text-heading);
}

.twofa-setup-header p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.twofa-qr-container {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: var(--radius);
    display: inline-block;
    margin: 12px 0;
}

.twofa-qr-image {
    width: 250px;
    height: 250px;
    image-rendering: pixelated;
}

.twofa-manual-key {
    margin-top: 12px;
}

.twofa-manual-key p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.twofa-manual-key code {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--accent-blue);
    user-select: all;
}

/* ── Backup Codes ── */
.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.backup-code {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
}

.backup-code code {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: 1px;
}

/* ── Verify Form ── */
.twofa-verify-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 400px;
}

.twofa-error {
    margin-top: 8px;
    color: var(--accent-red, #ef4444);
    font-size: 13px;
}

/* ── Action Cards ── */
.twofa-actions {
    display: grid;
    gap: 16px;
}

.twofa-action-card {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
}

.twofa-action-card.danger {
    border-color: rgba(239, 68, 68, 0.3);
}

.twofa-action-card h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 6px;
}

.twofa-action-card.danger h4 {
    color: #ef4444;
}

.twofa-action-card p {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.twofa-action-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.twofa-action-form .form-control {
    max-width: 200px;
}

/* ── Spinner ── */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .twofa-status-box {
        flex-direction: column;
        text-align: center;
    }

    .twofa-verify-form {
        flex-direction: column;
    }

    .twofa-action-form {
        flex-direction: column;
    }

    .twofa-action-form .form-control {
        max-width: none;
    }

    .backup-codes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .twofa-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

/* ══════════════════════════════════════════
   CLIENT ENRICHMENT — MODULES CSS
   (Transactions, Objectifs, Sentiments, KYC)
   ══════════════════════════════════════════ */

/* ── TRANSACTIONS SUMMARY ── */
.tx-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tx-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.tx-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tx-summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.tx-card-depot .tx-summary-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.tx-card-retrait .tx-summary-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tx-card-solde .tx-summary-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Blue */
.tx-card-count .tx-summary-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.tx-card-ftd .tx-summary-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.tx-summary-data {
    display: flex;
    flex-direction: column;
}

.tx-summary-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tx-summary-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-top: 2px;
}

.tx-summary-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tx-amount-positive {
    color: #10b981;
    font-weight: 600;
}

.tx-amount-negative {
    color: #ef4444;
    font-weight: 600;
}

.tx-pending-alert {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── OBJECTIFS PROGRESS ── */
.obj-progress-container {
    height: 10px;
    background: var(--bg-body);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.obj-progress-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 5px;
    transition: width 0.6s ease;
}

/* ── RISK GAUGE ── */
.risk-gauge {
    display: flex;
    gap: 4px;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.risk-bar {
    flex: 1;
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

.risk-1 {
    background: #10b981;
}

/* Conservateur */
.risk-2 {
    background: #f59e0b;
}

/* Modéré */
.risk-3 {
    background: #f97316;
}

/* Dynamique */
.risk-4 {
    background: #ef4444;
}

/* Agressif */

.obj-stat-box {
    background: var(--bg-body);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.obj-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.obj-rendement-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto 0;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-heading);
}

.obj-note-box {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 20px;
    font-style: italic;
    font-size: 0.95rem;
}

.obj-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.obj-hist-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.obj-hist-item:last-child {
    border-bottom: none;
}

.obj-hist-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-body);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
}

.obj-hist-content {
    font-size: 0.9rem;
}

/* ── SENTIMENTS ── */
.sentiment-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-sentiment {
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    border-radius: 8px;
    padding: 8px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-sentiment:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-sentiment.active {
    background: var(--bg-accent-soft);
    border-color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
}

/* ── KYC RESUME ── */
.kyc-summary-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 24px;
}

.kyc-grid-status {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.kyc-grid-item {
    background: var(--bg-body);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* ══════════════════════════════════════════
   MANAGER DASHBOARD
   ══════════════════════════════════════════ */
.dashboard-manager .page-header {
    margin-bottom: 24px;
}

/* ── KPI CARDS ── */
.kpi-card {
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.kpi-card .card-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
    color: var(--text-heading);
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kpi-trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── ACTIVITY FEED ── */
.activity-feed {
    max-height: 350px;
    overflow-y: auto;
}

/* ── HELPERS ── */
.bg-primary-soft {
    background: rgba(59, 130, 246, 0.1);
}

.bg-success-soft {
    background: rgba(16, 185, 129, 0.1);
}

.bg-danger-soft {
    background: rgba(239, 68, 68, 0.1);
}

.bg-warning-soft {
    background: rgba(245, 158, 11, 0.1);
}

.text-warning-dark {
    color: #d97706;
}

.hover-underline:hover {
    text-decoration: underline;
}