/* ============================================
   OptyLoft - Main Stylesheet
   Bootstrap 5.3 customizations
   ============================================ */

:root {
    /* Primary */
    --slate-900: #0F172A;
    --blue-600: #2563EB;
    --blue-500: #3B82F6;
    /* Secondary / Neutral Scale */
    --slate-700: #334155;
    --slate-500: #64748B;
    --slate-400: #94A3B8;
    --slate-300: #CBD5E1;
    --slate-100: #F1F5F9;
    --bg: #FAFBFD;
    --white: #FFFFFF;
    /* Accent Blue Scale */
    --blue-100: #DBEAFE;
    --blue-50: #EFF6FF;
    /* Semantic colors */
    --ov-success: #16A34A;
    --ov-danger: #DC2626;
    --ov-warning: #D97706;
    --ov-info: #2563EB;
    /* Legacy aliases used in views */
    --ov-primary: #2563EB;
    --ov-primary-rgb: 37, 99, 235;
    --ov-primary-dark: #1D4ED8;
    --ov-primary-light: #EFF6FF;
    --ov-primary-50: #EFF6FF;
    --ov-primary-100: #DBEAFE;
    --ov-secondary: #64748B;
    --ov-accent: #3B82F6;
    --ov-dark: #0F172A;
    --ov-gray-50: #FAFBFD;
    --ov-gray-100: #F1F5F9;
    --ov-gray-200: #E2E8F0;
    --ov-gray-300: #CBD5E1;
    --ov-gray-400: #94A3B8;
    --ov-gray-500: #64748B;
    --ov-gray-600: #475569;
    --ov-gray-700: #334155;
    --ov-gray-800: #1E293B;
    --ov-gray-900: #0F172A;
    /* Layout */
    --ov-sidebar-width: 260px;
    --ov-sidebar-collapsed: 60px;
    --ov-navbar-height: 60px;
    /* Shadows - OptyLoft scale */
    --ov-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.03);
    --ov-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --ov-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --ov-shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.08);
    --ov-shadow-xl: 0 24px 64px rgba(15, 23, 42, 0.16);
    /* Radii - OptyLoft scale */
    --ov-radius-sm: 10px;
    --ov-radius-md: 16px;
    --ov-radius-lg: 16px;
    --ov-radius-xl: 20px;
    /* Sidebar */
    --ov-sidebar-bg: var(--slate-900);
    /* Transitions */
    --ov-transition-fast: 150ms ease;
    --ov-transition-base: 200ms ease;
    --ov-transition-slow: 300ms ease;
}

/* ---- Brand Color Overrides ---- */
.bg-primary { background-color: var(--blue-600) !important; }
.btn-primary {
    background-color: var(--blue-600);
    border-color: var(--blue-600);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--blue-500);
    border-color: var(--blue-500);
}
.btn-primary:active {
    background-color: #1D4ED8 !important;
    border-color: #1D4ED8 !important;
}
.btn-outline-primary {
    color: var(--blue-600);
    border-color: var(--blue-600);
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary.active {
    background-color: var(--blue-600);
    border-color: var(--blue-600);
    color: #fff;
}
.text-primary { color: var(--blue-600) !important; }
.border-primary { border-color: var(--blue-600) !important; }
.btn-check:checked + .btn-outline-primary {
    background-color: var(--blue-600);
    border-color: var(--blue-600);
}
a { color: var(--blue-600); }
a:hover { color: var(--blue-500); }
.bg-success { background-color: var(--ov-success) !important; }
.btn-success { background-color: var(--ov-success); border-color: var(--ov-success); }
.btn-success:hover { background-color: #15803D; border-color: #15803D; }
.text-success { color: var(--ov-success) !important; }
.bg-danger { background-color: var(--ov-danger) !important; }
.text-danger { color: var(--ov-danger) !important; }
.bg-info { background-color: var(--ov-info) !important; }
.text-info { color: var(--ov-info) !important; }

/* ---- Typography ---- */
.page-title {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--slate-900);
    letter-spacing: -0.5px;
}
.page-title i { color: var(--blue-600); }
.text-gradient {
    background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
h4.mb-0 i, h4.page-title i { margin-right: 0.35rem; }

/* ---- Body & Layout ---- */
body {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
    font-size: 16px;
    padding-top: var(--ov-navbar-height);
    color: var(--slate-700);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--slate-900);
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
h1 { font-size: 48px; font-weight: 700; letter-spacing: -1.5px; }
h2 { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.5px; }
h4 { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
small, .small, .text-muted { color: var(--slate-500); }

/* ==============================
   SIDEBAR - OptyLoft Dark
   ============================== */
.sidebar {
    position: fixed;
    top: var(--ov-navbar-height);
    left: 0;
    bottom: 0;
    width: var(--ov-sidebar-width);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: all var(--ov-transition-slow);
    scrollbar-width: thin;
    background: var(--slate-900) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-brand {
    padding: 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-brand-icon {
    flex-shrink: 0;
    color: #fff;
}
.sidebar-brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.5px;
}
.sidebar-brand-text small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 2px;
}

.sidebar .sidebar-section {
    padding: 20px 20px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--slate-500);
    font-weight: 500;
}

.sidebar .nav-link {
    color: var(--slate-400);
    padding: 10px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 400;
    transition: all var(--ov-transition-base);
    white-space: nowrap;
    margin: 2px 12px;
    border-left: 3px solid transparent;
}
.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.sidebar .nav-link.active {
    color: var(--blue-600);
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
    border-left-color: var(--blue-600);
}
.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--ov-transition-fast);
}
.sidebar .nav-link:hover i { opacity: 1; color: #fff; }
.sidebar .nav-link.active i { opacity: 1; color: var(--blue-600); }

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--ov-sidebar-width);
    min-height: calc(100vh - var(--ov-navbar-height));
    transition: margin-left var(--ov-transition-slow);
    padding-bottom: 80px;
}

