/**
 * Musical Instruments Retail POS - Modern UI Theme
 * Professional, Clean, Desktop & Mobile Optimized
 */

:root {
    --primary-color: #1e3a8a;
    --primary-dark: #172554;
    --primary-light: #3b82f6;
    --secondary-color: #0ea5e9;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-width: 260px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
}

body {
    font-family: var(--font-sans);
    color: #1e293b;
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-text {
    font-family: var(--font-heading);
}

/* ========================================================
   1. APP WRAPPER & TWO-COLUMN RESPONSIVE LAYOUT
   ======================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Sidebar Styling - Left Column */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    position: sticky;
    top: 0;
    background-color: var(--sidebar-bg);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
    overflow-x: hidden;
    overflow-y: hidden;
}

.bg-slate-900 {
    background-color: #0f172a !important;
}

.text-primary-light {
    color: #60a5fa !important;
}

/* Sidebar Brand & Header */
.app-sidebar .sidebar-brand {
    flex-shrink: 0;
    background-color: rgba(15, 23, 42, 0.95);
}

/* Sidebar User Profile Strip */
.app-sidebar .user-strip {
    flex-shrink: 0;
}

/* Sidebar Navigation Scrollable Area */
.app-sidebar .sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.app-sidebar .sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar .sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

.app-sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Nav Links */
.app-sidebar .sidebar-nav .nav-link {
    color: #94a3b8;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
}

.app-sidebar .sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: inherit;
    transition: color 0.15s ease;
}

.app-sidebar .sidebar-nav .nav-link:hover,
.app-sidebar .sidebar-nav .nav-link:focus {
    color: #ffffff;
    background-color: var(--sidebar-hover);
}

.app-sidebar .sidebar-nav .nav-link:hover i,
.app-sidebar .sidebar-nav .nav-link:focus i {
    color: #ffffff;
}

.app-sidebar .sidebar-nav .nav-link.active {
    color: #ffffff;
    background-color: var(--sidebar-active);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.app-sidebar .sidebar-nav .nav-link.active i {
    color: #ffffff;
}

/* POS Terminal Nav Link - High-Contrast Visibility */
.app-sidebar .sidebar-nav .nav-link.nav-link-pos {
    color: #ffffff;
}

.app-sidebar .sidebar-nav .nav-link.nav-link-pos i {
    color: #34d399; /* Bright mint emerald for instant recognition */
}

.app-sidebar .sidebar-nav .nav-link.nav-link-pos:hover,
.app-sidebar .sidebar-nav .nav-link.nav-link-pos:focus {
    color: #ffffff;
    background-color: var(--sidebar-hover);
}

.app-sidebar .sidebar-nav .nav-link.nav-link-pos:hover i,
.app-sidebar .sidebar-nav .nav-link.nav-link-pos:focus i {
    color: #6ee7b7;
}

.app-sidebar .sidebar-nav .nav-link.nav-link-pos.active {
    color: #ffffff;
    background-color: var(--sidebar-active);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.app-sidebar .sidebar-nav .nav-link.nav-link-pos.active i {
    color: #ffffff;
}

/* Main Content Area - Right Column */
.app-main {
    flex: 1 1 auto;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8fafc;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top Navbar Header */
.app-navbar {
    min-height: 58px;
    flex-shrink: 0;
    z-index: 1020;
    background-color: #ffffff;
}

/* Content Area */
.app-content {
    flex: 1 0 auto;
    width: 100%;
    max-width: 100%;
}

/* Footer */
.app-footer {
    flex-shrink: 0;
    background-color: #ffffff;
}

/* ========================================================
   2. DESKTOP COLLAPSIBLE SIDEBAR
   ======================================================== */
@media (min-width: 992px) {
    body.sidebar-collapsed .app-sidebar {
        width: 0;
        min-width: 0;
        max-width: 0;
        overflow: hidden;
        visibility: hidden;
        transform: translateX(-100%);
    }

    body.sidebar-collapsed .app-main {
        width: 100%;
        max-width: 100%;
    }
}

/* ========================================================
   3. RESPONSIVE TABLET & MOBILE SIDEBAR DRAWER
   ======================================================== */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        height: 100vh;
        max-height: 100vh;
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1050;
    }

    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.6);
    }

    .app-main {
        width: 100%;
        max-width: 100%;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(15, 23, 42, 0.55);
        backdrop-filter: blur(2px);
        z-index: 1045;
        transition: opacity 0.25s ease;
    }

    body.overflow-hidden-mobile {
        overflow: hidden;
    }
}

