/* ============================================================ 
   ARTIVITY POS - PREMIUM UI SYSTEM
   v3.0 "Pastel Harmony"
   Focus: Cleanliness, Softness, Modernity
============================================================ */

:root {
    /* --- Colors: Pastel & Soft Palette --- */
    /* Primary (Soft Blue) - Action & Brand */
    --primary: #60A5FA;       /* Blue 400 */
    --primary-light: #93C5FD; /* Blue 300 */
    --primary-dark: #3B82F6;  /* Blue 500 */
    --primary-soft: rgba(96, 165, 250, 0.12);

    /* Secondary (Soft Pink) - Accents */
    --secondary: #F472B6;       /* Pink 400 */
    --secondary-light: #FBCFE8; /* Pink 200 */
    --secondary-soft: rgba(244, 114, 182, 0.12);

    /* Functional Colors (Soft Variations) */
    --success: #2DD4BF;       /* Teal 400 */
    --success-soft: rgba(45, 212, 191, 0.12);
    --warning: #FB923C;       /* Orange 400 */
    --warning-soft: rgba(251, 146, 60, 0.12);
    --danger: #F87171;        /* Red 400 */
    --danger-soft: rgba(248, 113, 113, 0.12);
    --info: #818CF8;          /* Indigo 400 */
    --info-soft: rgba(129, 140, 248, 0.12);

    /* Backgrounds */
    --bg-main: #F8FAFC;       /* Slate 50 - Very clean, light background */
    --bg-sidebar: #1E293B;    /* Slate 800 - Deep, professional contrast */
    --bg-card: #FFFFFF;
    --bg-input: #F1F5F9;      /* Slate 100 */

    /* Typography */
    --text-main: #334155;     /* Slate 700 - Softer than black */
    --text-muted: #94A3B8;    /* Slate 400 */
    --text-light: #F8FAFC;    /* Slate 50 */

    /* --- Shadows & Glass --- */
    /* Ultra-soft, diffused shadows */
    --shadow-sm: 0 2px 4px rgba(148, 163, 184, 0.05);
    --shadow-md: 0 8px 16px -4px rgba(148, 163, 184, 0.08);
    --shadow-lg: 0 20px 40px -10px rgba(148, 163, 184, 0.12);
    --shadow-glow: 0 0 20px rgba(96, 165, 250, 0.25);

    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --glass-blur: blur(16px);

    /* --- Animation --- */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* --- Dimensions --- */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    /* --- Borders --- */
    --border-color: #E2E8F0;
    --border-color-light: #F1F5F9;
    --border-color-hover: #CBD5E1;

    /* --- Text Variants --- */
    --text-heading: #1E293B;    /* Slate 800 - Headings */
    --text-secondary: #64748B;  /* Slate 500 */
    --text-placeholder: #94A3B8;/* Slate 400 */

    /* --- Functional Color Pairs (Bootstrap-compatible) --- */
    --bs-primary: #0d6efd;
    --bs-primary-hover: #0b5ed7;
    --bs-success: #198754;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    --bs-secondary: #6c757d;

    /* --- Spacing Scale --- */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* --- Z-Index Scale --- */
    --z-sidebar: 1500;
    --z-modal: 1600;
    --z-swal2: 1600;
    --z-search-dropdown: 99999;
    --z-tooltip: 1000;

    /* --- Transitions --- */
    --transition-fast: 0.15s var(--ease-smooth);
    --transition-base: 0.25s var(--ease-smooth);
    --transition-slow: 0.35s var(--ease-smooth);

    /* --- Attendance Spec Colors --- */
    --spec-blue: #185FA5;
    --spec-amber: #BA7517;
    --spec-red: #E24B4A;
    --spec-green: #3B6D11;
    --spec-teal: #0F6E56;

    /* --- Gradient Tokens --- */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-dark));
    --gradient-success: linear-gradient(135deg, #10b981, #059669);
    --gradient-warning: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
    --gradient-analytics: linear-gradient(135deg, #0d6efd, #6366f1);

    /* --- WhatsApp Theme --- */
    --wa-green: #008069;
    --wa-chat-bg: #efeae2;
    --wa-bubble-out: #d9fdd3;
}

/* ============================================================ 
   RESET & TYPOGRAPHY
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    min-height: 100%;
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Remove the old background image override to ensure clean look */
body {
    background: var(--bg-main) !important;
}

/* Better Scrollbar (Rounder & Softer) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color-hover);
    border-radius: 10px;
    border: 2px solid var(--bg-main); /* Creates padding effect */
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================ 
   ANIMATIONS & MICRO-INTERACTIONS
============================================================ */

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.98) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-entrance {
    animation: fadeInScale 0.6s var(--ease-primary) forwards;
}

