/* ============================================
   CREAMES - Gestion Boutique
   Theme: Earthy Artisan Collection
   ============================================ */

/* === Color Palette === */
:root {
    /* Primary Earthy Tones */
    --espresso: #5B4C3A;
    --earth-brown: #8A7356;
    --mushroom: #C4B39A;
    --putty: #DED1BA;
    --bone-white: #F4EFE6;

    /* Functional Colors */
    --primary-color: #8A7356;
    --primary-dark: #5B4C3A;
    --primary-light: #C4B39A;
    --accent-warm: #A67C52;
    --accent-gold: #C9A66B;

    /* Status Colors - Earthy variants */
    --success-color: #7A9A6D;
    --success-light: #9DB892;
    --danger-color: #B87A6B;
    --danger-light: #D4A090;
    --info-color: #7A8FA3;
    --warning-color: #C9A66B;

    /* Layout */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(91, 76, 58, 0.08);
    --shadow-md: 0 4px 20px rgba(91, 76, 58, 0.12);
    --shadow-lg: 0 8px 40px rgba(91, 76, 58, 0.16);
    --shadow-glow: 0 0 30px rgba(138, 115, 86, 0.2);
}

/* === Base === */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(135deg, var(--bone-white) 0%, #EDE6DC 50%, var(--putty) 100%);
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* === Logo Watermark Background === */
.main-content {
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background-image: url('logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    filter: sepia(20%) brightness(1.1);
}

.main-content > * {
    position: relative;
    z-index: 1;
}

/* === Sidebar Logo === */
.sidebar-logo {
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-logo {
    width: 55px !important;
    height: 55px !important;
    border-width: 2px;
}

/* === Layout Principal === */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: 1rem;
    gap: 1rem;
}

.main-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* === Sidebar - Premium Earthy Gradient === */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg,
        var(--putty) 0%,
        var(--mushroom) 30%,
        #9A8366 70%,
        var(--earth-brown) 100%
    );
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 30px rgba(91, 76, 58, 0.2);
}

/* Sidebar decorative overlay */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at top left, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(0,0,0,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Sidebar subtle pattern */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.85);
    border-radius: 10px;
    margin: 4px 12px;
    padding: 0.85rem 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0;
    margin: 6px auto;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
}

.sidebar.collapsed .nav-link i {
    margin: 0;
    width: auto;
    min-width: auto;
    font-size: 1.25rem;
}

.sidebar.collapsed .sidebar-footer {
    text-align: center;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
}

.sidebar.collapsed .sidebar-footer .nav-link {
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
}

.sidebar.collapsed .sidebar-footer .nav-link i {
    font-size: 1.25rem;
}

.sidebar.collapsed .logout-link {
    background: transparent;
}

.sidebar.collapsed .logout-link:hover {
    background: rgba(184, 122, 107, 0.6) !important;
    transform: scale(1.08) !important;
}

.sidebar.collapsed .sidebar-header {
    text-align: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .sidebar-header h4 {
    display: flex;
    justify-content: center;
}

.sidebar.collapsed ul.nav {
    align-items: center;
    padding: 0;
}

.sidebar.collapsed ul.nav .nav-item {
    display: flex;
    justify-content: center;
    width: 100%;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.08) 100%);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.12) 100%);
    box-shadow:
        0 4px 15px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, var(--accent-gold), var(--putty));
    border-radius: 0 4px 4px 0;
}

/* Collapsed state specific styles */
.sidebar.collapsed .nav-link:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.sidebar.collapsed .nav-link.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.15) 100%);
    border: 1px solid rgba(255,255,255,0.2);
}

.sidebar.collapsed .nav-link.active::before {
    display: none;
}

.sidebar .nav-link i {
    width: 24px;
    min-width: 24px;
    text-align: center;
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.sidebar .nav-link span {
    opacity: 1;
    transition: opacity 0.2s ease, width 0.2s ease;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-header h4 span,
.sidebar.collapsed .sidebar-header small,
.sidebar.collapsed .sidebar-footer span,
.sidebar.collapsed .sidebar-footer small {
    opacity: 0;
    width: 0;
    display: none;
}

.sidebar.collapsed .sidebar-header h4 {
    justify-content: center;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -16px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bone-white), var(--putty));
    border: 2px solid var(--earth-brown);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: translateY(-50%) scale(1.15);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    background: linear-gradient(135deg, var(--earth-brown), var(--espresso));
}

.sidebar-toggle:hover i {
    color: white;
}