/* ========================================================
   4. UI COMPONENTS, CARDS & AVATARS
   ======================================================== */
.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.avatar-circle-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Metric Cards */
.metric-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-radius: 0.75rem;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06) !important;
}

.metric-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Login Page Theme */
.login-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    min-height: 100vh;
}

.login-card-container .card {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
}

/* Utility buttons */
.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.35rem;
}

/* Table styling & responsive safety */
.table > :not(caption) > * > * {
    padding: 0.75rem 0.85rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* POS Customer Searchable Dropdown */
#customerSearchContainer .dropdown-menu {
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.customer-dropdown-item {
    cursor: pointer;
    transition: background-color 0.12s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.customer-dropdown-item:last-child {
    border-bottom: none;
}

.customer-dropdown-item:hover,
.customer-dropdown-item:focus,
.customer-dropdown-item.active-item {
    background-color: #f1f5f9 !important;
    outline: none;
}

.customer-dropdown-item.selected-customer {
    background-color: rgba(13, 110, 253, 0.06);
}

/* ========================================================
   5. MODERN TABLE ACTIONS SYSTEM
   ======================================================== */
.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    vertical-align: middle;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    margin: 0;
    border-radius: 7px;
    font-size: 0.875rem;
    line-height: 1;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.btn-action i {
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.btn-action:hover {
    transform: translateY(-1.5px);
}

.btn-action:active {
    transform: translateY(0) scale(0.95);
}

.btn-action:focus-visible {
    outline: none;
}

/* 1. View / Details - Modern Blue */
.btn-action-view {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}
.btn-action-view:hover,
.btn-action-view:focus {
    background-color: #2563eb;
    color: #ffffff !important;
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}
.btn-action-view:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

/* 2. Activate - Modern Vibrant Green */
.btn-action-activate {
    background-color: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}
.btn-action-activate:hover,
.btn-action-activate:focus {
    background-color: #16a34a;
    color: #ffffff !important;
    border-color: #16a34a;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.28);
}
.btn-action-activate:focus-visible {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.35);
}

/* 3. Deactivate - Modern Amber / Orange */
.btn-action-deactivate {
    background-color: #fff7ed;
    color: #ea580c;
    border-color: #fed7aa;
}
.btn-action-deactivate:hover,
.btn-action-deactivate:focus {
    background-color: #ea580c;
    color: #ffffff !important;
    border-color: #ea580c;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.28);
}
.btn-action-deactivate:focus-visible {
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.35);
}

/* 4. Delete / Purge - Modern Crimson Red */
.btn-action-delete {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}
.btn-action-delete:hover,
.btn-action-delete:focus {
    background-color: #dc2626;
    color: #ffffff !important;
    border-color: #dc2626;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.28);
}
.btn-action-delete:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35);
}

/* 5. Edit - Slate Indigo */
.btn-action-edit {
    background-color: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}
.btn-action-edit:hover,
.btn-action-edit:focus {
    background-color: #334155;
    color: #ffffff !important;
    border-color: #334155;
    box-shadow: 0 4px 10px rgba(51, 65, 85, 0.28);
}
.btn-action-edit:focus-visible {
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.35);
}

/* 6. Print / Receipt / Barcode - Purple */
.btn-action-print {
    background-color: #f5f3ff;
    color: #7c3aed;
    border-color: #ddd6fe;
}
.btn-action-print:hover,
.btn-action-print:focus {
    background-color: #7c3aed;
    color: #ffffff !important;
    border-color: #7c3aed;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.28);
}
.btn-action-print:focus-visible {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.35);
}

/* 7. Success / Receive / Restore - Emerald */
.btn-action-success {
    background-color: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}
.btn-action-success:hover,
.btn-action-success:focus {
    background-color: #059669;
    color: #ffffff !important;
    border-color: #059669;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.28);
}
.btn-action-success:focus-visible {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.35);
}

/* 8. Secondary / Archive - Neutral Slate */
.btn-action-secondary {
    background-color: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}
.btn-action-secondary:hover,
.btn-action-secondary:focus {
    background-color: #64748b;
    color: #ffffff !important;
    border-color: #64748b;
    box-shadow: 0 4px 10px rgba(100, 116, 139, 0.28);
}
.btn-action-secondary:focus-visible {
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.35);
}

