:root {
    color-scheme: light;
    --ink: #182031;
    --ink-soft: #334155;
    --muted: #68758a;
    --line: #d9e3ec;
    --line-strong: #c6d3df;
    --panel: #ffffff;
    --panel-soft: #f8fbfd;
    --page: #eef5f8;
    --brand: #1769aa;
    --brand-dark: #0d4777;
    --brand-soft: #e7f2fb;
    --accent: #0f766e;
    --accent-soft: #e5f7f4;
    --danger: #b42318;
    --danger-soft: #fff1ee;
    --warning: #b7791f;
    --success: #0f766e;
    --shadow-soft: 0 16px 36px rgba(15, 76, 129, 0.09);
    --shadow-strong: 0 24px 70px rgba(15, 76, 129, 0.14);
    --radius: 8px;
    --content-max: 1480px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% -8%, rgba(23, 105, 170, 0.12), transparent 30%),
        linear-gradient(180deg, #f7fbfd 0%, var(--page) 42%, #f7fafc 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
}

.site-footer {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.site-footer-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 28px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    border-radius: var(--radius);
}

a,
button {
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:disabled,
button[aria-busy="true"] {
    cursor: wait;
    opacity: 0.72;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-shell {
    width: min(430px, 100%);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 22px 60px rgba(23, 33, 29, 0.11);
}

.auth-panel {
    padding: 36px;
}

.auth-kicker {
    margin: 0 0 10px;
    color: currentColor;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    opacity: 0.74;
}

.auth-card h1,
.topbar h1,
.workspace h2 {
    margin: 0;
    line-height: 1.08;
    letter-spacing: 0;
}

.auth-card {
    width: 100%;
}

.auth-card-header {
    margin-bottom: 30px;
}

.auth-card .auth-kicker,
.dashboard-page .auth-kicker {
    color: var(--brand);
}

.auth-card h1 {
    font-size: 2.1rem;
}

.auth-alert {
    margin-bottom: 18px;
    border-left: 4px solid var(--danger);
    padding: 12px 14px;
    background: #fff0ed;
    color: var(--danger);
    font-weight: 700;
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 12px 28px;
    border-bottom: 1px solid var(--line);
    background: #fff7e6;
    color: var(--ink);
}

.impersonation-banner strong {
    display: block;
    font-size: 0.86rem;
}

.impersonation-banner span {
    color: var(--muted);
    font-size: 0.92rem;
}

.duplicate-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.debt-alert {
    margin-top: 20px;
    border-left: 6px solid var(--danger);
    padding: 18px;
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
    font-size: 1.05rem;
    font-weight: 900;
}

.search-panel {
    margin-top: 28px;
    border: 1px solid var(--line);
    padding: 22px;
    background: #fff;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.search-form input {
    min-height: 54px;
    border: 1px solid var(--line);
    padding: 0 16px;
    font-size: 1.05rem;
    outline: none;
}

.search-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.14);
}

.search-form button {
    border: 0;
    padding: 0 20px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.catalog-picker {
    display: grid;
    gap: 16px;
}

.catalog-source {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.catalog-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.catalog-toolbar label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.catalog-toolbar input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    padding: 0 14px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.catalog-toolbar input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.14);
}

.catalog-family-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.catalog-family-tabs button {
    min-height: 38px;
    border: 1px solid var(--line);
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
}

.catalog-family-tabs button.is-active {
    border-color: var(--brand);
    background: rgba(15, 111, 92, 0.1);
    color: var(--brand-dark);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.catalog-item {
    display: grid;
    gap: 5px;
    min-height: 128px;
    border: 1px solid var(--line);
    padding: 12px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.catalog-item:hover,
.catalog-item.is-selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.12);
}

.catalog-item span,
.catalog-item small {
    color: var(--muted);
    font-size: 0.78rem;
    font-style: normal;
}

.catalog-item strong {
    font-size: 0.98rem;
}

.catalog-item em {
    color: var(--brand-dark);
    font-style: normal;
    font-weight: 900;
}

.catalog-cart {
    border: 1px solid var(--line);
    padding: 14px;
    background: #fbfcfb;
}

