/* ── Global ─────────────────────────────────────────── */
body {
    background-color: #f0f2f5;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
}

/* ── Navbar ─────────────────────────────────────────── */
.app-navbar {
    background: #1a1f2e;
    padding: 0 1.5rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.app-navbar .brand {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    text-decoration: none;
}

.app-navbar .brand span {
    color: #7eb3f5;
}

.app-navbar nav a {
    color: #b8c4d8;
    font-size: 0.82rem;
    text-decoration: none;
    padding: 0 0.75rem;
    line-height: 52px;
    display: inline-block;
    transition: color .15s;
    white-space: nowrap;
}

.app-navbar nav a:hover {
    color: #fff;
}

.app-navbar nav a.nav-deconnect {
    color: #f08080;
}

.app-navbar nav a.nav-deconnect:hover {
    color: #fff;
}

@media (max-width: 991px) {
    /* Bouton hamburger visible */
    #nav-toggle {
        display: flex !important;
    }
    /* Navbar : flex-wrap pour que le menu passe en dessous */
    .app-navbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 52px;
        padding: 0 1rem;
    }
    .app-navbar .brand {
        flex: 1;
        line-height: 52px;
        padding: 0;
    }
    /* Nav masquée par défaut, pleine largeur, en dessous */
    #nav-links {
        display: none !important;
        width: 100%;
        order: 10;
        border-top: 1px solid rgba(255,255,255,.15);
        padding-bottom: 6px;
    }
    /* Nav visible quand ouverte */
    #nav-links.nav-open {
        display: block !important;
    }
    /* Liens en colonne */
    #nav-links a {
        display: block !important;
        line-height: 1 !important;
        padding: 11px 8px !important;
        border-bottom: 1px solid rgba(255,255,255,.1);
        white-space: normal;
    }
    #nav-links a:last-child {
        border-bottom: none;
    }
    .page-wrapper {
        padding: 1rem 0.75rem;
    }
    .page-title {
        font-size: 1.05rem;
        flex-wrap: wrap;
    }
}

/* ── Page wrapper ───────────────────────────────────── */
.page-wrapper {
    padding: 1.25rem 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ── Page title ─────────────────────────────────────── */
.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1f2e;
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title .page-subtitle {
    font-weight: 400;
    color: #6c757d;
    font-size: 1rem;
}

/* ── Section cards ──────────────────────────────────── */
.section-card {
    background: #ffffff;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.section-card .table-responsive {
    margin: 0;
}

.section-card h2 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: .75rem;
}

.section-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 .5rem;
}

.section-card table {
    width: 100%;
}

/* ── Document rows ──────────────────────────────────── */
.doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #f0f2f5;
}

.doc-row:last-of-type {
    border-bottom: none;
}

.doc-add-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f2f5;
}

/* ── Badges ─────────────────────────────────────────── */
.badge-non-public {
    background-color: #fff3cd;
    color: #856404;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

.badge-compat-c { background-color: #d1f2e0; color: #0a6b3f; }
.badge-compat-p { background-color: #fff3cd;  color: #856404; }
.badge-compat-r { background-color: #ffe5d0;  color: #a3501d; }
.badge-compat-n { background-color: #f8d7da;  color: #842029; }

/* ── Document add form ──────────────────────────────── */
.doc-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-add-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
    min-width: 110px;
}

.doc-add-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.doc-add-fields .form-control,
.doc-add-fields .form-select {
    height: 32px;
    font-size: 0.85rem;
    padding: 4px 8px;
}

.doc-add-fields input[type="text"] {
    min-width: 200px;
    flex: 1;
}

.doc-add-fields .form-select {
    min-width: 220px;
    flex: 2;
}

.form-control-file-custom {
    font-size: 0.82rem;
    color: #495057;
}

.doc-add-check {
    font-size: 0.82rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    margin: 0;
    cursor: pointer;
}

/* ── Périmètre tables ───────────────────────────────── */
#perimetre .table th,
#pointsop .table th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    border-bottom: 2px solid #e2e6ea;
    padding: 8px 6px;
    white-space: nowrap;
}

#perimetre .table td,
#pointsop .table td {
    vertical-align: middle;
    padding: 6px 6px;
    font-size: 0.85rem;
}

#perimetre .table input.form-control,
#pointsop .table input.form-control {
    height: 30px;
    font-size: 0.83rem;
    padding: 3px 6px;
}

#perimetre .table textarea,
#pointsop .table textarea {
    font-size: 0.83rem;
    rows: 2;
    min-height: 52px;
    resize: vertical;
}

.compat-radios {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compat-radios .form-check {
    margin: 0;
    padding-left: 1.4em;
    white-space: nowrap;
}

.compat-radios .form-check-label {
    font-size: 0.82rem;
    color: #495057;
}

.compat-radios .form-check-input {
    margin-top: 3px;
}

/* ── Harmonisation globale des pages standard ───────── */

/* Containers → même comportement que .page-wrapper */
.container,
.container-fluid {
    padding-top: 1.25rem;
    padding-bottom: 1rem;
    max-width: 1600px !important;
}

/* h1 des anciennes pages → style page-title */
.container > h1,
.container-fluid > h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1f2e;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards Bootstrap → style section-card */
.card {
    border: 1px solid #e2e6ea !important;
    border-radius: 10px !important;
    margin-bottom: 1rem;
    box-shadow: none !important;
}

.card-header {
    background: #ffffff !important;
    border-bottom: 1px solid #f0f2f5 !important;
    border-radius: 10px 10px 0 0 !important;
    padding: 0.75rem 1.25rem;
}

.card-header h3,
.card-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
}

/* Tables dans les cards */
.card .table th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    border-bottom: 2px solid #e2e6ea;
}

.card .table td {
    vertical-align: middle;
    font-size: 0.85rem;
}

/* Titres h2 en dehors des cards (pages avec section directe) */
.container > h2,
.container-fluid > h2 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    margin: 1.25rem 0 0.75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #e2e6ea;
}

/* Page de login centrée */
/* En-têtes colorés (dashboard index) */
.card-header-colored {
    background: var(--header-bg, #6c757d) !important;
    border-bottom: none !important;
    border-radius: 10px 10px 0 0 !important;
    padding: 0.5rem 1rem;
}
.card-header-colored,
.card-header-colored i,
.card-header-colored strong {
    color: var(--header-color, #fff) !important;
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 52px);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 1.5rem;
}
