:root {
  --ink: #1c2430;
  --muted: #6b7280;
  --line: #e7ebf0;
  --paper: #f3f5f8;
  --card: #ffffff;
  --blue: #007fff;
  --blue-deep: #0e2a47;
  --yellow: #f7d618;
  --red: #ce1021;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: white;
  padding: .5rem 1rem;
  z-index: 30;
  border-radius: 8px;
}
.skip-link:focus { top: .5rem; }

.flag-ribbon { display: none; }

.app-shell { min-height: 100vh; }

.app-sidebar,
.offcanvas.app-sidebar,
.offcanvas-lg.app-sidebar {
  width: 272px;
  background-color: #071e36 !important;
  background-image: linear-gradient(180deg, #0c3058 0%, #071e36 42%, #061628 100%) !important;
  color: white;
  border-right: 0;
}

@media (min-width: 992px) {
  .app-shell { display: flex; }
  .offcanvas-lg.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    transform: none;
    visibility: visible;
  }
  .app-main { flex: 1; min-width: 0; }
}

.app-sidebar .offcanvas-body {
  display: block;
  overflow: visible;
  background: transparent;
}

.sidebar-logo {
  display: block;
  width: 96px;
  margin: .55rem auto .7rem;
  padding: .15rem .2rem 0;
  background: #fff;
  border-radius: 12px;
  line-height: 0;
}

.sidebar-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-mark,
.auth-mark {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--blue-deep);
  font-size: 1.05rem;
  line-height: 1;
}

.app-sidebar nav { padding: .35rem .7rem 1.6rem; }

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: rgba(255, 255, 255, .88);
  border-radius: 10px;
  padding: .5rem .65rem;
  margin-bottom: .15rem;
  font-size: .92rem;
}

.app-sidebar .nav-link i {
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .8);
  font-size: .9rem;
}

.app-sidebar .nav-link span {
  min-width: 0;
  line-height: 1.25;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link:focus {
  background: rgba(255, 255, 255, .08);
  color: white;
}

.app-sidebar .nav-link.is-active {
  background: rgba(0, 127, 255, .28);
  color: white;
  font-weight: 680;
  box-shadow: inset 3px 0 0 var(--yellow);
}

.app-sidebar .nav-link.is-active i {
  background: var(--yellow);
  color: #071e36;
}

.nav-section {
  margin: 1.05rem .65rem .4rem;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}

button.nav-parent {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nav-branch.is-open > .nav-parent { background: rgba(255, 255, 255, .08); }
.app-sidebar .nav-link .nav-caret {
  width: auto;
  height: auto;
  margin-left: auto;
  background: transparent;
  color: inherit;
  border-radius: 0;
  font-size: .8rem;
  transition: transform .15s ease;
}
.app-sidebar .nav-link.is-active .nav-caret {
  background: transparent;
  color: white;
}
.nav-branch.is-open .nav-caret { transform: rotate(180deg); }
.nav-sub {
  display: none;
  margin: 0 0 .45rem .85rem;
  padding-left: .55rem;
  border-left: 2px solid rgba(247, 214, 24, .55);
}
.nav-branch.is-open .nav-sub { display: grid; }
.nav-sub .nav-link {
  padding: .38rem .55rem;
  font-size: .84rem;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-height: 78px;
  padding: .55rem 1.35rem .7rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  border-bottom: 0;
  box-shadow: 0 10px 24px rgba(7, 30, 54, .05);
  position: sticky;
  top: 0;
  z-index: 5;
}

.app-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--blue) 0 33.34%,
    var(--yellow) 33.34% 66.67%,
    var(--red) 66.67% 100%
  );
}

