/* ─── RESET & BASE ─── */
.ba-wrap *,
.ba-wrap *::before,
.ba-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ba-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #F5F5F7;
    min-height: 100vh;
    padding: 40px 24px 64px;
    color: #1D1D1F;
}

/* ─── HEADER ─── */
.ba-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
}
.ba-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #1D1D1F;
}
.ba-subtitle {
    font-size: 13px;
    color: #86868B;
    margin-top: 4px;
    font-weight: 400;
}
.ba-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #86868B;
    background: #E5E5EA;
    padding: 5px 10px;
    border-radius: 20px;
    align-self: center;
}

/* ─── STAT CARDS ─── */
.ba-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.ba-stat {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}
.ba-stat-icon {
    font-size: 8px;
    position: absolute;
    top: 18px;
    right: 18px;
    opacity: 0.5;
}
.ba-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #86868B;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.ba-stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    color: #1D1D1F;
    line-height: 1;
    margin-top: 4px;
}
.ba-stat--green  { border-top: 3px solid #30D158; }
.ba-stat--green  .ba-stat-icon  { color: #30D158; opacity: 1; font-size: 11px; }
.ba-stat--green  .ba-stat-value { color: #1D5C30; }
.ba-stat--yellow { border-top: 3px solid #FFD60A; }
.ba-stat--yellow .ba-stat-icon  { color: #FFD60A; opacity: 1; font-size: 11px; }
.ba-stat--yellow .ba-stat-value { color: #5C4D00; }
.ba-stat--red    { border-top: 3px solid #FF453A; }
.ba-stat--red    .ba-stat-icon  { color: #FF453A; opacity: 1; font-size: 11px; }
.ba-stat--red    .ba-stat-value { color: #6B1010; }

/* ─── EXPORT CARD ─── */
.ba-export-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}
.ba-export-label {
    font-size: 13px;
    font-weight: 600;
    color: #86868B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}
.ba-export-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.ba-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ba-field label {
    font-size: 12px;
    font-weight: 500;
    color: #86868B;
}
.ba-field input[type="date"] {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #D2D2D7;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: #1D1D1F;
    background: #F5F5F7;
    outline: none;
    transition: border-color 0.15s;
    min-width: 160px;
    -webkit-appearance: none;
}
.ba-field input[type="date"]:focus {
    border-color: #0071E3;
    background: #fff;
}
.ba-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 20px;
    background: #0071E3;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.ba-pdf-btn:hover  { background: #0077ED; }
.ba-pdf-btn:active { transform: scale(0.97); }

/* ─── TABLE CARD ─── */
.ba-table-card {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}
.ba-table {
    width: 100%;
    border-collapse: collapse;
}
.ba-table thead tr {
    border-bottom: 1px solid #E5E5EA;
}
.ba-table th {
    padding: 13px 20px 13px 0;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #86868B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #FAFAFA;
}
.ba-table td {
    padding: 14px 20px 14px 0;
    font-size: 14px;
    border-bottom: 1px solid #F2F2F5;
    vertical-align: middle;
}
.ba-table tbody tr:last-child td { border-bottom: none; }

/* Lignes colorées fond complet selon statut */
.ba-row--working    { background: #EAFAF1; }
.ba-row--working td { border-bottom-color: #c3f0d4; }
.ba-row--working:hover { background: #d4f5e2; }

.ba-row--break    { background: #FFFBEA; }
.ba-row--break td { border-bottom-color: #fde98a; }
.ba-row--break:hover { background: #fff3b0; }

.ba-row--off    { background: #FFF0F0; }
.ba-row--off td { border-bottom-color: #ffd4d4; }
.ba-row--off:hover { background: #ffe0e0; }

.ba-td-name { font-weight: 600; color: #1D1D1F; padding-left: 32px; }
.ba-table th:first-child { padding-left: 32px; }
.ba-td-time { font-variant-numeric: tabular-nums; font-weight: 500; color: #3A3A3C; font-size: 13px; }


/* ─── STATUS PILLS ─── */
.ba-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}
.ba-pill::before    { content: "●"; font-size: 7px; }
.ba-pill--working   { background: #D1F5DC; color: #1A6630; }
.ba-pill--break     { background: #FFF3CC; color: #7A5C00; }
.ba-pill--off       { background: #FFE5E4; color: #9B2B27; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .ba-wrap          { padding: 24px 16px 48px; }
    .ba-stats         { grid-template-columns: repeat(2, 1fr); }
    .ba-header        { flex-direction: column; gap: 10px; }
    .ba-export-form   { flex-direction: column; align-items: stretch; }
    .ba-pdf-btn       { justify-content: center; }
    .ba-table th,
    .ba-table td      { padding: 12px 14px 12px 0; }
}
@media (max-width: 480px) {
    .ba-stats      { grid-template-columns: 1fr 1fr; }
    .ba-stat-value { font-size: 26px; }
}

/* ─── BOUTON ACTUALISER dans le header ─── */
.ba-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #FF3B30;
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    align-self: center;
}
.ba-refresh-btn:hover  { background: #E0342A; }
.ba-refresh-btn:active { transform: scale(0.97); }

/* ─── SÉLECTEUR DE DATE ─── */
.ba-date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 12px 12px 0 0;
    padding: 14px 20px;
    border-bottom: 1px solid #E5E5EA;
}
.ba-date-nav-label {
    font-size: 14px;
    font-weight: 600;
    color: #1D1D1F;
}
.ba-date-nav-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ba-date-nav-form input[type="date"] {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #D2D2D7;
    border-radius: 8px;
    font-size: 13px;
    color: #1D1D1F;
    background: #F5F5F7;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}
.ba-date-nav-form input[type="date"]:focus { border-color: #0071E3; background: #fff; }
.ba-date-nav-btn {
    height: 36px;
    padding: 0 16px;
    background: #1D1D1F;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.ba-date-nav-btn:hover { background: #3A3A3C; }
.ba-date-nav-today {
    height: 36px;
    padding: 0 14px;
    background: none;
    color: #0071E3;
    border: 1px solid #0071E3;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.ba-date-nav-today:hover { background: #E6F1FB; }
