/* ================================================
   PSM SMART INVENTORY SYSTEM V2.3.2
   Main Stylesheet
   ================================================ */

:root {
    /* Prevent Chrome Force Dark Mode from altering colors */
    color-scheme: dark;
    forced-color-adjust: none;
    -webkit-forced-color-adjust: none;
    /* Core Palette */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #020617;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #334155;
    --info: #3b82f6;
    --purple: #8b5cf6;
    /* User Roles */
    --admin-red: #f87171;
    --manager-blue: #60a5fa;
    --supervisor-amber: #fbbf24;
    --user-green: #34d399;
    --viewer-gray: #9ca3af;
    /* Smart Logic Colors */
    --abc-a: #a3e635;
    /* Lime */
    --abc-b: #facc15;
    /* Yellow */
    --abc-c: #94a3b8;
    /* Slate */
    --reorder-alert: #f43f5e;
    /* Rose */
}

.sync-panel {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

/* === UNIFIED CONNECTION CHIP === */
.unified-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 28px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Roboto Mono', monospace;
    transition: all 0.35s ease;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    /* Establish stacking context */
}

.unified-chip:hover {
    filter: brightness(1.25);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.unified-chip-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.unified-chip-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
}

/* State: LIVE SYNC (Online + Realtime ON) */
.unified-chip.unified-live {
    border: 1px solid rgba(63, 185, 80, 0.4);
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
}

.unified-chip.unified-live .unified-chip-dot {
    background: #3fb950;
    box-shadow: 0 0 12px rgba(63, 185, 80, 0.8);
}

.unified-chip.unified-live .unified-chip-dot::after {
    background-color: #3fb950;
    animation: premium-pulse-ring 2.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* State: ONLINE (Online + Realtime OFF) */
.unified-chip.unified-online {
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.unified-chip.unified-online .unified-chip-dot {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.unified-chip.unified-online .unified-chip-dot::after {
    background-color: #f59e0b;
    /* No ripple for online-only, just glow */
}

/* State: OFFLINE */
.unified-chip.unified-offline {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.unified-chip.unified-offline .unified-chip-dot {
    background: #ef4444;
    box-shadow: none;
}

/* State: SYNCING */
.unified-chip.unified-syncing {
    border: 1px solid rgba(88, 166, 255, 0.4);
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
}

.unified-chip.unified-syncing .unified-chip-dot {
    background: #58a6ff;
    box-shadow: 0 0 12px rgba(88, 166, 255, 0.8);
}

.unified-chip.unified-syncing .unified-chip-dot::after {
    background-color: #58a6ff;
    animation: premium-pulse-ring 1.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* State: CONNECTING */
.unified-chip.unified-connecting {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.08);
    color: #94a3b8;
}

.unified-chip.unified-connecting .unified-chip-dot {
    background: #64748b;
    box-shadow: 0 0 8px rgba(100, 116, 139, 0.5);
}

.unified-chip.unified-connecting .unified-chip-dot::after {
    background-color: #64748b;
    animation: premium-pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes premium-pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(4.5);
        opacity: 0;
    }
}

.chip-time {
    font-size: 8px;
    font-weight: 600;
    opacity: 0.7;
    margin-left: 2px;
    letter-spacing: 0;
}

.sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(148, 163, 184, 0.08);
    font-size: 9px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.3px;
    color: var(--text-main);
    white-space: nowrap;
    cursor: default;
    transition: all 0.3s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

.sync-icon {
    opacity: 0.8;
    width: 12px;
    display: inline-flex;
    justify-content: center;
    font-size: 10px;
}

.sync-pill.sync-accent {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
}

* {
    box-sizing: border-box;
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    padding: 0;
}

/* === ANTI-SWIPE LOGOUT === */
html,
body {
    overscroll-behavior-y: none !important;
    touch-action: pan-y !important;
    min-height: 100vh;
    background: var(--bg-body);
    color: var(--text-main);
}

/* === AUTO-LOCK OVERLAY === */
#autoLockOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

#autoLockCard {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--accent);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    width: 320px;
    box-shadow: 0 0 50px rgba(56, 189, 248, 0.2);
}

/* === DYNAMIC PRINT STYLES === */


/* ==========================================
    DYMANIC PRINT STYLES (FIXED FOR 58MM, 80MM & A4)
    ========================================== */
@page {
    margin: 0;
    size: auto;
}

#printable-receipt,
#printable-invoice,
#printable-a4 {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }

    header,
    nav,
    .pos-layout,
    .table-container,
    .form-grid,
    .btn,
    .settings-group,
    #toast-container,
    .profile-avatar,
    .modal-close-btn-red,
    .report-filter-bar,
    .main-content,
    .content-section,
    .modal,
    #printPreviewModal,
    #printConfigModal {
        display: none !important;
        visibility: hidden !important;
    }

    body {
        background: white;
        color: black;
        padding: 0;
        margin: 0;
        overflow: visible;
        font-size: 10pt;
        width: 100%;
    }

    /* THERMAL RECEIPT (58MM) - OPTIMIZED FOR BLUETOOTH THERMAL */
    body.printing-58mm #printable-receipt,
    body.printing-58mm #printable-receipt * {
        visibility: visible;
    }

    body.printing-58mm #printable-receipt {
        display: block !important;
        position: relative;
        top: 0;
        left: 0;
        width: 58mm;
        max-width: 58mm;
        margin: 0 auto;
        padding: 4mm 1mm;
        color: black;
        background: white;
        font-family: 'Roboto Mono', 'Courier New', monospace;
        font-size: 9px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
        page-break-inside: avoid;
    }

    body.printing-58mm #printable-receipt * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* INVOICE (80MM) - OPTIMIZED FOR BLUETOOTH THERMAL */
    body.printing-80mm #printable-invoice,
    body.printing-80mm #printable-invoice * {
        visibility: visible;
    }

    body.printing-80mm #printable-invoice {
        display: block !important;
        position: relative;
        top: 0;
        left: 0;
        width: 80mm;
        max-width: 80mm;
        margin: 0 auto;
        padding: 3mm 2mm;
        background: white;
        color: black;
        font-family: 'Roboto Mono', 'Courier New', monospace;
        font-size: 10px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
    }

    body.printing-80mm #printable-invoice * {
        max-width: 100%;
    }



    /* Removes browser default headers/footers */
    body.printing-a4 #printable-a4,
    body.printing-a4 #printable-a4 * {
        visibility: visible;
    }

    body.printing-a4 #printable-a4 {
        display: block !important;
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        padding: 0;
        background: white;
        color: black;
        font-family: 'Arial', 'Helvetica', sans-serif;
        font-size: 11pt;
    }

    body.printing-58mm #printable-invoice,
    body.printing-58mm #printable-a4 {
        display: none !important;
    }

    body.printing-80mm #printable-receipt,
    body.printing-80mm #printable-a4 {
        display: none !important;
    }

    body.printing-a4 #printable-receipt,
    body.printing-a4 #printable-invoice {
        display: none !important;
    }
}

