/**
 * =====================================================================
 * CCS OPTIK MASTER — DESIGN SYSTEM & MASTER STYLESHEET
 * =====================================================================
 * Architecture:
 * 1. CSS Custom Properties / Tokens (:root)
 * 2. Typography & Core Layout
 * 3. Component Modules (Cards, Buttons, Inputs, Badges, Tables, Sidebar)
 * 4. Micro-Animations & Utilities
 * =====================================================================
 */

:root {
    --primary-color: #6366f1; /* Indigo */
    --primary-light: #818cf8;
    --secondary-color: #0d9488; /* Teal */
    --secondary-light: #2dd4bf;
    --background-color: #f8fafc;
    --card-background: rgba(255, 255, 255, 0.95);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --sidebar-bg: linear-gradient(135deg, #4f46e5, #0d9488);
    --sidebar-width: 240px;
    --sidebar-mini-width: 64px;
    --topbar-height: 60px;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 0.875rem; /* Smaller base font */
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Auth Login Page */
.auth-bg {
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(13, 148, 136, 0.08) 0%, transparent 40%),
                #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.9);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    box-shadow: 0 30px 60px -15px rgba(99, 102, 241, 0.16), 0 6px 16px rgba(0, 0, 0, 0.04);
}

/* Custom Unified Input Group */
.custom-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 2px 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.custom-input-group:hover {
    border-color: #94a3b8;
}

.custom-input-group:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.custom-input-group .input-icon-left {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.15rem;
    margin-right: 10px;
    transition: color 0.25s ease;
    flex-shrink: 0;
}

.custom-input-group:focus-within .input-icon-left {
    color: #6366f1;
}

.custom-input-group .form-control-modern {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 11px 0;
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 500;
    min-width: 0;
}

.custom-input-group .form-control-modern::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Prevent Webkit Autofill yellow/blue background override */
.custom-input-group .form-control-modern:-webkit-autofill,
.custom-input-group .form-control-modern:-webkit-autofill:hover, 
.custom-input-group .form-control-modern:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.custom-input-group .toggle-password-btn {
    border: none;
    background: transparent;
    padding: 6px 8px;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

.custom-input-group .toggle-password-btn:hover {
    color: #4f46e5;
    background-color: rgba(99, 102, 241, 0.08);
}

.custom-input-group:focus-within .toggle-password-btn {
    color: #6366f1;
}

/* Invalid State */
.custom-input-group.is-invalid {
    border-color: #ef4444 !important;
}

.custom-input-group.is-invalid:focus-within {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}

.custom-input-group.is-invalid .input-icon-left {
    color: #ef4444 !important;
}

/* Button style */
.btn-indigo-gradient {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    transition: all 0.25s ease;
}

.btn-indigo-gradient:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-indigo-gradient:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* =====================================================
   LAYOUT STRUCTURE — Sidebar + Main Content
   ===================================================== */

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ----- SIDEBAR ----- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(.4,0,.2,1), min-width 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 20px rgba(79, 70, 229, 0.1);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 200;
    flex-shrink: 0;
}

/* MINI sidebar state */
.sidebar.mini {
    width: var(--sidebar-mini-width);
    min-width: var(--sidebar-mini-width);
}

/* Sidebar toggle button (style of Gambar 1, position at the top header) */
.sidebar-expand-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: -1px; /* sits exactly on the sidebar border */
    z-index: 201;
    background: linear-gradient(160deg, #4f46e5 0%, #0d9488 100%);
    color: white;
    width: 18px;
    height: 48px;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    box-shadow: 3px 3px 12px rgba(79, 70, 229, 0.3);
    border: none;
    transition: width 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.72rem;
    outline: none;
}
.sidebar-expand-tab:hover {
    width: 24px;
    box-shadow: 5px 3px 16px rgba(79, 70, 229, 0.45);
    color: white;
}
.sidebar-expand-tab i {
    transition: transform 0.25s ease;
    pointer-events: none;
}

/* Sidebar Header — same height as topbar */
.sidebar-header {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: linear-gradient(to right, #ffffff, #ccfbf1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

/* Hide brand name when sidebar is mini and center the brand wrapper / logo */
.sidebar.mini .sidebar-brand-name {
    display: none !important;
}
.sidebar.mini .sidebar-header {
    justify-content: center !important;
}
.sidebar.mini .sidebar-brand-wrapper {
    justify-content: center !important;
    width: 100%;
}

/* Sidebar Body — scrollable */
.sidebar-body {
    flex: 1;
    padding: 0.85rem 0.6rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar-body::-webkit-scrollbar {
    width: 4px;
}
.sidebar-body::-webkit-scrollbar-track { background: transparent; }
.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Sidebar menu item links */
.sidebar-item-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-item-link i {
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1;
    /* No fixed width here — width is handled per mode */
}

.sidebar-item-link span {
    opacity: 1;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.sidebar.mini .sidebar-item-link span {
    display: none; /* Completely remove from grid so icon is the only child */
}

/* Sidebar Menu Badge (Notification count) */
.sidebar-badge-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 50px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
    line-height: 1;
    flex-shrink: 0;
}

.sidebar.mini .sidebar-item-link .sidebar-badge-count {
    display: flex !important;
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.62rem;
}

/* Also reduce sidebar-body padding in mini mode */
.sidebar.mini .sidebar-body {
    padding: 0.85rem 0.3rem;
}

/* Center each sidebar-item li in mini mode */
.sidebar.mini .sidebar-menu li {
    display: flex;
    justify-content: center;
}

.sidebar-item-link:hover, .sidebar-item.active .sidebar-item-link {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-item.active .sidebar-item-link {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* Mini tooltip on hover */
/* Mini mode: icon perfectly centered inside highlight */
.sidebar.mini .sidebar-item-link {
    position: relative;
    /* Override flex to use grid for true centering */
    display: grid;
    place-items: center;
    gap: 0;
    padding: 0;
    width: 40px;
    height: 40px;
    margin: 0 auto; /* center item inside sidebar-menu li */
    border-radius: 10px;
}

.sidebar.mini .sidebar-item-link i {
    font-size: 1.05rem;
    width: auto;
    line-height: 1;
}

.sidebar.mini .sidebar-item-link:hover::after {
    content: attr(data-label);
    position: absolute;
    left: calc(var(--sidebar-mini-width) + 4px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 7px;
    white-space: nowrap;
    z-index: 999;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: rgba(255,255,255,0.85);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    transition: all 0.25s ease;
    font-size: 0.85rem;
}
.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.22);
    color: white;
}

/* Sidebar section separator label */
.sidebar-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    padding: 0.6rem 0.85rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}
.sidebar.mini .sidebar-section-label {
    font-size: 0;
    line-height: 0;
    height: 0;
    padding: 0;
    margin: 0.5rem 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    opacity: 1;
}
.sidebar.mini .sidebar-menu > .sidebar-section-label:first-child {
    display: none !important;
}

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.6rem;
    margin-top: 0.5rem;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    min-width: 0; /* Prevent overflow */
}

/* Topbar — STICKY */
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem 0 1.5rem; /* left padding adjusted for toggle button */
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
    flex-shrink: 0;
}

.topbar h5 {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.content-body {
    flex: 1;
    padding: 1.25rem 1rem; /* lebih rapat ke kiri & kanan */
    overflow-y: auto;
}

/* Override: semua kolom di dalam content-body memakai lebar penuh
   (menghilangkan justify-content-center + col-lg-8/col-lg-10 yang mempersempit form) */
.content-body > .row.justify-content-center > [class*="col-lg-"],
.content-body > .row.justify-content-center > [class*="col-md-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

/* =====================================================
   CUSTOM UI CARDS
   ===================================================== */

.custom-card {
    border: none;
    border-radius: 16px;
    background: white;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.025);
    border: 1px solid #f1f5f9;
}

.custom-card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.1rem 1.5rem;
}

.custom-card-body {
    padding: 1.5rem;
}

/* =====================================================
   PREMIUM GRADIENT BUTTONS
   ===================================================== */

.btn-indigo-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.2);
}

