/* SIGLDA GED — thème institutionnel */
:root {
    --siglda-blue: #0033A0;
    --siglda-blue-hover: #002880;
    --siglda-blue-soft: rgba(0, 51, 160, 0.08);
    --siglda-urgent: #c0392b;
    --siglda-warning: #e67e22;
    --siglda-ok: #27ae60;
    --siglda-muted: #6c757d;
}

.siglda-text-primary {
    color: var(--siglda-blue) !important;
}

.siglda-breadcrumb-title {
    color: var(--siglda-blue);
    border-color: rgba(0, 51, 160, 0.2) !important;
}

/* Boutons de validation (enregistrer, valider, soumettre) */
.btn-siglda-validate {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--siglda-blue);
    --bs-btn-border-color: var(--siglda-blue);
    --bs-btn-hover-bg: var(--siglda-blue-hover);
    --bs-btn-hover-border-color: var(--siglda-blue-hover);
    --bs-btn-focus-shadow-rgb: 0, 51, 160;
    --bs-btn-active-bg: var(--siglda-blue-hover);
    --bs-btn-active-border-color: var(--siglda-blue-hover);
}

.btn-siglda-outline {
    color: var(--siglda-blue);
    border-color: var(--siglda-blue);
    background: #fff;
}

.btn-siglda-outline:hover {
    color: #fff;
    background: var(--siglda-blue);
    border-color: var(--siglda-blue);
}

/* Cartes et en-têtes de page GED */
.siglda-ged-card {
    border: 1px solid rgba(0, 51, 160, 0.12);
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 51, 160, 0.06);
}

.siglda-ged-card .card-header {
    background: linear-gradient(90deg, var(--siglda-blue-soft), transparent);
    border-bottom: 1px solid rgba(0, 51, 160, 0.1);
    font-weight: 600;
    color: var(--siglda-blue);
}

/* Badges urgence */
.badge-siglda-priorite-basse {
    background: #95a5a6;
    color: #fff;
}

.badge-siglda-priorite-normale {
    background: #3498db;
    color: #fff;
}

.badge-siglda-priorite-urgente {
    background: var(--siglda-urgent);
    color: #fff;
}

.badge-siglda-priorite-confidentielle {
    background: #8e44ad;
    color: #fff;
}

/* Badges statut workflow / courrier */
.badge-siglda-statut-enregistre {
    background: #7f8c8d;
    color: #fff;
}

.badge-siglda-statut-affecte {
    background: #8e44ad;
    color: #fff;
}

.badge-siglda-statut-encours {
    background: #2980b9;
    color: #fff;
}

.badge-siglda-statut-cloture {
    background: var(--siglda-ok);
    color: #fff;
}

.badge-siglda-statut-archive {
    background: #34495e;
    color: #fff;
}

.badge-siglda-statut-bloque {
    background: #c0392b;
    color: #fff;
}

.siglda-ged-alert {
    border-left: 4px solid var(--siglda-blue);
    background: var(--siglda-blue-soft);
    color: #212529;
    border-radius: 0.375rem;
}

/* Conteneur pages GED / courrier */
.page-wrapper-custom {
    max-width: 1200px;
    margin: 0 auto;
}

.module-shell.page-content.ged-siglda-page,
.page-content.ged-siglda-page {
    background: linear-gradient(180deg, #f4f7fc 0%, #eef3fa 100%);
}

/* Inbox / liste courriers — dernière version SIGLDA */
.gcourrier-hero {
    border: 1px solid rgba(0, 51, 160, 0.1);
    border-radius: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f6f9ff 55%, #eef4ff 100%);
    box-shadow: 0 14px 34px rgba(0, 51, 160, 0.08);
}

.gcourrier-hero__title {
    font-family: "Plus Jakarta Sans", "Manrope", Arial, sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #10233f;
}

.gcourrier-hero__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.gcourrier-kpi {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 51, 160, 0.08);
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
}

.gcourrier-kpi__label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7a90;
}

.gcourrier-kpi__value {
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #11284b;
}

.gcourrier-panel {
    border: 1px solid rgba(14, 30, 64, 0.08);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.gcourrier-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(90deg, var(--siglda-blue-soft), transparent);
}

.gcourrier-panel__body {
    padding: 1.2rem;
}

.gcourrier-mailbox-nav .btn-siglda-validate {
    box-shadow: 0 6px 14px rgba(0, 51, 160, 0.18);
}

.gcourrier-list-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5b6b82;
    white-space: nowrap;
}

.gcourrier-list-row:hover {
    background: rgba(0, 51, 160, 0.035);
}

