:root {
    --agent-green: #174c31;
    --agent-green-2: #28714a;
    --agent-gold: #c79c47;
    --agent-ink: #17231b;
    --agent-muted: #718078;
    --agent-border: #dfe8e2;
    --agent-surface: #ffffff;
    --agent-bg: #f3f7f4;
}

body {
    background: var(--agent-bg);
}

.main-content,
.page-content {
    background: var(--agent-bg);
}

.page-content {
    min-height: 100vh;
}

#page-topbar {
    border-bottom: 1px solid #e4ebe6;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 4px 18px rgba(23, 49, 31, .045);
    backdrop-filter: blur(12px);
}

.app-menu.navbar-menu {
    background:
        radial-gradient(circle at 20% 0, rgba(199, 156, 71, .16), transparent 25%),
        linear-gradient(180deg, #143b27, #102f20 62%, #0d281b);
    border-right: 0;
    box-shadow: 9px 0 28px rgba(13, 40, 27, .12);
}

.app-menu .navbar-brand-box {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .035);
}

.app-menu .menu-title span {
    color: rgba(255, 255, 255, .38) !important;
    font-size: 9px;
    letter-spacing: .12em;
}

.app-menu .navbar-nav .nav-link {
    margin: 2px 10px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, .67);
    border-radius: 10px;
    transition: .18s ease;
}

.app-menu .navbar-nav .nav-link i {
    color: rgba(255, 255, 255, .55);
}

.app-menu .navbar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .075);
}

.app-menu .navbar-nav .nav-link.active,
.app-menu .navbar-nav .nav-link[aria-expanded="true"] {
    color: #fff;
    background: linear-gradient(100deg, rgba(199, 156, 71, .27), rgba(255, 255, 255, .09));
    box-shadow: inset 3px 0 0 var(--agent-gold);
}

.app-menu .navbar-nav .nav-link.active i,
.app-menu .navbar-nav .nav-link[aria-expanded="true"] i {
    color: #f1cf84;
}

.app-menu .menu-dropdown {
    margin: 3px 10px 7px;
    padding: 4px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .12);
}

.app-menu .menu-dropdown .nav-link {
    margin: 1px 0;
    padding: 8px 10px 8px 38px;
    font-size: 11px;
}

/* Télédéclaration : conserver les sous-menus proches du bord pour les libellés longs. */
#agentTeledeclarationMenu {
    margin-right: 8px;
    margin-left: 8px;
    padding: 3px;
}

#agentTeledeclarationMenu > .nav-sm {
    padding-left: 0;
}

#agentTeledeclarationMenu > .nav-sm > .nav-item > .nav-link {
    padding-right: 18px !important;
    padding-left: 14px !important;
}

#agentEmployeursMenu {
    margin-right: 0;
    margin-left: 5px;
    padding: 2px;
}

#agentEmployeursMenu .nav-sm {
    padding-left: 0;
}

#agentEmployeursMenu .nav-link {
    padding-right: 12px !important;
    padding-left: 18px !important;
    white-space: normal;
}

.sidebar-brand-copy strong {
    color: #fff !important;
}

.sidebar-brand-copy small {
    color: rgba(255, 255, 255, .52) !important;
}

.page-title-box {
    margin: 0 0 18px;
    padding: 18px 20px;
    border: 1px solid var(--agent-border);
    border-radius: 16px;
    background: linear-gradient(100deg, #fff, #f5faf6);
    box-shadow: 0 8px 24px rgba(25, 53, 34, .05);
}

.page-title-box h4 {
    color: var(--agent-ink) !important;
    font-size: 18px;
    font-weight: 700;
    text-transform: none;
}

.card {
    border: 1px solid var(--agent-border);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(25, 50, 32, .055);
}

.card-header {
    border-color: #e8eeea;
    border-radius: 16px 16px 0 0 !important;
    background: #f8faf8;
}

.btn {
    border-radius: 9px;
}

.btn-success,
.bg-success {
    border-color: var(--agent-green-2) !important;
    background-color: var(--agent-green-2) !important;
}

.btn-soft-success {
    color: var(--agent-green-2);
    background: #e8f4ec;
}

.form-control,
.form-select {
    min-height: 40px;
    border-color: #dbe5de;
    border-radius: 10px;
}

/* Aperçu plein écran des déclarations dans l’espace agent. */
.declaration-preview-modal .modal-content {
    height: 100vh;
    overflow: hidden;
    border: 0;
    border-radius: 0;
}

.declaration-preview-modal .modal-header {
    flex: 0 0 66px;
    min-height: 66px;
    padding: 10px 18px;
    color: #fff;
    background: #071f3a;
    border: 0;
}

.declaration-preview-modal .modal-title {
    overflow: hidden;
    color: #fff;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.declaration-preview-modal .modal-body {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #cfd7e0;
}

.declaration-preview-modal iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #cfd7e0;
    opacity: 1;
    transition: opacity .15s ease;
}