.btn-indigo-gradient:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3);
}

.btn-teal-gradient {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.2);
}

.btn-teal-gradient:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.3);
}

/* =====================================================
   FORM STYLING
   ===================================================== */

.form-control-custom {
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
    height: 38px;
    transition: all 0.3s ease;
}

.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px !important;
    border-color: #cbd5e1 !important;
    font-size: 0.85rem !important;
    min-height: 38px !important;
    height: 38px !important;
}

.form-control-custom:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Alert Styling */
.custom-alert {
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
}

/* =====================================================
   BUTTON & FILE INPUT ALIGNMENT OVERRIDES (PREMIUM FIX)
   ===================================================== */

/* Align heights of all small buttons */
.btn-sm,
.btn-indigo-gradient.btn-sm,
.btn-teal-gradient.btn-sm {
    height: 36px !important;
    padding: 0 1.1rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Align heights of regular buttons (non-sm) */
.btn:not(.btn-sm),
.btn-indigo-gradient:not(.btn-sm),
.btn-teal-gradient:not(.btn-sm) {
    height: 44px !important;
    padding: 0 1.5rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    line-height: 1 !important;
}

/* File Input Vertical Centering Fix */
input[type="file"].form-control-custom {
    padding: 0.4rem 0.75rem !important;
    line-height: 1.5 !important;
    display: flex !important;
    align-items: center !important;
}
input[type="file"].form-control-custom::file-selector-button {
    padding: 0.2rem 0.75rem !important;
    margin: -0.2rem -0.5rem !important;
    margin-right: 0.75rem !important;
    border-radius: 6px !important;
}

/* Icon-only buttons should be square */
.btn-icon.btn-sm {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
}
.btn-icon:not(.btn-sm) {
    width: 44px !important;
    min-width: 44px !important;
    padding: 0 !important;
}
/* Sidebar Tooltip */
.sidebar-tooltip {
    position: fixed;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 7px;
    white-space: nowrap;
    pointer-events: none;
    transform: translateY(-50%) translateX(-8px);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-tooltip.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* =====================================================
   GLOBAL LOADING & PRESS FEEDBACK
   ===================================================== */

.page-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top, rgba(99, 102, 241, 0.12), transparent 42%),
        rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.page-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.page-loader-card {
    min-width: 220px;
    max-width: 280px;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.page-loader-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(99, 102, 241, 0.18);
    border-top-color: var(--primary-color);
    animation: pageLoaderSpin 0.75s linear infinite;
    flex-shrink: 0;
}

.page-loader-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.01em;
}