/* 9. Warning / Key */
.btn-action-warning {
    background-color: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}
.btn-action-warning:hover,
.btn-action-warning:focus {
    background-color: #b45309;
    color: #ffffff !important;
    border-color: #b45309;
    box-shadow: 0 4px 10px rgba(180, 83, 9, 0.28);
}
.btn-action-warning:focus-visible {
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.35);
}

/* ========================================================
   9. STORE & SYSTEM SETTINGS MODERN DESIGN SYSTEM
   ======================================================== */

/* Settings Vertical Sidebar Navigation (Desktop) */
.settings-nav-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 0.65rem;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    background-color: transparent;
}

.settings-nav-item:hover {
    color: var(--primary-color);
    background-color: #f1f5f9;
    transform: translateX(2px);
}

.settings-nav-item.active {
    color: var(--primary-color);
    background-color: #eff6ff;
    border-left-color: var(--primary-light);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.06);
}

.settings-nav-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background-color: #f1f5f9;
    color: #64748b;
}

.settings-nav-item:hover .settings-nav-icon {
    background-color: #e0e7ff;
    color: var(--primary-color);
}

.settings-nav-item.active .settings-nav-icon {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
}

/* Settings Horizontal Navigation (Mobile & Tablet) */
.settings-nav-horizontal {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0.15rem 0.5rem;
}

.settings-nav-horizontal::-webkit-scrollbar {
    display: none;
}