.catalog-cart > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.catalog-cart > div:first-child span {
    color: var(--muted);
    font-weight: 900;
    text-transform: uppercase;
}

.catalog-cart-lines {
    display: grid;
    gap: 8px;
}

.catalog-cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.catalog-cart-line span {
    color: var(--muted);
    font-size: 0.88rem;
}

.catalog-cart-line button {
    border: 1px solid var(--line);
    padding: 8px 10px;
    background: #fff;
    color: var(--danger);
    font-weight: 900;
    cursor: pointer;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 220px) auto;
    gap: 12px;
}

.filter-grid input,
.filter-grid select {
    min-height: 46px;
    border: 1px solid var(--line);
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.filter-grid input:focus,
.filter-grid select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.14);
}

.filter-grid button {
    border: 0;
    padding: 0 18px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--line);
    padding: 14px 15px;
    background: #fbfcfb;
    color: var(--ink);
    outline: none;
}

.auth-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.14);
}

.auth-form button,
.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    padding: 0 18px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.auth-form button {
    margin-top: 10px;
}

.auth-form button:hover,
.logout-link:hover {
    background: var(--brand-dark);
}

.dashboard-page {
    min-height: 100vh;
    padding: 28px;
}

.admin-page {
    min-height: 100vh;
    padding: 28px;
}

.control-app {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.control-sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    border-right: 1px solid var(--line);
    padding: 22px;
    background: #fff;
}

.control-brand {
    display: grid;
    gap: 5px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
}

.control-brand span {
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.control-brand strong {
    font-size: 1.2rem;
}

.control-sidebar nav {
    display: grid;
    gap: 6px;
    align-content: start;
    flex: 1;
    margin-top: 22px;
    overflow-y: auto;
    padding-right: 4px;
}

.control-sidebar nav a,
.control-back {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.control-nav-group {
    margin: 18px 4px 6px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.control-nav-link {
    position: relative;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 44px;
    padding: 7px 10px !important;
    border: 1px solid transparent;
}

.control-nav-link::before {
    content: "";
    position: absolute;
    inset: 8px auto 8px 0;
    width: 3px;
    border-radius: 999px;
    background: transparent;
}

.control-nav-icon {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfd;
    color: var(--muted);
}

.control-nav-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.control-nav-icon svg path:first-child:not(:only-child),
.control-nav-icon svg path:only-child {
    fill: none;
}

.control-nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 7px;
    background: var(--danger);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
}

.control-nav-link.is-active {
    border-color: rgba(23, 105, 170, 0.2);
    background: var(--brand-soft);
    color: var(--brand-dark);
    box-shadow: 0 8px 20px rgba(23, 105, 170, 0.1);
}

.control-nav-link.is-active::before {
    background: var(--brand);
}

.control-nav-link.is-active .control-nav-icon {
    border-color: rgba(23, 105, 170, 0.22);
    background: #fff;
    color: var(--brand);
}

.control-nav-link:focus-visible {
    outline: 3px solid rgba(23, 105, 170, 0.2);
    outline-offset: 2px;
}

.control-sidebar nav a:hover,
.control-back:hover {
    background: rgba(15, 111, 92, 0.08);
    color: var(--brand);
}

.control-back {
    margin-top: 24px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.control-nav-logout {
    flex: 0 0 auto;
    margin-top: 24px;
    border-color: var(--line);
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.control-main {
    min-width: 0;
    padding: 28px;
}

.control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 22px;
}

.control-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topbar h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 1px solid var(--line);
    padding: 0 18px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.secondary-link:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.workspace {
    margin-top: 32px;
    max-width: 760px;
    border: 1px solid var(--line);
    padding: 32px;
    background: var(--panel);
}

.workspace h2 {
    font-size: 1.8rem;
}

.workspace p:last-child {
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.workspace-actions {
    margin-top: 24px;
}

.data-section,
.form-section {
    margin-top: 28px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.data-section {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 16px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table a,
.compact-table a {
    color: var(--brand-dark);
    font-weight: 900;
    text-decoration: none;
}

.data-table a:hover,
.compact-table a:hover {
    color: var(--brand);
    text-decoration: underline;
}

.debt-amount {
    color: var(--danger) !important;
    font-weight: 900;
}

.file-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.file-summary article,
.record-panel {
    border: 1px solid var(--line);
    padding: 20px;
    background: #fff;
}

.file-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.file-summary strong {
    display: block;
    margin-top: 10px;
    font-size: 1.2rem;
}

.record-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
    gap: 18px;
    margin-top: 28px;
}

.record-panel-wide {
    margin-top: 28px;
}

.record-panel h2 {
    margin: 0 0 18px;
    font-size: 1.25rem;
}

.record-panel p {
    margin: 0;
    line-height: 1.7;
}

.detail-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
}

.compact-table {
    width: 100%;
    border-collapse: collapse;
}

.compact-table th,
.compact-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

.compact-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.compact-table span {
    color: var(--muted);
    font-size: 0.9rem;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(15, 111, 92, 0.22);
    padding: 0 10px;
    background: rgba(15, 111, 92, 0.08);
    color: var(--brand-dark);
    font-weight: 800;
}

.role-pill-muted {
    border-color: var(--line);
    background: #f7f8f7;
    color: var(--muted);
}

.inline-admin-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 16px;
}

.inline-admin-form select,
.inline-admin-form input {
    width: 100%;
    border: 1px solid var(--line);
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.inline-admin-form select:focus,
.inline-admin-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.14);
}

.inline-cancel-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    gap: 8px;
    min-width: 280px;
}

.inline-cancel-form input {
    width: 100%;
    border: 1px solid var(--line);
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.inline-cancel-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.14);
}

