/* ==========================================================================
   SITEC Astreintes — design sobre, mobile-first
   Base = mobile · @media 768px = tablette · @media 1024px = desktop
   ========================================================================== */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-alt: #f9fafb;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --text: #111827;
    --text-muted: #6b7280;

    --primary: #111827;
    --primary-hover: #1f2937;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-bg: #eff6ff;

    --success: #047857;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);

    --header-h: 3.5rem;
    --tabbar-h: 3.75rem;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.55;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 1rem;
}

/* Espace pour la tab bar mobile fixée en bas */
body.has-nav .container {
    padding-bottom: calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    body.has-nav .container {
        padding-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 2rem 1.5rem;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.app-header-top {
    max-width: 1140px;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}

.brand-mark {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.brand-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.brand-sub {
    display: none;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}

@media (min-width: 1024px) {
    .brand-text {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }
    .brand-sub {
        display: block;
    }
}

/* Navigation principale : cachée sur mobile (remplacée par la tab bar) */
.main-nav {
    display: none;
}

@media (min-width: 768px) {
    .main-nav {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        max-width: 1140px;
        margin: 0 auto;
        padding: 0 1rem;
    }
}

.main-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.05rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav .nav-link:hover {
    color: var(--text);
}

.main-nav .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Tablette : la barre est trop étroite pour le texte, on ne garde que les icônes */
@media (max-width: 1023px) {
    .main-nav .nav-label {
        display: none;
    }

    .main-nav .nav-link,
    .main-nav .nav-dropdown-trigger {
        padding: 0.65rem 0.5rem;
    }

    .main-nav .nav-link svg,
    .main-nav .nav-dropdown-trigger svg:not(.nav-dropdown-chevron) {
        width: 1.3rem;
        height: 1.3rem;
    }
}

.main-nav .nav-link svg {
    width: 1.05rem;
    height: 1.05rem;
}

/* Menu déroulant "Administration" (desktop) : regroupe les liens admin
   dans un seul item de nav pour ne pas rallonger la barre principale. */
.nav-dropdown {
    position: relative;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}

.nav-dropdown-trigger {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.nav-dropdown-trigger::-webkit-details-marker {
    display: none;
}

.nav-dropdown-chevron {
    width: 0.85rem !important;
    height: 0.85rem !important;
    margin-left: -0.1rem;
    transition: transform 0.15s ease;
}

.nav-dropdown[open] .nav-dropdown-chevron {
    transform: rotate(180deg);
}

.nav-dropdown[open] .nav-dropdown-trigger {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 13rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    z-index: 30;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-item svg {
    width: 1.05rem;
    height: 1.05rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.nav-dropdown-item:hover {
    background: var(--surface-alt);
}

.nav-dropdown-item.active {
    color: var(--accent);
    background: var(--accent-bg);
}

.nav-dropdown-item.active svg {
    color: var(--accent);
}

/* Utilisateur */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    padding-right: 0.5rem;
    border-right: 1px solid var(--border);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.user-avatar {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.user-name {
    display: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1024px) {
    .user-name {
        display: block;
        max-width: 12rem;
    }
}

.role-tag {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--warning);
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

.btn-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
    background: var(--surface-alt);
    color: var(--danger);
}

.btn-icon.btn-icon-accent:hover {
    color: var(--accent);
}

.btn-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.btn-icon-sm {
    width: 1.9rem;
    height: 1.9rem;
}

.btn-icon-sm svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* ==========================================================================
   Tab bar mobile (navigation basse)
   ========================================================================== */

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 768px) {
    .tab-bar {
        display: none;
    }
}

.tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    height: var(--tabbar-h);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 500;
}

.tab-link svg {
    width: 1.35rem;
    height: 1.35rem;
}

.tab-link.active {
    color: var(--accent);
}

/* Menu déroulant "Admin" (tab bar mobile) : s'ouvre vers le haut, au-dessus de la barre. */
.tab-dropdown {
    position: relative;
}

.tab-dropdown-trigger {
    width: 100%;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.tab-dropdown-trigger::-webkit-details-marker {
    display: none;
}

.tab-dropdown[open] .tab-dropdown-trigger {
    color: var(--accent);
}

.tab-dropdown-panel {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    right: 0.25rem;
    min-width: 12rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    z-index: 30;
}

.tab-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.65rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.tab-dropdown-item svg {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.tab-dropdown-item.active {
    color: var(--accent);
    background: var(--accent-bg);
}

.tab-dropdown-item.active svg {
    color: var(--accent);
}

/* ==========================================================================
   Titres de page & sections
   ========================================================================== */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 1.25rem;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.05rem;
}

@media (min-width: 768px) {
    .page-header h1 {
        font-size: 1.4rem;
    }
    .section-header h2 {
        font-size: 1.15rem;
    }
}

/* ==========================================================================
   Cartes
   ========================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.card-flush {
    padding: 0;
    overflow: hidden;
}

.card-flush .table-container {
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .card-flush .table-container {
        padding: 0;
    }
}

/* ==========================================================================
   KPI
   ========================================================================== */

.kpis-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .kpis-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border-left-width: 3px;
}

.kpi-card.kpi-primary { border-left-color: var(--accent); }
.kpi-card.kpi-success { border-left-color: var(--success); }
.kpi-card.kpi-warning { border-left-color: var(--warning); }
.kpi-card.kpi-accent  { border-left-color: var(--border-strong); }

.kpi-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

@media (min-width: 768px) {
    .kpi-value {
        font-size: 1.35rem;
    }
}

.kpi-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Cartes astreinte (identité niveau 1 / niveau 2 / jours dus)
   ========================================================================== */

.kpi-card--astreinte {
    border-left-width: 1px;
    border-radius: 14px;
}

.astreinte-identity {
    display: flex;
    gap: 0.85rem;
}

.astreinte-icon {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.astreinte-icon--l1 {
    background: var(--accent-bg);
    color: var(--accent);
}

.astreinte-icon--l2 {
    background: var(--success-bg);
    color: var(--success);
}

.astreinte-body {
    min-width: 0;
    flex: 1;
}

.astreinte-eyebrow-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.astreinte-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.status-live {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--success-bg);
    color: var(--success);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.status-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.astreinte-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.astreinte-desc {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.days-left-pill {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--warning);
    background: var(--warning-bg);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.astreinte-contacts {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.astreinte-contact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
}

.astreinte-contact-row a {
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.astreinte-contact-row a:hover {
    text-decoration: underline;
}

.astreinte-contact-name {
    font-weight: 600;
    color: var(--text-muted);
}

/* Carte "jours dus" : nom en tête de carrousel + montant mis en avant */
.kpi-card--stat .kpi-title {
    margin-bottom: 0.6rem;
}

.astreinte-stat-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.astreinte-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.astreinte-stat-value {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.astreinte-stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--warning);
}

.astreinte-stat-number--zero {
    color: var(--text-muted);
}

.astreinte-stat-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dashboard-equity-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.dashboard-equity-values > div {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.35rem;
    align-items: baseline;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}

.dashboard-equity-label {
    grid-column: 1 / -1;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dashboard-equity-values strong { font-size: 1rem; color: var(--text-muted); }
.dashboard-equity-values strong.is-owing { color: var(--warning); }
.dashboard-equity-values strong.is-ahead { color: var(--success); }

/* Carrousel "jours dus" */
.carousel-card {
    position: relative;
}

.carousel-viewport {
    position: relative;
    min-height: 2.9rem;
}

.carousel-item {
    display: none;
}

.carousel-item.active {
    display: block;
    animation: carousel-fade 0.4s ease;
}

@keyframes carousel-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carousel-dots {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.6rem;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-strong);
    opacity: 0.5;
}

.carousel-dot.active {
    opacity: 1;
    background: var(--warning);
}

/* ==========================================================================
   Boutons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: var(--surface-alt);
}

.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border-color: var(--danger-border);
}

.btn-danger:hover {
    background: var(--danger-bg);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover:not(:disabled) {
    background: var(--accent-hover);
}

/* ==========================================================================
   Tableaux responsives (cartes sur mobile, tableau dès 768px)
   ========================================================================== */

.table-container {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

/* --- Mobile : chaque ligne devient une carte --- */
table.responsive thead {
    display: none;
}

table.responsive tbody,
table.responsive tr,
table.responsive td {
    display: block;
    width: 100%;
}

table.responsive tr {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.6rem;
}

table.responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.35rem 0;
    border: none;
    font-size: 0.875rem;
}

table.responsive td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

table.responsive td.cell-employee {
    justify-content: flex-start;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

table.responsive td.actions-col {
    justify-content: flex-end;
    padding-top: 0.6rem;
}

/* --- Tablette / desktop : tableau classique --- */
@media (min-width: 768px) {
    table.responsive thead {
        display: table-header-group;
    }
    table.responsive tbody {
        display: table-row-group;
    }
    table.responsive tr {
        display: table-row;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }
    table.responsive td {
        display: table-cell;
        width: auto;
        padding: 0.75rem 0.75rem;
        border-bottom: 1px solid var(--border);
    }
    table.responsive td[data-label]::before {
        content: none;
    }
    table.responsive td.cell-employee {
        border-bottom: 1px solid var(--border);
        margin: 0;
    }
    table.responsive tr:hover td {
        background: var(--surface-alt);
    }
    .table-container {
        overflow-x: auto;
    }
}

th {
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    padding: 0.75rem 1rem;
    background: var(--surface-alt);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

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

.data-table tbody tr:hover td {
    background: var(--surface-alt);
}

.data-table .total-cell {
    border-left: 2px solid var(--border-strong);
}

.row-past {
    opacity: 0.55;
}

.cell-main {
    font-weight: 600;
}

.cell-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.actions-cell {
    display: inline-flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.actions-cell form {
    margin: 0;
}

/* ==========================================================================
   Badges & progression
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.status-check-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-top: .5rem;
}

.status-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
}

.status-check.is-ok {
    color: var(--success);
}

.status-check.is-ko {
    color: var(--danger);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.progress-bar-wrapper {
    flex-grow: 1;
    height: 0.4rem;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    min-width: 4rem;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.progress-value {
    font-weight: 600;
    min-width: 2.5rem;
    text-align: right;
    font-size: 0.8rem;
}

/* ==========================================================================
   Encarts d'information (recommandations, alertes)
   ========================================================================== */

.info-box {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.info-box.info-success {
    background: var(--success-bg);
    border-color: var(--success-border);
}

.info-box.info-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.info-box-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.info-box.info-success .info-box-title {
    color: var(--success);
}

.info-box.info-warning .info-box-title {
    color: var(--warning);
}

.info-box p {
    font-size: 0.83rem;
    color: var(--text-muted);
}

.info-box p + p,
.info-box p + .candidate-list {
    margin-top: 0.5rem;
}

.info-box strong {
    color: var(--text);
}

.candidate-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.candidate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.875rem;
}

/* ==========================================================================
   Formulaires
   ========================================================================== */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.form-control,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
select:focus,
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.form-errors {
    margin-top: 0.35rem;
    color: var(--danger);
    font-size: 0.78rem;
    list-style: none;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    width: 100%;
}

@media (min-width: 768px) {
    .form-actions {
        flex-direction: row;
    }
    .form-actions .btn {
        width: auto;
    }
}

.debt-form-card {
    margin-bottom: 1.25rem;
}

.debt-phrase-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}

.debt-phrase-control {
    min-width: 0;
}

.debt-phrase-control.is-person {
    flex: 1 1 190px;
}

.debt-phrase-control.is-days {
    flex: 0 0 5rem;
}

.debt-phrase-control.is-date {
    flex: 0 1 10.5rem;
}

.debt-phrase-word {
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}

.debt-form-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.debt-form-footer .form-help {
    margin: 0;
}

.debt-form-footer .btn {
    width: 100%;
}

.debt-list-header {
    padding: 1rem;
}

.debt-sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.debt-settle-form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.debt-settle-form input[type="number"] {
    width: 5rem;
    padding: 0.35rem 0.5rem;
}

@media (min-width: 768px) {

    .debt-form-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-top: 1rem;
    }

    .debt-form-footer .btn {
        width: auto;
    }
}

.settings-time-grid {
    display: grid;
    gap: 0.75rem;
}

.settings-time-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transform: rotate(90deg);
}

.settings-time-arrow svg {
    width: 1.5rem;
    height: 1.5rem;
}

.settings-period-preview {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.settings-period-icon {
    color: var(--accent);
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .settings-time-grid {
        grid-template-columns: minmax(0, 1fr) 2.25rem minmax(0, 1fr);
        align-items: end;
    }

    .settings-time-grid .form-group {
        margin-bottom: 0;
    }

    .settings-time-arrow {
        height: 2.5rem;
        transform: none;
    }
}

/* Carte formulaire centrée (new / edit) */
.form-card {
    max-width: 560px;
    margin: 0 auto;
}

/* ==========================================================================
   Messages flash & états vides
   ========================================================================== */

.flash-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.flash-danger,
.flash-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

.flash-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

/* ==========================================================================
   Page de connexion
   ========================================================================== */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 8vh;
    min-height: 80vh;
}

@media (min-width: 768px) {
    .login-wrapper {
        align-items: center;
        padding-top: 0;
    }
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .login-card {
        padding: 2.25rem;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    border-radius: var(--radius);
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.9rem;
}

.login-header h1 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    font-size: 0.83rem;
    color: var(--text-muted);
}

.login-submit {
    width: 100%;
    padding: 0.7rem;
}

.login-help-box {
    margin-top: 1.5rem;
    padding: 0.9rem 1rem;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-help-box summary {
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.login-help-box ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

.login-help-box li {
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   Calendrier
   ========================================================================== */

.calendar-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .calendar-layout {
        grid-template-columns: 1.4fr 0.8fr;
        gap: 1.5rem;
        align-items: start;
    }
}

.calendar-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .calendar-container {
        padding: 1.25rem;
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
}

.calendar-header h3 {
    font-size: 1rem;
    text-transform: capitalize;
}

.calendar-controls {
    display: flex;
    gap: 0.4rem;
}

.calendar-nav-btn {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s ease;
}

.calendar-nav-btn:hover {
    background: var(--surface-alt);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
}

@media (min-width: 768px) {
    .calendar-grid {
        gap: 0.4rem;
    }
}

.calendar-day-label {
    text-align: center;
    font-weight: 600;
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 0.35rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calendar-day-cell {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    background: var(--surface);
    position: relative;
    overflow: hidden;
    min-height: 3rem;
}

@media (min-width: 768px) {
    .calendar-day-cell {
        min-height: 4.25rem;
        padding: 0.4rem;
    }
}

.calendar-day-cell:hover:not(.occupied) {
    background: var(--accent-bg);
    border-color: var(--accent);
}

.calendar-day-number {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .calendar-day-number {
        font-size: 0.85rem;
    }
}

.calendar-day-cell.today {
    border-color: var(--accent);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

.calendar-day-cell.today .calendar-day-number {
    color: var(--accent);
    font-weight: 700;
}

/* Jour occupé */
.calendar-day-cell.occupied {
    background: var(--surface-alt);
    cursor: pointer;
}

.calendar-day-cell.occupied .calendar-day-number {
    color: var(--border-strong);
}

.calendar-day-cell.selected-occupied {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: var(--accent-bg) !important;
}

.calendar-day-cell.selected-occupied .calendar-day-number {
    color: var(--accent) !important;
    font-weight: 700;
}

.calendar-day-assignee {
    font-size: 0.58rem;
    padding: 0.1rem 0.2rem;
    background: var(--accent-bg);
    border-radius: 3px;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-top: auto;
    text-align: center;
}

@media (min-width: 768px) {
    .calendar-day-assignee {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
}

/* Jour sélectionné (multi-sélection jour par jour) */
.calendar-day-cell.selected {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: var(--accent-bg) !important;
}

.calendar-day-cell.selected .calendar-day-number {
    color: var(--primary) !important;
    font-weight: 700;
}

/* Jour verrouillé : une demande de remplacement est en attente de validation */
.calendar-day-cell.locked {
    cursor: not-allowed;
    opacity: 0.75;
    background: repeating-linear-gradient(
        45deg,
        var(--surface-alt),
        var(--surface-alt) 6px,
        var(--warning-bg) 6px,
        var(--warning-bg) 12px
    );
}

.calendar-day-cell.locked:hover {
    background: repeating-linear-gradient(
        45deg,
        var(--surface-alt),
        var(--surface-alt) 6px,
        var(--warning-bg) 6px,
        var(--warning-bg) 12px
    );
    border-color: var(--border);
}

.calendar-day-cell.locked .calendar-day-assignee {
    background: var(--warning-bg);
    color: var(--warning);
}

/* Panneau de planification */
.calendar-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .calendar-panel {
        padding: 1.25rem;
    }
}

.calendar-panel-heading {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.calendar-panel h4 {
    font-size: 0.95rem;
}

.calendar-panel-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.calendar-panel-placeholder {
    color: var(--text-muted);
    font-size: 0.83rem;
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    line-height: 1.5;
}

.calendar-panel-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.selected-dates-badge {
    padding: 0.75rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.selected-dates-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.selected-dates-badge span#selectedDatesText {
    font-weight: 600;
}

.selection-info-box {
    padding: 0.75rem 0.9rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-sm);
    color: var(--warning);
    font-size: 0.8rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.selection-info-icon {
    flex-shrink: 0;
    line-height: 1;
}

.selection-info-box p {
    margin: 0;
    color: inherit;
}

/* Select "Remplaçant" : flèche personnalisée, cohérente avec le reste de l'UI */
#replacement_employee.select-chevron {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
}

.rec-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.9rem;
    margin-bottom: 0.5rem;
}

.rec-suggestion {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    background: var(--accent-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    font-family: var(--font);
    transition: border-color 0.15s ease;
}

.rec-suggestion:hover {
    border-color: var(--accent);
}

.rec-suggestion-icon {
    flex-shrink: 0;
    color: var(--accent);
    font-size: 0.95rem;
    line-height: 1;
}

.rec-suggestion-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.rec-suggestion-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.rec-suggestion-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Équité — cartes de balance (façon Settle)
   ========================================================================== */

.equity-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .equity-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
}

.equity-cta {
    margin-top: 0.6rem;
}

.balance-list {
    display: flex;
    flex-direction: column;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.balance-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.balance-item:first-child {
    padding-top: 0;
}

.balance-avatar {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.balance-avatar.is-positive {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.balance-avatar.is-negative {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.balance-info {
    flex: 1;
    min-width: 0;
}

/* Barre divergente autour de la moyenne (masquée sur mobile, l'essentiel
   est porté par le montant signé) */
.balance-bar {
    display: none;
}

@media (min-width: 768px) {
    .balance-bar {
        display: flex;
        align-items: stretch;
        flex: 0 0 200px;
        height: 8px;
    }

    .balance-bar-side {
        position: relative;
        flex: 1;
        background: var(--surface-alt);
        overflow: hidden;
    }

    .balance-bar-side.neg {
        border-radius: 4px 0 0 4px;
        border-right: 1px solid var(--border-strong);
    }

    .balance-bar-side.pos {
        border-radius: 0 4px 4px 0;
        border-left: 1px solid var(--border-strong);
    }

    .balance-bar-side span {
        position: absolute;
        top: 0;
        height: 100%;
    }

    .balance-bar-side.neg span {
        right: 0;
        background: var(--warning);
        border-radius: 4px 0 0 4px;
    }

    .balance-bar-side.pos span {
        left: 0;
        background: var(--success);
        border-radius: 0 4px 4px 0;
    }
}

.balance-amount-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 5rem;
}

.balance-amount {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.balance-amount.positive { color: var(--success); }
.balance-amount.negative { color: var(--warning); }
.balance-amount.neutral  { color: var(--text-muted); }

.balance-amount-sub {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
}

/* Cartes de synthèse « hero » : en avance / doit le plus */
.equity-hero {
    position: relative;
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    background: var(--surface);
    overflow: hidden;
}

.equity-hero.is-ahead {
    background: linear-gradient(140deg, var(--success-bg) 0%, var(--surface) 65%);
    border-color: var(--success-border);
}

.equity-hero.is-owing {
    background: linear-gradient(140deg, var(--warning-bg) 0%, var(--surface) 65%);
    border-color: var(--warning-border);
}

.equity-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.equity-hero-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
}

.equity-hero.is-ahead .equity-hero-label { color: var(--success); }
.equity-hero.is-owing .equity-hero-label { color: var(--warning); }

.equity-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.equity-hero-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.equity-hero.is-ahead .equity-hero-icon {
    color: var(--success);
    border: 1px solid var(--success-border);
}

.equity-hero.is-owing .equity-hero-icon {
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.equity-hero-person {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.equity-hero-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.equity-hero-amount {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
    .equity-hero-amount {
        font-size: 2.9rem;
    }
}

.equity-hero.is-ahead .equity-hero-amount { color: var(--success); }
.equity-hero.is-owing .equity-hero-amount { color: var(--warning); }

.equity-hero-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.equity-hero .equity-cta {
    margin-top: 0.9rem;
}

/* ==========================================================================
   Modification Request Rows
   ========================================================================== */

.mod-request-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.mod-request-row:last-child {
    margin-bottom: 0;
}

.mod-request-row.status-pending {
    border-left-color: var(--warning);
}

.mod-request-row.status-accepted {
    border-left-color: var(--success);
}

.mod-request-row.status-refused {
    border-left-color: var(--danger);
}

@media (min-width: 768px) {
    .mod-request-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
    }
}

.mod-request-info {
    flex: 1;
    min-width: 0;
}

.mod-proposal {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.mod-proposal .mod-requester {
    font-weight: 600;
}

.mod-proposal .mod-proposed-employee {
    color: var(--accent);
    font-weight: 600;
}

.mod-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mod-meta a {
    color: var(--accent);
    font-weight: 500;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-badge.status-pending {
    background-color: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.status-badge.status-accepted {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.status-badge.status-refused {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.mod-request-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .mod-request-actions {
        width: 100%;
        justify-content: flex-end;
        border-top: 1px dashed var(--border);
        padding-top: 0.75rem;
        margin-top: 0.25rem;
    }
}

.modification-review-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.modification-review-main {
    display: grid;
    gap: 1.25rem;
}

.modification-review-grid .card {
    margin: 0;
}

.modification-summary-card {
    border-left: 3px solid var(--border-strong);
}

.modification-summary-card.is-proposed {
    border-left-color: var(--accent);
}

.modification-summary-card p:last-child {
    margin-bottom: 0;
}

.modification-approvals-card {
    display: flex;
    flex-direction: column;
}

.approval-decision-date {
    margin: -0.25rem 0 0.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.approval-review-list {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.approval-review-row {
    display: flex;
    min-height: 5.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}

.approval-review-row + .approval-review-row {
    border-top: 1px solid var(--border);
}

.approval-review-person {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
}

.approval-accepted-mark {
    display: inline-flex;
    width: 3.5rem;
    height: 3.5rem;
    flex: 0 0 3.5rem;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--success-border);
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
}

.approval-accepted-mark svg {
    width: 2.15rem;
    height: 2.15rem;
}

.approval-status-badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.approval-status-badge.is-pending {
    border-color: var(--warning-border);
    background: var(--warning-bg);
    color: var(--warning);
}

.approval-status-badge.is-refused {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger);
}

@media (min-width: 900px) {
    .modification-review-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
        align-items: stretch;
    }
}

/* Heures pratiquées et interventions */
.intervention-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.intervention-page-header .btn { flex-shrink: 0; }
.intervention-header-actions { display: flex; align-items: center; gap: .65rem; }
.intervention-header-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
@media (max-width: 767px) {
    .intervention-header-actions { flex-direction: column; width: 100%; }
}
.period-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.period-form, .period-inline-form { display: flex; align-items: end; gap: .65rem; }
.period-form .form-group { margin: 0; }
.night-rule { color: var(--text-muted); font-size: .875rem; }
.intervention-form-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
.intervention-form-grid .form-control { min-width: 0; width: 100%; }
.intervention-form-description { grid-column: 1 / -1; }
.form-help { margin: .75rem 0 1rem; color: var(--text-muted); font-size: .84rem; }
.form-help p { margin: 0; }
.form-help ul { display: grid; gap: .2rem; margin: .35rem 0; padding-left: 1.1rem; }
.intervention-table-wrap { overflow-x: auto; }
.intervention-detail-table { min-width: 920px; }
@media (min-width: 768px) {
    .intervention-summary-table { min-width: 920px; }
}
.intervention-summary-table th:not(:first-child), .intervention-summary-table td:not(:first-child) { text-align: right; white-space: nowrap; }
@media (max-width: 767px) {
    .intervention-summary-table.responsive td.total-cell { border-left: none; }
}
.technician-cell { font-weight: 600; white-space: nowrap; }
.total-cell { font-weight: 700; background: var(--surface-alt); }
.description-cell { min-width: 230px; max-width: 380px; white-space: normal; }
.number-cell { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions-cell { display: flex; gap: .4rem; justify-content: flex-end; white-space: nowrap; }
.actions-cell form { margin: 0; }
.intervention-edit-card { max-width: 760px; margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 768px) {
    .intervention-form-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .8fr) minmax(0, .8fr); gap: 1rem; }
}

@media (max-width: 767px) {
    .intervention-page-header, .period-toolbar, .section-header:has(.period-inline-form) { align-items: stretch; flex-direction: column; }
    .intervention-page-header .btn { width: 100%; }
    .period-form, .period-inline-form { width: 100%; }
    .period-form .form-group, .period-inline-form input { flex: 1; }
}
