/* ============================================================
   HRFlow — Design System
   Charte Moderne & Corporate
   Palette : Navy #0B1D51 | Blue #1E4FD8 | Sky #38AEFF | White
   ============================================================ */

/* ── VARIABLES ── */
:root {
    --bg: #f0f2f8;
    --surface: #ffffff;
    --surface2: #f7f8fc;
    --border: #e4e7f0;

    --navy: #0b1d51;
    --blue: #1e4fd8;
    --blue-light: #eef3ff;
    --blue-hover: #1641b8;
    --sky: #38aeff;

    --text: #0f1a3e;
    --muted: #6e7a99;
    --subtle: #a8b0c8;

    --green: #16a363;
    --green-bg: #e8f7f1;
    --amber: #e07b00;
    --amber-bg: #fff4e5;
    --red: #d93838;
    --red-bg: #fdeaea;
    --purple: #7c3aed;
    --purple-bg: #f3eeff;

    --shadow-sm: 0 1px 3px rgba(11, 29, 81, 0.07);
    --shadow-md: 0 4px 16px rgba(11, 29, 81, 0.1);
    --shadow-lg: 0 8px 32px rgba(11, 29, 81, 0.13);

    --font: "Plus Jakarta Sans", system-ui, sans-serif;
    --radius: 12px;
    --sidebar-w: 248px;
}

/* ── RESET ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    font-size: 14px;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100dvh;
}
a {
    text-decoration: none;
    color: inherit;
}
button {
    cursor: pointer;
    font-family: var(--font);
}
input,
select,
textarea {
    font-family: var(--font);
}
ul,
ol {
    list-style: none;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes pop {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ── LAYOUT ── */
.app-wrapper {
    display: flex;
    min-height: 100dvh;
    overflow: hidden; /* empêche le body de scroller horizontalement */
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    height: 100dvh;
    z-index: 100;
    transition: transform 0.25s ease;
}
.sidebar-logo {
    padding: 28px 24px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--blue);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-logo-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
.sidebar-logo-name span {
    color: var(--sky);
}
.sidebar-logo-tag {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 1px;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
}
.nav-section {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 0 12px;
    margin: 20px 0 6px;
    font-weight: 600;
}
.nav-section:first-child {
    margin-top: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 1px;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
}
.nav-item.active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 2px 10px rgba(30, 79, 216, 0.4);
}
.nav-item.active .nav-icon {
    opacity: 1;
}
.nav-icon {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}
.nav-badge {
    margin-left: auto;
    background: var(--sky);
    color: var(--navy);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    line-height: 1.6;
}
.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.sidebar-footer {
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.sidebar-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}
.sidebar-user-more {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    cursor: pointer;
}

/* ── MAIN ── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0; /* critique : sans ça, flex:1 ne borne pas la largeur en flex */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}
.page-eyebrow {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 4px;
}
.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── BUTTONS ── */
.btn {
    padding: 9px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    font-family: var(--font);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 2px 10px rgba(30, 79, 216, 0.35);
}
.btn-primary:hover {
    background: var(--blue-hover);
    box-shadow: 0 4px 16px rgba(30, 79, 216, 0.45);
}

.btn-ghost {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--subtle);
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1.5px solid rgba(217, 56, 56, 0.2);
}
.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

.btn-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1.5px solid rgba(22, 163, 99, 0.2);
}
.btn-success:hover {
    background: var(--green);
    color: #fff;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
}
.btn-xs {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 7px;
}
.btn-icon {
    padding: 8px;
    border-radius: 8px;
    aspect-ratio: 1;
    justify-content: center;
}

