/* =========================
   RESET & BASE
   ========================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f4f6f9;
    color: #2d3436;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================
   HEADER
   ========================= */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

header h1::before {
    content: "📊 ";
}

header nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

header nav a {
    color: #dfe6e9;
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

header nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

header nav a.active {
    background: #0984e3;
    color: #fff;
}

header hr {
    display: none;
}

/* =========================
   BANQUE NAV (sticky bar)
   ========================= */
.banque-nav {
    background: #16213e;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.6rem 2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.banque-nav-groupe {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.banque-nav-groupe-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0.3rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
}

.banque-nav-groupe-comptes {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.banque-nav-item {
    text-decoration: none;
    color: #dfe6e9;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.05);
}

.banque-nav-nom {
    font-weight: 600;
    font-size: 0.9rem;
}

.banque-nav-item-type {
    font-weight: 600;
    font-size: 0.85rem;
}

.banque-nav-item-num {
    font-size: 0.7rem;
    opacity: 0.75;
}

.banque-nav-detail {
    font-size: 0.7rem;
    opacity: 0.75;
}

.banque-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.banque-nav-item.active {
    background: #0984e3;
    color: #fff;
    box-shadow: 0 2px 8px rgba(9, 132, 227, 0.3);
}

/* =========================
   SUB NAV (Opérations / Relevé)
   ========================= */
.sub-nav {
    background: #0f3460;
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.sub-nav-item {
    text-decoration: none;
    color: #b2bec3;
    padding: 0.6rem 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.sub-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sub-nav-item.active {
    color: #fff;
    border-bottom-color: #0984e3;
}

/* =========================
   MAIN CONTENT
   ========================= */
h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 1.5rem 2rem 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #0984e3;
    display: inline-block;
}

/* =========================
   BANQUE BUTTONS
   ========================= */
.banque-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 2rem 1.5rem;
}

.banque-buttons a {
    text-decoration: none;
}

.banque-buttons button {
    background: #fff;
    border: 2px solid #dfe6e9;
    padding: 0.6rem 1.4rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #2d3436;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.banque-buttons button:hover {
    border-color: #0984e3;
    color: #0984e3;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(9, 132, 227, 0.15);
}

.banque-buttons button:active {
    transform: translateY(0);
}

.banque-buttons button.active {
    background: #0984e3;
    color: #fff;
    border-color: #0984e3;
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
    transform: translateY(-1px);
}

.banque-buttons button.active:hover {
    background: #0773c5;
    color: #fff;
    border-color: #0773c5;
}

/* =========================
   TABLE
   ========================= */
.table-wrapper {
    width: calc(100% - 4rem);
    margin: 0 2rem 2rem;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table thead {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

table thead th {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.9rem 1rem;
    text-align: center;
    border: none;
    white-space: nowrap;
}

table thead th:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

table tbody tr {
    transition: background 0.15s ease;
}

table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

table tbody tr:hover {
    background: #eef5ff;
}

table tbody td {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
    border: none;
    white-space: normal;
    word-wrap: break-word;
}

table tbody td:not(:last-child) {
    border-right: 1px solid #f0f0f0;
}

/* Solde initial row */
table tbody tr.row-solde-initial {
    background: linear-gradient(135deg, #f8f9fa, #eef1f5) !important;
}

table tbody tr.row-solde-initial td {
    font-weight: 600;
    color: #1a1a2e;
}

/* Future operations coloring */
table tbody tr.row-future-odd {
    background: #d4edda !important;
}

table tbody tr.row-future-odd td {
    color: #155724;
}

table tbody tr.row-future-even {
    background: #e8d5f5 !important;
}

table tbody tr.row-future-even td {
    color: #6b21a8;
}

/* Column alignments */
table tbody td:nth-child(2) {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #636e72;
    white-space: nowrap;
}

table tbody td:nth-child(6),
table tbody td:nth-child(7),
table tbody td:nth-child(8) {
    font-family: 'Consolas', 'Courier New', monospace;
    text-align: right;
    font-weight: 500;
}

/* Credit positive */
table tbody td:nth-child(6) {
    color: #00b894;
}

/* Debit negative */
table tbody td:nth-child(7) {
    color: #d63031;
}

/* Balance */
table tbody td:nth-child(8) {
    color: #1a1a2e;
}

/* Balance negative */
table tbody td:nth-child(8):empty::after {
    content: "0,00";
    color: #b2bec3;
}

/* =========================
   BANQUE CARDS (Accueil)
   ========================= */
.banque-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin: 1rem 2rem 1.5rem;
}

.banque-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    text-decoration: none;
    color: #2d3436;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

.banque-card:hover {
    border-color: #0984e3;
    box-shadow: 0 6px 20px rgba(9, 132, 227, 0.12);
    transform: translateY(-3px);
}

.banque-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
}

.banque-card-type {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1a1a2e;
}

.banque-card-info {
    font-size: 0.85rem;
    color: #636e72;
}

.banque-card-solde {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 700;
}

.banque-card-solde.positif {
    color: #00b894;
}

.banque-card-solde.negatif {
    color: #d63031;
}

.solde-global {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 2rem 2rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.solde-global span:last-child {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.4rem;
}

.solde-global .positif {
    color: #55efc4;
}

.solde-global .negatif {
    color: #ff7675;
}

/* =========================
   OP ACTIONS (edit/delete)
   ========================= */
table tbody td:nth-child(9) {
    white-space: nowrap;
    padding: 0.4rem 0.6rem;
    vertical-align: middle;
    text-align: center;
}

.btn-edit,
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background: #eef5ff;
    color: #0984e3;
}

.btn-edit:hover {
    background: #0984e3;
    color: #fff;
}

.btn-delete {
    background: #fff0f0;
    color: #d63031;
}

.btn-delete:hover {
    background: #d63031;
    color: #fff;
}

.delete-form {
    margin: 0;
    padding: 0;
    display: inline;
}

/* =========================
   OP FORM (add/edit)
   ========================= */
.op-actions {
    display: flex;
    gap: 0.6rem;
    margin: 0 2rem 0.8rem;
}

.btn-toggle-form {
    background: #0984e3;
    color: #fff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-toggle-form:hover {
    background: #0773c5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}

.btn-import {
    display: inline-block;
    background: #6c5ce7;
    color: #fff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-import:hover {
    background: #5a4bd1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.op-form {
    display: none;
    margin: 0 2rem 1.2rem;
    padding: 1.2rem 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #0984e3;
}

.op-form.visible {
    display: block;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 130px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 0.5rem 0.7rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fafbfc;
    transition: border-color 0.2s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #0984e3;
    background: #fff;
}

.form-group input.input-error {
    border-color: #d63031;
    background: #fff5f5;
}

.form-group input.input-error:focus {
    border-color: #d63031;
}

.form-group input[type="number"] {
    font-family: 'Consolas', 'Courier New', monospace;
}

.input-credit {
    color: #00b894;
}

.input-debit {
    color: #d63031;
}

.input-disabled {
    background: rgba(0, 0, 0, 0.05);
    color: #636e72;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: auto;
}

.btn-submit,
.btn-cancel {
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.btn-submit {
    background: #00b894;
    color: #fff;
}

.btn-submit:hover {
    background: #00a381;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 184, 148, 0.3);
}

.btn-cancel {
    background: #dfe6e9;
    color: #636e72;
}

.btn-cancel:hover {
    background: #b2bec3;
    color: #fff;
}

/* =========================
   NO SELECTION MESSAGE
   ========================= */
p:not(header p, footer p) {
    margin: 1rem 2rem;
    padding: 1.5rem 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    color: #636e72;
    font-size: 1rem;
    text-align: center;
    border-left: 4px solid #0984e3;
}

/* =========================
   FOOTER
   ========================= */
hr {
    display: none;
}

footer {
    margin-top: auto;
    background: #1a1a2e;
    color: #b2bec3;
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.85rem;
}

footer p {
    margin: 0;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
        padding: 1rem;
    }

    h2 {
        margin: 1rem 1rem 0.5rem;
        font-size: 1.3rem;
    }

    .banque-buttons {
        margin: 0.8rem 1rem 1.2rem;
    }

    .table-wrapper {
        width: calc(100% - 2rem);
        margin: 0 1rem 1.5rem;
    }

    table {
        font-size: 0.8rem;
    }

    table thead th,
    table tbody td {
        padding: 0.5rem 0.6rem;
    }

    p:not(header p, footer p) {
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 0.75rem;
    }

    table thead th,
    table tbody td {
        padding: 0.4rem 0.4rem;
    }

    .banque-buttons button {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}

/* =========================
   IMPORT QIF
   ========================= */
.import-layout {
    margin: 1rem 2rem;
}

.import-upload {
    background: #fff;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.import-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.import-form .form-group {
    flex: 1;
    min-width: 250px;
}

.import-form .btn-submit {
    white-space: nowrap;
}

.import-table {
    width: 100%;
    margin: 0 0 1.5rem;
}

.import-table select {
    padding: 0.3rem 0.5rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    background: #fafbfc;
    max-width: 140px;
}

.import-table .col-amount {
    font-family: 'Consolas', 'Courier New', monospace;
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
}

.import-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.import-success {
    margin: 1rem 2rem;
    padding: 1.2rem 1.5rem;
    background: #d4edda;
    border-radius: 12px;
    color: #155724;
    font-weight: 600;
    font-size: 1.1rem;
    border-left: 4px solid #28a745;
}

.btn-back {
    display: inline-block;
    margin: 1rem 2rem;
    padding: 0.6rem 1.4rem;
    background: #0984e3;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: #0773c5;
    transform: translateY(-1px);
}

.error-msg {
    margin: 1rem 2rem;
    padding: 1rem 1.5rem;
    background: #fff0f0;
    border-radius: 10px;
    color: #d63031;
    border-left: 4px solid #d63031;
    font-weight: 500;
}

/* =========================
   RELEVÉ BANCAIRE / LETTRAGE
   ========================= */
.rl-layout {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 2rem;
    align-items: flex-start;
}

.rl-sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 1rem;
}

.rl-upload {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
}

.rl-upload h3,
.rl-list h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rl-upload-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.rl-upload-form .btn-submit {
    align-self: flex-start;
}

.rl-list {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.rl-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    color: #2d3436;
    transition: background 0.15s ease;
    margin-bottom: 0.3rem;
}

.rl-item:hover {
    background: #f0f8ff;
}

.rl-item.active {
    background: #eef5ff;
    border-left: 3px solid #0984e3;
}

.rl-item-date {
    font-size: 0.75rem;
    color: #636e72;
    font-weight: 500;
}

.rl-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rl-item-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    flex-shrink: 0;
}

.rl-item-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: #dfe6e9;
    color: #636e72;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

.rl-item-badge-ok {
    background: #d4edda;
    color: #155724;
}

.rl-item-complete {
    background: #e6f9f0 !important;
}

.rl-item-complete.active {
    background: #d4f5e3 !important;
}

.rl-item-complete.active .rl-item-date {
    color: inherit !important;
}

.rl-item-complete .rl-item-date {
    color: #155724 !important;
}

.rl-item-check {
    color: #00b894;
    font-weight: 700;
    font-size: 0.9rem;
    margin-left: auto;
    flex-shrink: 0;
}

.rl-main {
    flex: 1;
    min-width: 0;
}

.rl-header {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.rl-header-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1a1a2e;
}

.rl-table {
    width: 100%;
    border-collapse: collapse;
}

.rl-date {
    text-align: center;
    font-family: 'Consolas', 'Courier New', monospace;
    white-space: nowrap;
}

.rl-table tbody tr.rl-reconciled {
    background: #f0fff4 !important;
}

.rl-table tbody tr.rl-reconciled td:not(.rl-amount) {
    color: #2d6a4f;
}

.rl-th-right {
    text-align: right;
}

.rl-th-center {
    text-align: center;
}

.rl-td-center {
    text-align: center;
}

.rl-amount {
    font-family: 'Consolas', 'Courier New', monospace;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.rl-amount.positif,
td .positif {
    color: #00b894;
}

.rl-amount.negatif,
td .negatif {
    color: #d63031;
}

.rl-sign {
    display: none;
}

.rl-match-select {
    padding: 0.3rem 0.5rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    background: #fafbfc;
    max-width: 280px;
    width: 100%;
}

.rl-match-select option.rl-suggested {
    background: #fff3cd;
    font-weight: 600;
}

.rl-matched-label {
    font-size: 0.85rem;
    color: #2d3436;
    vertical-align: middle;
}

.rl-unlink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #fff0f0;
    color: #d63031;
    text-decoration: none;
    font-size: 0.75rem;
    margin-left: 0.4rem;
    transition: all 0.15s ease;
    vertical-align: middle;
}

.rl-unlink:hover {
    background: #d63031;
    color: #fff;
}

.rl-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rl-badge-ok {
    background: #d4edda;
    color: #155724;
}

.rl-badge-suggest {
    background: #fff3cd;
    color: #856404;
}

.rl-badge-pending {
    background: #e2e3e5;
    color: #383d41;
}

.rl-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-top: 0.5rem;
}

.no-data {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: #636e72;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

@media (max-width: 900px) {
    .rl-layout {
        flex-direction: column;
    }

    .rl-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }
}

/* =========================
   LETTRAGE CHECK
   ========================= */
.th-check {
    width: 2rem;
}

.td-check {
    text-align: center;
    width: 2rem;
}

.check-ok {
    color: #00b894;
    font-size: 1.1rem;
}

.row-lettre {
    background-color: #e6f9f0 !important;
}

.row-lettre td {
    color: #155724;
}

.row-lettre:nth-child(even) {
    background-color: #d4f5e3 !important;
}

.row-lettre:hover {
    background-color: #b8e8ca !important;
}

/* =========================
   GROUPE SECTIONS (Accueil)
   ========================= */
.groupe-section {
    margin: 1.5rem 2rem 1rem;
}

.groupe-titre {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #eef5ff, #f8f9fa);
    border-left: 4px solid #0984e3;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.groupe-logo {
    height: 28px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    vertical-align: middle;
}

.op-logo {
    height: 48px;
    max-width: 140px;
}

.banque-nav-logo {
    height: 28px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
}

/* =========================
   ADMIN PAGE
   ========================= */
.admin-section {
    margin: 1.5rem 2rem;
}

.admin-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #0984e3;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.admin-table thead {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.admin-table thead th {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.8rem 1rem;
    text-align: left;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f0f8ff;
}

.inline-form {
    margin: 0;
    padding: 0;
    display: inline;
}

.btn-add {
    background: #0984e3;
    color: #fff;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.btn-cancel {
    background: transparent;
    color: #636e72;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
}

.btn-action {
    background: transparent;
    color: #1a1a2e;
    border: 1px solid #dfe6e9;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-action:hover {
    background: #0984e3;
    color: #fff;
    border-color: #0984e3;
}

.btn-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.input-small {
    width: 70px;
    padding: 0.4rem 0.5rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    background: #fafbfc;
}

.input-small:focus {
    border-color: #0984e3;
    background: #fff;
    outline: none;
}

.input-medium {
    width: 160px;
    padding: 0.4rem 0.5rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fafbfc;
}

.input-medium:focus {
    border-color: #0984e3;
    background: #fff;
    outline: none;
}

.input-text {
    padding: 0.4rem 0.7rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fafbfc;
}

.input-text:focus {
    border-color: #0984e3;
    background: #fff;
    outline: none;
}

.btn-small {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.logo-preview {
    height: 32px;
    max-width: 80px;
    object-fit: contain;
}

.logo-preview-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.td-logo-cell {
    white-space: nowrap;
}

.no-logo {
    color: #b2bec3;
    font-size: 1.2rem;
}

.logo-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-actions-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-standalone {
    display: inline;
}

.logo-upload-form {
    display: inline;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    background: #eef5ff;
    color: #0984e3;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.btn-upload:hover {
    background: #0984e3;
    color: #fff;
}

.btn-upload input[type="file"] {
    display: none;
}

.admin-save {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    text-align: right;
}

.admin-save-inline {
    margin-top: 0.5rem;
    text-align: right;
}

.td-actions {
    overflow: visible !important;
    white-space: nowrap;
}

.td-logo {
    position: relative;
    vertical-align: top;
}

.logo-actions-inline {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.btn-tiny {
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   RESPONSIVE ADMIN
   ========================= */
@media (max-width: 900px) {
    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table thead th,
    .admin-table tbody td {
        padding: 0.4rem 0.5rem;
    }

    .input-medium {
        width: 120px;
    }

    .groupe-section {
        margin: 1rem 1rem;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    min-width: 350px;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.modal-box h3 {
    margin: 0 0 1rem;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed #dfe6e9;
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    text-align: center;
}

.file-input-wrapper:hover {
    border-color: #0984e3;
    background: #fff;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-input-text {
    font-size: 0.9rem;
    color: #636e72;
}

.file-input-wrapper.has-file {
    border-color: #00b894;
    border-style: solid;
    background: #fff;
}