/* ==========================================
    MODAL PRINT CONFIGURATION (ENTERPRISE)
    ========================================== */
#printConfigModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    z-index: 20001;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.print-config-content {
    background: var(--bg-card);
    width: 95%;
    max-width: 1100px;
    height: 90vh;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.config-sidebar {
    width: 300px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.config-preview-area {
    flex: 1;
    background: #e2e8f0;
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    position: relative;
}

.config-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.config-card:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent);
}

.config-card.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.config-card i {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--accent);
}

.config-card h4 {
    font-size: 12px;
    color: white;
    margin-bottom: 4px;
}

.config-card p {
    font-size: 9px;
    color: var(--text-muted);
}

/* ==========================================
    VISUAL PREVIEW STYLES (WYSIWYG)
    ========================================== */
#printPreviewModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    z-index: 20000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.preview-content {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 95%;
    max-height: 95vh;
    overflow: hidden;
}

.preview-paper-container {
    overflow: auto;
    max-height: 80vh;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.preview-paper {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform-origin: top center;
    transition: width 0.3s, height 0.3s;
    height: auto !important;
    /* Grow with content */
    padding-bottom: 10mm;
    /* Tambahkan lebih banyak ruang untuk margin bawah */
}

.preview-paper.receipt-58mm {
    width: 58mm;
}

.preview-paper.invoice-80mm {
    width: 80mm;
}

.preview-paper.invoice-a4 {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
}

.preview-paper .a4-table th,
.preview-paper .a4-table td {
    background: #fff !important;
    color: #000 !important;
}

.preview-paper .a4-table th {
    background: #eee !important;
    color: #000 !important;
}

/* INTERNAL RECEIPT STYLING - OPTIMIZED FOR THERMAL PRINTERS (ELEGANT & PROFESSIONAL) */
.rec-header {
    text-align: center;
    margin-bottom: 10px;
    color: #000;
    padding: 0 2mm;
}

.rec-logo {
    max-width: 150px;
    max-height: 80px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 10px auto;
    object-fit: contain;
}

.rec-store-name {
    font-weight: 900;
    font-size: 14px;
    /* Sophisticated understatement */
    text-transform: uppercase;
    margin-bottom: 2px;
    font-family: 'Inter', sans-serif;
    color: #000;
    letter-spacing: 0.3px;
    line-height: 1.1;
}

.rec-meta {
    font-size: 10px;
    /* Refined for 58mm/80mm impact */
    margin-bottom: 1px;
    line-height: 1.25;
    color: #000;
    font-family: 'Roboto Mono', monospace;
    opacity: 1;
}

.rec-meta-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    text-align: left;
    gap: 2px;
    margin-top: 5px;
    margin-left: 2mm;
    /* Edge-avoidance */
    margin-right: 2mm;
    /* Edge-avoidance */
    padding: 0;
}