/* ── CARD ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.4s ease both;
}
.card-body {
    padding: 22px;
}
.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}
.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.card-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.card-link {
    font-size: 12px;
    color: var(--blue);
    font-weight: 600;
    flex-shrink: 0;
}

/* ── KPI CARDS ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.kpi-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.4s ease both;
    transition:
        box-shadow 0.2s,
        transform 0.2s;
}
.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}
.kpi-value {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}
.kpi-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    margin-top: 5px;
}
.kpi-trend {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.kpi-blue .kpi-icon {
    background: var(--blue-light);
}
.kpi-blue .kpi-value {
    color: var(--blue);
}
.kpi-green .kpi-icon {
    background: var(--green-bg);
}
.kpi-green .kpi-value {
    color: var(--green);
}
.kpi-amber .kpi-icon {
    background: var(--amber-bg);
}
.kpi-amber .kpi-value {
    color: var(--amber);
}
.kpi-red .kpi-icon {
    background: var(--red-bg);
}
.kpi-red .kpi-value {
    color: var(--red);
}
.trend-up {
    background: var(--green-bg);
    color: var(--green);
}
.trend-down {
    background: var(--red-bg);
    color: var(--red);
}
.trend-flat {
    background: var(--surface2);
    color: var(--muted);
}

/* ── TABLE ── */
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
thead th {
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 9px 14px;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    white-space: nowrap;
}
thead th.th-center {
    text-align: center;
}
tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}
tbody tr:last-child td {
    border-bottom: none;
}
tbody tr:hover td {
    background: var(--surface2);
}
.td-center {
    text-align: center;
}
.td-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-blue {
    background: var(--blue-light);
    color: var(--blue);
}
.badge-green {
    background: var(--green-bg);
    color: var(--green);
}
.badge-amber {
    background: var(--amber-bg);
    color: var(--amber);
}
.badge-red {
    background: var(--red-bg);
    color: var(--red);
}
.badge-purple {
    background: var(--purple-bg);
    color: var(--purple);
}
.badge-grey {
    background: var(--surface2);
    color: var(--muted);
    border: 1px solid var(--border);
}
.badge-white {
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--border);
}
.badge-navy {
    background: var(--navy);
    color: #fff;
}

/* Permission tag (pill small) */
.perm-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    background: var(--blue-light);
    color: var(--blue);
    margin: 2px;
}

/* ── FORMS ── */
.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: fadeUp 0.4s ease both;
}
.form-section {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}
.form-section:last-child {
    border-bottom: none;
}
.form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.form-section-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.form-section-title {
    font-size: 14px;
    font-weight: 700;
}
.form-section-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
.col-span-2 {
    grid-column: span 2;
}
.col-span-3 {
    grid-column: span 3;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.form-label.required::after {
    content: " *";
    color: var(--red);
}

.form-input {
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    width: 100%;
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}
.form-input:focus {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 79, 216, 0.08);
}
.form-input::placeholder {
    color: var(--subtle);
}
.form-input.is-invalid {
    border-color: var(--red);
}
.form-input.is-valid {
    border-color: var(--green);
}
select.form-input {
    cursor: pointer;
}
textarea.form-input {
    resize: vertical;
    min-height: 90px;
}

.form-hint {
    font-size: 11px;
    color: var(--subtle);
    margin-top: 3px;
}
.form-error {
    font-size: 11px;
    color: var(--red);
    margin-top: 3px;
}
.form-valid {
    font-size: 11px;
    color: var(--green);
    margin-top: 3px;
}

.input-wrap {
    position: relative;
}
.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--subtle);
    pointer-events: none;
}
.input-wrap .form-input {
    padding-left: 36px;
}
.input-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--subtle);
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font);
}
.input-wrap .form-input.has-suffix {
    padding-right: 36px;
}

.form-actions {
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface2);
    border-top: 1px solid var(--border);
}
.form-actions-spacer {
    flex: 1;
}

/* ── TOGGLE ── */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}
.toggle-info {
    flex: 1;
}
.toggle-label {
    font-size: 13px;
    font-weight: 600;
}
.toggle-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 20px;
    transition: 0.25s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle input:checked + .toggle-slider {
    background: var(--blue);
}
.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ── CHECKBOX GRID ── */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface2);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    font-weight: 500;
}
.checkbox-item:hover {
    border-color: var(--blue);
    background: var(--blue-light);
}
.checkbox-item input[type="checkbox"] {
    accent-color: var(--blue);
    width: 15px;
    height: 15px;
    cursor: pointer;
}
.checkbox-item.checked {
    border-color: var(--blue);
    background: var(--blue-light);
}
.checkbox-item span {
    color: var(--text);
    font-size: 12px;
}