/* Card Hover Lift */
.hover-lift {
    transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Click feedback */
.active-press:active {
    transform: scale(0.98);
}

/* ============================================================ 
   DATATABLES
============================================================ */

.dataTables_info {
    padding: 1rem !important;
    font-size: 0.875rem !important;
    justify-content: center !important; 
    align-items: center !important;
}

.dataTables_paginate {
    padding: 1rem !important;
    font-size: 0.875rem !important;
}

.dataTables_length {
    padding: 1rem !important;
    font-size: 0.875rem !important;
    justify-content: center !important; 
    align-items: center !important;
}

/* ============================================================ 
   SIDEBAR (Modern & Clean)
============================================================ */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-sidebar);
    /* Subtle inner glow for depth instead of harsh shadow */
    box-shadow: 20px 0 40px rgba(0,0,0,0.04); 
    z-index: var(--z-sidebar);
    transition: width 0.4s var(--ease-smooth);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.05);
}

#sidebar.collapsed {
    width: 90px;
}

/* Header */
.sidebar-header {
    height: 90px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.4s var(--ease-smooth);
}

#sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
    flex-direction: column;
    height: auto;
    padding-top: 24px;
    gap: 15px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s var(--ease-smooth);
}

.brand .logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 0 15px rgba(96, 165, 250, 0.2));
    transition: all 0.3s var(--ease-smooth);
}

.brand .logo-collapsed {
    display: none;
    height: 36px;
    width: auto;
    filter: drop-shadow(0 0 15px rgba(96, 165, 250, 0.3));
    transition: all 0.3s var(--ease-smooth);
}

#sidebar.collapsed .brand {
    justify-content: center;
    width: 100%;
}

#sidebar.collapsed .brand .logo {
    display: none;
}

#sidebar.collapsed .brand .logo-collapsed {
    display: block;
}

/* Hover Interaction for Brand */
.brand:hover {
    transform: translateY(-1px);
}

.brand:hover .logo, 
.brand:hover .logo-collapsed {
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.4));
}

#toggleSidebar {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

#toggleSidebar:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
    transform: rotate(90deg);
}

#sidebar.collapsed #toggleSidebar {
    transform: rotate(0deg); /* Reset rotation or keep it? Let's keep it simple */
}

#sidebar.collapsed #toggleSidebar:hover {
    transform: rotate(180deg);
}

/* Menu */
.sidebar-menu {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Increased spacing */
}

/* Clean scrollbar for sidebar */
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-base);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    width: 100%;
    background: none;
}

.menu-item .icon {
    width: 24px;
    font-size: 18px;
    margin-right: 14px;
    display: flex;
    justify-content: center;
    transition: transform 0.2rem var(--ease-spring);
    color: var(--text-secondary);
}

.menu-item:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.03);
}

.menu-item:hover .icon {
    transform: scale(1.2);
    color: var(--primary);
}

.menu-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(96, 165, 250, 0.2);
    font-weight: 600;
}

.menu-item.active .icon {
    color: var(--primary);
}

.rotate {
    transform: rotate(0deg);
    transition: transform 0.2s var(--ease-smooth);
}

.rotate.down {
    transform: rotate(90deg);
}

.menu-item.active::after {
    content: '';
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

/* Collapsed Logic */
#sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 16px 0;
}
#sidebar.collapsed .menu-item span,
#sidebar.collapsed .rotate,
#sidebar.collapsed .menu-item.active::after {
    display: none;
}
#sidebar.collapsed .menu-item .icon { margin: 0; }

