/* ============================================
   PREMIUM DASHBOARD VARIABLES
   ============================================ */
:root {
    --primary: #0093DA;
    /* UNSA Blue */
    --secondary: #8E2F89;
    /* UNSA Purple */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg-body: #F3F4F6;
    /* Light Gray */
    --bg-card: #FFFFFF;
    --bg-sidebar: #0f172a;
    /* Dark Slate */
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --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);
    --radius: 12px;
}

/* Champs montant : pas de centimes (step 1 €), pas de flèches */
.gc-input-montant::-webkit-outer-spin-button,
.gc-input-montant::-webkit-inner-spin-button,
input[type="number"].gc-input-montant::-webkit-outer-spin-button,
input[type="number"].gc-input-montant::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.gc-input-montant,
input[type="number"].gc-input-montant {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* RESET & LAYOUT */
.gc-dashboard {
    position: fixed;
    top: 32px;
    /* WP Admin Bar */
    left: 0;
    width: 100vw;
    height: calc(100vh - 32px);
    background: var(--bg-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: grid;
    grid-template-columns: 260px 1fr;
    z-index: 999;
}

/* SIDEBAR */
.gc-sidebar {
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #1e1e2e 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.gc-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 40px;
    color: white;
}

.gc-logo-icon {
    color: var(--primary);
    font-size: 24px;
}

.gc-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gc-nav-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.gc-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.gc-nav-item:hover,
.gc-nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.gc-nav-item.active {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 147, 218, 0.3);
}

.gc-nav-item .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.gc-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gc-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: 2px solid var(--secondary);
}

.gc-user-info {
    display: flex;
    flex-direction: column;
}

.gc-user-info .name {
    font-weight: 600;
    font-size: 14px;
}

.gc-user-info .role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* MAIN AREA */
.gc-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* HEADER */
.gc-header {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    padding: 8px 16px;
    border-radius: 8px;
    width: 400px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.search-bar:focus-within {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 2px rgba(0, 147, 218, 0.1);
}

.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    margin-left: 10px;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-display {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--bg-body);
}

/* CONTENT */
.gc-content {
    padding: 32px;
    overflow-y: auto;
    height: calc(100% - 70px);
}

/* GRIDS */
.gc-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.gc-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* CARDS */
.gc-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gc-card .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gc-card .card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.gc-card .card-body {
    padding: 24px;
}

/* STAT CARDS */
.stat-card {
    padding: 24px;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    border: none;
    color: white;
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0077b6 100%);
    box-shadow: 0 10px 15px -3px rgba(0, 147, 218, 0.3);
}

/* TABLE ROW COLORS & STYLING */
.table-modern {
    border-collapse: separate;
    border-spacing: 0 8px;
    /* Space between rows */
    margin-top: -8px;
}

.table-modern thead tr th {
    border-bottom: none;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 12px 16px;
}

.table-modern tbody tr {
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.table-modern td {
    background: white;
    /* Default bg for cells to allow border radius on row effect */
    padding: 16px !important;
    vertical-align: middle !important;
}

.table-modern td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.table-modern td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.table-modern tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    z-index: 1;
    position: relative;
}

/* Row Specifics Override */
.table-modern tr.row-attente td {
    background-color: #fffaf0 !important;
    padding: 16px !important;
    /* Softer vintage cream/orange */
    border-top: 1px solid #feeebb;
    border-bottom: 1px solid #feeebb;
}

.table-modern tr.row-attente td:first-child {
    border-left: 4px solid var(--warning);
}

.table-modern tr.row-recu td {
    background-color: #ffffff !important;
    padding: 16px !important;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.table-modern tr.row-recu td:first-child {
    border-left: 4px solid var(--success);
}

/* STATUS & BADGES */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.attente {
    background-color: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-dot.recu {
    background-color: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* DETAILS LIST (Cheques) */
.details-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

tr.row-attente .detail-item {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(245, 158, 11, 0.2);
}

.detail-item:hover {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.detail-info {
    font-weight: 500;
    color: var(--text-main);
}

.btn-pointer-small {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 20px;
    /* Pill shape */
    border: none;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.btn-pointer-small.topoint {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.3);
}

.btn-pointer-small.topoint:hover {
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-pointer-small.pointed {
    background: #ecfdf5;
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
    color: white;
}

transform: scale(0.95);
}

/* BADGE TIERS */
.badge-tiers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
    font-weight: 600;
}

/* MODERN ICON BUTTONS */
.btn-icon-modern {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-icon-modern:hover {
    background: var(--bg-body);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-icon-modern.delete:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fca5a5;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(4px);
}

.stat-content h3 {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    margin: 0;
}

.stat-content .value {
    font-size: 28px;
    font-weight: 700;
    margin: 5px 0;
}

.stat-content .trend {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}

/* FORMS */
.input-modern {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.2s;
    background: #fff;
}

.input-modern:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 147, 218, 0.1);
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.cheque-ligne-modern {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr;
    gap: 10px;
    margin-bottom: 10px;
    background: var(--bg-body);
    padding: 10px;
    border-radius: 8px;
}

.btn-primary-lg {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-primary-lg:hover {
    background: #007bb8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-main);
    font-weight: 500;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.full-width {
    width: 100%;
}

/* TABLE */
.table-responsive {
    overflow-x: auto;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern th {
    text-align: left;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.table-modern td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 14px;
    vertical-align: middle;
}

.table-modern tr:last-child td {
    border-bottom: none;
}

.table-modern tr:hover {
    background: #fafafa;
}

/* Ligne cliquable : ouvrir la modale au clic n'importe où sur la ligne */
#table-body tr.gc-row-transaction {
    cursor: pointer;
}
#table-body tr.gc-row-transaction:hover {
    background: #f1f5f9;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-text {
    width: 36px;
    height: 36px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.attente {
    background: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-dot.recu {
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.badge-type {
    background: #F3F4F6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #4B5563;
    font-weight: 500;
}

.font-bold {
    font-weight: 600;
}

.pagination-simple {
    padding: 20px;
    text-align: center;
    font-size: 14px;
}

.pagination-simple a {
    padding: 0 5px;
    color: var(--text-muted);
    text-decoration: none;
}

.pagination-simple .current {
    font-weight: bold;
    color: var(--primary);
}

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: white;
    width: 900px;
    max-width: 95vw;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease-out;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

/* Labels accessibles formulaire ajout chèque (modale) */
.gc-field-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.8);
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.close-modal:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

.modal-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-main);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.info-box {
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.info-box h4 {
    margin: 0 0 12px 0;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-weight: 500;
    color: var(--text-main);
}

/* TIMELINE */
.timeline {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid #e5e7eb;
    margin-top: 16px;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -31px;
    top: 0;
    width: 12px;
    height: 12px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
}

.timeline-content {
    font-size: 13px;
}

.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-text {
    color: var(--text-main);
    line-height: 1.4;
}

.loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.8);
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}