/* ── ALERT ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
    animation: fadeUp 0.3s ease;
}
.alert-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}
.alert-body {
}
.alert-title {
    font-weight: 700;
}
.alert-text {
    color: var(--muted);
    margin-top: 2px;
    font-size: 12px;
}
.alert-success {
    background: var(--green-bg);
    border: 1px solid rgba(22, 163, 99, 0.2);
    color: var(--green);
}
.alert-danger {
    background: var(--red-bg);
    border: 1px solid rgba(217, 56, 56, 0.2);
    color: var(--red);
}
.alert-warning {
    background: var(--amber-bg);
    border: 1px solid rgba(224, 123, 0, 0.2);
    color: var(--amber);
}
.alert-info {
    background: var(--blue-light);
    border: 1px solid rgba(30, 79, 216, 0.2);
    color: var(--blue);
}

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 29, 81, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.modal-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 0;
    max-width: 520px;
    width: 92%;
    box-shadow: var(--shadow-lg);
    animation: pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
.modal-header {
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-size: 16px;
    font-weight: 700;
}
.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 18px;
    background: none;
    border: none;
    transition: all 0.15s;
}
.modal-close:hover {
    background: var(--surface2);
    color: var(--text);
}
.modal-body {
    padding: 22px 26px;
}
.modal-footer {
    padding: 16px 26px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--surface2);
}

/* ── CONFIRM MODAL ── */
.modal-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 16px;
}
.modal-confirm-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}
.modal-confirm-text {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    line-height: 1.7;
}

/* ── FILTER BAR ── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font);
    transition: all 0.15s;
}
.filter-pill.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.filter-pill:hover:not(.active) {
    border-color: var(--blue);
    color: var(--blue);
}

.search-input {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 8px 14px 8px 36px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text);
    outline: none;
    width: 240px;
    transition: border-color 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A8B0C8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}
.search-input:focus {
    border-color: var(--blue);
}

/* ── AVATAR ── */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-cell-name {
    font-weight: 600;
    font-size: 13px;
}
.user-cell-sub {
    font-size: 11px;
    color: var(--muted);
}

/* ── PAGINATION ── */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    padding: 16px 0 2px;
}
.pg-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    transition: all 0.15s;
}
.pg-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}
.pg-btn.current {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* ── BREADCRUMB ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 20px;
}
.breadcrumb a {
    color: var(--muted);
}
.breadcrumb a:hover {
    color: var(--blue);
}
.breadcrumb-sep {
    color: var(--subtle);
}
.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
    opacity: 0.5;
}
.empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.empty-text {
    font-size: 13px;
    color: var(--muted);
}

/* ── TOAST ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: fadeUp 0.3s ease;
    pointer-events: all;
    min-width: 240px;
}
.toast-success {
    background: var(--green);
    color: #fff;
}
.toast-danger {
    background: var(--red);
    color: #fff;
}
.toast-info {
    background: var(--navy);
    color: #fff;
}

/* ── LOGIN PAGE ── */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.login-left {
    background: var(--navy);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}
.login-left::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(30, 79, 216, 0.25);
}
.login-left::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(56, 174, 255, 0.1);
}
.login-brand {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 48px;
}
.login-brand-icon {
    width: 64px;
    height: 64px;
    background: var(--blue);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 16px;
    box-shadow: 0 8px 32px rgba(30, 79, 216, 0.4);
}
.login-brand-name {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.login-brand-name span {
    color: var(--sky);
}
.login-brand-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 6px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.login-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.login-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.login-feature-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.login-feature-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}
.login-feature-title {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: var(--bg);
}
.login-form-wrap {
    width: 100%;
    max-width: 400px;
}
.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.login-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 32px;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── RESPONSIVE ── */