.gcourrier-help {
    background: #f7faff;
    border: 1px dashed rgba(0, 51, 160, 0.22);
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
}

.gcourrier-dropzone {
    position: relative;
    border: 1.5px dashed rgba(0, 51, 160, 0.28);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(0, 51, 160, 0.03), rgba(0, 51, 160, 0.01));
    padding: 1rem;
}

.gcourrier-dropzone input[type=file] {
    min-height: 44px;
}

.gcourrier-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.9rem;
}

.gcourrier-doc-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.95rem;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.gcourrier-doc-card__icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 51, 160, 0.08);
    color: var(--siglda-blue);
    font-size: 1.35rem;
}

.gcourrier-timeline {
    position: relative;
    padding-left: 1rem;
}

.gcourrier-timeline::before {
    content: "";
    position: absolute;
    left: 0.28rem;
    top: 0.3rem;
    bottom: 0.3rem;
    width: 2px;
    background: rgba(0, 51, 160, 0.12);
}

.gcourrier-timeline__item {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.gcourrier-timeline__item::before {
    content: "";
    position: absolute;
    left: -0.04rem;
    top: 0.45rem;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--siglda-blue);
}

.gcourrier-actions-stack .btn {
    text-align: left;
}

.gcourrier-step-mini {
    display: flex;
    align-items: center;
    gap: 0.28rem;
}

.gcourrier-step-mini__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #e2e8f0;
    display: inline-block;
}

.gcourrier-step-mini__dot--done {
    background: var(--siglda-blue);
}

.gcourrier-step-mini__dot--current {
    background: #fff;
    border: 2px solid var(--siglda-blue);
    box-shadow: 0 0 0 2px rgba(0, 51, 160, 0.12);
}

/* Icône init catalogues dans la barre SIGLDA */
.ged-seed-icon-btn {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    border: 1px solid rgba(0, 51, 160, 0.2);
    background: #fff;
    color: var(--siglda-blue);
    box-shadow: 0 4px 12px rgba(0, 51, 160, 0.08);
}

.ged-seed-icon-btn:hover:not(:disabled) {
    background: var(--siglda-blue-soft);
    border-color: var(--siglda-blue);
}

.ged-seed-icon-btn:disabled {
    opacity: 0.65;
}

.ged-seed-icon-btn i {
    font-size: 1.15rem;
}

/* ── GDocument / DMS ───────────────────────────────────────── */
.ged-dms-root {
    max-width: 1440px;
}

.ged-dms-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem 1.35rem;
    border: 1px solid rgba(0, 51, 160, 0.1);
    border-radius: 1rem;
    background:
        radial-gradient(1200px 280px at 0% 0%, rgba(0, 51, 160, 0.08), transparent 55%),
        linear-gradient(135deg, #ffffff 0%, #f7f9ff 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.ged-dms-head-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.ged-dms-head__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--siglda-blue);
    margin: 0;
}

.ged-dms-head__title {
    font-family: "Plus Jakarta Sans", "Manrope", Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #10233f;
    margin: 0;
}

.ged-dms-head__sub {
    color: #64748b;
    font-size: 0.92rem;
}

.ged-dms-head__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.ged-dms-stat {
    min-width: 5.4rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 51, 160, 0.08);
    text-align: center;
}

.ged-dms-stat--muted {
    opacity: 0.85;
}

.ged-dms-stat__n {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #11284b;
    line-height: 1.1;
}

.ged-dms-stat__l {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7a90;
}

.ged-dms-toast {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.95rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.ged-dms-toast i {
    font-size: 1.15rem;
}

.ged-dms-toast--ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.ged-dms-toast--warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.ged-dms-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 300px;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1199.98px) {
    .ged-dms-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
    .ged-dms-layout__inspector {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991.98px) {
    .ged-dms-layout {
        grid-template-columns: 1fr;
    }
}

.ged-dms-workspace {
    border: none;
    padding: 0.5rem;
}

.ged-dms-workspace__item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-radius: 0.7rem;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.ged-dms-workspace__item:hover {
    background: rgba(0, 51, 160, 0.06);
}

.ged-dms-workspace__item--active {
    background: linear-gradient(135deg, rgba(0, 51, 160, 0.12), rgba(0, 51, 160, 0.05));
    color: var(--siglda-blue);
    box-shadow: inset 0 0 0 1px rgba(0, 51, 160, 0.12);
}

.ged-dms-workspace__item--danger {
    color: #b91c1c;
}

.ged-dms-workspace__item--danger.ged-dms-workspace__item--active {
    background: rgba(185, 28, 28, 0.08);
    color: #991b1b;
    box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.15);
}