/* Submenu */
.submenu {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    padding: 4px;
}
.submenu a {
    display: block;
    padding: 10px 10px 10px 56px;
    color: #94A3B8;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: var(--radius-sm);
}
.submenu a:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
    transform: translateX(2px);
}
.submenu a.active {
    color: var(--secondary);
    font-weight: 600;
}
/* Collapsed flyout submenu */
#sidebar.collapsed .sidebar-menu {
    overflow: visible;
}
#sidebar.collapsed .menu-group {
    position: relative;
}
#sidebar.collapsed .submenu {
    display: none !important;
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    min-width: 200px;
    background: #1a2332;
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: 4px 4px 20px rgba(0,0,0,0.3);
    z-index: 100;
    margin: 0;
    height: auto !important;
}
#sidebar.collapsed .menu-group:hover > .submenu {
    display: block !important;
}
/* Invisible bridge to prevent hover gap */
#sidebar.collapsed .submenu::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 8px;
}
#sidebar.collapsed .submenu a {
    padding: 10px 16px;
    white-space: nowrap;
    border-radius: var(--radius-sm);
}
#sidebar.collapsed .menu-group:hover > .menu-item {
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 0;
}

/* Footer */
.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 8px 16px -4px rgba(96, 165, 250, 0.4);
}
.details .name {
    color: #F8FAFC;
    font-weight: 600;
    font-size: 14px;
}
.details .role-badge {
    color: #94A3B8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    display: inline-block;
}
#sidebar.collapsed .details, #sidebar.collapsed .logout-btn { display: none; }
#sidebar.collapsed .sidebar-footer { justify-content: center; padding: 24px 0; }


/* ============================================================ 
   CONTENT & LAYOUT
============================================================ */
#contentArea {
    position: relative;
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 32px;
    min-height: 100vh;
    transition: all 0.4s var(--ease-smooth);
}

#contentArea.collapsed {
    margin-left: 90px;
    width: calc(100% - 90px);
}

/* Card System */
.card, .content-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color); /* Subtle border */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); /* Soft shadow */
    transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
    overflow: visible; /* Important for dropdowns */
    position: relative;
    margin-bottom: 24px;
}

/* Ensure complex interactive elements inside don't break */
.card:has(.result-box), 
.content-box:has(.result-box) { overflow: visible !important; }

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md); /* Lift effect */
    border-color: var(--border-color-hover);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color-light);
    padding: 24px 32px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 32px;
}

/* ============================================================ 
   UI ELEMENTS
============================================================ */

.swal2-actions {
    gap: 14px;
}

.swal2-actions button {
    border-radius: 16px;
    transition: all 0.2s var(--ease-smooth);
}
.swal2-actions button:hover {
    transform: scale(1.025);
}

/* Buttons */
.btn {
    border-radius: var(--radius-md); /* More rounded */
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s var(--ease-smooth);
    border: none;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 10px 20px -5px rgba(96, 165, 250, 0.4);
    transform: translateY(-2px);
}

/* Secondary/Outline style */
.btn-outline-secondary {
    border: 1px solid var(--border-color);
    color: var(--text-main);
    background: #fff;
}
.btn-outline-secondary:hover {
    background: var(--bg-main);
    border-color: var(--border-color-hover);
    color: var(--primary);
}

/* Inputs */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1px solid transparent; 
    background: var(--bg-input);
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.25s;
    color: var(--text-main);
}

.form-control:focus, .form-select:focus {
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-soft);
    outline: none;
}

.form-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Tables - Clean & Spacious */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
}
.table thead th {
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    padding: 14px 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table thead th:first-child {
    border-top-left-radius: var(--radius-md);
}
.table thead th:last-child {
    border-top-right-radius: var(--radius-md);
}
.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-main);
    font-size: 14px;
    background: #fff;
    transition: background 0.2s;
}
.table-hover tbody tr:hover td {
    background: #F8FAFC;
}