/* ── Hamburger : caché par défaut sur desktop ── */
.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.hamburger span,
.hamburger span::before,
.hamburger span::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    position: relative;
    transition: all 0.25s;
}
.hamburger span::before,
.hamburger span::after {
    content: "";
    position: absolute;
    left: 0;
}
.hamburger span::before {
    top: -5px;
}
.hamburger span::after {
    top: 5px;
}

/* Overlay sombre derrière la sidebar ouverte (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 29, 81, 0.45);
    z-index: 99;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.visible {
    display: block;
}

/* Topbar mobile : cachée sur desktop */
.mobile-topbar {
    display: none;
}

/* Wrapper de contenu : padding desktop */
.main-content-inner {
    padding: 32px 36px;
}

/* ── Tablette (≤ 1024px) ── */
@media (max-width: 1024px) {
    .login-page {
        grid-template-columns: 1fr;
    }
    .login-left {
        display: none;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-content-inner {
        padding: 24px 20px;
    }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {
    /* Sidebar cachée, glisse depuis la gauche */
    .sidebar {
        transform: translateX(-100%);
        z-index: 100;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Contenu pleine largeur */
    .main-content {
        margin-left: 0;
        padding: 0;
    }

    /* Topbar mobile collée en haut */
    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
    }
    .mobile-topbar-title {
        font-size: 15px;
        font-weight: 700;
        color: var(--text);
        flex: 1;
    }

    /* Hamburger visible */
    .hamburger {
        display: flex;
    }

    /* Contenu scrollable sous la topbar mobile */
    .main-content-inner {
        padding: 16px;
    }

    /* Grilles → 1 colonne */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
    .col-span-2,
    .col-span-3 {
        grid-column: span 1;
    }

    /* Tables : scroll horizontal propre, sans débordement global */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius);
    }

    /* Topbar page (titre + boutons) → empilée */
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }
    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .topbar-actions .btn,
    .topbar-actions select {
        flex: 1;
        min-width: 120px;
    }

    /* Page title plus petite */
    .page-title {
        font-size: 20px;
    }

    /* Cards : padding réduit */
    .card-body {
        padding: 14px 16px;
    }
    .kpi-card {
        padding: 14px 16px;
    }
    .kpi-value {
        font-size: 26px;
    }

    /* Formulaires */
    .form-section {
        padding: 18px 16px;
    }
    .form-actions {
        padding: 14px 16px;
        flex-wrap: wrap;
    }
    .form-actions .btn {
        flex: 1;
        justify-content: center;
    }

    /* Modales → bottom sheet sur mobile */
    .modal-overlay {
        align-items: flex-end;
    }
    .modal-box {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Login → 1 colonne */
    .login-page {
        grid-template-columns: 1fr;
    }
    .login-left {
        display: none;
    }
    .login-right {
        padding: 32px 20px;
    }

    /* Filter bar scroll horizontal */
    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .filter-pill {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Breadcrumb raccourci */
    .breadcrumb {
        font-size: 11px;
    }

    /* Pagination plus compacte */
    .pg-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Sidebar layout interne avec padding sécurisé */
    .sidebar-nav {
        padding: 12px 10px;
    }
    .nav-item {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Toast en bas, pleine largeur */
    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    .toast {
        min-width: unset;
        width: 100%;
    }
}

/* ── Très petit mobile (≤ 420px) ── */
@media (max-width: 420px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .td-actions {
        flex-wrap: wrap;
    }
}

/* ══════════════════════════════════════════════════════════════
   TABLES RESPONSIVE — transformation en cards sur mobile
   ══════════════════════════════════════════════════════════════ */

/* Desktop */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    /* card-header : empiler */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .card-header .search-input {
        width: 100%;
    }
    .card-header select {
        width: 100% !important;
    }

    /* Wrapper : plus de scroll, on affiche en cards */
    .table-wrap {
        overflow-x: visible;
        background: none;
    }

    /* Table → block */
    .table-wrap table,
    .table-wrap tbody {
        display: block;
        width: 100%;
    }

    /* Cacher thead */
    .table-wrap thead {
        display: none;
    }

    /* Chaque tr → card */
    .table-wrap tbody tr {
        display: block;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 12px;
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }

    /* Chaque td → ligne label + valeur */
    .table-wrap tbody td {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 9px 14px;
        border-bottom: 1px solid var(--border);
        font-size: 13px;
        box-sizing: border-box;
        overflow: hidden;
        gap: 12px;
    }
    .table-wrap tbody td:last-child {
        border-bottom: none;
    }

    /* Label à gauche */
    .table-wrap tbody td[data-label]::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--muted);
        flex-shrink: 0;
        width: 85px;
        min-width: 85px;
    }

    /* Valeur à droite : prend le reste, tronque si trop long */
    .table-wrap tbody td[data-label] > *:not(style) {
        flex: 1;
        min-width: 0;
    }
    .table-wrap tbody td[data-label] .user-cell-name,
    .table-wrap tbody td[data-label] code {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
    }

    /* Numéro de ligne : fond gris, compact */
    .table-wrap tbody td:first-child:not([data-label]) {
        background: var(--surface2);
        font-size: 10px;
        color: var(--subtle);
        font-weight: 700;
        justify-content: flex-end;
        padding: 5px 14px;
    }

    /* Cellule actions */
    .table-wrap tbody td:last-child:not([data-label]) {
        background: var(--surface2);
        justify-content: flex-end;
        padding: 8px 14px;
    }

    /* user-cell : avatar à droite sur mobile */
    .table-wrap .user-cell {
        flex-direction: row-reverse;
        justify-content: flex-end;
        flex: 1;
        min-width: 0;
    }

    /* empty-state : pas de style card */
    .table-wrap tbody tr.empty-row {
        background: transparent;
        border: none;
        box-shadow: none;
    }
    .table-wrap tbody tr.empty-row td {
        display: block;
        border: none;
    }
}

