/* AMS — styles complémentaires à Bootstrap 5 */

:root {
    --ams-navy: #0d3b66;
    --ams-navy-dark: #092a49;
}

/* ---------- Pages d'authentification ---------- */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--ams-navy) 0%, #1b6ca8 100%);
}
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
}
.auth-wrapper > p { color: rgba(255, 255, 255, .75) !important; }
.auth-card { width: 100%; max-width: 420px; border-radius: 1rem; }
.auth-logo {
    width: 56px; height: 56px; margin: 0 auto;
    display: grid; place-items: center;
    border-radius: 14px;
    background: var(--ams-navy); color: #fff; font-size: 1.6rem;
}
.otp-input { letter-spacing: .6em; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Indicateur de robustesse : largeur selon data-score (pas de style inline, cf. CSP) */
.pw-meter { height: 4px; }
.pw-meter .progress-bar { width: 0; transition: width .2s; }
.pw-meter .progress-bar[data-score="1"] { width: 20%; }
.pw-meter .progress-bar[data-score="2"] { width: 40%; }
.pw-meter .progress-bar[data-score="3"] { width: 60%; }
.pw-meter .progress-bar[data-score="4"] { width: 80%; }
.pw-meter .progress-bar[data-score="5"] { width: 100%; }

/* ---------- Application ---------- */
.app-navbar { background: var(--ams-navy); }
.app-navbar .nav-link.active { background: rgba(255, 255, 255, .12); border-radius: .375rem; }
.app-navbar .nav-link.disabled { color: rgba(255, 255, 255, .4); }
.avatar-circle {
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-grid; place-items: center;
    background: #fff; color: var(--ams-navy); font-weight: 700; font-size: .8rem;
}

/* Cartes indicateurs */
.kpi-card .card-body { padding: 1rem; }
.kpi-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center; font-size: 1.1rem; margin-bottom: .6rem;
}
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .8rem; color: var(--bs-secondary-color); }

/* Zones de graphiques à hauteur fixe (Chart.js responsive) */
.chart-box { position: relative; height: 240px; }
.chart-box-wide { height: 280px; }

.table > :not(caption) > * > * { padding-top: .55rem; padding-bottom: .55rem; }

/* ---------- Module Assets ---------- */
.btn-sort {
    border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: inherit;
    white-space: nowrap;
}
.btn-sort::after { content: "\F127"; font-family: "bootstrap-icons"; font-size: .7rem; margin-left: .3rem; opacity: .3; }
.btn-sort.sorted[data-dir="asc"]::after { content: "\F235"; opacity: 1; }
.btn-sort.sorted[data-dir="desc"]::after { content: "\F229"; opacity: 1; }

.form-section {
    font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--bs-secondary-color); border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: .35rem; margin-bottom: .9rem;
}
.asset-icon {
    width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
    background: var(--ams-navy); color: #fff; font-size: 1.5rem;
}
.detail-list dt { font-weight: 500; color: var(--bs-secondary-color); }
.detail-list dd { margin-bottom: .5rem; }
.text-pre-wrap { white-space: pre-wrap; }
.change-list { padding-left: 1rem; color: var(--bs-body-color); }
.change-list del { color: var(--bs-danger-text-emphasis); }

/* Barre d'amortissement (<progress> : pas de style inline, cf. CSP) */
.depr-bar { height: 8px; appearance: none; border: 0; border-radius: 4px; background: var(--bs-secondary-bg); }
.depr-bar::-webkit-progress-bar { background: var(--bs-secondary-bg); border-radius: 4px; }
.depr-bar::-webkit-progress-value { background: var(--bs-warning); border-radius: 4px; }
.depr-bar::-moz-progress-bar { background: var(--bs-warning); border-radius: 4px; }
.card > .table-responsive > .table > :not(caption) > tr > :first-child,
.card > .table-responsive > .table > * > tr > :first-child { padding-left: 1rem; }
.card > .table-responsive > .table > * > tr > :last-child { padding-right: 1rem; }
.btn-close-sm { width: .5em; height: .5em; padding: .15em; }

/* ---------- Impression ---------- */
@media print {
    .app-navbar, footer, .d-print-none, .toast-container { display: none !important; }
    body { background: #fff !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
    .report-block { break-inside: avoid; }
    a { text-decoration: none !important; color: inherit !important; }
}

/* ---------- Étiquettes QR (format A4, 3 × 7 étiquettes de 63,5 × 38,1 mm) ---------- */
.labels-sheet { display: grid; grid-template-columns: repeat(3, 63.5mm); grid-auto-rows: 38.1mm; gap: 0 2.5mm; justify-content: center; padding: 15mm 0; }
.label {
    border: 1px dashed #ced4da; padding: 2.5mm; display: flex; gap: 2.5mm; align-items: center; overflow: hidden;
    font-family: Arial, Helvetica, sans-serif; color: #000;
}
.label-qr { width: 30mm; height: 30mm; flex: 0 0 30mm; }
.label-qr svg { width: 100%; height: 100%; }
.label-text { font-size: 7.5pt; line-height: 1.25; min-width: 0; }
.label-tag { font-size: 11pt; font-weight: 700; margin-bottom: 1mm; }
.label-text div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.labels-toolbar { padding: 1rem; text-align: center; }
@media print {
    @page { size: A4; margin: 0; }
    .labels-toolbar { display: none; }
    .label { border-color: transparent; }
}
a.kpi-card { transition: transform .12s, box-shadow .12s; }
a.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important; }
