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

.sidebar {
    width: 240px;
    background-color: #1a1a2e;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: margin-left 0.3s ease;
    z-index: 30;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header .title {
    margin-bottom: 0;
}

.sidebar-menu {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.sidebar-item:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-item.is-active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-right: 3px solid #48c78e;
}

.sidebar-item .icon {
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 0.75rem;
    right: -2.75rem;
    background: #1a1a2e;
    border: none;
    color: #fff;
    padding: 0.5rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.main-content {
    background-color: #f5f5f5;
    min-height: 100vh;
}

.mobile-navbar {
    display: none;
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
}

.page-title {
    margin-bottom: 0.25rem;
}

.footer {
    background: transparent;
    padding: 1.5rem;
}

.flash-message {
    animation: flashFadeIn 0.3s ease;
}

@keyframes flashFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-tile {
    border-radius: 8px;
    padding: 1.5rem;
    color: #fff;
}

.dashboard-tile .title {
    color: #fff;
}

.dashboard-tile .subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.dashboard-tile .icon {
    font-size: 2rem;
}

.dashboard-tile-total { background: #485fc7; }
.dashboard-tile-actif { background: #48c78e; }
.dashboard-tile-inactif { background: #ffe08a; color: #333; }
.dashboard-tile-inactif .title { color: #333; }
.dashboard-tile-inactif .subtitle { color: rgba(0, 0, 0, 0.6); }
.dashboard-tile-suspendu { background: #f14668; }
.dashboard-tile-anomalie { background: #ff9f43; }

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dbdbdb;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 0.35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #48c78e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #48c78e;
}

.timeline-item.is-out::before {
    background: #f14668;
    box-shadow: 0 0 0 2px #f14668;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot-verrouille { background: #485fc7; }
.status-dot-anomalie { background: #f14668; }
.status-dot-valide { background: #48c78e; }
.status-dot-en_attente { background: #ffe08a; }
.status-dot-sync_ok { background: #48c78e; }
.status-dot-sync_error { background: #f14668; }
.status-dot-sync_pending { background: #9479fa; }

.audit-json {
    background: #f5f5f5;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.audit-json.is-visible {
    display: block;
}

.attendance-timeline {
    position: relative;
}

.attendance-timeline .timeline-slot {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    min-height: 3rem;
}

.attendance-timeline .timeline-time {
    width: 5rem;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.attendance-timeline .timeline-bar {
    flex: 1;
    height: 1.75rem;
    border-radius: 4px;
    position: relative;
    margin: 0 0.5rem;
}

.attendance-timeline .timeline-label {
    font-size: 0.8rem;
    padding-left: 0.5rem;
    flex-shrink: 0;
    width: 6rem;
    text-align: right;
}

/* Responsive */
@media screen and (max-width: 1023px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 40;
        transform: translateX(0);
        transition: transform 0.3s ease;
    }

    .sidebar.is-collapsed {
        transform: translateX(-100%);
    }

    .sidebar-toggle {
        display: block;
    }

    .mobile-navbar {
        display: block;
    }
}

@media screen and (max-width: 768px) {
    .sidebar {
        width: 100%;
    }

    .dashboard-tile {
        margin-bottom: 1rem;
    }
}

@media print {
    .sidebar,
    .sidebar-toggle,
    .mobile-navbar,
    .navbar,
    .footer {
        display: none !important;
    }

    .app-layout {
        display: block !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .button,
    .pagination {
        display: none !important;
    }
}

.tag.is-lg {
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    height: auto;
}

.batch-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.batch-step:last-child {
    border-bottom: none;
}

.batch-step .step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #dbdbdb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.batch-step.is-done .step-number {
    background: #48c78e;
}

.batch-step.is-current .step-number {
    background: #485fc7;
}

.batch-step.is-pending .step-number {
    background: #dbdbdb;
}

.field-group-inline {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

@media screen and (max-width: 768px) {
    .field-group-inline {
        flex-direction: column;
        align-items: stretch;
    }
}