/* ── DASHBOARD ── */

/* Grille principale : 2 colonnes desktop */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* Grille raccourcis : 3 colonnes desktop */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

/* Carte raccourci */
.shortcut-card {
    text-decoration: none;
    transition: box-shadow 0.15s;
}
.shortcut-card:hover {
    box-shadow: var(--shadow-md);
}
.shortcut-card--primary {
    background: var(--blue);
}
.shortcut-body {
    display: flex;
    align-items: center;
    gap: 14px;
}
.shortcut-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.shortcut-title {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}

/* Ligne dans une card dashboard */
.dash-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.dash-row:last-child {
    border-bottom: none;
}

/* Label de section (Aujourd'hui, Prochains...) */
.dash-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 6px;
}

/* Graphique barres */
.dash-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 140px;
    padding-bottom: 24px;
    position: relative;
}
.dash-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.dash-bar-label-top {
    font-size: 10px;
    font-weight: 700;
    color: var(--blue);
    height: 16px;
    line-height: 16px;
}
.dash-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    padding: 0 4px;
}
.dash-bar {
    width: 100%;
    background: var(--blue);
    border-radius: 4px 4px 0 0;
    opacity: 0.85;
    transition: opacity 0.2s;
    min-height: 4px;
}
.dash-bar:hover {
    opacity: 1;
}
.dash-bar-label {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
    text-align: center;
}

/* Profil row */
.profil-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.profil-actions {
    margin-left: auto;
}

@media (max-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
    .shortcuts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .shortcuts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .profil-actions {
        margin-left: 0;
        width: 100%;
    }
    .dash-chart {
        height: 100px;
    }
}

@media (max-width: 420px) {
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
}