/* DataTables container — fit parent width */
div.dataTables_wrapper div.dataTables_scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table.dataTable {
    table-layout: fixed !important;
    width: 100% !important;
}
/* Override DataTables nowrap so cells can wrap */
table.dataTable tbody td {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
}
table.dataTable thead th {
    white-space: nowrap !important;
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.table-responsive > .table {
    min-width: 600px;
}

/* Category Group Headers for Product List */
.table .group-header td {
    background: linear-gradient(135deg, var(--bg-input) 0%, var(--border-color) 100%) !important;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-dark);
    padding: 12px 24px !important;
    border-top: 2px solid var(--primary-light);
    border-bottom: 1px solid var(--border-color-hover);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table .group-header td i {
    opacity: 0.7;
}


/* Badges - Pastel Pops */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Pagination */
.page-item .page-link {
    border-radius: 8px;
    margin: 0 4px;
    border: none;
    color: var(--text-muted);
    background: transparent;
    font-weight: 500;
}
.page-item.active .page-link {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(96, 165, 250, 0.3);
}

/* ============================================================ 
   SEARCH RESULT BOX & OVERFLOW
============================================================ */
/* Fix z-indices and overflows for dropdowns */
.pos-layout, .pos-layout .card, .pos-layout .card-body {
    overflow: visible !important;
}

.result-box {
    top: calc(100% + 12px);
    border: none;
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 10px 15px -5px rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 8px;
    max-height: 380px;
    z-index: var(--z-search-dropdown) !important;
    background: #fff;
    overflow-y: auto;
}

.result-item {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.result-item:hover {
    background-color: var(--primary-soft);
    border-color: rgba(96, 165, 250, 0.2);
    transform: translateX(4px);
}

.result-item .fw-bold { color: var(--text-main); font-size: 15px; }
.result-item .small { color: var(--text-muted); font-size: 13px; }

/* ============================================================ 
   PRINT PREVIEW & MODALS
============================================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--border-color-light);
    padding: 24px 32px;
}
.modal-footer {
    border-top: 1px solid var(--border-color-light);
    padding: 24px 32px;
}
.modal-backdrop { display: none !important; }
.modal {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal) !important;
}
.swal2-container { z-index: var(--z-swal2) !important; }

/* Receipt Paper */
.paper-receipt {
    background: #fff;
    padding: 24px;
    margin: 20px auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 15px rgba(0,0,0,0.1);
    /* Zig-zag bottom */
    mask-image: radial-gradient(circle at 10px bottom, transparent 10px, black 11px) 0 100%/20px 20px repeat-x;
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 10px), transparent 100%),
        radial-gradient(10px circle at 10px bottom, transparent 50%, black 51%) 0 100% / 20px 10px repeat-x;
}
.paper-receipt.w-58 { width: 360px; min-width: 360px; }
.paper-receipt.w-80 { width: 440px; min-width: 440px; }