.sidebar-toggle i {
    transition: all 0.3s ease;
    color: var(--espresso);
    font-size: 0.9rem;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-header h4 {
    font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-header h4 span {
    display: none;
}

.sidebar-header {
    padding: 1.25rem 0.75rem;
    position: relative;
    z-index: 1;
}

.sidebar-header h4 {
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.75rem;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Logout link styling */
.logout-link {
    color: rgba(255,255,255,0.8) !important;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.logout-link:hover {
    color: #fff !important;
    background: rgba(184, 122, 107, 0.5) !important;
    transform: none !important;
}

.logout-link i {
    color: rgba(255,255,255,0.9);
}

/* === Cards === */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, var(--bone-white) 100%);
    border: 1px solid rgba(196, 179, 154, 0.2);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #FDFBF8 100%);
    border: 1px solid rgba(196, 179, 154, 0.15);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 8px 25px rgba(138, 115, 86, 0.15);
    border-color: var(--mushroom);
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--espresso) 0%, var(--earth-brown) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

/* === Dashboard Header - Elegant Earthy Gradient === */
.dashboard-header {
    background: linear-gradient(135deg,
        var(--earth-brown) 0%,
        #9A8366 40%,
        var(--mushroom) 100%
    );
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-md), 0 10px 40px rgba(91, 76, 58, 0.15);
}

/* Header decorative elements */
.dashboard-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: url('logo2.png') no-repeat center center;
    background-size: contain;
    filter: brightness(1.6) contrast(0.9);
    pointer-events: none;
}

.welcome-text {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.welcome-text strong {
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--putty) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-stat {
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.08) 100%);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.15);
}

.quick-stat:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.15) 100%);
    transform: scale(1.02);
}

.quick-stat-link {
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.quick-stat-link:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.2) 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* === Stats Row === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    flex-shrink: 0;
}

/* === Content Layout === */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.content-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    overflow: hidden;
}

.content-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 100%;
}

