.view-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 3rem;
}

body {
    background-color: #f6f7fb;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1f2933;
    min-height: 100vh;
}

body.modal-open {
    overflow: hidden;
}

.layout-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.app-sidebar {
    width: 260px;
    background: #111827;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 1.5rem;
    bottom: 1.5rem;
    left: 1.5rem;
    border-radius: 26px;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.28);
    padding: 0.5rem 0;
    z-index: 1030;
    backdrop-filter: blur(6px);
}

.app-sidebar .brand-section {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .brand-logo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.app-sidebar .brand-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.app-sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.app-sidebar .nav-pill {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1.5rem;
    margin: 0.2rem 0;
    color: #cbd5f5;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 18px;
}

.app-sidebar .nav-pill .nav-icon {
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.15);
}

.app-sidebar .nav-pill.active .nav-icon {
    background: rgba(255, 255, 255, 0.18);
}

.app-sidebar .nav-pill:hover,
.app-sidebar .nav-pill:focus {
    background-color: rgba(59, 130, 246, 0.12);
    color: #ffffff;
}

.app-sidebar .nav-pill.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35);
}

.app-sidebar .sidebar-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-sidebar .user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.app-main {
    flex: 1;
    margin-left: 300px;
    padding: 2.5rem 2.5rem 4rem;
}

.app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-title {
    font-weight: 700;
    font-size: 1.75rem;
    color: #0f172a;
}

.metric-card {
    border: none;
    border-radius: 18px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.badge-soft {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
}

.table thead {
    background: #f0f4ff;
    color: #1f2a44;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
}

.table thead th {
    border-bottom: none;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.06);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pill.success {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.status-pill.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.status-pill.warning {
    background: rgba(250, 204, 21, 0.18);
    color: #b45309;
}

.widget {
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.widget-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid #edf2ff;
}

.widget-body {
    padding: 1.75rem;
}

.floating-action {
    position: fixed;
    right: 1.5rem;
    bottom: 5rem;
    z-index: 1050;
}

.floating-action .btn {
    border-radius: 50%;
    width: 58px;
    height: 58px;
    font-size: 1.5rem;
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.45);
}

.mobile-nav-spacer {
    height: 72px;
}

.mobile-bottom-nav {
    display: none;
}

.card-transparent {
    background: transparent;
    border: none;
}

.toastify {
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
}

.modal .form-label {
    font-weight: 600;
    color: #1f2933;
}

.modal-footer {
    border-top: none;
    padding-top: 0;
}

.modal-header {
    border-bottom: none;
}

.modal-header .modal-title {
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.empty-state strong {
    display: block;
    font-size: 1.1rem;
}

.scan-widget-body {
    display: flex;
    flex-direction: column;
}

.scan-stage {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.scan-stage-active video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scan-frame {
    width: 280px;
    height: 280px;
    border: 4px solid rgba(34, 197, 94, 0.85);
    border-radius: 32px;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.35);
    animation: pulseGlow 2s infinite;
}

.scan-ghost,
.scan-init {
    margin-top: 1.25rem;
    color: #e2e8f0;
    font-weight: 500;
    text-shadow: 0 6px 18px rgba(15, 23, 42, 0.6);
}

.scan-init {
    text-align: center;
}

.scan-stage.collapsed {
    display: none;
}

.scan-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.35));
    pointer-events: none;
}

.scan-stage > span {
    color: #cbd5f5;
}

.scan-stage video {
    filter: saturate(1.1) contrast(1.1);
}

#manual-lookup-card.collapsed {
    display: none;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 55px rgba(34, 197, 94, 0.55);
    }
}

@media (max-width: 991.98px) {
    .scan-stage {
        min-height: 280px;
    }

    .scan-frame {
        width: 220px;
        height: 220px;
        border-width: 3px;
    }
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.filter-group .form-control {
    min-width: 200px;
}

.list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.badge-rounded {
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
}

.qr-preview {
    border-radius: 16px;
    border: 1px dashed #94a3b8;
    padding: 1.25rem;
    background: rgba(148, 163, 184, 0.08);
}

.materiels-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.materiel-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.materiel-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.materiel-card-select {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.2rem;
}

.materiel-card-info {
    flex: 1;
}

.materiel-card-title {
    font-weight: 600;
    color: #1f2937;
}

.materiel-card-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.materiel-card-body {
    margin-top: 1rem;
    display: grid;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.materiel-card-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.materiel-card-actions .btn {
    flex: 1 1 calc(50% - 0.5rem);
}

@media (min-width: 576px) {
    .materiel-card-actions .btn {
        flex: 0 0 auto;
    }
}

.utilisateurs-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.utilisateur-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.2rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.utilisateur-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.utilisateur-card-info {
    flex: 1;
}

.utilisateur-card-title {
    font-weight: 600;
    color: #1f2937;
}

.utilisateur-card-sub {
    font-size: 0.85rem;
    color: #64748b;
}

.utilisateur-card-actions {
    margin-top: 1.1rem;
    display: flex;
    gap: 0.5rem;
}

.utilisateur-card-actions .btn {
    flex: 1 1 50%;
}

.salles-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.salle-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.15rem;
    background: #fff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.salle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.salle-card-info {
    flex: 1;
}

.salle-card-title {
    font-weight: 600;
    color: #111827;
}

.salle-card-sub {
    font-size: 0.85rem;
    color: #64748b;
}

.salle-card-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.salle-card-actions .btn {
    flex: 1 1 50%;
}

.maintenance-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.maintenance-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.2rem;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.maintenance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.maintenance-card-info {
    flex: 1;
}

.maintenance-card-title {
    font-weight: 600;
    color: #111827;
}

.maintenance-card-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.maintenance-card-body {
    margin-top: 0.75rem;
    color: #1f2937;
    font-size: 0.92rem;
}

.maintenance-card-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.maintenance-card-actions .btn {
    flex: 1 1 100%;
}

.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #dbeafe;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0.3rem;
    left: -1.55rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3b82f6;
}