/* Preview Area Pattern */
#previewScrollArea {
    background-color: var(--bg-main);
    background-image: radial-gradient(var(--border-color-hover) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Nav Pills */
.nav-pills .nav-link {
    border-radius: var(--radius-md);
    padding: 10px 20px;
    color: var(--text-muted);
    font-weight: 500;
}
.nav-pills .nav-link:hover {
    color: var(--primary);
    background: var(--primary-soft);
}
.nav-pills .nav-link.active {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* ============================================================ 
   UTILITIES & HELPERS
============================================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Legacy / Print Overrides */
.preview-container, .preview-po {
    font-family: 'Courier New', monospace !important;
    background: #fff;
    padding: 15px; border: 1px solid var(--border-color);
}

@media print {
    #sidebar, #toggleSidebar, .no-print { display: none !important; }
    #contentArea { margin: 0; width: 100%; padding: 0; }
    body { background: #fff !important; }
}

/* ============================================================
   POS UX IMPROVEMENTS v2 — Keyboard, Flow, Cart Cards
   Added for pos_transaksi.php speed/UX overhaul
============================================================ */

/* --- Popular Products Strip --- */
.popular-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(90deg, rgba(251, 146, 60, 0.08) 0%, rgba(251, 146, 60, 0.02) 100%);
    border: 1px dashed var(--border-color-hover);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}
.popular-strip-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    padding-right: 10px;
    border-right: 1px solid var(--border-color);
}
.popular-strip-items {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: thin;
}
.popular-strip-items::-webkit-scrollbar { height: 4px; }
.product-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    white-space: nowrap;
    flex-shrink: 0;
}
.product-chip:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(96, 165, 250, 0.25);
}
.product-chip .chip-qty {
    display: inline-block;
    padding: 1px 6px;
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}
.product-chip:hover .chip-qty {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* --- Cart Card List (replaces table) --- */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}
.cart-list:empty::before {
    content: 'Keranjang kosong. Pilih produk untuk memulai.';
    display: block;
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}
.cart-item-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: all 0.2s var(--ease-smooth);
    animation: fadeInScale 0.25s var(--ease-smooth);
}
.cart-item-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.08);
}
.cart-item-card.is-merged {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), #fff);
    border-color: rgba(251, 191, 36, 0.3);
}
.cart-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.cart-item-header .item-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}
.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.cart-item-meta .meta-ukuran {
    color: var(--text-secondary);
    font-weight: 600;
}
.cart-item-meta .meta-ket {
    font-style: italic;
    color: var(--text-muted);
}
.cart-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}
.cart-item-prices {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cart-item-prices .price-unit {
    font-size: 11px;
    color: var(--text-muted);
}
.cart-item-prices .price-subtotal {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-dark);
}
.btn-icon-delete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--danger-soft);
    color: var(--danger);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-smooth);
    flex-shrink: 0;
}
.btn-icon-delete:hover {
    background: var(--danger);
    color: #fff;
    transform: scale(1.05);
}
.btn-icon-unmerge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--warning-soft);
    color: var(--warning);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-smooth);
    flex-shrink: 0;
}
.btn-icon-unmerge:hover {
    background: var(--warning);
    color: #fff;
    transform: scale(1.05);
}

/* --- Qty Stepper --- */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: var(--radius-pill);
    padding: 2px;
    border: 1px solid var(--border-color);
}
.qty-stepper button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.15s var(--ease-smooth);
    box-shadow: var(--shadow-sm);
}
.qty-stepper button:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}
.qty-stepper button:active:not(:disabled) { transform: scale(0.92); }
.qty-stepper button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.qty-stepper .qty-input {
    width: 48px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    padding: 0;
    height: 28px;
    -moz-appearance: textfield;
}
.qty-stepper .qty-input::-webkit-outer-spin-button,
.qty-stepper .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-stepper .qty-input:focus { outline: 2px solid var(--primary-soft); border-radius: 4px; }

/* --- Quick Amount Buttons --- */
.quick-amount-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-top: 10px;
}
.quick-amount-btn {
    padding: 8px 4px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s var(--ease-smooth);
    text-align: center;
    line-height: 1.2;
}
.quick-amount-btn small {
    display: block;
    font-size: 9px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
}
.quick-amount-btn:hover {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(96, 165, 250, 0.2);
}
.quick-amount-btn:hover small { color: rgba(255,255,255,0.8); }
.quick-amount-btn:active { transform: scale(0.97); }

/* --- Help button (top-right floating) --- */
.help-fab {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 6px 16px rgba(96, 165, 250, 0.35);
    cursor: pointer;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s var(--ease-smooth);
}
.help-fab:hover {
    background: var(--primary-dark);
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 8px 22px rgba(96, 165, 250, 0.5);
}

/* --- Help Modal Table --- */
.help-table {
    font-size: 13px;
    margin: 0;
}
.help-table .help-category {
    background: var(--bg-input);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 8px 12px;
}
.help-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color-light);
    vertical-align: middle;
}
.help-table td:first-child { width: 40%; color: var(--text-main); }
.help-table kbd {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 4px;
    color: var(--text-main);
    margin-right: 4px;
}