/* ==============================
   CARDS - OptyLoft
   ============================== */
.card {
    border-radius: 16px;
    border: 1px solid var(--slate-100);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: box-shadow var(--ov-transition-base), transform 0.15s ease;
    overflow: visible;
    background: var(--white);
}
.card > .card-header:first-child {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.card > .card-footer:last-child {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}
.card > .card-body:first-child {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.card > .card-body:last-child {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}
.card.border-0 { border: 1px solid var(--slate-100) !important; }
.card-body .fs-2 { line-height: 1; }
.card.shadow-sm, .card.border-0.shadow-sm { box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important; }
.card.shadow-sm:hover, .card.border-0.shadow-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}
.card-body .fs-2 { transition: transform 0.15s ease; }
.card.shadow-sm:hover .fs-2 { transform: scale(1.03); }

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--slate-100);
    font-weight: 600;
    padding: 16px 24px;
}
.card-header h6 {
    font-weight: 600;
    color: var(--slate-900);
    font-size: 14px;
    letter-spacing: -0.3px;
}
.card-header.bg-white {
    background: var(--white) !important;
    border-bottom: 1px solid var(--slate-100);
}
.card-footer {
    background: var(--bg);
    border-top: 1px solid var(--slate-100);
}

/* ==============================
   TABLES - OptyLoft Clean
   ============================== */
.table th {
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--slate-500);
    white-space: nowrap;
    background: var(--slate-100);
    padding: 14px 16px;
    border-bottom: 1px solid var(--slate-100);
}
.table td {
    vertical-align: middle;
    padding: 14px 16px;
    border-color: var(--slate-100);
    color: var(--slate-700);
    font-size: 14px;
}
.table-hover tbody tr { transition: background-color var(--ov-transition-fast); }
.table-hover tbody tr:hover { background-color: var(--bg); }
.table-light { background: var(--slate-100) !important; }

/* ---- Badges ---- */
.badge {
    font-weight: 500;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0;
}

/* ==============================
   NAVBAR - OptyLoft
   ============================== */