.inline-cancel-form button {
    border: 0;
    padding: 0 12px;
    background: var(--danger);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.empty-state {
    color: var(--muted);
    text-align: center;
}

.notice-success {
    margin-top: 20px;
    border-left: 4px solid var(--brand);
    padding: 12px 14px;
    background: rgba(15, 111, 92, 0.08);
    color: var(--brand-dark);
    font-weight: 800;
}

.module-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.module-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid var(--line);
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
}

.module-nav a:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.metric-grid article {
    border: 1px solid var(--line);
    padding: 20px;
    background: #fff;
}

.metric-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-grid strong {
    display: block;
    margin-top: 12px;
    font-size: 2rem;
    line-height: 1;
}

.metric-danger {
    border-color: rgba(180, 35, 24, 0.42) !important;
    background: #fff7f5 !important;
    color: var(--danger);
}

.family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.family-card {
    display: grid;
    gap: 18px;
    border: 1px solid var(--line);
    padding: 22px;
    background: #fff;
}

.family-card h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.15;
}

.family-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notification-role-picker {
    display: grid;
    gap: 12px;
}

.notification-role-picker > label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.notification-role-help {
    margin: -4px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.notification-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.notification-role-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    min-height: 110px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.notification-role-card:hover {
    border-color: rgba(23, 105, 170, 0.38);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.notification-role-input {
    position: absolute;
    inset: 12px 12px auto auto;
    width: 18px !important;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
}

.notification-role-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fbfd;
    color: var(--brand);
}

.notification-role-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-role-content {
    display: grid;
    gap: 6px;
    padding-right: 24px;
}

.notification-role-content strong {
    color: var(--ink);
    font-size: 1rem;
}

.notification-role-content small {
    color: var(--muted);
    line-height: 1.45;
}

.notification-role-card:has(.notification-role-input:checked) {
    border-color: rgba(23, 105, 170, 0.5);
    background: var(--brand-soft);
    box-shadow: 0 10px 24px rgba(23, 105, 170, 0.12);
}

.notification-role-card:has(.notification-role-input:checked)::after {
    content: "Sélectionné";
    position: absolute;
    right: 12px;
    bottom: 10px;
    color: var(--brand-dark);
    font-size: 0.74rem;
    font-weight: 900;
}

.notification-role-card:has(.notification-role-input:checked) .notification-role-icon {
    border-color: rgba(23, 105, 170, 0.24);
    background: #fff;
}

.muted-text {
    color: var(--muted);
}

.form-section {
    max-width: 820px;
    padding: 28px;
}

.admin-form {
    display: grid;
    gap: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-form div {
    display: grid;
    gap: 8px;
}

.admin-form .form-wide {
    grid-column: 1 / -1;
}

.admin-form .form-wide > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px;
}

.admin-form .form-wide > div > label {
    grid-column: 1 / -1;
}

.admin-form .form-wide input[type="checkbox"],
.admin-form input[type="checkbox"] {
    width: auto;
}

.admin-form .form-wide label,
.admin-form label.required {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-form label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    padding: 13px 14px;
    background: #fbfcfb;
    color: var(--ink);
    outline: none;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.14);
}