/* --- Result-item keyboard nav highlight --- */
.result-item.active,
.result-item.active:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    transform: translateX(4px);
}
.result-item.active .fw-bold { color: var(--primary-dark); }

/* --- Active focus ring for inputs in POS --- */
.pos-layout .form-control:focus,
.pos-layout .form-select:focus {
    box-shadow: 0 0 0 4px var(--primary-soft), 0 0 0 1px var(--primary);
}

/* --- Sticky bottom action bar --- */
.pos-action-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    margin: 0 -16px -16px -16px;
    z-index: 10;
}

/* ============================================================
   POS PAYMENT UX v2 — Kasir-Oriented Layout
   Compact trio, large displays, breakdown, DP mode badge
============================================================ */

/* --- Total Card with Breakdown --- */
.pos-total-card {
    background: linear-gradient(135deg, #fff 0%, rgba(96, 165, 250, 0.03) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.06);
}
.pos-total-breakdown {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pos-total-breakdown:empty {
    display: none;
}
.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}
.breakdown-row .breakdown-label {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 11px;
}
.breakdown-row .breakdown-value {
    font-weight: 600;
    color: var(--text-main);
}
.breakdown-row.breakdown-discount .breakdown-value {
    color: var(--warning);
    font-weight: 700;
}
.pos-total-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.pos-total-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-muted);
}
.pos-total-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* --- DP Mode Badge --- */
.dp-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--warning);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    box-shadow: 0 4px 10px rgba(251, 146, 60, 0.35);
    animation: fadeInScale 0.3s var(--ease-smooth);
}
.dp-mode-badge i { font-size: 11px; }
.dp-mode-badge strong { font-weight: 800; }

/* --- Payment Trio (compact horizontal) --- */
.payment-trio {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 10px;
    align-items: stretch;
}
.payment-trio-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.payment-trio-input {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}
.payment-trio-field.payment-amount {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    width: 100%;
}
.payment-trio-field.payment-amount:focus {
    outline: none;
    box-shadow: none;
    background: transparent;
}
.payment-trio-display {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}
.payment-trio-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}
.payment-trio-change::before { background: var(--success); }
.payment-trio-remaining::before { background: var(--danger); }
.payment-trio-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.3px;
    color: var(--text-muted);
    margin-top: 2px;
    transition: all 0.2s var(--ease-smooth);
}
.payment-trio-value.has-value {
    transform: scale(1.02);
}
.payment-trio-change .payment-trio-value.has-value {
    color: var(--success);
    text-shadow: 0 0 12px rgba(45, 212, 191, 0.2);
}
.payment-trio-remaining .payment-trio-value.has-value {
    color: var(--danger);
    text-shadow: 0 0 12px rgba(248, 113, 113, 0.2);
}

/* --- Quick Amount Grid (compact under bayar) --- */
.payment-trio-input .quick-amount-grid {
    grid-template-columns: repeat(6, 1fr);
    margin-top: 8px;
    gap: 4px;
}
.payment-trio-input .quick-amount-btn {
    padding: 6px 2px;
    font-size: 11px;
}

/* --- Payment Method Compact --- */
.payment-method-compact {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}
.payment-method-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.payment-method-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.payment-method-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s var(--ease-smooth);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    position: relative;
}
.payment-method-tile i {
    font-size: 16px;
    color: var(--text-muted);
    transition: color 0.18s var(--ease-smooth);
}
.payment-method-tile input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.payment-method-tile:hover {
    border-color: var(--primary-light);
    background: #fff;
}
.payment-method-tile:hover i { color: var(--primary); }
.payment-method-tile.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.payment-method-tile.active i { color: var(--primary); }

/* --- Compact deadline+diskon row --- */
.form-control-sm[type="datetime-local"] {
    padding: 4px 8px;
    height: auto;
    line-height: 1.4;
}

/* --- Mobile fallback: stack payment trio --- */
@media (max-width: 991px) {
    .payment-trio {
        grid-template-columns: 1fr;
    }
    .payment-trio-display {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .payment-trio-value { font-size: 18px; }
}

