:root {
    --orange-primary: #FF6600;
    --orange-dark: #E55A00;
    --sidebar-width: 260px;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: #f4f6f9;
    min-height: 100vh;
}

.text-orange { color: var(--orange-primary) !important; }
.bg-orange { background-color: var(--orange-primary) !important; }

.btn-orange {
    background-color: var(--orange-primary);
    border-color: var(--orange-primary);
    color: #fff;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
}

.btn-orange:hover,
.btn-orange:focus {
    background-color: var(--orange-dark);
    border-color: var(--orange-dark);
    color: #fff;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar .nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.sidebar-link {
    color: rgba(255, 255, 255, 0.75) !important;
    padding: 0.85rem 1rem !important;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 1.05rem;
    transition: all 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: rgba(255, 102, 0, 0.2);
    color: #fff !important;
}

.sidebar-footer {
    position: relative;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    background: inherit;
}

#page-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

#page-content main {
    max-width: 100%;
    overflow-x: auto;
}

.min-w-0 {
    min-width: 0 !important;
}

.table-mouvements-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

#tableMouvements {
    width: 100%;
    min-width: 640px;
}

#tableMouvements th,
#tableMouvements td {
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

#tableMouvements .entrepot-cell {
    white-space: normal;
    max-width: 180px;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    min-height: 70px;
}

.page-title {
    color: #1a1a2e;
    font-weight: 600;
}

/* Login */
.login-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-card {
    width: 100%;
    max-width: 460px;
    border-radius: 16px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--orange-primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
}

/* Cards & tables */
.stat-card {
    border-radius: 12px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card {
    border-radius: 12px;
}

.table-lg td,
.table-lg th {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    font-size: 1rem;
}

.btn-action {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Movement type badges */
.type-badge { font-size: 0.9rem; padding: 0.4em 0.8em; }
.type-entree { background-color: #198754; }
.type-sortie { background-color: #dc3545; }
.type-transfert { background-color: #0d6efd; }

/* Tablet optimizations */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    #page-content {
        margin-left: 0;
    }

    .form-control-lg,
    .form-select-lg {
        font-size: 1.1rem;
        min-height: 52px;
    }

    .btn-lg {
        min-height: 52px;
        font-size: 1.1rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .table-lg td,
    .table-lg th {
        padding: 0.85rem 1rem;
    }
}