.admin-form button {
    justify-self: start;
    min-height: 46px;
    border: 0;
    padding: 0 18px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.admin-form button:hover {
    background: var(--brand-dark);
}

.result-form {
    margin: 12px 0;
    border: 1px solid var(--line);
    padding: 18px;
    background: #fff;
}

.result-form audio,
.result-summary audio {
    width: min(360px, 100%);
    display: block;
    margin-top: 8px;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
    font-weight: 900;
}

.result-summary {
    display: grid;
    gap: 8px;
    border-left: 4px solid var(--brand);
    padding: 12px 14px;
    background: #fff;
}

.result-summary p {
    margin: 0;
}

.salary-form input,
.data-table td > input {
    width: 100%;
    min-width: 160px;
    border: 1px solid var(--line);
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.salary-form input:focus,
.data-table td > input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.14);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.table-actions button {
    min-height: 46px;
    border: 0;
    padding: 0 14px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.table-actions button:hover {
    background: var(--brand-dark);
}

.data-section form button {
    min-height: 38px;
    border: 0;
    padding: 0 12px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.data-section form button:hover {
    background: var(--brand-dark);
}

.receipt-preview {
    margin-top: 28px;
    display: flex;
    justify-content: center;
}

.receipt-ticket {
    width: 320px;
    border: 1px solid var(--line);
    padding: 22px;
    background: #fff;
    color: #111;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.receipt-ticket h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    text-align: center;
}

.receipt-ticket p {
    margin: 6px 0;
    font-size: 0.88rem;
}

.receipt-ticket div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0;
}

ul {
    margin: 0;
    padding-left: 18px;
    color: var(--danger);
}

/* UI/UX globale - applique visuel.md aux écrans existants. */
.auth-shell,
.search-panel,
.catalog-item,
.catalog-cart,
.workspace,
.data-section,
.form-section,
.file-summary article,
.record-panel,
.metric-grid article,
.family-card,
.result-form,
.result-summary,
.receipt-ticket {
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.auth-shell,
.workspace,
.data-section,
.form-section,
.record-panel,
.metric-grid article,
.family-card {
    border-color: var(--line);
}

.auth-page {
    background:
        linear-gradient(180deg, rgba(232, 243, 251, 0.84), rgba(244, 248, 251, 0.96)),
        var(--page);
}

.auth-kicker {
    color: var(--brand);
}

.auth-card h1,
.topbar h1,
.control-header h1,
.workspace h2 {
    color: var(--ink);
}

.control-sidebar {
    background: #ffffff;
    box-shadow: 8px 0 24px rgba(15, 76, 129, 0.04);
}

.control-brand {
    border-bottom-color: var(--line);
}

.control-brand span {
    color: var(--brand);
}

.control-sidebar nav a,
.control-back,
.secondary-link,
.logout-link,
.module-nav a {
    border-radius: var(--radius);
}

.control-sidebar nav a:hover,
.control-back:hover,
.module-nav a:hover,
.secondary-link:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.logout-link,
.auth-form button,
.search-form button,
.filter-grid button,
.admin-form button,
.table-actions button,
.data-section form button {
    box-shadow: 0 8px 18px rgba(23, 105, 170, 0.16);
}

.logout-link:hover,
.auth-form button:hover,
.search-form button:hover,
.filter-grid button:hover,
.admin-form button:hover,
.table-actions button:hover,
.data-section form button:hover {
    transform: translateY(-1px);
}

.data-section {
    padding: 6px;
}

.data-section > h2,
.form-section > h2,
.record-panel-wide > h2 {
    margin: 16px 18px;
    font-size: 1.25rem;
}

.data-table,
.compact-table {
    background: #fff;
}

.data-table th,
.compact-table th {
    background: #f8fbfd;
    color: #526273;
    letter-spacing: 0;
}

.data-table tbody tr:hover,
.compact-table tbody tr:hover {
    background: #f9fcfe;
}

.empty-state {
    min-height: 72px;
    padding: 20px !important;
    background: #f8fbfd;
    color: var(--muted);
    font-weight: 800;
}

.auth-alert,
.notice-success {
    border-radius: var(--radius);
}

.notice-success {
    border-left-color: var(--success);
    background: #ecfdf7;
    color: #075f57;
}

.auth-alert {
    background: #fff5f4;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.auth-form input,
.search-form input,
.filter-grid input,
.filter-grid select,
.catalog-toolbar input,
.inline-admin-form select,
.inline-admin-form input,
.inline-cancel-form input,
.salary-form input,
.data-table td > input {
    border-radius: var(--radius);
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.auth-form input:focus,
.search-form input:focus,
.filter-grid input:focus,
.filter-grid select:focus,
.catalog-toolbar input:focus,
.inline-admin-form select:focus,
.inline-admin-form input:focus,
.inline-cancel-form input:focus,
.salary-form input:focus,
.data-table td > input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.15);
}

.role-pill {
    border-radius: 999px;
    border-color: rgba(23, 105, 170, 0.24);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.role-pill-muted {
    background: #f1f5f9;
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric-grid article {
    min-height: 116px;
}

.metric-grid strong {
    color: var(--brand-dark);
}

.metric-danger strong,
.debt-amount {
    color: var(--danger) !important;
}

.form-section,
.record-panel,
.family-card {
    overflow: hidden;
}

.table-actions button,
.data-section form button,
.admin-form button,
.inline-cancel-form button {
    border-radius: var(--radius);
}

.inline-cancel-form button {
    background: var(--danger);
}

.inline-cancel-form button:hover {
    background: #8f1d14;
}

.form-section .admin-form,
.record-panel .admin-form,
.data-section .admin-form {
    padding: 18px;
}

[aria-busy="true"] {
    pointer-events: none;
}

@media (max-width: 760px) {
    .control-app {
        grid-template-columns: 1fr;
    }

    .control-sidebar {
        display: block;
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .control-sidebar nav {
        grid-template-columns: 1fr 1fr;
    }

    .control-main {
        padding: 16px;
    }

    .auth-page {
        padding: 16px;
        place-items: stretch;
    }

    .auth-shell {
        width: 100%;
    }

    .auth-panel {
        padding: 28px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .catalog-toolbar,
    .catalog-cart-line {
        grid-template-columns: 1fr;
    }

    .admin-form .form-wide > div {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .file-summary,
    .record-grid,
    .detail-list div {
        grid-template-columns: 1fr;
    }

    .dashboard-page,
    .admin-page {
        padding: 16px;
    }

    .site-footer-line {
        flex-direction: column;
        gap: 2px;
        padding: 9px 16px;
    }

    .control-sidebar nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
        padding-right: 0;
        scroll-snap-type: x proximity;
    }

    .control-sidebar nav a {
        flex: 0 0 auto;
        scroll-snap-align: start;
        white-space: nowrap;
    }

    .control-back {
        width: 100%;
        justify-content: center;
    }

    .control-nav-group {
        display: none;
    }

    .control-nav-link {
        min-width: 178px;
    }

    .control-nav-logout {
        margin-top: 12px;
    }

    .data-section {
        margin-left: -4px;
        margin-right: -4px;
        padding: 4px;
    }

    .data-table,
    .compact-table {
        min-width: 680px;
    }

    .table-actions,
    .topbar-actions {
        width: 100%;
    }

    .table-actions button,
    .topbar-actions a,
    .logout-link,
    .secondary-link {
        width: 100%;
    }

    .search-form {
        grid-template-columns: 1fr;
    }
}

/* Refresh UI global 2026: surfaces, responsive density and clearer actions. */
::selection {
    background: rgba(23, 105, 170, 0.18);
}

:focus-visible {
    outline: 3px solid rgba(23, 105, 170, 0.24);
    outline-offset: 2px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(23, 105, 170, 0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(23, 105, 170, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 62%);
}

.skip-link {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 1000;
    transform: translateY(-140%);
    border: 1px solid rgba(23, 105, 170, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    background: #fff;
    color: var(--brand-dark);
    font-weight: 900;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
}

.skip-link:focus {
    transform: translateY(0);
}

.control-app {
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.78), rgba(248, 251, 253, 0.72)),
        transparent;
}

.control-main,
.dashboard-page,
.admin-page {
    width: 100%;
    max-width: var(--content-max);
}

.control-main {
    margin: 0 auto;
}

.control-sidebar {
    border-right-color: rgba(198, 211, 223, 0.78);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 253, 0.96)),
        #fff;
}

.control-brand {
    position: relative;
    padding-left: 14px;
}

.control-brand::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 23px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--brand), var(--accent));
}

.control-brand strong {
    color: var(--ink);
    letter-spacing: 0;
}

.control-nav-link {
    border-radius: 10px;
}

.control-nav-link:hover {
    border-color: rgba(23, 105, 170, 0.18);
    transform: translateX(2px);
}

.control-nav-link.is-active {
    background:
        linear-gradient(90deg, rgba(231, 242, 251, 0.98), rgba(229, 247, 244, 0.68)),
        var(--brand-soft);
}

.control-nav-badge {
    box-shadow: 0 8px 18px rgba(180, 35, 24, 0.18);
}

.control-header,
.topbar {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(198, 211, 223, 0.8);
    border-radius: 14px;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 253, 0.92)),
        #fff;
    box-shadow: var(--shadow-soft);
}