.ged-dms-workspace__count {
    min-width: 1.6rem;
    height: 1.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #334155;
}

.ged-dms-workspace__item--active .ged-dms-workspace__count {
    background: var(--siglda-blue);
    color: #fff;
}

.ged-type-chip {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 0.65rem;
    padding: 0.4rem 0.55rem;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ged-type-chip:hover {
    border-color: rgba(0, 51, 160, 0.18);
    background: #f8fafc;
}

.ged-type-chip--active {
    border-color: rgba(0, 51, 160, 0.28);
    background: rgba(0, 51, 160, 0.06);
    box-shadow: 0 4px 12px rgba(0, 51, 160, 0.08);
}

.ged-dms-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.ged-dms-search {
    flex: 1 1 220px;
    min-width: 0;
}

.ged-dms-search .input-group-text {
    background: #fff;
    border-color: #dbe3f0;
    color: var(--siglda-blue);
}

.ged-dms-search .form-control {
    border-color: #dbe3f0;
    box-shadow: none !important;
}

.ged-dms-view-toggle .btn {
    min-width: 2.4rem;
}

.ged-dms-file-ico {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.ged-dms-file-ico--sm {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    font-size: 1rem;
}

.ged-dms-file-ico--pdf {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.ged-dms-file-ico--img {
    background: rgba(8, 145, 178, 0.12);
    color: #0e7490;
}

.ged-dms-file-ico--doc {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.ged-dms-file-ico--xls {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.ged-dms-file-ico--file {
    background: rgba(0, 51, 160, 0.08);
    color: var(--siglda-blue);
}

.gcourrier-doc-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border: 1px solid rgba(15, 23, 42, 0.08);
    cursor: pointer;
}

.gcourrier-doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    border-color: rgba(0, 51, 160, 0.2);
}

.ged-dms-card--selected {
    border-color: var(--siglda-blue) !important;
    box-shadow: 0 0 0 2px rgba(0, 51, 160, 0.15), 0 12px 24px rgba(0, 51, 160, 0.1) !important;
    background: linear-gradient(180deg, #fff 0%, #f5f8ff 100%);
}

.ged-dms-empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: #64748b;
    border: 1px dashed rgba(0, 51, 160, 0.2);
    border-radius: 1rem;
    background: #f8faff;
}

.ged-dms-empty i {
    font-size: 2.2rem;
    color: var(--siglda-blue);
    opacity: 0.55;
}

.ged-dms-table-wrap {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 0.85rem;
    overflow: hidden;
}

.ged-dms-table thead th {
    background: #f8fafc;
    border-bottom-width: 1px;
}

.ged-dms-row {
    cursor: pointer;
}

.ged-dms-row--selected {
    background: rgba(0, 51, 160, 0.07) !important;
}

.ged-dms-name {
    max-width: 280px;
}

.ged-dms-inspector {
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 8rem);
    display: flex;
    flex-direction: column;
}

.ged-dms-inspector .gcourrier-panel__body {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.ged-preview-box {
    border: 1px solid rgba(0, 51, 160, 0.1);
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #f8faff, #fff);
    padding: 1rem;
}

.ged-preview-box i {
    color: var(--siglda-blue) !important;
}

.ged-dms-rh {
    border: 1px solid rgba(14, 30, 64, 0.08);
    border-radius: 1rem;
    background: #fff;
    overflow: hidden;
}

.ged-dms-rh > summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.2rem;
    background: linear-gradient(90deg, rgba(0, 51, 160, 0.05), transparent);
    border-bottom: 1px solid transparent;
}

.ged-dms-rh[open] > summary {
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

.ged-dms-rh > summary::-webkit-details-marker {
    display: none;
}

.ged-dms-modal {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.ged-dms-modal .modal-content {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.ged-dms-modal .modal-header {
    background: linear-gradient(135deg, var(--siglda-blue) 0%, #1a4fc4 100%);
    color: #fff;
    border: none;
}

.ged-dms-modal .modal-header .btn-close {
    filter: invert(1);
}

.ged-dms-drop-hint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ged-dms-drop-hint > i {
    font-size: 1.75rem;
    color: var(--siglda-blue);
    opacity: 0.75;
}

@media (max-width: 767.98px) {
    .gcourrier-panel__header,
    .gcourrier-panel__body {
        padding: 1rem;
    }

    .ged-dms-head {
        padding: 1rem;
    }

    .ged-dms-name {
        max-width: 160px;
    }
}