.topbar-menu {
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--blue-deep);
  font-size: 1.25rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.topbar-logo {
  display: block;
  height: 54px;
  width: auto;
  max-width: min(460px, 52vw);
  object-fit: contain;
  object-position: left center;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 0 0 auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .28rem .85rem .28rem .28rem;
  border: 1px solid #e4eaf2;
  border-radius: 999px;
  background: white;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.user-meta strong {
  color: var(--blue-deep);
  font-size: .86rem;
  font-weight: 680;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span {
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .08em;
  font-weight: 700;
}

.user-avatar {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1a8cff, #0e2a47);
  color: white;
  font-size: .78rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px white, 0 0 0 2px var(--yellow);
}

.topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 2.2rem;
  padding: 0 .85rem;
  border-radius: 999px;
  border: 1px solid #f0c9cd;
  background: #fff8f8;
  color: var(--red);
  font-size: .82rem;
  font-weight: 680;
}

.topbar-logout:hover,
.topbar-logout:focus {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

@media (max-width: 760px) {
  .app-topbar { padding-inline: .75rem; }
  .topbar-logo { height: 42px; max-width: 46vw; }
  .user-meta { display: none; }
  .user-chip { padding-right: .28rem; }
  .topbar-logout span { display: none; }
  .topbar-logout { width: 2.2rem; padding: 0; justify-content: center; }
}

.app-content { padding: 1.4rem 1.5rem 2.6rem; }

.page-intro { margin-bottom: 1.1rem; }
.page-intro h1,
.app-content h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 680;
  letter-spacing: -.03em;
  color: var(--blue-deep);
}
.page-intro p {
  margin: .2rem 0 0;
  color: var(--muted);
}

.app-content > .d-flex {
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem !important;
}
.app-content > .d-flex > h1,
.app-content > .d-flex > .h3 { margin: 0; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  background: var(--card);
}
.card .card-body { padding: 1.05rem 1.15rem; }

.stat-card { height: 100%; }
.stat-card .card-body {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .95rem 1rem;
}
.stat-card p { margin: 0; color: var(--muted); font-size: .78rem; }
.stat-card strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -.03em;
  color: var(--blue-deep);
}
.stat-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 1.05rem;
}
.icon-blue { background: #e8f3ff; color: var(--blue); }
.icon-yellow { background: #fff6cc; color: #8a6d00; }
.icon-red { background: #fde8ea; color: var(--red); }

.app-content > form.row,
.app-content > form.card {
  background:
    linear-gradient(#f7d618, #f7d618) left / 3px 100% no-repeat,
    white;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  margin-bottom: 1rem;
  box-shadow: 0 8px 22px rgba(7, 30, 54, .05);
}
.app-content > form.row { padding: .85rem .9rem .15rem; }

.form-card { max-width: 920px; }
.form-card > .card-body > h1,
.card > .card-body > h1 { margin-bottom: 1rem; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem 1rem;
}
@media (min-width: 768px) {
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-grid .is-wide { grid-column: 1 / -1; }
}
.field textarea { min-height: 110px; }
.field.is-invalid .form-control,
.field.is-invalid .form-select,
.field-check.is-invalid .form-check-input {
  border-color: var(--red);
  background: #fff8f8;
}
.field-check {
  margin: 0;
  padding: .75rem .85rem .75rem 2.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.req { color: var(--red); }

.filter-bar .card-body { padding: .95rem 1.05rem .8rem; }
.filter-bar .form-control,
.filter-bar .form-select {
  background: white;
  min-height: 40px;
}
.app-content > form.row {
  align-items: end;
}

.card:has(.table),
.card:has(.table-responsive) {
  overflow: hidden;
  border: 1px solid #d5e0ec;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(7, 30, 54, .07);
  background:
    linear-gradient(90deg, #007fff 0 34%, #f7d618 34% 67%, #ce1021 67% 100%) top / 100% 3px no-repeat,
    white;
}
.table tbody tr:last-child td { border-bottom: 0; }
.row-title {
  color: #10283f;
  font-weight: 700;
}
.row-title:hover { color: #0057b8; }
.code-chip {
  display: inline-block;
  padding: .16rem .48rem;
  border-radius: 6px;
  background: #e8f1fb;
  color: #0c3058;
  font-family: Consolas, "Segoe UI", sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.coef {
  display: inline-block;
  min-width: 2.6rem;
  padding: .12rem .45rem;
  border-radius: 6px;
  background: #fff6d0;
  color: #7a5b00;
  font-weight: 700;
  text-align: center;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .58rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.2;
}
.state::before {
  content: "";
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: currentColor;
}
.state-on,
.state-actif { background: #e5f6ea; color: #146c43; }
.state-off,
.state-sorti,
.state-retraite { background: #eef1f4; color: #5c6770; }
.state-suspendu { background: #fff6d0; color: #7a5b00; }
.table tbody td[colspan] {
  text-align: center;
  color: #64748b;
  padding: 2.5rem 1rem;
  background: white;
  font-size: .95rem;
}
.table tbody td[colspan] .bi {
  display: block;
  margin-bottom: .4rem;
  font-size: 1.55rem;
  color: #007fff;
}

.btn {
  border-radius: 10px;
  font-weight: 650;
}
.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.btn-primary:hover,
.btn-primary:focus {
  background: #0066cc;
  border-color: #0066cc;
  color: white;
}
.btn-outline-primary {
  color: #0057b8;
  border-color: #c9ddf5;
  background: white;
}
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: white;
}
.btn-outline-danger { color: var(--red); border-color: #f3c5ca; background: white; }
.btn-danger,
.btn-outline-danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.form-control,
.form-select {
  border-color: #d5dbe3;
  border-radius: 10px;
  min-height: 42px;
  background: #fbfcfd;
}
.form-control:focus,
.form-select:focus {
  background: white;
  border-color: #8ebdf5;
  box-shadow: 0 0 0 .18rem rgba(0, 127, 255, .16);
}
.form-label {
  font-size: .78rem;
  font-weight: 650;
  color: #475569;
  margin-bottom: .28rem;
}

.table { margin: 0; color: #1c2430; }
.table thead th {
  background: #f3f7fb;
  color: #1e3a56;
  font-size: .72rem;
  letter-spacing: .055em;
  text-transform: uppercase;
  font-weight: 700;
  border-top: 0;
  border-bottom: 2px solid #d5e3f2;
  padding: .9rem 1rem .75rem;
  white-space: nowrap;
}
.table th a { color: inherit; text-decoration: none; }
.table th a:hover { color: #0057b8; }
.table td {
  vertical-align: middle;
  border-color: #e7eef5;
  padding: .82rem 1rem;
  font-variant-numeric: tabular-nums;
}
.table tbody tr:nth-child(even) > * { background: #f8fbfe; }
.table td:not(.row-actions) a {
  color: #10283f;
  font-weight: 650;
  text-decoration: none;
}
.table td:not(.row-actions) a:hover { color: #0057b8; }
.row-actions {
  white-space: nowrap;
  text-align: right;
}
.row-actions a,
.table td.row-actions a,
.table td:last-child a {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  margin: .1rem 0 .1rem .3rem;
  padding: .28rem .58rem;
  border: 1px solid #d3dfeb;
  border-radius: 8px;
  background: white;
  color: #0c3058;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .04);
}
.row-actions a:hover,
.table td:last-child a:hover {
  border-color: #007fff;
  background: #f3f8ff;
  color: #0057b8;
  text-decoration: none;
}
.row-actions a.is-primary,
.table td.row-actions a.is-primary {
  background: #007fff;
  border-color: #007fff;
  color: white;
}
.row-actions a.is-primary:hover { background: #0066cc; color: white; }
.row-actions a.is-danger,
.table td:last-child a[href*="supprimer"] {
  background: white;
  border-color: #f0c8cd;
  color: #9d1c2b;
}
.row-actions a.is-danger:hover,
.table td:last-child a[href*="supprimer"]:hover {
  background: #fff5f6;
  border-color: #ce1021;
  color: #9d1c2b;
}
.table tbody tr:hover > * { background: #eef5fc; }
.table tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 #007fff; }
.pagination { gap: .35rem; margin-bottom: 0; }
.pagination .page-link {
  border-radius: 8px;
  border-color: #d5e0ec;
  color: #10283f;
  font-size: .84rem;
  font-weight: 700;
  padding: .4rem .8rem;
  background: white;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.pagination .page-link:hover { background: #f3f8ff; border-color: #007fff; color: #0057b8; }
.pagination .page-item.disabled .page-link {
  background: #f4f7fb;
  color: #5c6775;
  box-shadow: none;
}

.badge { border-radius: 999px; font-weight: 700; padding: .4em .7em; letter-spacing: .01em; }
.badge.text-bg-secondary { background: #eef1f4 !important; color: #475569 !important; }
.badge.text-bg-info { background: #e7f1ff !important; color: #0b4f8a !important; }
.badge.text-bg-warning { background: #fff6d0 !important; color: #7a5b00 !important; }
.badge.text-bg-success { background: #e5f6ea !important; color: #146c43 !important; }
.badge.text-bg-danger { background: #fde8ea !important; color: #9d1c2b !important; }
.badge.text-bg-dark { background: #e8eaed !important; color: #334155 !important; }
.page-link { color: #0057b8; }
.alert { border: 0; border-radius: 12px; }

dl.row > dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
  padding-top: .55rem;
}
dl.row > dd {
  margin: 0;
  padding-top: .45rem;
  padding-bottom: .35rem;
}

.card-body > h2,
.card-body > h3 { color: var(--blue-deep); font-weight: 680; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  margin: 0 0 .75rem;
  padding-left: .85rem;
  border-left: 2px solid #dbeafe;
}

.audit-json {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem;
  white-space: pre-wrap;
}

.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(145deg, #007fff 0%, #0066cc 38%, #f7d618 68%, #ce1021 100%);
}
.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.auth-card {
  width: min(400px, 100%);
  background: white;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(12, 28, 46, .28);
  padding: 1.15rem 1.25rem 1.1rem;
  text-align: center;
}
.auth-logo {
  display: block;
  width: 210px;
  max-width: 78%;
  height: auto;
  margin: 0 auto .65rem;
}
.auth-title {
  margin: 0;
  color: var(--blue-deep);
  font-size: 1.25rem;
  font-weight: 700;
}
.auth-lead {
  margin: .15rem 0 .9rem;
  color: var(--muted);
  font-size: .84rem;
}
.auth-form { text-align: left; }
.auth-field { margin-bottom: .75rem; }
.auth-form .form-label {
  margin-bottom: .25rem;
  font-size: .78rem;
}
.auth-form .form-control {
  min-height: 42px;
  border-radius: 10px;
  background: #f7f9fc;
}
.auth-form .btn {
  margin-top: .35rem;
  min-height: 44px;
  font-size: .95rem;
}
.auth-forgot {
  margin: .75rem 0 0;
  font-size: .84rem;
}
.auth-card input:not([type="hidden"]),
.auth-card select,
.auth-card textarea {
  width: 100%;
  border: 1px solid #d5dbe3;
  border-radius: 10px;
  padding: .55rem .75rem;
  background: #fbfcfd;
}
.auth-card input:focus {
  outline: 2px solid rgba(0, 127, 255, .25);
  border-color: var(--blue);
  background: white;
}

.demo-accounts { margin-top: 1.15rem; }
.demo-accounts-title {
  margin: 0 0 .45rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.demo-accounts-list { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.demo-account {
  text-align: left;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  padding: .45rem .6rem;
  cursor: pointer;
}
.demo-account strong { display: block; color: var(--blue-deep); font-size: .86rem; }
.demo-account span { color: var(--muted); font-size: .72rem; }
.demo-account:hover { border-color: #b9d7f8; background: white; }

#preview-duree,
#preview-type { color: #0057b8; }

a { color: #0057b8; }

.agent-sheet {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 1.2rem;
  align-items: center;
  padding: 1.15rem 1.2rem 1.2rem;
  background:
    linear-gradient(90deg, #007fff 0 34%, #f7d618 34% 67%, #ce1021 67% 100%) top / 100% 3px no-repeat,
    white;
}
.agent-portrait {
  width: 132px;
  height: 158px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #e8f2fc, #f7fafc);
  border: 1px solid #d5e0ec;
  color: #0c3058;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.agent-portrait img { width: 100%; height: 100%; object-fit: cover; }
.agent-kicker {
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5c6775;
}
.agent-identity h1 { margin: .1rem 0 .55rem; }
.agent-tags { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; color: #334155; }
.filiation { margin-top: .75rem; }
.filiation ol {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.filiation-step {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  max-width: 100%;
}
.filiation-step:not(:first-child)::before {
  content: "";
  width: .42rem;
  height: .42rem;
  border-right: 2px solid #8aa0b8;
  border-top: 2px solid #8aa0b8;
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.filiation-card {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  min-width: 0;
  max-width: 16rem;
  padding: .38rem .7rem .42rem;
  border: 1px solid #e3e8ee;
  border-left-width: 3px;
  border-left-color: #0c3058;
  border-radius: 10px;
  background: #f8fafc;
  color: #10283f;
  text-decoration: none;
}
a.filiation-card:hover {
  background: white;
  border-color: #b9d4ee;
  border-left-color: #007fff;
  color: #10283f;
}
.filiation-level {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #5c6775;
}
.filiation-name {
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.25;
  color: inherit;
}
.filiation-card.niveau-DIRECTION { border-left-color: #007fff; }
.filiation-card.niveau-DIVISION { border-left-color: #c9a227; }
.filiation-card.niveau-BUREAU { border-left-color: #8aa0b8; }
.filiation-card.niveau-SECRETARIAT { border-left-color: #7a5b9a; }
.filiation-card.niveau-POSTE { border-left-color: #146c43; }
.filiation-card.is-current {
  background: #0c3058;
  border-color: #0c3058;
}
.filiation-card.is-current .filiation-level { color: #f7d618; }
.filiation-card.is-current .filiation-name { color: white; }
.agent-photo-form {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  margin-top: .9rem;
}
.agent-photo-form .form-control { max-width: 280px; min-height: 38px; background: white; }
.agent-photo-hint { margin: .4rem 0 0; color: var(--muted); font-size: .78rem; }
.agent-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.fact {
  padding: .75rem .85rem;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
  background: white;
  box-shadow: 0 6px 16px rgba(7, 30, 54, .04);
}
.fact > span {
  display: block;
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.fact strong { display: block; margin-top: .18rem; color: #10283f; font-weight: 650; }
.fact.is-wide { grid-column: 1 / -1; }
.detail-hero {
  padding: 1.15rem 1.25rem 1.2rem;
  border: 1px solid #d5e0ec;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(7, 30, 54, .07);
  background:
    linear-gradient(90deg, #007fff 0 34%, #f7d618 34% 67%, #ce1021 67% 100%) top / 100% 3px no-repeat,
    white;
}
.detail-hero h1 { margin: .12rem 0 .55rem; }
.detail-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 992px) {
  .detail-split { grid-template-columns: 1fr; }
}
.fact-note {
  display: block;
  margin-top: .15rem;
  font-style: normal;
  font-size: .75rem;
  letter-spacing: 0;
  text-transform: none;
  color: #64748b;
  font-weight: 600;
}
.agent-name-cell { display: flex; align-items: center; gap: .65rem; }
.agent-mini {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #e8f1fb;
  color: #0c3058;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}
.agent-mini img { width: 100%; height: 100%; object-fit: cover; }
.agent-form-card {
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid #d5e0ec;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(7, 30, 54, .07);
  background:
    linear-gradient(90deg, #007fff 0 34%, #f7d618 34% 67%, #ce1021 67% 100%) top / 100% 3px no-repeat,
    white;
}
.agent-form-card > .card-body { padding: .95rem 1.1rem 1rem; }
.agent-form-head { text-align: center; margin-bottom: .15rem; }
.agent-form-head h1 { margin: .1rem 0 0; font-size: 1.35rem; }
.agent-form-card .form-section { margin-top: .8rem; }
.agent-form-card .form-section > h2 {
  margin: 0 0 .5rem;
  padding-bottom: .28rem;
  border-bottom: 1px solid #e7eef5;
  color: #1e3a56;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.agent-form-card .field-grid { gap: .55rem .75rem; }
.agent-form-card .form-label { margin-bottom: .15rem; }
.agent-form-card .form-control,
.agent-form-card .form-select { min-height: 36px; padding-top: .3rem; padding-bottom: .3rem; }
.agent-form-card .field-check { padding: .5rem .7rem .5rem 2rem; }
.agent-form-card .form-actions { justify-content: center; margin-top: .75rem; padding-top: .7rem; }
.saisie-note { margin: .35rem 0 0; color: #5c6775; font-size: .82rem; }
.is-locked {
  background: #f4f7fb !important;
  color: #1e3a56;
  pointer-events: none;
}
.saisie-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .8rem;
  margin-top: .9rem;
  padding: .7rem .85rem;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
  background: #f8fbfe;
}
.saisie-preview span {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #64748b;
}
.saisie-preview strong { color: #0c3058; font-size: 1.05rem; }
.saisie-preview p {
  grid-column: 1 / -1;
  margin: .15rem 0 0;
  color: #5c6775;
  font-size: .78rem;
}
.liste-service {
  margin: .7rem 0 .35rem;
  color: #1e3a56;
  font-size: .92rem;
}
.liste-signes {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .6rem;
  align-items: center;
  margin-bottom: .4rem;
  color: #10283f;
}
.liste-signes span {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
}
.liste-signes em { color: #8aa0b8; font-style: normal; }
.liste-sign-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.agent-form-preview {
  display: flex;
  justify-content: center;
  margin-bottom: .55rem;
}
.agent-form-preview[hidden] { display: none !important; }
.agent-form-preview img {
  width: 84px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d5e0ec;
  background: #e8f2fc;
}
@media (max-width: 1100px) {
  .agent-facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .agent-sheet { grid-template-columns: 1fr; }
  .agent-facts { grid-template-columns: 1fr; }
}

.ref-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
.ref-panel {
  overflow: hidden;
  border: 1px solid #d5e0ec;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(7, 30, 54, .07);
  background:
    linear-gradient(90deg, #007fff 0 34%, #f7d618 34% 67%, #ce1021 67% 100%) top / 100% 3px no-repeat,
    white;
}
.ref-head { padding: 1.05rem 1.1rem .85rem; border-bottom: 1px solid #e7eef5; }
.ref-head h2 { margin: 0 0 .35rem; color: var(--blue-deep); font-size: 1.15rem; font-weight: 700; }
.ref-head p { margin: 0; color: var(--muted); font-size: .84rem; }
.ref-group {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: .7rem 1.1rem;
  background: #f3f7fb;
  border-top: 1px solid #e7eef5;
  border-bottom: 1px solid #e7eef5;
  color: #1e3a56;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.ref-panel .ref-group:first-of-type { border-top: 0; }
.schedule-legend {
  margin-left: auto;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #5c6775;
}
.schedule-scale,
.ref-list li.schedule-row {
  display: grid;
  grid-template-columns: 7.2rem minmax(8rem, 1fr) 10.5rem auto;
  gap: .75rem;
  align-items: center;
}
.schedule-scale {
  padding: .45rem 1.1rem 0;
  color: #8aa0b8;
  font-size: .68rem;
  font-weight: 700;
}
.schedule-scale-marks { position: relative; height: .9rem; }
.schedule-scale-marks i {
  position: absolute;
  top: 0;
  font-style: normal;
  transform: translateX(-50%);
}
.schedule-scale-marks i:first-child { left: 0; transform: none; }
.schedule-scale-marks i:nth-child(2) { left: 42.86%; }
.schedule-scale-marks i:nth-child(3) { left: 85.71%; }
.schedule-day span {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #5c6775;
}
.schedule-day strong { display: block; color: #10283f; font-weight: 700; }
.schedule-day em { display: block; font-style: normal; font-size: .75rem; color: #5c6775; }
.schedule-track {
  position: relative;
  height: .62rem;
  border-radius: 999px;
  background: #e7eef5;
}
.schedule-block {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: #007fff;
  overflow: hidden;
}
.schedule-pause {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #f7d618;
}
.schedule-hours strong {
  display: block;
  color: #10283f;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.schedule-hours span { color: #5c6775; font-size: .78rem; }
.schedule-row.is-off .schedule-block { background: #b7c3d1; }
.schedule-row.is-off .schedule-pause { background: #e4e8ee; }
.holiday-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.holiday-tools .form-control { width: 13rem; min-height: 34px; padding-top: .3rem; padding-bottom: .3rem; }
.holiday-tools .btn { min-height: 34px; padding-top: .3rem; padding-bottom: .3rem; }
.holiday-list li { padding: .38rem .9rem; }
.holiday-main {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  flex-wrap: wrap;
}
.holiday-main time {
  flex: 0 0 auto;
  width: 2.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #0c3058;
}
.holiday-type {
  flex: 0 0 auto;
  padding: .05rem .42rem;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.holiday-NATIONAL { background: #e7f1ff; color: #0b4f8a; }
.holiday-OFFICIEL { background: #fff6d0; color: #7a5b00; }
.holiday-LOCAL { background: #f4f7fb; color: #3d4a5c; }
.holiday-EXCEPTIONNEL { background: #fde8ea; color: #9b1c2c; }
.agent-search { position: relative; margin-bottom: .85rem; }
.agent-results {
  list-style: none;
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  margin: .25rem 0 0;
  padding: 0;
  border: 1px solid #d5e0ec;
  border-radius: 10px;
  background: white;
  box-shadow: 0 10px 24px rgba(7, 30, 54, .1);
  max-height: 16rem;
  overflow: auto;
}
.agent-results button {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  border: 0;
  background: white;
  padding: .45rem .7rem;
  text-align: left;
  color: #10283f;
}
.agent-results button:hover,
.agent-results button:focus { background: #eef5fc; }
.agent-results .agent-empty { padding: .5rem .7rem; color: #5c6775; }
.agent-pick {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: .85rem;
  padding: .75rem .85rem .8rem;
  border: 1px solid #d5e0ec;
  border-radius: 14px;
  background:
    linear-gradient(90deg, #007fff 0 34%, #f7d618 34% 67%, #ce1021 67% 100%) top / 100% 3px no-repeat,
    #f8fbff;
}
.agent-pick[hidden] { display: none; }
.agent-pick-photo {
  width: 72px;
  height: 86px;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #e8f2fc, #f7fafc);
  border: 1px solid #d5e0ec;
  color: #0c3058;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.agent-pick-photo img { width: 100%; height: 100%; object-fit: cover; }
.agent-pick-id { min-width: 0; }
.agent-pick-id strong {
  display: block;
  margin-bottom: .2rem;
  color: var(--blue-deep);
  font-size: 1.02rem;
  line-height: 1.2;
}
.agent-pick-id p {
  margin: .2rem 0 0;
  color: #3d4a5c;
  font-size: .84rem;
}
#agent-pick-service { color: var(--muted); }
@media (max-width: 900px) {
  .schedule-scale { display: none; }
  .ref-list li.schedule-row { grid-template-columns: 1fr; }
}
.cat-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #0c3058;
  color: white;
  font-size: .78rem;
  letter-spacing: 0;
}
.cat-B .cat-mark { background: #007fff; }
.cat-C .cat-mark { background: #8a6d00; }
.cat-D .cat-mark { background: #5c6775; }
.fam-STRUCTURE .cat-mark { background: #007fff; }
.fam-EMPLOI .cat-mark { background: #5c6775; }
.ref-list { list-style: none; margin: 0; padding: 0; }
.ref-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .72rem 1.1rem;
  border-bottom: 1px solid #eef1f4;
}
.ref-list li:last-child { border-bottom: 0; }
.ref-list li:hover { background: #f8fbfe; }
.ref-list strong { color: #10283f; font-weight: 650; }
.ref-group a { color: inherit; text-decoration: none; }
.ref-group a:hover { color: #0057b8; }
.ref-main { display: flex; align-items: center; gap: .65rem; min-width: 0; flex-wrap: wrap; }
.niveau {
  flex: 0 0 auto;
  padding: .12rem .45rem;
  border-radius: 999px;
  background: #e8f1fb;
  color: #0c3058;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.niveau-DG { background: #0c3058; color: white; }
.niveau-DIRECTION { background: #e7f1ff; color: #0b4f8a; }
.niveau-DIVISION { background: #fff6d0; color: #7a5b00; }
.niveau-BUREAU { background: #f4f7fb; color: #3d4a5c; }
.niveau-SECRETARIAT { background: #f3eef8; color: #5b3d7a; }
.niveau-POSTE { background: #e5f6ea; color: #146c43; }
.ref-main .row-title { color: #10283f; }
.ref-side { display: flex; align-items: center; gap: .55rem; flex: 0 0 auto; }
.echelon {
  flex: 0 0 auto;
  padding: .16rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: #e8f1fb;
  color: #0c3058;
}
.echelon-2 { background: #e5f0ff; color: #0b4f8a; }
.echelon-1 { background: #f4f7fb; color: #5c6775; }
.echelon-none { background: #f7f8fa; color: #7b8794; }
.ref-empty { margin: 0; padding: 1.4rem 1.1rem; color: var(--muted); text-align: center; }
.ref-empty .bi { display: block; margin-bottom: .35rem; color: #007fff; font-size: 1.4rem; }
@media (max-width: 992px) {
  .ref-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ref-list li { flex-wrap: wrap; }
}

.hs-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.hs-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hs-scope {
  display: inline-flex;
  gap: .15rem;
  padding: .2rem;
  border-radius: 12px;
  background: #e7eef6;
}
.hs-scope a {
  padding: .38rem .75rem;
  border-radius: 9px;
  color: #1e3a56;
  font-size: .82rem;
  font-weight: 680;
  text-decoration: none;
}
.hs-scope a.is-on {
  background: white;
  color: var(--blue-deep);
  box-shadow: 0 1px 3px rgba(7, 30, 54, .1);
}
.hs-filters {
  display: grid;
  grid-template-columns: 1.2fr .8fr .9fr 1fr .7fr .7fr auto;
  gap: .7rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: .9rem 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background:
    linear-gradient(#f7d618, #f7d618) left / 3px 100% no-repeat,
    white;
  box-shadow: 0 8px 22px rgba(7, 30, 54, .05);
}
.hs-filters .btn { min-height: 42px; padding-inline: 1rem; }
.hs-panel {
  overflow: hidden;
  border: 1px solid #d5e0ec;
  border-radius: 16px;
  background:
    linear-gradient(90deg, #007fff 0 34%, #f7d618 34% 67%, #ce1021 67% 100%) top / 100% 3px no-repeat,
    white;
  box-shadow: 0 10px 28px rgba(7, 30, 54, .07);
}
.hs-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem .7rem;
  border-bottom: 1px solid #e7eef5;
  color: var(--muted);
  font-size: .78rem;
}
.hs-sort { display: flex; gap: .45rem; }
.hs-sort a {
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #f3f7fb;
  color: #0c3058;
  font-weight: 700;
  text-decoration: none;
}
.hs-sort a:hover { background: #e7f1ff; }
.hs-list { list-style: none; margin: 0; padding: 0; }
.hs-row {
  display: grid;
  grid-template-columns: 74px minmax(150px, .9fr) minmax(160px, 1.2fr) auto;
  gap: .85rem 1rem;
  align-items: center;
  padding: .8rem 1rem;
  border-bottom: 1px solid #e7eef5;
}
.hs-row.has-agent { grid-template-columns: 74px minmax(150px, 1.1fr) minmax(140px, .85fr) minmax(140px, 1fr) auto; }
.hs-row:last-child { border-bottom: 0; }
.hs-row:hover { background: #f8fbfe; }
.hs-date {
  display: grid;
  justify-items: center;
  padding: .4rem .2rem .35rem;
  border-radius: 12px;
  background: #f3f7fb;
  color: var(--blue-deep);
  line-height: 1.15;
}
.hs-date span { font-size: 1.15rem; font-weight: 750; }
.hs-date strong {
  font-size: .66rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hs-date em { font-style: normal; font-size: .66rem; color: var(--muted); }
.hs-agent strong,
.hs-motif strong,
.hs-slot strong {
  display: block;
  color: var(--blue-deep);
  font-size: .92rem;
  line-height: 1.25;
}
.hs-agent span,
.hs-slot > span { color: var(--muted); font-size: .8rem; }
.hs-motif { min-width: 0; }
.hs-motif strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hs-track {
  position: relative;
  height: 8px;
  margin-top: .4rem;
  border-radius: 999px;
  background: #e7eef5;
}
.hs-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #007fff, #0e2a47);
}
.hs-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
}
.state-brouillon { background: #eef1f4; color: #5c6770; }
.state-soumis { background: #e7f1ff; color: #0b4f8a; }
.state-en_validation { background: #fff6d0; color: #7a5b00; }
.state-approuve { background: #e5f6ea; color: #146c43; }
.state-rejete { background: #fde8ea; color: #9b1c2c; }
.state-annule { background: #f4f7fb; color: #3d4a5c; }
@media (max-width: 1100px) {
  .hs-filters { grid-template-columns: 1fr 1fr 1fr; }
  .hs-row,
  .hs-row.has-agent { grid-template-columns: 74px 1fr 1fr; }
  .hs-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
@media (max-width: 700px) {
  .hs-filters { grid-template-columns: 1fr; }
  .hs-row,
  .hs-row.has-agent { grid-template-columns: 74px 1fr; }
  .hs-motif { grid-column: 2; }
}

.rapport-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.rapport-filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: .9rem 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background:
    linear-gradient(#f7d618, #f7d618) left / 3px 100% no-repeat,
    white;
  box-shadow: 0 8px 22px rgba(7, 30, 54, .05);
}
.rapport-filters .field-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .7rem;
}
.rapport-filters .btn { min-height: 42px; }
.rapport-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.rapport-stats.is-quad { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chart-circle {
  display: block;
  width: 100%;
  height: 240px;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: .65rem 0 0;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}
.chart-legend span::before {
  content: "";
  display: inline-block;
  width: .55rem;
  height: .55rem;
  margin-right: .35rem;
  border-radius: 2px;
  vertical-align: -1px;
}
.chart-legend .is-paye::before { background: #007fff; }
.chart-legend .is-cours::before { background: #c8960a; }
.chart-legend .is-avenir::before { background: #c5d0dc; }
.rapport-stats .stat-card strong span {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}
.rapport-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}
.rapport-side {
  border: 1px solid #d5e0ec;
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 28px rgba(7, 30, 54, .06);
  overflow: hidden;
}
.rapport-side h2 {
  margin: 0;
  padding: .9rem 1rem .75rem;
  border-bottom: 1px solid #e7eef5;
  color: var(--blue-deep);
  font-size: .95rem;
}
.rapport-side ul { list-style: none; margin: 0; padding: 0; }
.rapport-side li {
  display: grid;
  gap: .15rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid #e7eef5;
}
.rapport-side li:last-child { border-bottom: 0; }
.rapport-side strong { color: var(--blue-deep); font-size: .88rem; line-height: 1.3; }
.rapport-side em { font-style: normal; color: var(--muted); font-size: .78rem; }
.rapport-side .is-empty { color: var(--muted); text-align: center; }
@media (max-width: 1100px) {
  .rapport-filters .field-grid { grid-template-columns: 1fr 1fr; }
  .rapport-layout { grid-template-columns: 1fr; }
  .rapport-stats.is-quad { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .rapport-filters { grid-template-columns: 1fr; }
  .rapport-filters .field-grid { grid-template-columns: 1fr; }
  .rapport-stats,
  .rapport-stats.is-quad { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
  .app-topbar {
    gap: .55rem;
    min-height: 64px;
    padding: .45rem max(.75rem, env(safe-area-inset-right)) .6rem max(.75rem, env(safe-area-inset-left));
  }
  .topbar-brand { flex: 1 1 auto; }
  .topbar-logo { height: 44px; max-width: 40vw; }
  .user-meta strong { max-width: 8.5rem; }
  .app-content {
    padding: 1rem max(.85rem, env(safe-area-inset-right)) 2rem max(.85rem, env(safe-area-inset-left));
  }
  .app-content h1,
  .page-intro h1 { font-size: 1.35rem; }
  .app-sidebar,
  .offcanvas.app-sidebar,
  .offcanvas-lg.app-sidebar { width: min(320px, 88vw); }
  .app-sidebar .offcanvas-body {
    overflow-y: auto;
    max-height: calc(100dvh - 3.4rem);
  }
  .app-sidebar .nav-link { min-height: 44px; }
  .hs-filters { grid-template-columns: 1fr 1fr; }
  .hs-motif strong,
  .hs-agent strong { white-space: normal; overflow-wrap: anywhere; }
  html.lists-ready .card:has(.table),
  html.lists-ready .table-responsive { overflow: visible; }
  html.lists-ready table.table thead { display: none; }
  html.lists-ready table.table,
  html.lists-ready table.table tbody,
  html.lists-ready table.table tr { display: block; width: 100%; }
  html.lists-ready table.table tr {
    padding: .35rem .15rem .5rem;
    border-bottom: 1px solid #e7eef5;
  }
  html.lists-ready table.table tr:last-child { border-bottom: 0; }
  html.lists-ready table.table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    width: auto;
    border: 0;
    padding: .28rem .7rem;
    text-align: right;
  }
  html.lists-ready table.table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 46%;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #5c6775;
  }
  html.lists-ready table.table td[colspan] {
    display: block;
    text-align: center;
  }
  html.lists-ready table.table td[colspan]::before { content: none; }
}

@media (max-width: 700px) {
  .app-content {
    padding: .8rem max(.65rem, env(safe-area-inset-right)) 1.5rem max(.65rem, env(safe-area-inset-left));
  }
  .app-content h1,
  .page-intro h1 { font-size: 1.22rem; }
  .topbar-logo { height: 36px; max-width: 44vw; }
  .app-content > .d-flex,
  .hs-head,
  .rapport-head {
    flex-direction: column;
    align-items: stretch;
  }
  .hs-tools,
  .hs-scope { width: 100%; }
  .hs-scope a { flex: 1; text-align: center; }
  .hs-tools .btn,
  .rapport-head .btn,
  .form-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .hs-filters,
  .rapport-filters .field-grid,
  .rapport-stats { grid-template-columns: 1fr; }
  .stat-card strong { font-size: 1.12rem; overflow-wrap: anywhere; }
  .detail-hero,
  .card .card-body { padding: .85rem; }
  .agent-pick { align-items: flex-start; }
  .form-control,
  .form-select,
  textarea,
  .auth-card input,
  .auth-card select {
    font-size: 16px;
  }
  .auth-panel { padding: 1rem .75rem; }
  .sidebar-logo { width: 80px; }
  .hs-row,
  .hs-row.has-agent {
    grid-template-columns: auto minmax(0, 1fr);
    gap: .45rem .7rem;
    padding: .75rem;
  }
  .hs-date { grid-column: 1; grid-row: 1; }
  .hs-side {
    grid-column: 2;
    grid-row: 1;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }
  .hs-agent,
  .hs-slot,
  .hs-motif { grid-column: 1 / -1; }
  .ref-list li {
    flex-direction: column;
    align-items: stretch;
  }
  .ref-side { justify-content: space-between; }
  .holiday-tools { width: 100%; }
  .holiday-tools .form-control { width: 100%; flex: 1 1 12rem; }
}