.settings-pill-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.settings-pill-link:hover {
    color: var(--primary-color);
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.settings-pill-link.active {
    color: #ffffff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
    font-weight: 600;
}

/* Settings Cards & Form Controls */
.settings-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.settings-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.settings-card-body {
    padding: 1.5rem;
}

.settings-section-divider {
    border-top: 1px dashed #e2e8f0;
    margin: 1.75rem 0;
}

/* Dropzone Upload Box */
.settings-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    background-color: #f8fafc;
    padding: 1.75rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.settings-dropzone:hover,
.settings-dropzone.dragover {
    border-color: var(--primary-light);
    background-color: #eff6ff;
}

.settings-dropzone .dropzone-icon {
    font-size: 2.2rem;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.settings-dropzone:hover .dropzone-icon {
    color: var(--primary-light);
    transform: translateY(-2px);
}

/* Checkerboard Background Utility */
.bg-checkerboard {
    background-color: #ffffff;
    background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
                      linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
                      linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* Dark Preview Mode (Matches POS Sidebar Theme) */
.bg-dark-preview {
    background-color: var(--sidebar-bg);
    border-radius: 0.5rem;
}

/* Simulated Browser Chrome Tab Mockup */
.browser-tab-simulation {
    background-color: #e2e8f0;
    border-radius: 0.65rem 0.65rem 0 0;
    padding: 0.45rem 0.5rem 0;
    display: inline-flex;
    align-items: flex-end;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.browser-tab-inner {
    background-color: #ffffff;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.4rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

/* Simulated 80mm ESC/POS Thermal Receipt */
.thermal-receipt-simulation {
    background: #ffffff;
    max-width: 330px;
    width: 100%;
    margin: 0 auto;
    padding: 22px 18px 24px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11.5px;
    line-height: 1.4;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 0.35rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
    position: relative;
}

.thermal-receipt-simulation::before,
.thermal-receipt-simulation::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background-size: 12px 6px;
}

.thermal-receipt-simulation::before {
    top: -6px;
    background-image: radial-gradient(circle at 6px 6px, transparent 6px, #ffffff 6px);
}

.thermal-receipt-simulation::after {
    bottom: -6px;
    background-image: radial-gradient(circle at 6px 0px, transparent 6px, #ffffff 6px);
}

.receipt-dashed-line {
    border-top: 1px dashed #94a3b8;
    margin: 8px 0;
}

.receipt-double-line {
    border-top: 2px solid #0f172a;
    margin: 8px 0;
}

/* Quick Fill Preset Pills */
.btn-preset {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-preset:hover {
    background-color: #e2e8f0;
    color: var(--primary-color);
    border-color: #cbd5e1;
}

/* Button Loading State Spinner */
.btn.is-submitting {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}

.btn.is-submitting .btn-text-content {
    visibility: hidden;
}

.btn.is-submitting::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-top: -0.5rem;
    margin-left: -0.5rem;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spinner 0.65s linear infinite;
}

@keyframes btn-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================================
   10. HARDWARE & THERMAL PRINTER INTEGRATION MODERN UI
   ======================================================== */

/* Transmission Mode Selectable Radio Cards */
.hw-radio-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.15rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    height: 100%;
    position: relative;
}

.hw-radio-card:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.hw-radio-card.active {
    border-color: var(--primary-light);
    background-color: #eff6ff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.12);
}

.hw-radio-card .form-check-input {
    cursor: pointer;
    width: 1.15rem;
    height: 1.15rem;
}

/* Hardware Test Action Buttons */
.hw-test-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1.15rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    text-align: left;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    width: 100%;
}

.hw-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.hw-test-btn .hw-test-icon {
    width: 42px;
    height: 42px;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.hw-test-btn:hover .hw-test-icon {
    transform: scale(1.08);
}

.hw-test-btn .hw-test-arrow {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.hw-test-btn:hover .hw-test-arrow {
    transform: translateX(4px);
}

/* Specific Test Action Color Themes */
.hw-test-btn-receipt:hover {
    border-color: #93c5fd;
}
.hw-test-btn-drawer:hover {
    border-color: #67e8f9;
}
.hw-test-btn-label:hover {
    border-color: #cbd5e1;
}

/* Hardware Spooler Terminal Console */
.hw-terminal {
    background-color: #0b0f19;
    border-radius: 0.75rem;
    border: 1px solid #1e293b;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.hw-terminal-header {
    background-color: #0f172a;
    border-bottom: 1px solid #1e293b;
    padding: 0.6rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hw-terminal-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hw-terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.hw-terminal-dot.dot-red { background-color: #ef4444; }
.hw-terminal-dot.dot-yellow { background-color: #f59e0b; }
.hw-terminal-dot.dot-green { background-color: #10b981; }

.hw-terminal-body {
    padding: 0.85rem 1rem;
    font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.77rem;
    line-height: 1.55;
    height: 165px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.hw-terminal-body::-webkit-scrollbar {
    width: 5px;
}

.hw-terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.hw-log-line {
    margin-bottom: 3px;
    word-break: break-all;
    animation: hw-log-fade 0.18s ease-in;
}

@keyframes hw-log-fade {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pulsing Status Dot */
.hw-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.hw-status-dot.pulse {
    animation: hw-pulse 1.8s infinite;
}

@keyframes hw-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Modern Accordion Styling */
.hw-accordion .accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem !important;
    margin-bottom: 0.5rem;
    overflow: hidden;
    background-color: #ffffff;
}

.hw-accordion .accordion-button {
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    background-color: #ffffff;
    box-shadow: none;
}

.hw-accordion .accordion-button:not(.collapsed) {
    background-color: #f8fafc;
    color: var(--primary-color);
    border-bottom: 1px solid #e2e8f0;
}

.hw-accordion .accordion-body {
    padding: 1rem;
    font-size: 0.83rem;
    line-height: 1.55;
    background-color: #ffffff;
}

.hw-step-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 0.65rem;
    flex-shrink: 0;
}

/* ========================================================
   POS TERMINAL - 55% / 45% DUAL PANEL DESKTOP LAYOUT
   ======================================================== */
body.pos-active-page {
    overflow-y: auto !important;
    overflow-x: hidden;
}

body.pos-active-page .app-content,
.app-content:has(#posApp) {
    padding: 0.5rem 0.75rem !important;
}

.pos-terminal-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 110px);
    width: 100%;
}

@media (min-width: 992px) {
    body.pos-active-page {
        overflow: hidden !important;
    }
    .pos-terminal-wrapper {
        height: calc(100vh - 105px);
        max-height: calc(100vh - 105px);
        min-height: 480px;
        overflow: hidden;
    }
    .pos-workspace {
        height: calc(100% - 58px);
        max-height: calc(100% - 58px);
        min-height: 0;
        overflow: hidden;
    }
    .pos-catalog-column,
    .pos-cart-column {
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
    .pos-cart-main-card {
        height: calc(100% - 56px) !important;
        max-height: calc(100% - 56px) !important;
        flex: 1 1 auto;
        overflow: hidden !important;
    }
}


.pos-topbar {
    flex-shrink: 0;
    padding: 0.45rem 0.85rem !important;
    margin-bottom: 0.5rem !important;
    border: 1px solid #e2e8f0;
}

.pos-workspace {
    flex: 1 1 0%;
    min-height: 0;
    display: flex !important;
    flex-direction: row;
    margin: 0 !important;
    gap: 0.65rem;
}

/* 55% Catalog Column */
.pos-catalog-column {
    flex: 0 0 55% !important;
    max-width: 55% !important;
    width: 55% !important;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* 45% Billing Cart Column */
.pos-cart-column {
    flex: 0 0 45% !important;
    max-width: 45% !important;
    width: 45% !important;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Top Aligned Search & Customer Cards */
.pos-search-card,
.pos-customer-card {
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    background: #ffffff !important;
    padding: 0.35rem 0.65rem !important;
    margin-bottom: 0.5rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.pos-search-input-group,
.pos-customer-input-group {
    height: 36px;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.375rem !important;
    background: #f8fafc !important;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: all 0.15s ease-in-out;
    width: 100%;
}

.pos-search-input-group:focus-within,
.pos-customer-input-group:focus-within {
    border-color: #3b82f6 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

.pos-search-icon {
    padding: 0 0.65rem !important;
    background: transparent !important;
    border: none !important;
    color: #2563eb !important;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.15rem;
}

.pos-search-card .form-control,
.pos-customer-card .form-control {
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0.4rem !important;
    font-size: 0.85rem !important;
    color: #1e293b !important;
}

.pos-search-card .form-control::placeholder,
.pos-customer-card .form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.pos-search-clear-btn {
    padding: 0 0.65rem !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #94a3b8 !important;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.pos-search-clear-btn:hover {
    color: #ef4444 !important;
    background: transparent !important;
    transform: scale(1.1);
}

.pos-customer-card #btnQuickCustomer {
    height: 36px !important;
    padding: 0 0.75rem !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    border-radius: 0.375rem !important;
    border: 1px solid #2563eb !important;
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

.pos-customer-card #btnQuickCustomer:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25) !important;
}

/* Category Filter Bar */
.pos-category-card {
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    padding: 0.35rem 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.category-scroll-strip {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0.1rem 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.category-scroll-strip::-webkit-scrollbar {
    height: 3px;
}

.category-scroll-strip::-webkit-scrollbar-track {
    background: transparent;
}

.category-scroll-strip::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.category-pill {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.85rem;
    border-radius: 2rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    color: #475569;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
}

.category-pill:hover {
    background-color: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.category-pill.active {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    border-color: #1e3a8a !important;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
}

.category-nav-btn {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.15s ease;
}

.category-nav-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Product Catalog Grid Container */
.pos-product-grid-card {
    flex: 1 1 0%;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 0.6rem !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.pos-product-grid-card::-webkit-scrollbar,
.pos-cart-items-container::-webkit-scrollbar,
body.pos-active-page::-webkit-scrollbar {
    width: 7px;
}

.pos-product-grid-card::-webkit-scrollbar-track,
.pos-cart-items-container::-webkit-scrollbar-track,
body.pos-active-page::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.pos-product-grid-card::-webkit-scrollbar-thumb,
.pos-cart-items-container::-webkit-scrollbar-thumb,
body.pos-active-page::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.pos-product-grid-card::-webkit-scrollbar-thumb:hover,
.pos-cart-items-container::-webkit-scrollbar-thumb:hover,
body.pos-active-page::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.65rem;
    align-content: start;
    width: 100%;
}

.pos-grid-item {
    min-width: 0;
}

.pos-product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 142px;
    background: #ffffff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.65rem !important;
    padding: 0.65rem !important;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.pos-product-card:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12) !important;
    transform: translateY(-2px);
}

.pos-product-card:active {
    transform: scale(0.98);
}

.pos-product-card.is-out-of-stock {
    background-color: #fef2f2;
    border-color: #fca5a5 !important;
    opacity: 0.82;
}

.pos-product-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.15rem;
    color: #1e293b;
    word-break: break-word;
}

.pos-product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a8a;
    letter-spacing: -0.01em;
}

.pos-btn-add {
    width: 28px;
    height: 28px;
    padding: 0 !important;
    border: none;
    border-radius: 50% !important;
    background-color: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.pos-btn-add:hover {
    background-color: #1d4ed8;
    transform: scale(1.1);
}

/* Cart Main Card */
.pos-cart-main-card {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
}

.pos-cart-header {
    height: 48px;
    flex-shrink: 0;
    padding: 0.45rem 0.85rem !important;
    border-bottom: 1px solid #e2e8f0;
}

.pos-cart-items-container {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0.45rem 0.65rem !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.cart-item-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem !important;
    margin-bottom: 0.4rem !important;
    transition: background 0.15s ease;
}

.cart-item-row:last-child {
    margin-bottom: 0 !important;
}

.cart-item-row:hover {
    background: #f1f5f9;
}

.cart-item-row .input-group-xs,
.cart-item-row .input-group {
    height: 28px;
}

.cart-item-row .btn-qty-minus,
.cart-item-row .btn-qty-plus {
    height: 28px;
    padding: 0 0.5rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
}

.cart-item-row .item-qty-input {
    height: 28px !important;
    font-size: 0.85rem !important;
    padding: 0 0.25rem !important;
    line-height: 1;
}

.pos-cart-summary-panel {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 0.65rem 0.85rem !important;
}

.pos-total-banner {
    background: #0f172a !important;
    border-radius: 0.5rem !important;
    padding: 0.6rem 0.85rem !important;
}

/* Compact screen heights (Laptops 1366x768, touch POS monitors) */
@media (max-height: 820px) {
    .pos-topbar {
        padding: 0.35rem 0.65rem !important;
        margin-bottom: 0.35rem !important;
    }
    .pos-search-card,
    .pos-customer-card {
        height: 42px;
        margin-bottom: 0.35rem !important;
        padding: 0.2rem 0.5rem !important;
    }
    .pos-search-input-group,
    .pos-customer-input-group {
        height: 32px;
    }
    .pos-search-icon {
        padding: 0 0.5rem !important;
        font-size: 1rem;
    }
    .pos-search-card .form-control,
    .pos-customer-card .form-control {
        font-size: 0.82rem !important;
    }
    .pos-search-clear-btn {
        padding: 0 0.5rem !important;
        font-size: 0.88rem;
    }
    .pos-customer-card #btnQuickCustomer {
        height: 32px !important;
        padding: 0 0.6rem !important;
        font-size: 0.78rem !important;
    }
    .pos-category-card,
    .pos-cart-header {
        height: 42px;
        margin-bottom: 0.35rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    .pos-product-card {
        min-height: 128px;
        padding: 0.5rem !important;
    }
    .pos-product-title {
        min-height: 1.9rem;
        font-size: 0.78rem;
    }
    .pos-total-banner {
        padding: 0.45rem 0.75rem !important;
        margin: 0.35rem 0 !important;
    }
    .pos-cart-summary-panel {
        padding: 0.5rem 0.75rem !important;
    }
    .cart-item-row {
        padding: 0.35rem 0.5rem !important;
        margin-bottom: 0.35rem !important;
    }
    .cart-item-row .input-group-xs,
    .cart-item-row .input-group {
        height: 26px;
    }
    .cart-item-row .btn-qty-minus,
    .cart-item-row .btn-qty-plus {
        height: 26px;
        padding: 0 0.4rem !important;
    }
    .cart-item-row .item-qty-input {
        height: 26px !important;
        font-size: 0.8rem !important;
    }
}

@media (min-width: 992px) and (max-height: 820px) {
    .pos-workspace {
        height: calc(100% - 50px);
        max-height: calc(100% - 50px);
    }
    .pos-cart-main-card {
        height: calc(100% - 48px) !important;
        max-height: calc(100% - 48px) !important;
    }
}

/* Responsive adjustments for tablets and mobile */
@media (max-width: 991.98px) {
    body.pos-active-page {
        overflow-y: auto !important;
    }
    .pos-terminal-wrapper {
        height: auto;
        min-height: auto;
    }
    .pos-workspace {
        flex-direction: column !important;
    }
    .pos-catalog-column,
    .pos-cart-column {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        height: auto;
        min-height: auto;
    }
    .pos-product-grid-card {
        min-height: 400px;
        max-height: 500px;
    }
    .pos-cart-main-card {
        height: auto;
        max-height: none;
    }
    .pos-cart-items-container {
        min-height: 120px;
        max-height: 360px !important;
        overflow-y: auto !important;
    }
}