@keyframes pageLoaderSpin {
    to {
        transform: rotate(360deg);
    }
}

.press-feedback-target {
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
    will-change: transform;
}

.press-feedback-target.is-pressed,
.press-feedback-target:active {
    transform: translateY(1px) scale(0.985) !important;
    filter: brightness(0.97);
}

/* =====================================================
   EXTRACTED STYLES FROM BLADE VIEWS
   ===================================================== */

/* 1. Status and Customer Type Badges */
.badge-terkirim   { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); font-size: 0.72rem; }
.badge-komplit    { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.3); font-size: 0.72rem; }
.badge-dibatalkan { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); font-size: 0.72rem; }
.badge-toko       { background: rgba(99,102,241,0.1); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); font-size: 0.7rem; }
.badge-ritel      { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); font-size: 0.7rem; }
.badge-none       { background: rgba(148,163,184,0.1); color: #94a3b8; border: 1px solid rgba(148,163,184,0.2); font-size: 0.7rem; }
.badge-transfer   { background: rgba(20,184,166,0.1); color: #2dd4bf; border: 1px solid rgba(20,184,166,0.2); font-size: 0.7rem; }
.badge-qris       { background: rgba(139,92,246,0.1); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.2); font-size: 0.7rem; }

/* 2. Premium Select2 single select (standard size) */
.select2-container--default .select2-selection--single {
    border: 1px solid #cbd5e1 !important; border-radius: 10px !important;
    height: 38px !important; padding: 0 0.9rem !important;
    display: flex !important; align-items: center !important;
    transition: all 0.3s ease !important;
}
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #818cf8 !important; box-shadow: 0 0 0 4px rgba(99,102,241,0.1) !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px !important; right: 12px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { padding-left: 0 !important; color: #334155 !important; font-size: 0.85rem !important; }

/* 3. Select2 for tables & transaction forms (like Stock Ins) */
.stock-ins-form-wrapper .select2-container,
.select2-container-block {
    display: block !important;
}
.stock-ins-form-wrapper .select2-container--default .select2-selection--single {
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    height: auto !important;
    min-height: unset !important;
    padding: 0.55rem 0.9rem !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    font-size: 0.85rem !important;
}
.stock-ins-form-wrapper .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1) !important;
}
.stock-ins-form-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 8px !important;
}
.stock-ins-form-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0 !important;
    padding-right: 20px !important;
    color: #334155 !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
}
.stock-ins-form-wrapper .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8 !important;
}