.navbar {
    height: var(--ov-navbar-height);
    z-index: 1030;
    background: var(--white) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    border-bottom: 1px solid var(--slate-100);
}
.navbar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--slate-900) !important;
}
.navbar-brand:hover { color: var(--slate-900) !important; }
.navbar-brand i {
    color: var(--blue-600);
}
.navbar .dropdown-menu {
    border: 1px solid var(--slate-100);
    box-shadow: var(--ov-shadow-lg);
    border-radius: 16px;
    padding: 8px;
    animation: slideDown 0.15s ease;
    background: var(--white);
}
.navbar .dropdown-item {
    border-radius: 10px;
    font-size: 14px;
    padding: 10px 14px;
    transition: all var(--ov-transition-fast);
    font-weight: 400;
    color: var(--slate-700);
}
.navbar .dropdown-item:hover {
    background-color: var(--blue-50);
    color: var(--blue-600);
}
.navbar .dropdown-item.active {
    background-color: var(--blue-50);
    color: var(--blue-600);
}
.navbar .btn-outline-light {
    border-color: var(--slate-300);
    color: var(--slate-700);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--ov-transition-base);
    border-radius: 10px;
}
.navbar .btn-outline-light:hover {
    background: var(--slate-100);
    border-color: var(--slate-300);
    color: var(--slate-900);
}
.navbar-brand-icon {
    display: flex; align-items: center; justify-content: center;
    color: var(--slate-900);
}
.navbar-icon-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--slate-500);
    border-radius: 10px;
    transition: all var(--ov-transition-fast);
    text-decoration: none;
    font-size: 1.05rem;
}
.navbar-icon-btn:hover {
    color: var(--blue-600);
    background: var(--blue-50);
}
.navbar-user-btn {
    display: flex; align-items: center; gap: 8px;
    color: var(--slate-700);
    text-decoration: none;
    padding: 6px 12px 6px 6px;
    border-radius: 50rem;
    transition: all var(--ov-transition-fast);
    font-size: 14px;
    font-weight: 500;
}
.navbar-user-btn:hover {
    color: var(--slate-900);
    background: var(--slate-100);
}
.navbar-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==============================
   ALERTS - OptyLoft Toasts
   ============================== */
.alert {
    border: none;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    font-weight: 400;
    padding: 14px 20px;
}
.alert-success {
    background-color: #DCFCE7;
    color: #16A34A;
    border-left: 3px solid #16A34A;
}
.alert-danger {
    background-color: #FEE2E2;
    color: #DC2626;
    border-left: 3px solid #DC2626;
}
.alert-warning {
    background-color: #FEF3C7;
    color: #D97706;
    border-left: 3px solid #D97706;
}
.alert-info {
    background-color: var(--blue-50);
    color: var(--blue-600);
    border-left: 3px solid var(--blue-600);
}

/* ==============================
   BUTTONS - OptyLoft
   ============================== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 14px;
    letter-spacing: 0.5px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--blue-600);
    border: none;
    color: #fff;
    box-shadow: none;
    padding: 12px 28px;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--blue-500);
    box-shadow: none;
    transform: translateY(-1px);
}
.btn-success {
    background: var(--ov-success);
    border: none;
    box-shadow: none;
}
.btn-success:hover {
    background: #15803D;
    box-shadow: none;
    transform: translateY(-1px);
}
.btn-outline-primary {
    position: relative;
    overflow: hidden;
    border-width: 1.5px;
    border-color: var(--slate-300);
    color: var(--slate-900);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--blue-600);
    border-color: var(--blue-600);
    color: #fff;
}
.btn-outline-primary::before { display: none; }
.btn-outline-secondary {
    border-color: var(--slate-300);
    color: var(--slate-900);
    border-width: 1.5px;
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--slate-100);
    border-color: var(--slate-300);
    color: var(--slate-900);
}
.btn-outline-warning {
    color: var(--ov-warning);
    border-color: var(--ov-warning);
}
.btn-outline-warning:hover {
    background-color: var(--ov-warning);
    border-color: var(--ov-warning);
    color: #fff;
}
/* Ghost button style */
.btn-link {
    color: var(--blue-600);
    text-decoration: none;
    background: transparent;
}
.btn-link:hover {
    background: var(--blue-50);
    color: var(--blue-600);
}
.btn-lg {
    border-radius: 10px;
    font-size: 15px;
    padding: 12px 28px;
    font-weight: 600;
}
.btn-sm {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
}
.btn-group-sm > .btn { border-radius: 6px; }
.btn-group .btn-outline-primary,
.btn-group .btn-outline-warning,
.btn-group .btn-outline-danger,
.btn-group .btn-outline-info {
    border-width: 1.5px;
}

/* ==============================
   FORMS - OptyLoft
   ============================== */
.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid var(--slate-300);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 15px;
    color: var(--slate-700);
    background-color: var(--white);
    padding: 12px 16px;
}
.form-control::placeholder {
    color: var(--slate-400);
    font-weight: 400;
}
.form-control:focus, .form-select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-control-lg {
    border-radius: 10px;
    font-size: 15px;
    padding: 12px 16px;
}
.form-label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--slate-700);
}
.input-group .form-control { border-radius: 10px; }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-text {
    background: var(--slate-100);
    border: 1.5px solid var(--slate-300);
    color: var(--slate-500);
    font-size: 14px;
}
.card-body.py-2 { padding: 12px 16px !important; }

/* ==============================
   POS / CAISSE
   ============================== */