/* === Filter Card === */
.filter-card {
    background: linear-gradient(135deg, #ffffff 0%, var(--bone-white) 100%);
    border-radius: 14px;
    border: 1px solid var(--mushroom);
    padding: 0.75rem !important;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.filter-card .form-label {
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
    color: var(--earth-brown);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-card .form-select-sm,
.filter-card .form-control-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-color: var(--mushroom);
    background-color: #fff;
}

.filter-card .form-select-sm:focus,
.filter-card .form-control-sm:focus {
    border-color: var(--earth-brown);
    box-shadow: 0 0 0 3px rgba(138, 115, 86, 0.15);
}

/* === Table Container === */
.table-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

.table-modern {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0;
}

.table-modern thead {
    background: linear-gradient(135deg, var(--putty) 0%, var(--mushroom) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-modern thead th {
    border-bottom: none;
    padding: 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
    color: var(--espresso);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-modern tbody tr {
    transition: all 0.2s ease;
}

.table-modern tbody tr:hover {
    background: linear-gradient(135deg, rgba(196, 179, 154, 0.15) 0%, rgba(222, 209, 186, 0.2) 100%) !important;
}

.table-modern td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    font-size: 0.9rem;
    border-color: rgba(196, 179, 154, 0.2);
}

/* === Buttons === */
.btn-primary {
    background: linear-gradient(135deg, var(--earth-brown) 0%, var(--espresso) 100%);
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(91, 76, 58, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--espresso) 0%, #4A3D2E 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 76, 58, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--earth-brown);
    border-color: var(--earth-brown);
}

.btn-outline-primary:hover {
    background: var(--earth-brown);
    border-color: var(--earth-brown);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #6A8A5D 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #6A8A5D 0%, #5A7A4D 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #A86A5B 100%);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #A86A5B 0%, #985A4B 100%);
}

/* === Badges === */
.badge-cb {
    background: linear-gradient(135deg, var(--info-color), #6A7F93);
}
.badge-especes {
    background: linear-gradient(135deg, var(--success-color), #6A8A5D);
}
.badge-virement {
    background: linear-gradient(135deg, #7AA3A0, #6A9390);
}
.badge-cheque {
    background: linear-gradient(135deg, var(--warning-color), #B9965B);
}
.badge-payment {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* === Vendor / Artisan Items === */
.vendor-item {
    transition: all 0.2s ease;
    border-radius: 8px;
}

.vendor-item:hover {
    background-color: rgba(138, 115, 86, 0.08);
}

/* === Vendors View === */
.vendors-view {
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.vendors-view .row.g-4 {
    flex: 1;
    min-height: 0;
}

.vendors-view .row.g-4 > .col-md-6 {
    display: flex;
    flex-direction: column;
}

.vendors-view .row.g-4 .card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 250px);
    border: 1px solid rgba(0,0,0,0.125);
    border-radius: 0.375rem;
}

.vendors-list-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Dernier élément de la liste sans bordure */
.vendors-list-body .vendor-item:last-child {
    border-bottom: none !important;
}

@media (max-width: 767.98px) {
    .vendors-view {
        height: auto;
        overflow: visible;
    }

    .vendors-list-body {
        max-height: 500px;
        min-height: 350px;
    }
}

/* === Section Title === */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
    font-size: 0.85rem;
    margin-bottom: 0;
    color: var(--espresso);
    font-weight: 600;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: linear-gradient(135deg, var(--earth-brown), var(--accent-gold));
    border-radius: 3px;
}

/* === Sidebar Cards (Top Artisans, Par Paiement) === */
.content-sidebar .card {
    font-size: 0.85rem;
    background: linear-gradient(135deg, #ffffff 0%, #FDFBF8 100%);
}

.content-sidebar .card-header {
    padding: 0.5rem 0.75rem !important;
    background: linear-gradient(135deg, var(--putty) 0%, var(--mushroom) 100%);
    border-bottom: 1px solid rgba(196, 179, 154, 0.3);
}

.content-sidebar .card-body {
    padding: 0.5rem 0.75rem !important;
}

.content-sidebar .card-header h5,
.content-sidebar .card-header h6 {
    font-size: 0.8rem;
    color: var(--espresso);
    font-weight: 600;
}

.content-sidebar .card-header small {
    font-size: 0.65rem;
    color: var(--earth-brown);
}

/* Top Artisans compact */
.content-sidebar .vendor-rank {
    padding: 0.35rem !important;
    margin-bottom: 0.35rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.content-sidebar .vendor-rank:hover {
    background: rgba(138, 115, 86, 0.08);
}

.content-sidebar .vendor-rank .badge {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* Rank colors - Gold, Silver, Bronze, etc. */
.content-sidebar .vendor-rank:nth-child(1) .badge {
    background: linear-gradient(145deg, #F4D03F, #D4AC0D) !important;
    box-shadow: 0 3px 10px rgba(244, 208, 63, 0.4);
}

.content-sidebar .vendor-rank:nth-child(2) .badge {
    background: linear-gradient(145deg, #BDC3C7, #95A5A6) !important;
    box-shadow: 0 3px 10px rgba(149, 165, 166, 0.4);
}

.content-sidebar .vendor-rank:nth-child(3) .badge {
    background: linear-gradient(145deg, #CD7F32, #A0522D) !important;
    box-shadow: 0 3px 10px rgba(205, 127, 50, 0.4);
}

.content-sidebar .vendor-rank:nth-child(4) .badge {
    background: linear-gradient(145deg, #A89078, #8B7355) !important;
    box-shadow: 0 3px 10px rgba(139, 115, 85, 0.3);
}

.content-sidebar .vendor-rank:nth-child(5) .badge {
    background: linear-gradient(145deg, #8B8078, #6B6055) !important;
    box-shadow: 0 3px 10px rgba(107, 96, 85, 0.3);
}

.content-sidebar .vendor-rank .fw-bold {
    font-size: 0.8rem;
    color: var(--espresso);
}

.content-sidebar .vendor-rank small {
    font-size: 0.65rem;
    color: var(--earth-brown);
}

/* Par Paiement compact */
.content-sidebar .payment-item {
    padding: 0.35rem 0 !important;
}

.content-sidebar .payment-item .small {
    font-size: 0.75rem;
}

.content-sidebar .payment-item .fw-bold {
    font-size: 0.8rem;
    color: var(--espresso);
}

/* === Live Badge === */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

/* État non connecté - gris */
.live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    box-shadow: 0 0 4px #999;
}

/* État connecté - vert avec pulse */
.live-badge.live-connected::before {
    background: #90EE90;
    box-shadow: 0 0 6px #90EE90;
    animation: pulse 2s infinite;
}

/* Activité temps réel - flash orange */
.live-badge.live-activity {
    background: rgba(255, 165, 0, 0.4);
    transform: scale(1.05);
}

.live-badge.live-activity::before {
    background: #FFA500 !important;
    box-shadow: 0 0 10px #FFA500 !important;
    animation: flash 0.3s ease-in-out !important;
}

@keyframes flash {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

/* === Real-time Indicator === */
.realtime-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-light);
    display: inline-block;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(122, 154, 109, 0.5);
}

/* === Login === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        var(--bone-white) 0%,
        var(--putty) 50%,
        var(--mushroom) 100%
    );
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%238A7356' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, var(--bone-white) 100%);
    border-radius: 24px;
    box-shadow: var(--shadow-lg), 0 20px 60px rgba(91, 76, 58, 0.15);
    border: 1px solid rgba(196, 179, 154, 0.3);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--espresso), var(--earth-brown), var(--accent-gold), var(--mushroom));
}

.login-card .text-primary {
    color: var(--espresso) !important;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, var(--earth-brown) 0%, var(--espresso) 100%);
    border: none;
    padding: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-card .form-control {
    border-color: var(--mushroom);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.login-card .form-control:focus {
    border-color: var(--earth-brown);
    box-shadow: 0 0 0 4px rgba(138, 115, 86, 0.15);
}

/* === POS === */
.pos-product {
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #ffffff 0%, var(--bone-white) 100%);
}

.pos-product:hover {
    border-color: var(--earth-brown);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.pos-product.selected {
    border-color: var(--earth-brown);
    background: linear-gradient(135deg, rgba(138, 115, 86, 0.1) 0%, rgba(196, 179, 154, 0.15) 100%);
}

.cart-item {
    border-bottom: 1px solid var(--putty);
}

/* === Form Controls === */
.form-control, .form-select {
    border-color: var(--mushroom);
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--earth-brown);
    box-shadow: 0 0 0 3px rgba(138, 115, 86, 0.15);
}

/* Select optgroup styling */
.form-select optgroup {
    font-weight: 600;
    color: var(--espresso);
}

.form-select optgroup[label="Inactifs"] {
    font-style: italic;
    color: var(--mushroom);
}

.form-select optgroup[label="Inactifs"] option {
    font-style: italic;
    color: #999;
}

/* === Modals === */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--putty) 0%, var(--bone-white) 100%);
    border-bottom: 1px solid var(--mushroom);
}

.modal-header .modal-title {
    color: var(--espresso);
    font-weight: 600;
}

.modal-footer {
    background: var(--bone-white);
    border-top: 1px solid rgba(196, 179, 154, 0.3);
}

/* === Artisan Colors === */
/* Patate Cousue - Ventes : Rouge clair */
.table-hover > tbody > tr.artisan-patate-cousue-ventes,
.table-hover > tbody > tr.artisan-patate-cousue-ventes > * {
    background-color: rgba(255, 182, 193, 0.4) !important;
}
.table-hover > tbody > tr.artisan-patate-cousue-ventes:hover,
.table-hover > tbody > tr.artisan-patate-cousue-ventes:hover > * {
    background-color: rgba(255, 182, 193, 0.6) !important;
}

/* Patate Cousue - Retouches : Violet clair */
.table-hover > tbody > tr.artisan-patate-cousue-retouches,
.table-hover > tbody > tr.artisan-patate-cousue-retouches > * {
    background-color: rgba(216, 191, 216, 0.45) !important;
}
.table-hover > tbody > tr.artisan-patate-cousue-retouches:hover,
.table-hover > tbody > tr.artisan-patate-cousue-retouches:hover > * {
    background-color: rgba(216, 191, 216, 0.65) !important;
}

/* Lumieres d'Ame : Vert clair */
.table-hover > tbody > tr.artisan-lumieres-d-ame,
.table-hover > tbody > tr.artisan-lumieres-d-ame > * {
    background-color: rgba(144, 238, 144, 0.35) !important;
}
.table-hover > tbody > tr.artisan-lumieres-d-ame:hover,
.table-hover > tbody > tr.artisan-lumieres-d-ame:hover > * {
    background-color: rgba(144, 238, 144, 0.55) !important;
}

/* === Animations === */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease-out forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.5s ease-out forwards; }
.animate-scaleIn { animation: scaleIn 0.4s ease-out forwards; }
.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* === Large Desktop (> 1400px) === */
@media (min-width: 1400px) {
    .content-grid {
        grid-template-columns: 1fr 350px;
    }

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

/* === Desktop (1200px - 1399px) === */
@media (max-width: 1399px) {
    .content-grid {
        grid-template-columns: 1fr 280px;
    }

    .stat-value {
        font-size: 1.3rem;
    }
}

/* === Tablet Landscape (992px - 1199px) === */
@media (max-width: 1199px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
        min-width: var(--sidebar-collapsed-width);
    }

    .sidebar .nav-link span,
    .sidebar .sidebar-header span,
    .sidebar .sidebar-header small,
    .sidebar .sidebar-footer span,
    .sidebar .sidebar-footer small {
        opacity: 0;
        width: 0;
        display: none;
    }

    .sidebar .sidebar-header h4 span {
        display: none;
    }

    .sidebar-toggle {
        display: none;
    }

    .content-grid {
        grid-template-columns: 1fr 260px;
    }

    .stats-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.75rem !important;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .welcome-text {
        font-size: 1.25rem;
    }
}

/* === Tablet Portrait (768px - 991px) === */
@media (max-width: 991px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .content-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-height: none;
        overflow: visible;
    }

    .main-content {
        overflow-y: auto;
        height: auto;
        max-height: 100vh;
    }

    .main-scroll {
        overflow: visible;
    }

    .dashboard-header .row {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-header .col-md-6:last-child {
        margin-top: 0.5rem;
    }
}

/* === Mobile (< 768px) === */
@media (max-width: 767px) {
    html, body {
        overflow: auto;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        min-height: auto;
        flex-direction: row;
        padding: 0.5rem;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: linear-gradient(90deg, var(--earth-brown) 0%, var(--mushroom) 100%);
    }

    .sidebar::before,
    .sidebar::after {
        display: none;
    }

    .sidebar .sidebar-header {
        display: none;
    }

    .sidebar .sidebar-footer {
        display: none;
    }

    .sidebar ul {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        margin: 0;
        padding: 0;
    }

    .sidebar .nav-link {
        margin: 0;
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.7rem;
    }

    .sidebar .nav-link::before {
        display: none;
    }

    .sidebar .nav-link i {
        font-size: 1.25rem;
    }

    .sidebar .nav-link span {
        display: block !important;
        opacity: 1 !important;
        width: auto !important;
        font-size: 0.65rem;
    }

    .sidebar-toggle {
        display: none;
    }

    .main-content {
        padding: 0.75rem;
        height: auto;
        overflow: visible;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem !important;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .dashboard-header {
        padding: 1rem;
        border-radius: 16px;
    }

    .welcome-text {
        font-size: 1.1rem;
    }

    .quick-stat {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .quick-stat-link {
        display: none;
    }

    .content-sidebar {
        grid-template-columns: 1fr;
    }

    .filter-card {
        padding: 0.75rem !important;
    }

    .filter-card .row > div {
        margin-bottom: 0.5rem;
    }

    .table-modern td,
    .table-modern th {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none !important;
    }
}

/* === Small Mobile (< 480px) === */
@media (max-width: 479px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card .d-flex {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .stat-icon {
        margin: 0 auto;
    }

    .table-modern td,
    .table-modern th {
        padding: 0.3rem;
        font-size: 0.75rem;
    }
}

/* === Utilities === */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-scroll {
    overflow: hidden !important;
}

.text-primary {
    color: var(--earth-brown) !important;
}

.border-primary {
    border-color: var(--earth-brown) !important;
}

/* Stat icon backgrounds - don't override Bootstrap's bg-opacity */
.stat-icon.bg-primary {
    background-color: rgba(138, 115, 86, 0.1) !important;
}

.stat-icon.bg-success {
    background-color: rgba(122, 154, 109, 0.1) !important;
}

.stat-icon.bg-danger {
    background-color: rgba(184, 122, 107, 0.1) !important;
}

.stat-icon.bg-warning {
    background-color: rgba(201, 166, 107, 0.1) !important;
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bone-white);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--mushroom), var(--earth-brown));
    border-radius: 4px;
    border: 2px solid var(--bone-white);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--earth-brown), var(--espresso));
}

/* === Selection === */
::selection {
    background: rgba(138, 115, 86, 0.3);
    color: var(--espresso);
}

/* === Focus States === */
*:focus-visible {
    outline: 2px solid var(--earth-brown);
    outline-offset: 2px;
}

/* === Print Styles === */
@media print {
    .sidebar,
    .btn-float,
    .sidebar-toggle {
        display: none !important;
    }

    .main-content {
        width: 100%;
        padding: 0;
    }

    body {
        background: white;
    }
}