/* 4. Select2 inside tables */
.table-select2 + .select2-container--default .select2-selection--single {
    height: 38px !important;
    border-radius: 8px !important;
}
.table-select2 + .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 8px !important;
}
.table-select2 + .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
}

/* 5. Currency input prefixes and dynamic layout elements */
.currency-prefix { position: relative; }
.currency-prefix .prefix-label {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: #64748b; font-size: 0.85rem; font-weight: 600; pointer-events: none; z-index: 5;
}
.currency-prefix input { padding-left: 2.8rem !important; }
.section-divider { border-top: 1px solid #f1f5f9; margin: 1.5rem 0; padding-top: 1.5rem; }
.section-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 1rem; }

/* 6. Product Detail styling */
.barcode-container { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; text-align: center; }
.barcode-container svg { max-width: 100%; height: auto; }
.detail-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
.detail-value { font-size: 0.95rem; font-weight: 600; color: #334155; }
.price-card { background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%); border: 1px solid #c7d2fe; border-radius: 12px; padding: 1rem 1.25rem; }
.stock-card { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border: 1px solid #bbf7d0; border-radius: 12px; padding: 1rem 1.25rem; }
.stock-card.low-stock { background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%); border-color: #fdba74; }
.stock-card-gray { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem 1.25rem; }

/* 7. Product Print overrides */
@media print {
    .no-print { display: none !important; }
    .custom-card { box-shadow: none !important; }
    .barcode-container { border: 1px solid #000; page-break-inside: avoid; }
}

/* 8. Sales details layouts & Thermal receipt */
.detail-header { background: linear-gradient(135deg, #1e293b, #263044); border-radius: 14px; padding: 1.5rem; margin-bottom: 1rem; }
.info-chip { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); border-radius: 8px; padding: 0.4rem 0.85rem; font-size: 0.82rem; color: #a5b4fc; font-weight: 600; }
.detail-table thead th { background: #f8fafc; font-size: 0.78rem; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

#thermal-receipt {
    display: none;
}

@media print {
    body * {
        visibility: hidden !important;
    }
    #thermal-receipt, #thermal-receipt * {
        visibility: visible !important;
    }
    #thermal-receipt {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 80mm !important;
        margin: 0 !important;
        padding: 4mm !important;
        box-sizing: border-box !important;
        font-family: 'Courier New', Courier, monospace !important;
        font-size: 9.5pt !important;
        line-height: 1.3 !important;
        color: #000 !important;
        background: #fff !important;
    }
    @page {
        size: 80mm auto;
        margin: 0;
    }
    .receipt-header {
        text-align: center;
        margin-bottom: 4mm;
    }
    .receipt-title {
        font-size: 14pt;
        font-weight: bold;
        margin: 0 0 1mm 0;
    }
    .receipt-subtitle {
        font-size: 8pt;
        margin: 0;
    }
    .receipt-divider {
        text-align: center;
        margin: 2mm 0;
        font-weight: bold;
    }
    .receipt-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 1.5mm;
    }
    .receipt-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
        margin: 2mm 0;
    }
    .receipt-table th {
        border-bottom: 1px dashed #000;
        padding-bottom: 1mm;
        font-weight: bold;
    }
    .receipt-table td {
        padding: 1mm 0;
        vertical-align: top;
    }
    .receipt-table td small {
        font-size: 7.5pt;
        color: #000;
    }
    .receipt-footer {
        text-align: center;
        margin-top: 5mm;
        font-size: 8pt;
        line-height: 1.4;
    }
}

/* 9. Global Indigo Utilities for Badge and Text visibility */
.bg-indigo-subtle {
    background-color: rgba(99, 102, 241, 0.1) !important;
}
.text-indigo {
    color: #6366f1 !important;
}
.border-indigo-subtle {
    border-color: rgba(99, 102, 241, 0.2) !important;
}

/* =====================================================
   10. AUTO TEXT FORMATTING — Kapitalisasi Otomatis
   ===================================================== */

/* Field Nama, Alamat, Keterangan → Capitalize (Huruf awal setiap kata besar) */
input[name="name"],
input[name*="name"],
input[name="address"],
input[name*="address"],
input[name="keterangan"],
input[name="notes"],
input[name="customer_name"],
input[name="supplier_name"],
textarea[name="address"],
textarea[name="notes"],
textarea[name="keterangan"] {
    text-transform: capitalize;
}

/* Field Kode → UPPERCASE */
input[name$="_code"],
input[name="product_code"],
input[name="category_code"],
input[name="supplier_code"],
input[name="marketing_code"],
input[name="retail_code"],
input[name="store_code"],
input[name="invoice_number"],
input[name="sale_number"] {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Tampilan teks di tabel dan detail view → capitalize untuk nama */
td .fw-semibold,
td .text-capitalize-auto,
.detail-value.name-value {
    text-transform: capitalize;
}

/* Badge status tetap seperti apa adanya (override jika ada konflik) */
.badge {
    text-transform: none !important;
}

/* Helper classes yang bisa dipakai manual */
.text-auto-capitalize { text-transform: capitalize !important; }
.text-auto-uppercase  { text-transform: uppercase !important; }
.text-auto-lowercase  { text-transform: lowercase !important; }
.text-auto-none       { text-transform: none !important; }

/* ── 11. PAGINATION SYSTEM OPTIMIZATION ── */
.mt-4.d-flex.justify-content-end {
    display: block !important;
    width: 100%;
}

.justify-content-end nav[role="navigation"] {
    width: 100% !important;
}

.justify-content-end nav[role="navigation"] div.d-sm-flex {
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: space-between !important;
}

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    gap: 3px;
    margin: 0;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    font-size: 0.81rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.page-item:not(.active) .page-link:hover {
    color: var(--primary-color);
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.page-item.disabled .page-link {
    color: #94a3b8;
    pointer-events: none;
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

/* Helper Utility Classes for Clean Blade Templates */
.icon-indigo { color: #6366f1 !important; }
.brand-logo-img { width: 30px; height: 30px; object-fit: cover; background-color: #ffffff; }
.user-badge { font-size: 0.78rem; font-weight: 500; border-radius: 8px; }
.user-badge-icon { font-size: 11px; }
.header-search-input { width: 240px; border-radius: 8px; font-size: 0.8rem; height: 32px; }
.header-search-btn { height: 32px !important; width: 36px !important; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.rounded-8 { border-radius: 8px !important; }
.rounded-12 { border-radius: 12px !important; }
.rounded-16 { border-radius: 16px !important; }
.img-product-preview { max-height: 200px; object-fit: contain; }
.price-val { font-size: 1.0rem; font-weight: 600; color: #4338ca; }
.stock-val { font-size: 1.25rem; font-weight: 600; color: #15803d; }
.stock-val-gray { font-size: 1.25rem; font-weight: 600; color: #334155; }
.barcode-text { letter-spacing: 0.15em; font-size: 1rem; }
.barcode-icon-lg { font-size: 3rem; }
.badge-status-lg { border-radius: 8px; font-size: 0.78rem; }
.font-dot { font-size: 7px !important; }

/* =====================================================
   PAGINATION LAYOUT
   Ensure 'Showing X to Y of Z results' is on the left,
   and page number links are on the right.
   ===================================================== */
nav.d-flex.justify-content-between,
nav.d-flex.justify-items-center,
.d-flex.justify-content-end > nav,
.pagination-wrapper nav {
    width: 100% !important;
}

nav .pagination {
    margin-bottom: 0 !important;
}

nav p.small,
nav .text-muted {
    margin-bottom: 0 !important;
}

/* =====================================================
   APPLICATION FOOTER
   ===================================================== */
.app-footer {
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    padding: 0.85rem 1.5rem;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: auto;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.02);
}

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-left {
    font-weight: 500;
}

.footer-left strong {
    color: #334155;
    font-weight: 600;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Select2 Global Overrides */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    min-height: 38px !important;
}
.select2-container--default .select2-selection--single {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    height: 38px !important;
    padding-top: 4px;
}