.auth-card .auth-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-card .auth-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: rgba(37, 99, 235, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #2563eb;
}

.auth-subtitle {
    color: #64748b;
    margin-bottom: 0;
}

/* Responsive */

@media (max-width: 1199.98px) {
    .app-main {
        padding: 2rem 1.75rem 4rem;
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        top: 0;
        bottom: 0;
        left: 0;
        border-radius: 0;
        padding: 0;
    }

    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 12px 0 32px rgba(15, 23, 42, 0.35);
    }

    .app-main {
        margin-left: 0;
        padding: 2rem 1.25rem 5rem;
    }

    .mobile-bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #111827;
        box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.4);
        z-index: 1040;
    }

    .mobile-bottom-nav .nav-link {
        color: #cbd5f5 !important;
        padding: 0.4rem 0;
        font-size: 0;
        width: 56px;
        height: 56px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 18px;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .mobile-bottom-nav .nav-link .icon {
        font-size: 1.45rem;
        line-height: 1;
    }

    .mobile-bottom-nav .nav-link.active {
        color: #3b82f6 !important;
        background: rgba(59, 130, 246, 0.15);
    }

    .mobile-nav-spacer {
        height: 84px;
    }
}

@media (max-width: 575.98px) {
    .app-main {
        padding: 1.5rem 1rem 5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .metric-card {
        border-radius: 16px;
    }
}

.auth-container {
    display: flex;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.auth-form input {
    padding: 0.75rem;
    border: 1px solid #cbd5f5;
    border-radius: 6px;
}

#modal-root {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
    z-index: 1010;
    pointer-events: auto;
}

.modal-dialog {
    max-width: 520px;
}

.modal-dialog.modal-lg {
    max-width: 720px;
}

.modal-dialog.modal-sm {
    max-width: 360px;
}

.modal-content {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 32px 60px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 3rem);
    animation: scaleIn 0.25s ease;
    overflow: hidden;
}

.modal-body {
    overflow-y: auto;
}

.modal-header,
.modal-footer {
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-icon {
    font-size: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(55, 65, 81, 0.6);
}

.modal-close:hover {
    color: #1f2937;
}

.modal-body {
    padding: 1.75rem;
    overflow: auto;
}

.modal-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    justify-content: flex-end;
}

.modal-footer .button:not(:last-child) {
    margin-right: 0.75rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-form label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 500;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

.modal::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.modal-backdrop:focus-visible,
.modal:focus-visible {
    outline: none;
}

.toastify {
    font-weight: 500;
}

@media (max-width: 1024px) {
    .content {
        padding: 2rem;
    }
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar-toggle {
        display: inline-flex !important;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 220px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 2rem 1.25rem;
        width: 100%;
        min-height: calc(100vh - 72px);
        padding-bottom: 5rem;
    }

    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: #111827;
        box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.35);
        z-index: 920;
    }

    .mobile-nav ul {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        list-style: none;
        margin: 0;
        padding: 0.35rem 0.85rem;
        gap: 0.25rem;
        width: 100%;
    }

    .mobile-nav button {
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.68);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 500;
        padding: 0.35rem 0;
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .mobile-nav button .nav-icon {
        font-size: 1.3rem;
    }

    .mobile-nav button.active,
    .mobile-nav button:focus {
        background: rgba(59, 130, 246, 0.18);
        color: #fff;
    }
}

@media (max-width: 600px) {
    .section-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-actions {
        width: 100%;
    }

    .filter-field {
        width: 100%;
    }

    .filter-field input {
        width: 100%;
        min-width: 0;
    }

    .modal {
        width: min(420px, 100%);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.type-message {
    min-height: 1.25rem;
    font-size: 0.95rem;
}

.type-message.error {
    color: #dc2626;
}

.type-message.success {
    color: #047857;
}

.champs-header {
    font-weight: 600;
    margin-bottom: 1rem;
}