.rec-meta-group div:nth-child(even) {
    text-align: right;
}

.rec-line {
    border-bottom: 1px dashed #000;
    margin: 3px 2mm;
    /* Edge-avoidance for thermal */
}

.rec-item-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 9px;
    page-break-inside: avoid;
    color: #000;
    line-height: 1.4;
    font-family: 'Roboto Mono', monospace;
}

.rec-item-row>div:first-child {
    flex: 1;
    padding-right: 5px;
    word-break: break-word;
}

.rec-item-row>div:last-child {
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

.rec-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-top: 8px;
    font-size: 10px;
    color: #000;
    border-top: 1px dashed #000;
    padding-top: 5px;
    font-family: 'Roboto Mono', monospace;
}

.rec-footer {
    text-align: center;
    margin-top: 4px;
    /* Tightened gap */
    font-size: 8px;
    color: #000;
    line-height: 1.2;
    /* Tighter line flow */
    font-family: 'Roboto Mono', monospace;
    padding: 0 2mm;
    padding-bottom: 10mm;
    /* Ensure footer does not touch the paper edge */
}

.rec-header-text {
    font-size: 8px;
    text-align: center;
    margin: 6px 0;
    line-height: 1.4;
    color: #000;
    font-family: 'Roboto Mono', monospace;
}

/* INTERNAL INVOICE 80MM STYLING - ELEGANT & NEAT */
.inv-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 10px;
    font-family: 'Roboto Mono', monospace;
    table-layout: fixed;
}

.inv-table thead th {
    border-bottom: 1px dashed #000;
    padding: 5px 2px;
    text-align: left;
    font-weight: bold;
    color: #000;
    white-space: nowrap;
    background: transparent !important;
}

.inv-table tbody td {
    padding: 4px 2px;
    color: #000;
    border-bottom: none;
    vertical-align: top;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.inv-table .text-right {
    text-align: right;
}

.inv-summary-container {
    margin-top: 10px;
    border-top: 1px dashed #000;
    padding-top: 5px;
}

.inv-summary-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
    font-size: 10px;
    font-family: 'Roboto Mono', monospace;
    color: #000;
}

.inv-summary-row.grand-total {
    font-weight: bold;
    font-size: 14px;
    margin-top: 8px;
    border-top: 1px dashed #000;
    padding-top: 5px;
    letter-spacing: 0.5px;
    color: #000 !important;
    text-shadow: none !important;
    /* FORCE BLACK FOR THERMAL */
}

.inv-summary-row.grand-total span:first-child {
    margin-right: 15px;
}

/* Prevent touching */

/* AUDIT LOG FIX: Allow wrapping for Details column */
#auditBody td:nth-child(4) {
    white-space: normal !important;
    word-wrap: break-word;
    min-width: 250px;
    line-height: 1.4;
}

/* INTERNAL A4 INVOICE STYLING */
.a4-inv-container {
    width: 100%;
    min-height: 100vh;
    font-family: 'Arial', 'Helvetica', sans-serif;
    color: #000;
    padding: 20mm 20mm 15mm 25mm;
    /* Increased Left padding to 25mm to avoid clipping */
    box-sizing: border-box;
}

.a4-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #000;
    padding-bottom: 10px;
}

.a4-title {
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.a4-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 5px;
}

.a4-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 11px;
}

.a4-table th,
.a4-table td {
    border: 1px solid #000;
    padding: 6px;
    text-align: left;
    color: #000 !important;
    background: transparent !important;
}

.a4-table th {
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    background: transparent !important;
}

.a4-table td {
    background: #fff !important;
    color: #000 !important;
}

.a4-summary {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.a4-summary-row {
    display: flex;
    justify-content: space-between;
    width: 200px;
    font-size: 12px;
    color: #000;
}

.a4-total {
    font-weight: bold;
    font-size: 14px;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 5px 0;
}

.preview-controls {
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 30px;
}

/* === UI HEADER STYLES === */
.ui-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
}