.control-header::after,
.topbar::after {
    content: "";
    position: absolute;
    inset: auto 22px 0 22px;
    height: 4px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--brand), var(--accent), #b7791f);
}

.control-header h1,
.topbar h1 {
    max-width: 15ch;
    color: var(--ink);
    font-weight: 900;
}

.auth-kicker,
.control-brand span,
.control-nav-group,
.metric-grid span,
.file-summary span,
.admin-form label,
.catalog-toolbar label {
    letter-spacing: 0.01em;
}

.logout-link,
.secondary-link,
.auth-form button,
.search-form button,
.filter-grid button,
.admin-form button,
.table-actions button,
.data-section form button,
.inline-cancel-form button,
.btn {
    min-height: 44px;
    border-radius: 10px;
    white-space: nowrap;
}

.logout-link,
.auth-form button,
.search-form button,
.filter-grid button,
.admin-form button,
.table-actions button,
.data-section form button,
.btn {
    border: 1px solid rgba(23, 105, 170, 0.12);
    background: linear-gradient(180deg, #1e78bd, var(--brand-dark));
    color: #fff;
}

.secondary-link {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink-soft);
}

.secondary-link:hover {
    border-color: rgba(23, 105, 170, 0.38);
    background: var(--brand-soft);
    color: var(--brand-dark);
    box-shadow: 0 10px 22px rgba(23, 105, 170, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.workspace,
.search-panel,
.data-section,
.form-section,
.record-panel,
.file-summary article,
.metric-grid article,
.family-card,
.catalog-item,
.catalog-cart,
.notification-role-card,
.result-form,
.result-summary {
    border-color: rgba(198, 211, 223, 0.86);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

.workspace,
.search-panel,
.data-section,
.form-section,
.record-panel,
.family-card {
    border-radius: 14px;
}

.metric-grid {
    gap: 16px;
}

.metric-grid article {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 22px;
}

.metric-grid article::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(23, 105, 170, 0.13), rgba(15, 118, 110, 0.1));
}

.metric-grid strong {
    position: relative;
    z-index: 1;
    font-size: clamp(1.45rem, 2.8vw, 2.18rem);
}

.metric-danger {
    background: linear-gradient(135deg, #fff, var(--danger-soft)) !important;
}

.data-section {
    border-radius: 14px;
    padding: 10px;
}

.data-section > h2,
.form-section > h2,
.record-panel-wide > h2 {
    margin: 18px 18px 12px;
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 900;
}

.data-table,
.compact-table {
    border-radius: 10px;
    overflow: hidden;
}

.data-table th,
.data-table td,
.compact-table th,
.compact-table td {
    line-height: 1.45;
}

.data-table th,
.compact-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f3f8fb;
    color: #4e5d70;
    font-weight: 900;
}

.data-table td,
.compact-table td {
    color: var(--ink-soft);
}

.data-table td strong,
.compact-table td strong {
    color: var(--ink);
}

.data-table span,
.compact-table span,
.muted-text {
    color: var(--muted);
}

.role-pill {
    min-height: 28px;
    max-width: 100%;
    white-space: normal;
}

.admin-form,
.auth-form {
    gap: 18px;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.auth-form input,
.search-form input,
.filter-grid input,
.filter-grid select,
.catalog-toolbar input,
.inline-admin-form select,
.inline-admin-form input,
.inline-cancel-form input,
.salary-form input,
.data-table td > input {
    border-color: var(--line-strong);
    background: #fff;
}

.admin-form textarea {
    min-height: 120px;
    resize: vertical;
}

.search-panel {
    padding: 18px;
}

.search-form {
    grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
}

.search-form input {
    min-height: 52px;
    background: #fff;
}

.catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.catalog-item {
    border-radius: 12px;
}

.catalog-item:hover,
.catalog-item.is-selected {
    transform: translateY(-2px);
}

.empty-state {
    border-radius: 10px;
}

.auth-page {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(231, 242, 251, 0.86), rgba(229, 247, 244, 0.64)),
        var(--page);
}

.auth-shell {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: var(--shadow-strong);
}

.auth-shell::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    background: linear-gradient(90deg, var(--brand), var(--accent), #b7791f);
}

.auth-card h1 {
    font-size: clamp(1.85rem, 7vw, 2.45rem);
}

.site-footer {
    border-top-color: rgba(198, 211, 223, 0.8);
    background: rgba(255, 255, 255, 0.88);
}

@media (min-width: 1120px) {
    .control-app {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .control-main {
        padding: 34px;
    }
}

@media (max-width: 980px) {
    .control-app {
        grid-template-columns: 248px minmax(0, 1fr);
    }

    .control-sidebar {
        padding: 18px;
    }

    .control-nav-label {
        font-size: 0.92rem;
    }
}

@media (max-width: 760px) {
    body {
        background: #f5f9fb;
    }

    body::before {
        display: none;
    }

    .control-app {
        grid-template-columns: 1fr;
    }

    .control-header,
    .topbar {
        border-radius: 12px;
        padding: 20px;
    }

    .control-header h1,
    .topbar h1 {
        max-width: none;
        font-size: 1.78rem;
    }

    .control-sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        padding: 14px 16px;
        box-shadow: 0 12px 28px rgba(15, 76, 129, 0.09);
    }

    .control-brand {
        padding-bottom: 14px;
    }

    .control-brand strong {
        font-size: 1.05rem;
    }

    .control-sidebar nav {
        margin-top: 14px;
    }

    .control-nav-link {
        min-width: 184px;
        min-height: 46px;
        background: #fff;
    }

    .control-nav-link:hover {
        transform: none;
    }

    .control-nav-logout {
        display: flex !important;
        min-width: 0;
    }

    .control-main,
    .dashboard-page,
    .admin-page {
        padding: 16px;
    }

    .workspace,
    .form-section,
    .record-panel,
    .search-panel {
        padding: 20px;
    }

    .metric-grid {
        gap: 12px;
    }

    .metric-grid article {
        min-height: 104px;
    }

    .data-section {
        border-radius: 12px;
        margin-top: 20px;
    }

    .data-table th,
    .data-table td {
        padding: 13px 12px;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .workspace-actions {
        display: grid;
        gap: 10px;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .site-footer {
        margin-top: 18px;
    }
}

@media (max-width: 460px) {
    .auth-panel {
        padding: 26px 20px;
    }

    .control-nav-link {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        min-width: 164px;
    }

    .control-nav-icon {
        width: 28px;
        height: 28px;
    }

    .detail-list div,
    .inline-admin-form,
    .inline-cancel-form {
        grid-template-columns: 1fr;
    }
}