#cart-items .cart-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color var(--ov-transition-fast);
}
#cart-items .cart-item:hover { background: var(--bg); }
#cart-items .cart-item .cart-item-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--slate-700);
}
#cart-items .cart-item .cart-item-price {
    font-weight: 700;
    color: var(--blue-600);
}
.cart-item-remove {
    cursor: pointer;
    color: var(--ov-danger);
    font-size: 1.1rem;
    transition: all var(--ov-transition-fast);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item-remove:hover {
    transform: scale(1.15);
    background: #FEE2E2;
}
.cart-item-qty {
    width: 50px !important;
    text-align: center;
    padding: 4px;
    font-size: 14px;
    border-radius: 10px;
}
.product-grid-card {
    border: 1.5px solid var(--slate-100);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white);
}
.product-grid-card:hover {
    border-color: var(--blue-600);
    background: var(--blue-50);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.product-grid-card .product-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--slate-900);
}
.product-grid-card .product-price {
    font-weight: 700;
    color: var(--blue-600);
    font-size: 14px;
}
.product-grid-card .product-stock {
    font-size: 12px;
    color: var(--slate-400);
}
.caisse-total-section {
    background: var(--slate-100);
    border-radius: 16px;
    padding: 16px;
}

/* ==============================
   KANBAN / WORKFLOW
   ============================== */
.kanban-wrapper { padding-bottom: 16px; }
.kanban-column {
    min-width: 200px;
    background: var(--bg);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid var(--slate-100);
}
.kanban-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    border: 1px solid var(--slate-100);
    background: var(--white);
}
.kanban-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
    border-color: var(--blue-600);
}

/* ==============================
   CALENDAR
   ============================== */
#calendar { min-height: 500px; }
.fc .fc-toolbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--slate-900);
}
.fc .fc-button {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 10px !important;
    font-weight: 500;
}
.fc .fc-button-primary {
    background-color: var(--blue-600);
    border-color: var(--blue-600);
}
.fc .fc-button-primary:hover {
    background-color: var(--blue-500);
    border-color: var(--blue-500);
}
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: #1D4ED8;
    border-color: #1D4ED8;
}
.fc .fc-daygrid-day.fc-day-today { background-color: var(--blue-50); }
.fc .fc-event {
    border-radius: 6px;
    border: none;
    padding: 3px 8px;
    font-size: 12px;
    box-shadow: var(--ov-shadow-xs);
    font-weight: 500;
}

/* ==============================
   MOBILE BOTTOM NAV
   ============================== */
.mobile-nav {
    z-index: 1040;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid var(--slate-100) !important;
}
.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--slate-400);
    font-size: 10px;
    padding: 4px;
    transition: color 0.2s ease;
    font-weight: 500;
}
.mobile-nav-link i { font-size: 1.25rem; margin-bottom: 2px; }
.mobile-nav-link.active, .mobile-nav-link:hover { color: var(--blue-600); }
.mobile-nav-link.caisse-btn {
    position: relative;
    top: -15px;
    background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
    color: #fff;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.mobile-nav-link.caisse-btn:hover, .mobile-nav-link.caisse-btn.active {
    color: #fff;
    background: linear-gradient(180deg, var(--blue-600), #1D4ED8);
}

/* ==============================
   SELECT2 / SWEETALERT / DATATABLES
   ============================== */
.select2-container--bootstrap-5 .select2-selection {
    font-size: 15px;
    border: 1.5px solid var(--slate-300);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.select2-container--bootstrap-5 .select2-selection--single:focus,
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid var(--slate-100);
    box-shadow: var(--ov-shadow-lg);
    border-radius: 16px;
    overflow: hidden;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--blue-600) !important;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--blue-50);
    border-color: var(--blue-100);
    color: var(--blue-600);
    border-radius: 6px;
    font-size: 12px;
}

.swal2-popup {
    font-size: 14px;
    border-radius: 20px !important;
    box-shadow: var(--ov-shadow-xl) !important;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.swal2-confirm {
    border-radius: 10px !important;
    background: var(--blue-600) !important;
    font-weight: 600 !important;
}
.swal2-cancel { border-radius: 10px !important; }

.dataTables_wrapper .dataTables_filter input {
    font-size: 14px;
    border-radius: 10px;
    border: 1.5px solid var(--slate-300);
    padding: 8px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}
.dataTables_wrapper .dataTables_length select {
    font-size: 14px;
    border-radius: 10px;
}
.dataTables_wrapper .dataTables_info {
    font-size: 13px;
    color: var(--slate-500);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    font-size: 13px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--blue-600) !important;
    border-color: var(--blue-600) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--blue-50) !important;
    border-color: var(--blue-600) !important;
    color: var(--blue-600) !important;
}