header {
    background: linear-gradient(to right, #020617, #0f172a);
    padding: 15px 25px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo-title-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logo-section h1 {
    font-size: 22px;
    color: var(--accent);
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.badge-flag {
    display: inline-flex;
    align-items: center;
    background: var(--warning);
    color: #0f172a;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 10px;
    transform: skewX(-20deg);
    margin-left: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.badge-flag span {
    transform: skewX(20deg);
    display: block;
}

/* === HEADER RIGHT SECTION (COMPACT ENTERPRISE) === */
.header-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ROW 1: USER (UPDATED TO MATCH BACKUP STYLE - GHOST VARIANT) */
.user-section {
    padding: 0;
    background: none;
    border: none;
}

.user-section:hover {
    background: none;
    border: none;
}

.user-info-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Base style matches .backup-status */
.user-badge-elegant,
.backup-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    height: 28px;
    border-radius: 6px;
    font-size: 9px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Specific Role Colors (Ghost Style) */
.user-badge-elegant.admin-root-gold {
    background: linear-gradient(135deg, #020617 0%, #1e1b4b 100%) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(251, 191, 36, 0.8) !important;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3) !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-badge-elegant.admin-root-gold i {
    color: #fbbf24 !important;
}

.user-badge-elegant.admin {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.2);
}

.user-badge-elegant.manager {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.2);
}

.user-badge-elegant.supervisor {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
}

.user-badge-elegant.user {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
}

.user-badge-elegant.viewer {
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.2);
}

.user-badge-elegant.staff {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
}

/* Hover effect for User Badge and Backup Status */
.user-badge-elegant:hover,
.backup-status:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

/* LOGOUT BUTTON */
.logout-btn-elegant {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.logout-btn-elegant:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.logout-btn-elegant i {
    font-size: 11px;
}

/* ROW 2: BACKUP (UPDATED TO MATCH SHARED BASE STYLE) */
/* .backup-status styles merged above with .user-badge-elegant */
.backup-status.active {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.backup-status.inactive {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ANIMATION FOR ACTIVE BACKUP */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

.backup-status.active {
    animation: pulse-green 2s infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.backup-status.active i {
    display: inline-block !important;
    animation: spin 2s linear infinite !important;
}

.timer-badge {
    background: transparent;
    padding: 0;
    border: none;
    font-size: 9px;
    font-family: 'Roboto Mono', monospace;
    display: flex;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 6px;
    margin-left: 6px;
    height: 100%;
}

/* === BADGES & GENERAL BUTTONS === */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    text-align: center;
    min-width: 50px;
    transition: all 0.2s;
    white-space: normal;
    line-height: 1.3;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-accent {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ABC BADGES CLARIFICATION */
.badge-abc-a {
    background: var(--abc-a);
    color: #000;
    border: 1px solid var(--abc-a);
}

.badge-abc-b {
    background: var(--abc-b);
    color: #000;
    border: 1px solid var(--abc-b);
}

.badge-abc-c {
    background: var(--abc-c);
    color: #fff;
    border: 1px solid var(--abc-c);
}

.badge-reorder {
    background: var(--reorder-alert);
    color: #fff;
    animation: pulse 2s infinite;
}

/* Tooltip for ABC */
[data-title] {
    position: relative;
}

[data-title]:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 9px;
    line-height: 1.45;
    color: var(--text-muted);
    font-weight: 500;
}

.field-hint strong {
    color: #94a3b8;
    font-weight: 700;
}

/* NAVIGATION */
nav {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-top: 22px;
    position: relative;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge Legacy */
}

nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

nav a,
nav .nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-transform: uppercase;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

nav a:hover,
nav .nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

nav a.active,
nav .nav-item.active {
    background: var(--accent);
    color: #0f172a;
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
    font-weight: 900;
}

nav .nav-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--danger);
    color: var(--danger);
}

nav .nav-item.locked:hover {
    background: rgba(0, 0, 0, 0.2);
    color: var(--danger);
    border-color: var(--danger);
}

#globalLockIndicator {
    display: none;
    font-size: 9px;
    font-weight: 900;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.nav-undo-btn {
    background: rgba(245, 158, 11, 0.1) !important;
    color: var(--warning) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.nav-undo-btn:hover {
    background: var(--warning) !important;
    color: #0f172a !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5) !important;
}

/* === BUTTON STYLES === */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-accent {
    background: var(--accent);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-success {
    background: var(--success);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #0f172a;
}

.btn-purple {
    background: var(--purple);
    color: white;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 10px;
    height: 28px;
}

.btn-xs {
    padding: 2px 4px;
    font-size: 8px;
    height: 20px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-icon:hover {
    background: var(--accent);
    color: #0f172a;
}

/* ELEGANT CONTROL BUTTONS */
.btn-elegant-control {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 30px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0 10px;
}

.btn-elegant-control:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-elegant-control.btn-search:hover {
    background: var(--info);
    color: white;
    border-color: var(--info);
}

.btn-elegant-control.btn-clear:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-elegant-control.btn-gen:hover {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
}

.btn-elegant-control.btn-nav:hover {
    background: var(--accent);
    color: #0f172a;
    border-color: var(--accent);
}

/* Store profile action bar (premium, subtle) */
.store-profile-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 8px;
}

.btn-store-action {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    letter-spacing: 0.35px;
    border: 1px solid transparent;
    background: linear-gradient(120deg, rgba(30, 41, 59, 0.95) 0%, rgba(22, 33, 56, 0.92) 45%, rgba(15, 23, 42, 0.96) 100%);
    color: #e5edf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 5px 16px rgba(2, 6, 23, 0.38);
    position: relative;
    overflow: hidden;
}

.btn-store-action:hover {
    transform: translateY(-1px);
    filter: none;
}

.btn-store-action::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 48%, transparent 100%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
}

.btn-store-action:hover::before {
    transform: translateX(120%);
}

.btn-store-action .btn-divider {
    opacity: 0.35;
}

.btn-store-action .btn-caption {
    font-weight: 500;
    opacity: 0.72;
    font-size: 9px;
}

.btn-store-save {
    border-color: rgba(16, 185, 129, 0.5);
    color: #9af7c5;
    background: linear-gradient(120deg, rgba(8, 73, 54, 0.9) 0%, rgba(15, 95, 72, 0.82) 45%, rgba(15, 23, 42, 0.95) 100%);
}

.btn-store-save:hover {
    background: linear-gradient(120deg, rgba(16, 185, 129, 0.36) 0%, rgba(5, 150, 105, 0.28) 45%, rgba(15, 23, 42, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(16, 185, 129, 0.34), 0 10px 24px rgba(16, 185, 129, 0.24);
}

.btn-store-refresh {
    border-color: rgba(59, 130, 246, 0.52);
    color: #a5d7ff;
    background: linear-gradient(120deg, rgba(18, 58, 109, 0.9) 0%, rgba(29, 78, 216, 0.56) 45%, rgba(15, 23, 42, 0.95) 100%);
}

.btn-store-refresh:hover {
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.34) 0%, rgba(14, 165, 233, 0.24) 45%, rgba(15, 23, 42, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(56, 189, 248, 0.34), 0 10px 24px rgba(56, 189, 248, 0.24);
}

.btn-store-reset {
    border-color: rgba(251, 146, 60, 0.52);
    color: #ffd4a5;
    background: linear-gradient(120deg, rgba(113, 56, 16, 0.9) 0%, rgba(180, 83, 9, 0.62) 45%, rgba(15, 23, 42, 0.95) 100%);
}

.btn-store-reset:hover {
    background: linear-gradient(120deg, rgba(251, 146, 60, 0.34) 0%, rgba(245, 158, 11, 0.24) 45%, rgba(15, 23, 42, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(251, 146, 60, 0.34), 0 10px 24px rgba(251, 146, 60, 0.24);
}

/* === INPUTS & FORMS === */
input,
select,
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: white;
    padding: 8px;
    border-radius: 4px;
    outline: none;
    font-size: 11px;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.1);
}

input[readonly] {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: transparent;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* === CONTENT LAYOUT === */
.main-content {
    padding: 20px;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.form-group label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.input-group {
    display: flex;
    gap: 4px;
}

/* === TABLE STYLES === */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #020617;
    max-height: 75vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

table {
    width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #0f172a !important;
    color: var(--accent);
    font-size: 9px;
    text-transform: uppercase;
    padding: 6px 8px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 4px 6px;
    font-size: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    white-space: nowrap;
    vertical-align: middle;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(56, 189, 248, 0.1);
    cursor: pointer;
}

tbody tr:hover td {
    color: var(--text-main);
}

.text-right {
    text-align: right;
}

/* HISTORY ACTION BUTTONS WRAPPER (FIXED) */
.action-buttons-wrapper {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* TABLE CONTROLS */
.table-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.table-search-bar {
    display: flex;
    gap: 5px;
    flex: 1;
    max-width: 400px;
}

.table-controls {
    float: right;
    clear: both;
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.controls-info {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    line-height: 1.1;
    padding: 0 5px;
    text-align: center;
}

.controls-select {
    width: auto !important;
    padding: 4px 8px;
    font-size: 10px;
}

/* OPNAME SPECIFIC */
.input-opname-qty {
    width: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent);
    color: var(--text-main);
    font-weight: bold;
    text-align: right;
}

.input-opname-qty:focus {
    background: rgba(56, 189, 248, 0.2);
    box-shadow: 0 0 5px var(--accent);
}

.input-opname-reason,
.input-opname-ket {
    width: 100%;
    padding: 4px;
    font-size: 9px;
    background: #0f172a;
    border: 1px solid var(--border);
    color: #f1f5f9;
    border-radius: 4px;
    appearance: none;
}

.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    height: calc(100vh - 140px);
    
    /* Ensure layout never gets unreadably narrow; forces horizontal scroll on mobile */
    min-width: 800px;
    /* Ensure layout never gets too short causing cart to disappear in landscape */
    min-height: 550px;
}

.pos-catalog {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.pos-cart-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pos-header {
    background: rgba(56, 189, 248, 0.1);
    padding: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pos-controls-bar {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 6px;
}

.pos-mode-badge {
    font-size: 10px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 5px;
    flex: 1;
}

.product-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100px;
    position: relative;
}

.product-card:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.product-card.out-of-stock {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

.pc-name {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1.2;
    color: white;
}

.pc-price {
    font-size: 12px;
    color: var(--success);
    font-weight: bold;
}

.pc-stock {
    font-size: 9px;
    color: var(--text-muted);
}

.cart-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 11px;
    transition: all 0.2s;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.3);
}

.cart-item.is-return {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
}

.cart-item-left {
    flex: 1 1 100px; /* Allow wrapping on very narrow screens */
    min-width: 0;
}

.cart-item-title {
    font-weight: bold;
    color: white;
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-sub {
    font-size: 9px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cart-qty-btn {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}

.cart-qty-btn:hover {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
    transform: scale(1.05);
}

.cart-item-total {
    font-weight: bold;
    color: var(--accent);
    width: 80px;
    text-align: right;
    font-size: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.cart-item-total.is-return {
    color: var(--danger);
}

.cart-footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-top: 1px solid var(--border);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.grand-total {
    font-size: 18px;
    font-weight: 900;
    color: var(--success);
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    margin-bottom: 15px;
    display: block;
    text-align: right;
}

.grand-total.is-return {
    color: var(--danger);
}

.pay-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.pay-input-wrapper input {
    flex: 1;
    font-size: 16px;
    font-weight: bold;
    text-align: right;
}

.btn-pay {
    width: 100%;
    padding: 12px;
    font-size: 12px;
    font-weight: 900;
    justify-content: center;
    background: var(--success);
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

/* DISCOUNT & TAX ROW */
.cart-disp-tax-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.cart-disp-tax-item label {
    display: block;
    font-size: 8px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.cart-disp-tax-item input {
    padding: 5px;
    font-size: 11px;
    text-align: right;
}

/* === SETTINGS STYLE (ENTERPRISE REDESIGN) === */
.settings-section-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.settings-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.settings-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.settings-title {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
}

.settings-content {
    padding: 20px;
}

.settings-input-wrapper {
    width: 100%;
    max-width: 350px;
    display: flex;
    gap: 5px;
    align-items: center;
    margin-bottom: 10px;
}

.settings-input-wrapper input {
    height: 30px;
    font-size: 10px;
}

.settings-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 20px;
}

.list-chip {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--accent);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    transition: 0.2s;
}

.list-chip:hover {
    background: var(--accent);
    color: #000;
}

.chip-close {
    cursor: pointer;
    opacity: 0.8;
    transition: 0.2s;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.chip-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
    color: #0f172a;
}

/* === ELEGANT DELETE BUTTON (Settings) === */
.btn-remove-col {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.btn-remove-col:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.btn-remove-line {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-line:hover {
    background: var(--warning);
    color: #0f172a;
}

/* === MODALS & TOASTS === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    margin: 5vh auto;
    padding: 0;
    border: 1px solid var(--border);
    width: 95%;
    max-width: 900px;
    border-radius: 12px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-close-btn-red {
    background: var(--danger);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: 0.2s;
    padding: 0;
    line-height: 1;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    color: white;
    margin: 0 auto 10px;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.action-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.action-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 12px;
    color: var(--accent);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.mini-table th {
    font-size: 9px;
    text-align: left;
    color: var(--text-muted);
    padding: 4px;
}

.mini-table td {
    font-size: 10px;
    padding: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-table tr {
    transition: background-color 0.2s ease;
}

.mini-table tr:hover {
    background-color: rgba(56, 189, 248, 0.1);
    cursor: pointer;
}

.mini-table tr:hover td {
    color: var(--text-main);
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 350px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast-close {
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    font-size: 14px;
    padding: 2px;
}

.toast-close:hover {
    opacity: 1;
    color: var(--danger);
    transform: scale(1.1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* === CEK HARGA CARD === */
.cek-harga-card {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cek-harga-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}

.cek-harga-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: left;
    border: 1px solid var(--border);
}

.cek-box-title {
    font-size: 11px;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    text-transform: uppercase;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    color: var(--text-main);
    font-weight: bold;
}

/* === SCANNER MODAL STYLES === */
#qrScannerModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.scanner-content {
    width: 100%;
    max-width: 500px;
    background: #0f172a;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.scanner-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px dashed var(--warning);
    border-radius: 8px;
    padding: 10px;
    font-size: 10px;
    color: var(--warning);
    text-align: left;
    line-height: 1.4;
}

.scanner-warning strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
}

#reader {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #334155;
    min-height: 300px;
    background: #000;
}

#reader video {
    object-fit: cover;
    border-radius: 6px;
}

.scanner-header {
    color: var(--accent);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border: none;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.stop-btn {
    background: #eab308;
    color: #000;
    width: 100%;
    padding: 12px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.3);
}

/* === REPORT STYLES === */
.report-preview-container {
    margin-top: 0;
    background: #020617;
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 500px;
    overflow: auto;
    position: relative;
    padding: 0;
}

#reportTableContent {
    padding: 15px;
}

.report-cols-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.report-col-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}

.report-col-check input {
    width: auto;
}

.report-filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.report-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-filter-label {
    font-size: 10px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
}

/* ==========================================
   MOBILE RESPONSIVE: POS & GLOBAL OPTIMIZATION
   ========================================== */

/* Optimization for Portrait Mode on Mobile (Narrow Screens) */
@media (max-width: 768px) {
    /* Print Config Modal Mobile Fix */
    #printConfigModal {
        padding: 0;
        align-items: flex-start;
        overflow-y: auto;
    }

    .print-config-content {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100%;
        border-radius: 0;
        border: none;
    }

    .config-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 15px;
        order: 1; /* Config options at the top but scrollable */
        flex-shrink: 0;
    }

    .config-preview-area {
        width: 100%;
        height: auto;
        min-height: 60vh;
        padding: 20px 10px;
        order: 2; /* Preview below config */
        overflow-x: auto; /* Enable horizontal scroll */
        -webkit-overflow-scrolling: touch;
        display: block; /* Allow child to center itself or be scrolled */
    }

    .config-card {
        padding: 15px;
        margin-bottom: 10px;
    }

    .config-sidebar h3 {
        font-size: 16px;
        margin-bottom: 15px !important;
    }

    #configPreviewPaper {
        margin: 0 auto; /* Center in the scrollable area */
    }

    /* Print Preview Modal (Legacy) Mobile Fix */
    .preview-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        padding: 15px;
    }

    .preview-paper-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        padding: 10px 0;
    }

    #previewPaperContainer {
        margin: 0 auto;
    }

    .ui-container {
        border-radius: 0;
        border: none;
    }

    header {
        padding: 10px 15px;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    .logo-section h1 {
        font-size: 18px;
    }

    nav {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        display: flex;
        scrollbar-width: none; /* Firefox */
    }

    nav::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .main-content {
        padding: 10px;
    }

    /* POS Mobile Fix: Allow side-by-side but with minimum readable width */
    .pos-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: auto;
        min-width: 100%;
        gap: 20px;
    }

    .pos-catalog {
        height: 50vh;
    }

    .pos-cart-wrapper {
        height: 60vh;
    }

    /* Table horizontal scroll optimization */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    /* Add visual hint for scrollable tables on mobile */
    .table-container::after {
        content: 'Swipe horizontal untuk melihat data →';
        position: sticky;
        left: 0;
        bottom: 0;
        width: 100%;
        background: rgba(56, 189, 248, 0.9);
        color: #0f172a;
        font-size: 9px;
        font-weight: 800;
        text-align: center;
        padding: 4px 0;
        z-index: 50;
        pointer-events: none;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    table {
        min-width: 1000px; /* Ensure table columns don't squish */
    }

    /* Form optimization */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group {
        grid-column: span 1 !important;
    }

    /* Table Header Mobile Fix */
    .table-header-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .table-search-bar {
        max-width: 100%;
    }

    .table-controls {
        justify-content: space-between;
        width: 100%;
    }
}

/* Landscape Mobile Fix */
@media (max-height: 500px) and (max-width: 900px) {
    .pos-layout {
        height: calc(100vh - 100px);
        min-height: 300px;
    }
}

/* ==========================================
    INTEGRATED SMART IMPORT MODAL STYLES
    ========================================== */
#importModal .modal-body {
    max-height: 80vh;
    overflow-y: auto;
    background: var(--bg-body);
}

.import-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-zone {
    border: 2px dashed var(--border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    margin: 30px;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.05);
}

.upload-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.import-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 0 30px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 5px;
}

