:root {
    font-family: Segoe UI, Arial, sans-serif;
    color: #153451;
    background: #f3f8fc;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
    height: 72px;
    background: white;
    border-bottom: 1px solid #d8e6f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(24px, calc((100vw - 1480px) / 2));
}
.brand { display: flex; align-items: center; gap: 14px; font-size: 22px; font-weight: 600; }
.brand b { background: #059ada; color: white; padding: 7px 11px; border-radius: 10px; }
.brand small { display: block; color: #6b8298; font-size: 12px; font-weight: 500; }
main { max-width: 1480px; margin: auto; padding: 34px 24px; }
.heading, .section_head { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.heading small, .eyebrow { color: #0089c1; letter-spacing: .18em; font-weight: 700; }
h1 { font-size: 32px; margin: 7px 0; }
h2 { font-size: 20px; margin: 0 0 22px; }
h3 { font-size: 15px; margin: 24px 0 10px; }
p { color: #64809a; }
section, .stats article {
    background: white;
    border: 1px solid #dbe8f2;
    border-radius: 16px;
    box-shadow: 0 7px 24px #1747630a;
    padding: 24px;
    margin: 20px 0;
}
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stats article { display: flex; flex-direction: column; margin: 0; }
.stats strong { font-size: 28px; color: #087aaa; }
.stats span { color: #64809a; }
.pill { display: inline-block; border-radius: 30px; padding: 6px 12px; background: #e3f2fb; color: #146887; font-size: 12px; font-weight: 700; }
.pill.ok { background: #def5e8; color: #166a42; }
.pill.off { background: #fee8e7; color: #ab3939; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; align-items: stretch; }
.grid section { margin: 0; }
form label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0; color: #385a70; }
input, select, textarea { display: block; width: 100%; padding: 11px; border: 1px solid #c9d9e5; border-radius: 8px; margin-top: 5px; font: inherit; color: #153451; background: white; }
button, .button_link { border: 1px solid #b6cfdf; border-radius: 8px; background: #eff8fd; color: #0876a6; padding: 10px 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
button:hover, .button_link:hover { background: #d9f1ff; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #71bfed; outline-offset: 2px; }
.grid button, .login button, .primary_link { background: #058fc9; color: white; border: 0; margin-top: 12px; }
.grid button:hover, .login button:hover, .primary_link:hover { background: #057bb2; color: white; }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; }
th, td { padding: 12px; border-bottom: 1px solid #e5eef4; font-size: 13px; }
th { background: #f0f7fb; color: #42677d; }
.sort { color: #42677d; text-decoration: none; }
.sort:hover { color: #0089c1; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.actions button, .actions .button_link { padding: 8px 11px; margin: 0; }
.search { display: flex; align-items: center; gap: 8px; min-width: min(620px, 100%); }
.search input { margin: 0; }
.mono { font-family: Consolas, monospace; }
.mismatch { background: #fff0f0; color: #a71919; font-weight: 700; }
.mismatch td { border-bottom-color: #f4c3c3; }
.login { max-width: 480px; margin: 10vh auto; }
.notice { background: #e2f4ff; padding: 14px; border-radius: 9px; }
.notice.warning { background: #fff2de; color: #84530c; }
.foot, .muted { font-size: 12px; color: #698297; }
.foot { margin-top: 30px; }
.date_grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.date_grid label { margin-top: 0; }
.token_result { margin-top: 24px; text-align: center; border-top: 1px solid #e2ebf3; padding-top: 18px; }
.token_result strong { display: block; font-size: 15px; }
.token_result output { display: inline-block; margin-top: 12px; padding: 12px 28px; font-size: 29px; letter-spacing: .15em; background: #ecf8ff; border: 1px solid #8cc8e7; border-radius: 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid #e5eef4; margin: 24px 0; }
.totp_enrollment .qr_code { display: block; max-width: 250px; width: 100%; height: auto; margin: 16px auto; border: 10px solid white; }
.secret { overflow-wrap: anywhere; background: #eff6fb; padding: 12px; }
.login button.neutral { background: #eff8fd; color: #0876a6; }

/* Une modale unique est affichée à la fois : clic sur le fond pour fermer. */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 26px; }
.overlay_scrim { position: absolute; inset: 0; background: rgba(12, 25, 42, .52); cursor: default; }
.overlay .modal { position: relative; margin: 0; width: min(1100px, 100%); max-height: min(85vh, 1000px); overflow-y: auto; box-shadow: 0 22px 80px rgba(0, 23, 47, .3); overscroll-behavior: contain; }
.overlay .modal_account { width: min(650px, 100%); }
.modal .section_head { align-items: flex-start; }
.modal .section_head h2 { margin: 0; }
.modal .section_head p { margin: 6px 0 0; }
.modal .table { margin-top: 12px; }
.manage_actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.manage_actions form, .manage_actions button { width: 100%; margin: 0; }
.danger_zone { border-top: 1px solid #f2c7c7; margin-top: 22px; padding-top: 8px; }
.danger_zone h3 { color: #a72d2d; }
.danger_button { background: #b63131; color: white; border-color: #b63131; margin-top: 10px; }
.danger_button:hover { background: #9c2424; }
@media (max-width: 900px) { .section_head { align-items: stretch; flex-direction: column; } .search { min-width: 100%; } .modal .section_head { flex-direction: row; } }
@media (max-width: 680px) { .stats { grid-template-columns: 1fr; } header { padding: 0 18px; } main { padding: 20px 14px; } .search { align-items: stretch; flex-direction: column; } .overlay { padding: 10px; } .overlay .modal { max-height: 95vh; padding: 16px; } .manage_actions { grid-template-columns: 1fr; } }
.api_key_notice { border-color: #d6bb61; background: #fff9e9; }
.api_key_notice input { font-family: Consolas, monospace; font-size: 15px; }

/* Interface compacte : création de compte intégrée au tableau des comptes. */
.accounts_section { min-width: 0; }
.account_create { border-top: 1px solid #e4edf4; margin-top: 22px; padding-top: 18px; }
.account_create_intro h3 { margin: 0 0 4px; font-size: 17px; }
.account_create_intro p { margin: 0 0 13px; }
.create_account_row { display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(185px, 1.15fr) minmax(145px, .8fr) auto; align-items: end; gap: 12px; }
.create_account_row label { margin: 0; min-width: 0; }
.create_account_row input, .create_account_row select { min-width: 0; }
.create_account_row button { min-height: 44px; border: none; background: #058fc9; color: white; margin: 0; }
.create_account_row button:hover { background: #057bb2; color: white; }

.dashboard_grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.dashboard_grid section { min-width: 0; }
.dashboard_grid .iub_section { scroll-margin-top: 18px; }
.field_caption { font-size: 13px; font-weight: 600; color: #385a70; margin-top: 14px; margin-bottom: 10px; }
.iub_section .date_grid { gap: 8px; }
.iub_section .date_grid input { padding-inline: 7px; min-width: 0; font-variant-numeric: tabular-nums; }
.iub_section .token_result { padding-top: 20px; }
.token_result p { font-size: 12px; margin: 12px 0 2px; }
.token_result .copy_jeton { margin: 8px 0 0; background: white; color: #0876a6; border: 1px solid #b6cfdf; }
.iub_error { margin-top: 20px; }
.remember_choice { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 13px; line-height: 1.45; }
.remember_choice input { display: inline-block; flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: #058fc9; }
.remember_choice span { flex: 1; }
.remember_choice small { display: block; color: #698297; font-weight: 400; }
.table, .responsive_table { max-width: 100%; }
.table table { min-width: max-content; }
.table .actions { flex-wrap: wrap; min-width: 240px; }
.section_head h2 { margin-bottom: 14px; }
.modal_open { overflow: hidden; }

@media (max-width: 1200px) {
    .create_account_row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .create_account_row button { justify-self: start; }
    .dashboard_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard_grid #mon-compte { grid-column: 1 / -1; }
}
@media (max-width: 840px) {
    main { padding: 24px 16px; }
    .dashboard_grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard_grid #mon-compte { grid-column: auto; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats strong { font-size: 23px; }
    .heading { align-items: flex-start; }
    .section_head { flex-direction: column; align-items: stretch; }
}
@media (max-width: 760px) {
    header { height: 64px; padding: 0 14px; }
    .brand { font-size: 18px; gap: 8px; }
    .brand b { padding: 7px 10px; }
    h1 { font-size: 26px; }
    h2 { font-size: 18px; }
    section, .stats article { padding: 17px; border-radius: 12px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .stats strong { font-size: 23px; }
    .search { display: grid; grid-template-columns: 1fr auto; width: 100%; min-width: 0; }
    .search input { min-width: 0; }
    .search .button_link { grid-column: 1 / -1; text-align: center; }
    .create_account_row { grid-template-columns: minmax(0, 1fr); }
    .create_account_row button { width: 100%; }
    .responsive_table.vehicles_table, .accounts_section .responsive_table { overflow: visible; }
    .responsive_table.vehicles_table table, .accounts_section .responsive_table table,
    .responsive_table.vehicles_table tbody, .accounts_section .responsive_table tbody { display: block; width: 100%; min-width: 0; }
    .responsive_table.vehicles_table thead, .accounts_section .responsive_table thead { display: none; }
    .responsive_table.vehicles_table tr, .accounts_section .responsive_table tr {
        display: block; border: 1px solid #dbe8f2; border-radius: 10px; overflow: hidden; margin-bottom: 12px; background: #fff;
    }
    .responsive_table.vehicles_table td, .accounts_section .responsive_table td {
        display: grid; grid-template-columns: minmax(88px, 36%) minmax(0, 1fr); align-items: start; gap: 10px; width: 100%; white-space: normal; overflow-wrap: anywhere; padding: 10px; min-width: 0;
    }
    .responsive_table.vehicles_table td::before, .accounts_section .responsive_table td::before {
        content: attr(data-label); font-weight: 700; color: #54758b; font-size: 12px;
    }
    .responsive_table.vehicles_table td:last-child, .accounts_section .responsive_table td:last-child { border-bottom: 0; }
    .responsive_table.vehicles_table td.actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
    .responsive_table.vehicles_table td.actions::before { display: block; width: 100%; }
    .responsive_table.vehicles_table td.actions a, .responsive_table.vehicles_table td.actions button { white-space: normal; min-height: 40px; }
    .overlay { padding: 8px; }
    .overlay .modal { width: 100%; max-height: calc(100dvh - 16px); padding: 15px; }
    .overlay .modal_account { width: 100%; }
    .modal .section_head { flex-direction: row; align-items: flex-start; gap: 10px; }
    .modal .section_head .button_link { flex: 0 0 auto; }
    .modal .section_head p { max-width: 58vw; overflow-wrap: anywhere; }
    .modal .table { overflow-x: auto; }
    .manage_actions { grid-template-columns: minmax(0, 1fr); }
    .login { margin: 6vh auto; }
}
@media (max-width: 420px) {
    .stats { grid-template-columns: 1fr; }
    .stats article:last-child { grid-column: auto; }
    .search { grid-template-columns: minmax(0, 1fr); }
    .search button { width: 100%; }
    .iub_section .date_grid { gap: 5px; }
    .iub_section .date_grid label { font-size: 12px; }
    .iub_section .date_grid input { padding: 9px 5px; font-size: 14px; }
    header .brand small { font-size: 11px; }
    header button { padding: 9px 10px; }
    .modal .section_head h2 { font-size: 16px; }
}

/* Publications WPF et Inno Setup. */
.releases_section { scroll-margin-top: 18px; }
.latest_release td { background: #e8f5ee; }
.release_upload_grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 790px; }
.release_form { padding: 20px; border: 1px solid #dceaf4; border-radius: 12px; min-width: 0; }
.release_form h3 { margin: 0 0 7px; }
.release_form .muted { min-height: 34px; }
.release_form input[type="file"] { width: 100%; padding: 12px 8px; }
.release_form textarea { display: block; width: 100%; max-width: 100%; min-height: 82px; resize: vertical; }
.release_form button { background: #058fc9; color: #fff; border: 0; margin-top: 16px; }
.release_sha { font-family: Consolas, monospace; }
@media (max-width: 830px) { .release_upload_grid { grid-template-columns: minmax(0, 1fr); } .release_form .muted { min-height: 0; } }
@media (max-width: 480px) { .release_form { padding: 14px; } .release_form input { min-width: 0; } }

/* Statistiques des comptes, en tableau et en affichage mobile. */
.accounts_section .count_cell { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Console de sessions distantes. */
.remote_admin_section{scroll-margin-top:20px}.remote_admin_selector{display:grid;gap:10px;max-width:720px}
.remote_admin_selector label{display:grid;gap:6px;font-weight:600;color:#315b76}
.remote_admin_selector input,.remote_admin_selector select{width:100%;max-width:100%;min-width:0;padding:10px;border:1px solid #c3d8e7;border-radius:7px;background:white;color:#173b54}
.remote_admin_selector select{min-height:130px;font:13px Consolas,monospace}
.remote_admin_selector form{display:grid;gap:9px;justify-items:start}
.remote_admin_selector form button{margin-top:4px}
.remote_admin_selector p{font-size:12px;color:#69849a;margin:0}
@media(max-width:600px){.remote_admin_selector form button{width:100%}}
