/* Thème GROUPE AMS — bleu marine + accent bleu */
:root {
    --ams-navy: #15233f;
    --ams-navy-700: #1d3050;
    --ams-blue: #2563eb;
    --ams-blue-600: #1d4ed8;
    --ams-bg: #f5f7fa;
    --bs-primary: var(--ams-blue);
    --bs-primary-rgb: 37, 99, 235;
}

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

/* Navbar marine */
.navbar.bg-primary { background: var(--ams-navy) !important; }
.navbar-brand { letter-spacing: .5px; }
.navbar .nav-link.active { border-bottom: 2px solid var(--ams-blue); }

/* Boutons primaires en bleu AMS */
.btn-primary {
    --bs-btn-bg: var(--ams-blue);
    --bs-btn-border-color: var(--ams-blue);
    --bs-btn-hover-bg: var(--ams-blue-600);
    --bs-btn-hover-border-color: var(--ams-blue-600);
    --bs-btn-active-bg: var(--ams-blue-600);
}
.text-primary { color: var(--ams-blue) !important; }
.bg-primary { background-color: var(--ams-blue) !important; }
a { color: var(--ams-blue); }

/* Cartes */
.card { border-radius: .6rem; }
.card.shadow-sm { box-shadow: 0 1px 3px rgba(21,35,63,.08), 0 1px 2px rgba(21,35,63,.06) !important; }

/* Badges de statut */
.badge { font-weight: 600; }

/* Login */
.login-hero { background: linear-gradient(135deg, var(--ams-navy), var(--ams-navy-700)); }

/* ===== Sidebar back-office ===== */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 244px; flex-shrink: 0;
    background: var(--ams-navy); color: #c4cee0;
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
    transition: transform .22s ease;
}
.admin-sidebar .sidebar-brand {
    display: flex; align-items: center; gap: .5rem; justify-content: space-between;
    padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-collapse-btn {
    background: none; border: 0; color: #9fb0cc; font-size: 1.15rem; line-height: 1;
    cursor: pointer; padding: .15rem .4rem; border-radius: .35rem;
    align-items: center; justify-content: center;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar .nav-section { padding: .6rem 0; overflow-y: auto; flex: 1; }
.admin-sidebar .side-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .62rem 1.1rem; color: #c4cee0; text-decoration: none;
    font-size: .92rem; border-left: 3px solid transparent; white-space: nowrap;
}
.admin-sidebar .side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-sidebar .side-link.active {
    background: rgba(37,99,235,.20); color: #fff;
    border-left-color: var(--ams-blue); font-weight: 600;
}
.admin-sidebar .side-ico { width: 1.5rem; text-align: center; font-size: 1.05rem; line-height: 1; }
.admin-sidebar .sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding: .8rem 1.1rem; }
.admin-sidebar .sidebar-footer .side-link { padding: .5rem 0; }

.admin-main { flex: 1 1 auto; margin-left: 244px; min-width: 0; }
.admin-topbar { display: none; }
.sidebar-backdrop { display: none; }

/* Mode replié (icônes seules) — desktop uniquement */
@media (min-width: 992px) {
    .admin-shell.sidebar-collapsed .admin-sidebar { width: 70px; }
    .admin-shell.sidebar-collapsed .admin-main { margin-left: 70px; }
    .admin-shell.sidebar-collapsed .lbl { display: none; }
    .admin-shell.sidebar-collapsed .brand-logo { display: none !important; }
    .admin-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
    .admin-shell.sidebar-collapsed .side-link { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
    .admin-shell.sidebar-collapsed .side-ico { width: auto; font-size: 1.15rem; }
}

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); box-shadow: 0 0 30px rgba(0,0,0,.3); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-topbar {
        display: flex; align-items: center; gap: .6rem;
        background: var(--ams-navy); color: #fff;
        padding: .5rem .8rem; position: sticky; top: 0; z-index: 1030;
    }
    .admin-topbar .burger { background: none; border: 0; color: #fff; font-size: 1.4rem; line-height: 1; padding: .1rem .4rem; }
    .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; }
}

/* ===== En-tête de page ===== */
.page-head {
    display: flex; flex-wrap: wrap; gap: .6rem;
    justify-content: space-between; align-items: center;
}
.page-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.page-actions form { margin: 0; }

/* ===== Boutons (arrondis modernes) ===== */
.btn { border-radius: .5rem; font-weight: 500; }
.btn-sm { border-radius: .45rem; }

/* ===== Tableaux modernes ===== */
.card > .table-responsive { border-radius: .6rem; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
    color: #8089a0; font-weight: 600; border-bottom: 1px solid #e7ebf2;
    background: #fafbfd; white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .72rem .85rem; vertical-align: middle; }
.table tbody td { border-bottom: 1px solid #f0f3f8; }
.table-hover tbody tr { transition: background .12s ease; }
.table-hover tbody tr:hover { background: #f3f7fe; }
.table tbody tr:last-child td { border-bottom: 0; }

/* Cellule d'actions : alignée à droite, espacée, sans superposition */
.table td.text-end { white-space: nowrap; }
.table td.text-end .btn,
.table td.text-end form { margin-left: .3rem; vertical-align: middle; }
.table td.text-end form { display: inline-block; }

/* Lignes de filtres : champs plus discrets */
.filter-row th { background: #fff; border-bottom: 1px solid #e7ebf2; padding-top: .4rem; padding-bottom: .5rem; }
.filter-row .form-control, .filter-row .form-select { font-size: .82rem; }

/* App technicien (mobile) */
.tech-app { max-width: 520px; margin: 0 auto; }
.tech-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid #e5e9f0;
    display: flex; justify-content: space-around; padding: .4rem 0; z-index: 1030;
}
.tech-bottom-nav a { color: #6b7280; text-decoration: none; font-size: .72rem; text-align: center; }
.tech-bottom-nav a.active { color: var(--ams-blue); }
.big-action { font-size: 1.1rem; padding: 1rem; border-radius: .8rem; }
.chrono { font-variant-numeric: tabular-nums; font-size: 2rem; font-weight: 700; }
.offline-banner { background: #b45309; color: #fff; text-align: center; padding: .25rem; font-size: .8rem; }
.sig-pad { border: 2px dashed #c2c9d6; border-radius: .6rem; touch-action: none; width: 100%; height: 200px; background: #fff; }