/* ── LAYOUT UTILITAIRES RESPONSIVE ── */
/* Grilles 2 colonnes contenu+sidebar */
.layout-sidebar-right {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}
.layout-sidebar-right-wide {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
.layout-sidebar-right-sm {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

/* Grilles 2 colonnes égales */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.grid-2-sm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* KPI grid avec N colonnes — on retire le style inline et on laisse kpi-grid gérer */
/* kpi-grid est déjà défini, juste enlever l'override inline */

/* Stats bar absentéisme */
.stats-bar-row {
    display: grid;
    grid-template-columns: 160px 1fr 60px 80px 80px;
    align-items: center;
    gap: 14px;
}

/* Grille 4 colonnes (détail solde) */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 768px) {
    .layout-sidebar-right,
    .layout-sidebar-right-wide,
    .layout-sidebar-right-sm {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-2-sm {
        grid-template-columns: 1fr;
    }

    .stats-bar-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stats-bar-row > *:nth-child(2) {
        grid-column: 1 / -1;
    } /* barre prend toute la largeur */

    .grid-3 {
        grid-template-columns: 1fr;
    }
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 420px) {
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── UTILITIES ── */
.text-muted {
    color: var(--muted);
}
.text-blue {
    color: var(--blue);
}
.text-green {
    color: var(--green);
}
.text-red {
    color: var(--red);
}
.text-amber {
    color: var(--amber);
}
.fw-600 {
    font-weight: 600;
}
.fw-700 {
    font-weight: 700;
}
.fs-12 {
    font-size: 12px;
}
.fs-13 {
    font-size: 13px;
}
.mt-8 {
    margin-top: 8px;
}
.mt-16 {
    margin-top: 16px;
}
.mt-24 {
    margin-top: 24px;
}
.mb-16 {
    margin-bottom: 16px;
}
.mb-22 {
    margin-bottom: 22px;
}
.gap-10 {
    gap: 10px;
}
.d-flex {
    display: flex;
}
.align-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.ml-auto {
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════
   CONFIGURATION — à ajouter à la fin de hrflow.css
   ═══════════════════════════════════════════════════ */

/* Layout 2 colonnes nav + contenu */
.config-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: start;
    min-width: 0;
    overflow: hidden;
}

/* Sans min-width:0, la colonne 1fr peut dépasser sa cellule grid */
.config-content {
    min-width: 0;
    overflow: hidden;
}

/* Navigation latérale */
.config-nav {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 8px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 20px;
}

.snav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.snav-item:hover {
    background: var(--surface2);
    color: var(--text);
}
.snav-item.active {
    background: var(--blue-light);
    color: var(--blue);
}
.snav-ic {
    font-size: 15px;
    flex-shrink: 0;
}
.snav-sep {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* En-tête de section (titre + bouton) */
.sec-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

/* Ligne de réglage (label + contrôle) */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.setting-row:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    min-width: 0;
}
.setting-label {
    font-size: 13px;
    font-weight: 600;
}
.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.tog-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 20px;
    transition: 0.25s;
}
.tog-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle input:checked + .tog-slider {
    background: var(--blue);
}
.toggle input:checked + .tog-slider::before {
    transform: translateX(18px);
}

/* Cartes de rôles */
.role-card {
    background: var(--surface2);
    border-radius: 10px;
    padding: 16px;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.role-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.role-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}
.role-desc {
    font-size: 12px;
    color: var(--text-muted);
}
.role-perms {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.perm-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--blue-light);
    color: var(--blue);
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .config-layout {
        grid-template-columns: 1fr;
    }
    .config-nav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 6px;
    }
    .snav-item {
        padding: 7px 10px;
        font-size: 12px;
    }
    .snav-sep {
        display: none;
    }
    .sec-header {
        flex-direction: column;
    }
}

.sidebar-logout {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.sidebar-logout:hover {
    background: rgba(217, 56, 56, 0.25);
    border-color: rgba(217, 56, 56, 0.5);
    color: #ff6b6b;
}

/* ── Utilitaires manquants ── */
.d-inline {
    display: inline;
}
.flex-1 {
    flex: 1;
    min-width: 0;
}

/* Colonnes masquées sur mobile */
@media (max-width: 768px) {
    .col-mobile-hide,
    th.col-mobile-hide {
        display: none !important;
    }
}