/* ==============================
   PAGINATION
   ============================== */
.page-link {
    color: var(--blue-600);
    border-radius: 10px;
    font-weight: 500;
    font-size: 13px;
    border-color: var(--slate-300);
    transition: all var(--ov-transition-fast);
}
.page-item.active .page-link {
    background: var(--blue-600);
    border-color: var(--blue-600);
}
.page-link:hover {
    background: var(--blue-50);
    border-color: var(--blue-600);
    color: var(--blue-600);
}

/* ==============================
   PRINT
   ============================== */
@media print {
    .sidebar, .navbar, .mobile-nav, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    body { padding-top: 0 !important; background: white !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

.ticket-print {
    width: 58mm;
    font-family: "Courier New", monospace;
    font-size: 11px;
    padding: 5mm;
}
.ticket-print .ticket-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 5px;
    margin-bottom: 5px;
}
.ticket-print .ticket-line { display: flex; justify-content: space-between; }
.ticket-print .ticket-total {
    border-top: 1px dashed #000;
    font-weight: bold;
    padding-top: 5px;
    margin-top: 5px;
}

/* ==============================
   SCROLLBAR - OptyLoft
   ============================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ==============================
   UTILITIES
   ============================== */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bg-purple { background-color: #7c3aed !important; }
.border-purple { border-color: #7c3aed !important; }

/* ==============================
   ANIMATIONS
   ============================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease both; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 0.3s ease both; }
.animate-count {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* ==============================
   LOADING OVERLAY
   ============================== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(250, 251, 253, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spinner-brand {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--blue-100);
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==============================
   SKELETON LOADING
   ============================== */
.skeleton {
    background: linear-gradient(90deg, var(--slate-100) 25%, #E2E8F0 50%, var(--slate-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
    min-height: 1em;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==============================
   EMPTY STATES
   ============================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state i {
    font-size: 3rem;
    color: var(--slate-300);
    margin-bottom: 16px;
    display: block;
}
.empty-state p {
    color: var(--slate-500);
    margin-bottom: 16px;
    font-size: 15px;
}
.empty-state .btn { margin-top: 8px; }

/* ============================================
   KPI DASHBOARD CARDS
   ============================================ */
.kpi-card {
    border: 1px solid var(--slate-100);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: var(--white);
}
.kpi-card .kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.kpi-card .kpi-icon.bg-primary-soft { background: var(--blue-100); color: var(--blue-600); }
.kpi-card .kpi-icon.bg-success-soft { background: #DCFCE7; color: #16A34A; }
.kpi-card .kpi-icon.bg-info-soft { background: var(--blue-100); color: var(--blue-600); }
.kpi-card .kpi-icon.bg-warning-soft { background: #FEF3C7; color: #D97706; }
.kpi-card .kpi-icon.bg-danger-soft { background: #FEE2E2; color: #DC2626; }
.kpi-card .kpi-icon.bg-purple-soft { background: #F3E8FF; color: #7c3aed; }
.kpi-card .kpi-value {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--slate-900);
    letter-spacing: -1px;
}
.kpi-card .kpi-label {
    font-size: 12px;
    color: var(--slate-500);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: uppercase;
}
.kpi-card .kpi-accent {
    position: absolute;
    top: 0; left: 0;
    width: 2.5px;
    height: 100%;
    border-radius: 0 1px 1px 0;
    background: var(--blue-600);
}

/* ============================================
   LOGIN PAGE - OptyLoft
   ============================================ */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}
.login-bg::before {
    content: "";
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    animation: loginPatternDrift 25s linear infinite;
}
@keyframes loginPatternDrift {
    from { transform: translate(0, 0); }
    to { transform: translate(32px, 32px); }
}
.login-card-premium {
    max-width: 420px;
    width: 100%;
    border: 1px solid var(--slate-100);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
    background: var(--white);
    animation: loginSlideUp 0.45s ease;
    position: relative;
    z-index: 1;
}
@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-header-premium {
    text-align: center;
    padding: 40px 32px 24px;
}
.login-logo-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 1px solid var(--slate-100);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.login-logo-icon i { font-size: 1.75rem; color: var(--blue-600); }
/* OptyLoft brand accent line */
.login-header-premium::after {
    content: "";
    display: block;
    width: 40px;
    height: 2.5px;
    background: var(--blue-600);
    border-radius: 1px;
    margin: 16px auto 0;
}

/* ============================================
   SOFT BADGES - OptyLoft
   ============================================ */
.badge-soft-primary { background: var(--blue-100); color: var(--blue-600); }
.badge-soft-success { background: #DCFCE7; color: #16A34A; }
.badge-soft-danger { background: #FEE2E2; color: #DC2626; }
.badge-soft-warning { background: #FEF3C7; color: #D97706; }
.badge-soft-info { background: var(--blue-100); color: var(--blue-600); }

/* ============================================
   STATUS DOT
   ============================================ */
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-dot.pulsing { animation: statusPulse 2s infinite; }
@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ============================================
   MODALS - OptyLoft
   ============================================ */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}
.modal-backdrop.show {
    backdrop-filter: blur(4px);
}
.modal-header {
    border-bottom: 1px solid var(--slate-100);
    padding: 24px 32px 16px;
}
.modal-header .modal-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--slate-900);
}
.modal-body { padding: 24px 32px; }
.modal-footer {
    border-top: 1px solid var(--slate-100);
    padding: 16px 32px;
}

/* ============================================
   LIST GROUP
   ============================================ */
.list-group-item {
    border-color: var(--slate-100);
    padding: 12px 16px;
    font-size: 14px;
    transition: background-color var(--ov-transition-fast);
}
.list-group-item:hover { background-color: var(--blue-50); }
.list-group-item-action { color: var(--slate-700); }
.list-group-item-action:hover { color: var(--blue-600); }

/* ---- Caisse search cards ---- */
.caisse-search-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}

/* ---- Autocomplete Dropdown ---- */
#client-results,
#produit-results,
#client_results,
#produit_results,
#devis-client-results,
#rdv-client-results,
#cmd-vente-results,
#searchClientResults {
    top: 100%;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--slate-100);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    background: var(--white);
    z-index: 1060 !important;
}
#client-results .list-group-item,
#produit-results .list-group-item,
#client_results .list-group-item,
#produit_results .list-group-item,
#devis-client-results .list-group-item,
#rdv-client-results .list-group-item,
#cmd-vente-results .list-group-item,
#searchClientResults .list-group-item {
    border-left: none;
    border-right: none;
    cursor: pointer;
    font-size: 14px;
}
#client-results .list-group-item:first-child,
#produit-results .list-group-item:first-child,
#client_results .list-group-item:first-child,
#produit_results .list-group-item:first-child,
#devis-client-results .list-group-item:first-child,
#rdv-client-results .list-group-item:first-child,
#cmd-vente-results .list-group-item:first-child,
#searchClientResults .list-group-item:first-child {
    border-top: none;
}

/* ---- Line Item Cards (Devis & Factures) ---- */
.ligne-devis,
.ligne-facture {
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.ligne-enter {
    opacity: 0;
    transform: translateY(-10px);
}
.ligne-exit {
    opacity: 0;
    transform: translateX(30px);
}
.ligne-devis:hover,
.ligne-facture:hover {
    background-color: var(--blue-50) !important;
    border-color: var(--blue-600) !important;
}
.ligne-devis .form-label,
.ligne-facture .form-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--slate-500);
}
#lignes-empty {
    border: 2px dashed var(--slate-300);
    border-radius: 16px;
}

/* ============================================
   NAV TABS - OptyLoft
   ============================================ */
.nav-tabs {
    border-bottom: 1px solid var(--slate-100);
}
.nav-tabs .nav-link {
    border: none;
    color: var(--slate-500);
    font-weight: 500;
    font-size: 14px;
    padding: 12px 16px;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px;
    transition: all var(--ov-transition-fast);
}
.nav-tabs .nav-link:hover {
    color: var(--blue-600);
    border-bottom-color: rgba(37, 99, 235, 0.3);
}
.nav-tabs .nav-link.active {
    color: var(--blue-600);
    border-bottom-color: var(--blue-600);
    background: transparent;
    font-weight: 600;
}
.card-header-tabs {
    margin-bottom: -1px;
}

/* ============================================
   DIVIDERS - prefer spacing over dividers
   ============================================ */
hr, .dropdown-divider {
    border-color: var(--slate-100);
    opacity: 1;
}

/* ============================================
   BRAND ACCENT LINE
   ============================================ */
.brand-accent-line {
    width: 40px;
    height: 2.5px;
    background: var(--blue-600);
    border-radius: 1px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        width: var(--ov-sidebar-width);
        transform: translateX(-100%);
    }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