.declaration-preview-modal iframe.is-loading {
    opacity: 0;
}

.declaration-preview-loading {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    place-items: center;
    background: #e7edf3;
}

.declaration-preview-loading > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #173d66;
}

@media (max-width: 700px) {
    .declaration-preview-modal .modal-header {
        align-items: flex-start;
        min-height: 112px;
    }

    .declaration-preview-modal .modal-header > .d-flex {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

/* Modal "Compte cotisant" : plus petit qu'un plein écran, coins arrondis, ombre douce */
.compte-cotisant-modal .modal-dialog {
    max-width: 1420px;
    height: 94vh;
    margin: 3vh auto;
}

.compte-cotisant-modal .modal-content {
    height: 94vh;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(10, 30, 55, .28);
}

.compte-cotisant-modal .modal-header {
    flex: 0 0 60px;
    min-height: 60px;
    background: linear-gradient(120deg, #071f3a, #0c4f8a 70%, #1267a8);
}

@media (max-width: 1480px) {
    .compte-cotisant-modal .modal-dialog { max-width: 97vw; }
}

/* Tableau de bord Télédéclaration */
.td-dashboard { --td-navy:#071f3a; --td-blue:#0b4d87; --td-cyan:#1086a5; --td-violet:#5a4bb5; --td-gold:#b77a16; }
.td-dashboard-hero { position:relative; display:flex; align-items:flex-end; justify-content:space-between; gap:24px; overflow:hidden; padding:30px 32px; color:#fff; border-radius:22px; background:radial-gradient(circle at 88% 18%,rgba(68,166,229,.36),transparent 23%),linear-gradient(125deg,#061a31,#0a3867 62%,#0a568f); box-shadow:0 20px 45px rgba(4,34,65,.2); }
.td-dashboard-hero::after { position:absolute; right:-70px; bottom:-110px; width:270px; height:270px; border:38px solid rgba(255,255,255,.055); border-radius:50%; content:""; }
.td-dashboard-hero > * { position:relative; z-index:1; }
.td-dashboard-hero h1 { margin:10px 0 7px; color:#fff!important; font-size:clamp(24px,3vw,34px); font-weight:800; }
.td-dashboard-hero p { max-width:720px; margin:0; color:rgba(255,255,255,.75); font-size:13px; }
.td-eyebrow { display:inline-flex; align-items:center; gap:7px; color:#9ed9ff; font-size:10px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.td-hero-meta { display:flex; flex-wrap:wrap; gap:16px; margin-top:18px; color:rgba(255,255,255,.78); font-size:11px; }
.td-hero-meta span { display:flex; align-items:center; gap:6px; }
.td-hero-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; min-width:330px; }
.td-hero-actions .btn { position:relative; z-index:2; padding:10px 14px; }
.td-kpi { display:flex; align-items:center; gap:14px; height:100%; min-height:132px; padding:18px; color:#23384b; border:1px solid #e0e8f0; border-radius:18px; background:#fff; box-shadow:0 9px 28px rgba(18,52,82,.07); transition:transform .18s ease,box-shadow .18s ease; }
a.td-kpi:hover { color:#23384b; transform:translateY(-3px); box-shadow:0 14px 34px rgba(18,52,82,.12); }
.td-kpi-icon { display:grid; flex:0 0 50px; place-items:center; width:50px; height:50px; color:#fff; border-radius:15px; font-size:24px; box-shadow:0 9px 18px rgba(0,0,0,.13); }
.td-kpi-blue .td-kpi-icon { background:linear-gradient(135deg,#0b3866,#1072b5); }.td-kpi-cyan .td-kpi-icon { background:linear-gradient(135deg,#08738b,#18a3b7); }.td-kpi-violet .td-kpi-icon { background:linear-gradient(135deg,#40328f,#7668d0); }.td-kpi-gold .td-kpi-icon { background:linear-gradient(135deg,#9e640c,#d9a237); }
.td-kpi div { min-width:0; }.td-kpi small,.td-kpi em { display:block; color:#7a8997; font-size:10px; font-style:normal; }.td-kpi strong { display:block; margin:3px 0; color:#102b45; font-size:25px; line-height:1.1; }.td-kpi em { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.td-panel { padding:21px; border:1px solid #e0e8f0; border-radius:19px; background:#fff; box-shadow:0 9px 28px rgba(18,52,82,.06); }
.td-panel-head { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:19px; }.td-panel-head span { color:#2082b4; font-size:9px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }.td-panel-head h2 { margin:3px 0 0; color:#142f49; font-size:17px; font-weight:800; }.td-panel-head > a { color:#35759e; font-size:10px; font-weight:700; }.td-panel-head > small { color:#748595; font-size:10px; }
.td-status-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }.td-status-card { padding:14px; color:#31475b; border:1px solid #e7edf2; border-radius:14px; background:#fbfcfd; transition:.16s ease; }.td-status-card:hover { color:#183d60; border-color:#b9d3e6; transform:translateY(-2px); }.td-status-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:9px; }.td-status-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; font-size:17px; }.td-status-top strong { color:#142f49; font-size:19px; }.td-status-card > span { font-size:11px; font-weight:700; }.td-status-card small { color:#84919d; font-size:9px; }.td-progress { height:5px; margin:9px 0 5px; overflow:hidden; border-radius:9px; background:#e9eef2; }.td-progress i { display:block; height:100%; min-width:2px; border-radius:inherit; }
.td-employer-health { display:grid; grid-template-columns:140px 1fr; align-items:center; gap:18px; }.td-health-ring { display:grid; place-items:center; width:140px; height:140px; border-radius:50%; background:conic-gradient(#16845a calc(var(--active-rate)*1%),#e7edf1 0); }.td-health-ring::before { position:absolute; width:100px; height:100px; border-radius:50%; background:#fff; content:""; }.td-health-ring div { position:relative; z-index:1; text-align:center; }.td-health-ring strong,.td-health-ring small { display:block; }.td-health-ring strong { color:#123552; font-size:22px; }.td-health-ring small { color:#84919d; font-size:9px; text-transform:uppercase; }.td-health-list { display:flex; flex-direction:column; gap:4px; }.td-health-list a { display:grid; grid-template-columns:8px 1fr auto; align-items:center; gap:8px; padding:7px 4px; color:#526371; border-bottom:1px solid #eef2f5; font-size:10px; }.td-health-list i { width:7px; height:7px; border-radius:50%; }.td-health-list strong { color:#173650; font-size:12px; }
.td-registration-alert { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:11px; margin-top:20px; padding:13px; color:#23425b; border:1px solid #d8e9f3; border-radius:13px; background:#f0f8fc; }.td-registration-alert > span { display:grid; place-items:center; width:37px; height:37px; color:#fff; border-radius:11px; background:#1679a7; font-size:18px; }.td-registration-alert strong,.td-registration-alert small { display:block; }.td-registration-alert strong { font-size:11px; }.td-registration-alert small { color:#718493; font-size:9px; }.td-registration-alert > a { color:#1679a7; font-size:19px; }
.td-chart { display:flex; align-items:flex-end; gap:14px; min-height:238px; padding:12px 8px 0; border-bottom:1px solid #dfe7ed; }.td-chart-column { display:flex; flex:1; flex-direction:column; align-items:center; min-width:44px; }.td-chart-value { height:20px; color:#5c7182; font-size:9px; font-weight:700; }.td-chart-track { display:flex; align-items:flex-end; width:min(52px,72%); height:150px; overflow:hidden; border-radius:9px 9px 3px 3px; background:#eff4f7; }.td-chart-track i { display:block; width:100%; border-radius:9px 9px 3px 3px; background:linear-gradient(180deg,#1c91ca,#0b477d); }.td-chart-column strong { margin-top:8px; color:#183954; font-size:11px; }.td-chart-column small { color:#8a98a3; font-size:8px; }
.td-localities { display:flex; flex-direction:column; }.td-localities > div { display:grid; grid-template-columns:30px 1fr auto; align-items:center; gap:10px; padding:9px 2px; border-bottom:1px solid #eef2f5; }.td-localities > div:last-child { border-bottom:0; }.td-rank { display:grid; place-items:center; width:27px; height:27px; color:#3379a5; border-radius:8px; background:#e9f3f9; font-size:10px; font-weight:800; }.td-localities strong,.td-localities small { display:block; }.td-localities strong { color:#28445b; font-size:11px; }.td-localities small { color:#8996a0; font-size:9px; }.td-localities em { color:#163b59; font-size:12px; font-style:normal; font-weight:800; }
.td-latest-table thead th { color:#7b8995; background:#f6f9fb!important; font-size:9px; }.td-latest-table tbody td { font-size:10px; }.td-latest-table td strong,.td-latest-table td small { display:block; }.td-latest-table td strong { color:#243f55; font-size:11px; }.td-latest-table td small { color:#8a98a3; font-size:9px; }.td-empty { padding:35px!important; color:#8a98a3; text-align:center; }
@media (max-width:1199px) { .td-status-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.td-dashboard-hero { align-items:flex-start; flex-direction:column; }.td-hero-actions { justify-content:flex-start; min-width:0; } }
@media (max-width:620px) { .td-dashboard-hero { padding:24px 20px; }.td-status-grid { grid-template-columns:1fr; }.td-employer-health { grid-template-columns:1fr; justify-items:center; }.td-health-list { width:100%; }.td-chart { gap:6px; overflow-x:auto; }.td-chart-column { flex:0 0 55px; } }

.form-control:focus,
.form-select:focus {
    border-color: #65a67b;
    box-shadow: 0 0 0 3px rgba(40, 113, 74, .11);
}

.form-label {
    color: #4d5d53;
    font-size: 11px;
    font-weight: 650;
}

.table-responsive {
    border-radius: 13px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    padding: 11px 12px;
    color: #68766d;
    border-bottom: 1px solid #dfe7e1;
    background: #f4f8f5 !important;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .025em;
}

.table tbody td {
    padding: 12px;
    color: #35443a;
    border-color: #edf1ee;
    vertical-align: middle;
}

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

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #dbe5de !important;
    border-radius: 9px;
}

.dataTables_wrapper .page-link,
.pagination .page-link {
    color: var(--agent-green-2);
    border-color: #dfe7e1;
}

.dataTables_wrapper .active > .page-link,
.pagination .active > .page-link {
    color: #fff;
    border-color: var(--agent-green-2);
    background: var(--agent-green-2);
}

.chat-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.file-manager-content {
    padding: 0 !important;
}

.file-manager-content > [data-simplebar] {
    overflow: visible !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.file-manager-content > [data-simplebar] > .simplebar-wrapper,
.file-manager-content > [data-simplebar] .simplebar-content-wrapper {
    overflow: visible !important;
}

#folder-list > .row:first-child,
.file-manager-content .row.justify-content-beetwen {
    margin-bottom: 13px !important;
    padding: 18px 20px;
    border: 1px solid var(--agent-border);
    border-radius: 16px;
    background: linear-gradient(100deg, #fff, #f5faf6);
    box-shadow: 0 8px 24px rgba(25, 53, 34, .05);
}

#folder-list h5 {
    color: var(--agent-ink) !important;
    font-size: 17px !important;
    font-weight: 750;
    text-transform: none;
}

#folderlist-data {
    row-gap: 12px;
}

.folder-card {
    min-width: 250px;
}

.folder-card .card {
    position: relative;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--agent-border) !important;
    background: #fff !important;
    box-shadow: 0 8px 25px rgba(25, 50, 32, .055) !important;
    transition: .2s ease;
}

.folder-card .card:before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--agent-green-2), var(--agent-gold));
}

.folder-card .card:hover {
    transform: translateY(-4px);
    border-color: #b9d2c0 !important;
    box-shadow: 0 15px 32px rgba(25, 50, 32, .11) !important;
}

.folder-card .card-body {
    padding: 18px;
}

.folder-card .display-5 {
    color: var(--agent-gold) !important;
    filter: drop-shadow(0 5px 8px rgba(199, 156, 71, .2));
}

.folder-card .folder-name {
    color: #25342a !important;
    font-size: 12px !important;
}

.folder-card .hstack {
    padding-top: 11px;
    border-top: 1px solid #edf1ee;
    font-size: 10px;
}

.folder-card .btn-sm {
    position: relative;
    z-index: 2;
    float: right;
}

.alert {
    border: 0;
    border-radius: 12px;
}

.modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 22px 65px rgba(18, 39, 25, .19);
}

.modal-header {
    border-color: #e6ece8;
    background: #f7faf8;
}

.profile-foreground,
.profile-wid-bg {
    border-radius: 18px;
}

.fc .fc-toolbar-title {
    color: var(--agent-ink);
    font-size: 18px;
}

.fc .fc-button-primary {
    border-color: var(--agent-green-2) !important;
    background: var(--agent-green-2) !important;
}

.dropdown-menu {
    border: 1px solid #e1e8e3;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(24, 44, 31, .11);
}

.agent-employer-actions-floating {
    position: fixed !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 1090 !important;
}

@media (max-width: 767px) {
    .page-content .container-fluid {
        padding-right: 12px;
        padding-left: 12px;
    }

    .page-title-box,
    #folder-list > .row:first-child,
    .file-manager-content .row.justify-content-beetwen {
        padding: 15px;
    }

    .folder-card {
        width: 100%;
        min-width: 0;
    }

    .table-responsive {
        border: 1px solid var(--agent-border);
    }
}