.stat-card-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.stat-card.danger .stat-card-value {
    color: var(--danger);
}

.stat-card.success .stat-card-value {
    color: var(--success);
}

.mapping-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 30px;
}

.mapping-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.mapping-table th {
    text-align: left;
    padding: 10px 15px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.mapping-table td {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.mapping-table tr {
    transition: background-color 0.2s ease;
}

.mapping-table tr:hover {
    background-color: rgba(56, 189, 248, 0.1);
    cursor: pointer;
}

.mapping-table tr:hover td {
    color: var(--text-main);
}

.mapping-field-label {
    font-weight: 700;
    color: white;
    font-size: 11px;
}

.mapping-select {
    width: 100%;
    max-width: 250px;
    cursor: pointer;
    background: #0f172a;
    color: white;
    border: 1px solid var(--border);
    padding: 5px;
}

.mapping-status {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-match {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-missing {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.preview-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow: auto;
    margin: 0 30px 30px 30px;
}

.preview-table-sm {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.preview-table-sm th,
.preview-table-sm td {
    padding: 8px;
    border: 1px solid var(--border);
    text-align: left;
}

.preview-table-sm th {
    background: rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
}

.preview-table-sm tr {
    transition: background-color 0.2s ease;
}

.preview-table-sm tr:hover {
    background-color: rgba(56, 189, 248, 0.1);
    cursor: pointer;
}

.preview-table-sm tr:hover td {
    color: var(--text-main);
}

.row-duplicate {
    background: rgba(239, 68, 68, 0.1);
}

.row-duplicate td {
    color: #fca5a5;
}

/* === LOADING OVERLAY === */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* === SALES PRINT OPTIONS MODAL === */
.sales-print-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.sales-print-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sales-print-card h4 {
    color: var(--text-main);
    font-size: 12px;
    margin: 0;
}

.sales-print-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-preview {
    background: var(--info);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    flex: 1;
}

.btn-print {
    background: var(--success);
    color: #0f172a;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    flex: 1;
}

/* === UPDATED BUTTON STYLES (ELEGANT) === */
/* Tombol Mode Retur di Kasir */
#btnToggleReturn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#btnToggleReturn:hover {
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

#btnToggleReturn.active-mode {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

/* Tombol Ambil di Kasir */
#btnLoadHold {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
    font-weight: 800;
}

#btnLoadHold:hover {
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Tombol Cetak Nota Terakhir di Penjualan */
.btn-print-elegant {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    color: white !important;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.btn-print-elegant:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* COLUMN VISIBILITY */
#masterBodyContainer.hide-status-smart .col-status,
#masterBodyContainer.hide-status-smart .col-smart {
    display: none !important;
}

/* === SORTABLE TABLE HEADERS === */
.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}

.sortable-th:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.sort-icon {
    font-size: 10px;
    margin-left: 6px;
    color: var(--text-muted);
    opacity: 0.5;
    transition: all 0.2s;
}

.sort-icon.active {
    color: var(--accent);
    opacity: 1;
}

/* POS NUMERIC INPUTS */
.pos-input-numeric {
    text-align: right !important;
    padding-right: 4px !important;
    /* Move spinners to the far right */
    padding-left: 8px !important;
    font-weight: bold !important;
    color: var(--text-primary) !important;
    transition: all 0.2s;
}

.pos-input-numeric:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2) !important;
    outline: none;
}

/* === SWITCH/SLIDER STYLES === */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked+.slider {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

input:focus+.slider {
    box-shadow: 0 0 4px rgba(167, 139, 250, 0.5);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* === POS INPUT NUMERIC FIXES === */
.pos-input-numeric::-webkit-inner-spin-button,
.pos-input-numeric::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-input-numeric {
    -moz-appearance: textfield;
}

/* Online Indicator */
.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.online-indicator.online {
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}
.online-indicator.offline {
    background-color: #94a3b8;
}

/* SUPER ADMIN Gold Theme */
.badge-admin-root-gold {
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%) !important;
    color: #000 !important;
    font-weight: 800 !important;
    border: 1px solid #fff !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5) !important;
}

.user-badge.admin_root {
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%) !important;
    color: #000 !important;
    font-weight: 800;
}

.btn-gold {
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%) !important;
    color: #000 !important;
    font-weight: 800 !important;
    border: 1px solid #fff !important;
}

.online-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: var(--text-main);
}

.online-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.online-dot-pulse {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    position: relative;
}

.online-dot-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Unified Status Bar - Box Shape */
.unified-status-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px; /* BOX SHAPE matching other elements */
    padding: 0;
    gap: 0;
    cursor: default;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 32px;
    overflow: hidden;
}

.status-indicator, .sync-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 0 12px;
    height: 100%;
    cursor: pointer;
    transition: background 0.2s;
}

.status-indicator:hover, .sync-indicator:hover {
    background: rgba(255, 255, 255, 0.08);
}

.status-divider {
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
}

.sync-indicator i {
    font-size: 10px;
    transition: transform 0.5s;
}

.sync-indicator.syncing i, .sync-loading #unifiedSyncIcon {
    animation: fa-spin 2s linear infinite;
}

#unifiedText {
    letter-spacing: 0.5px;
}

.chip-time {
    font-size: 9px;
    opacity: 0.6;
    font-weight: 400;
}

/* Status Colors */
.status-online #onlineCountText { color: #22c55e; }
.sync-ok #unifiedText { color: #22c55e; }
.sync-error #unifiedText { color: #ef4444; }
.sync-connecting #unifiedText { color: #f59e0b; }

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

