/* ============================================
   CUSTOM CSS - Hardware POS System
   All colors, fonts, and custom styles live here

   Palette: the system uses exactly three brand
   colors - dark green (primary), orange (accent),
   and white - plus neutral grays for text/borders
   (grays are UI infrastructure, not brand colors)
   and red reserved strictly for destructive/error
   states, which is a deliberate usability exception
   (a "delete" button or error alert needs a color
   everyone already reads as danger).
   ============================================ */

/* 1. CSS Variables (Colors, Fonts, Type Scale) */
:root {
    /* Brand colors */
    --color-primary: #14532D;          /* dark green - brand primary */
    --color-primary-hover: #0F3D22;    /* darker green - hover/active shade */
    --color-primary-tint: #E6F0EA;     /* light green - hover/active backgrounds */
    --color-secondary: #14532D;        /* success/positive - same dark green */
    --color-accent-orange: #EA580C;    /* orange - brand accent */
    --color-accent-orange-hover: #C2410C;
    --color-accent-orange-tint: #FDECE1;
    --color-accent-teal: #1B7A41;      /* brighter green - interactive/focus accent */

    /* Neutrals (infrastructure, not brand colors) */
    --color-white: #FFFFFF;
    --color-neutral-light: #F3F4F6;
    --color-neutral-medium: #6B7280;
    --color-neutral-dark: #374151;
    --color-border: #E5E7EB;
    --color-text: #1a1a1a;

    /* Danger - destructive/error actions only */
    --color-danger: #DC2626;
    --color-danger-hover: #B91C1C;

    --font-primary: 'Bahnschrift', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Bahnschrift', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Type scale - one consistent set of sizes for the app chrome
       (the POS screen keeps its own compact rem scale for information
       density, but draws its colors from the same palette) */
    --fs-xs: 0.7rem;     /* 11.2px - micro labels, tiny badges */
    --fs-sm: 0.8rem;     /* 12.8px - table cells, hints */
    --fs-base: 0.875rem; /* 14px   - body text, base */
    --fs-md: 1rem;       /* 16px   - emphasized labels */
    --fs-lg: 1.25rem;    /* 20px   - card/section titles */
    --fs-xl: 1.75rem;    /* 28px   - stat numbers, page headers */

    --sidebar-width: 250px;
    --sidebar-collapsed-width: 64px;
    --topbar-height: 60px;
    --border-radius: 8px;
    --transition-speed: 0.2s;
}

/* 2. Global Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-primary);
    font-size: var(--fs-base);
    line-height: 1.6;
    background-color: var(--color-neutral-light);
    color: var(--color-text);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--color-primary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover { color: var(--color-accent-teal); }

img { max-width: 100%; }

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--color-primary);
    color: #ffffff;
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.topbar .brand {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.topbar .brand i { font-size: 1.5rem; flex-shrink: 0; }

.topbar .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40vw;
}

.topbar .sidebar-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: var(--fs-lg);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-right: 0.5rem;
}
.topbar .sidebar-toggle:hover { opacity: 0.8; }
.topbar .sidebar-toggle.rotated i { transform: rotate(180deg); }

.topbar .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.topbar .topbar-right .dropdown-toggle {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.topbar .topbar-right .dropdown-toggle:hover { color: #ffffff; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s ease;
    z-index: 1020;
    padding: 0.75rem 0;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-link .badge,
.sidebar.collapsed .sidebar-label { display: none; }

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    margin: 0.15rem 0.5rem;
    padding: 0.75rem;
}

.sidebar.collapsed .sidebar-link i {
    margin-right: 0;
    font-size: 1.15rem;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-neutral-medium);
    border-radius: 4px;
}

/* Sidebar Navigation */
.sidebar .sidebar-label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-neutral-medium);
    padding: 0.75rem 1.25rem 0.35rem;
    letter-spacing: 0.06em;
}

.sidebar .sidebar-link {
    display: flex;
    align-items: center;
    margin: 0.1rem 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: var(--color-neutral-dark);
    text-decoration: none;
    transition: all 0.15s ease;
    gap: 0.75rem;
    font-size: var(--fs-base);
}

.sidebar .dropdown-toggle {
    width: calc(100% - 1.5rem);
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}

.sidebar .sidebar-link:hover {
    background: var(--color-primary-tint);
    color: var(--color-primary);
}

.sidebar .sidebar-link.active {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(20, 83, 45, 0.25);
}

.sidebar .sidebar-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* Sidebar Dropdowns */
.sidebar .nav-dropdown .dropdown-toggle { cursor: pointer; }

/* Remove default dropdown arrow */
.sidebar .nav-dropdown .dropdown-toggle::after { display: none; }

/* Add custom + / - icons */
.sidebar .nav-dropdown .dropdown-toggle .icon-toggle {
    margin-left: auto;
    font-size: var(--fs-sm);
    font-weight: 700;
    transition: transform 0.3s ease;
    width: 20px;
    text-align: center;
    color: var(--color-neutral-medium);
    flex-shrink: 0;
}

.sidebar .nav-dropdown .dropdown-toggle .icon-toggle .icon-plus { display: inline; }
.sidebar .nav-dropdown .dropdown-toggle .icon-toggle .icon-minus { display: none; }

/* When dropdown is open, show minus, hide plus */
.sidebar .nav-dropdown.open .dropdown-toggle .icon-toggle .icon-plus { display: none; }
.sidebar .nav-dropdown.open .dropdown-toggle .icon-toggle .icon-minus { display: inline; }

/* Hover effect */
.sidebar .nav-dropdown .dropdown-toggle:hover .icon-toggle {
    color: var(--color-primary);
}

/* Sub-dropdown */
.sidebar .nav-dropdown .dropdown-menu-sidebar {
    padding-left: 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar .nav-dropdown.open .dropdown-menu-sidebar { max-height: 600px; }

.sidebar .nav-dropdown > .dropdown-toggle[aria-expanded="true"] .icon-toggle {
    color: var(--color-primary);
}

.sidebar .nav-dropdown .dropdown-menu-sidebar .sidebar-link {
    padding-left: 1.5rem;
    font-size: var(--fs-sm);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--topbar-height));
    background: var(--color-neutral-light);
    transition: margin-left 0.3s ease;
    max-width: 100vw;
}

.main-content.expanded { margin-left: var(--sidebar-collapsed-width); }

.breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.breadcrumb::-webkit-scrollbar { display: none; }

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--fs-base);
    border-radius: var(--border-radius);
    padding: 0.6rem 1.5rem;
    transition: all var(--transition-speed);
    border: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 83, 45, 0.3);
}

.btn-success {
    background-color: var(--color-secondary);
    color: #ffffff;
}
.btn-success:hover {
    background-color: var(--color-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 83, 45, 0.3);
}

.btn-warning {
    background-color: var(--color-accent-orange);
    color: #ffffff;
}
.btn-warning:hover {
    background-color: var(--color-accent-orange-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.btn-info {
    background-color: var(--color-accent-teal);
    color: #ffffff;
}
.btn-info:hover {
    background-color: var(--color-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 122, 65, 0.3);
}

.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: var(--color-danger-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
    background-color: var(--color-neutral-medium);
    color: #ffffff;
}
.btn-secondary:hover {
    background-color: var(--color-neutral-dark);
    color: #ffffff;
}

.btn-sm { padding: 0.4rem 1rem; font-size: var(--fs-sm); }
.btn-lg { padding: 0.8rem 2rem; font-size: var(--fs-md); }

/* Action Buttons - Clean Icons Only */
.btn-link {
    text-decoration: none !important;
    padding: 4px 6px !important;
    font-size: var(--fs-md) !important;
    line-height: 1 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
    min-width: 28px;
    text-align: center;
}

.btn-link:hover {
    transform: scale(1.15);
    background: transparent !important;
}

.btn-link.text-info { color: var(--color-accent-teal) !important; }
.btn-link.text-info:hover { color: var(--color-primary-hover) !important; }
.btn-link.text-danger { color: var(--color-danger) !important; }
.btn-link.text-danger:hover { color: var(--color-danger-hover) !important; }
.btn-link.text-success { color: var(--color-secondary) !important; }
.btn-link.text-success:hover { color: var(--color-primary-hover) !important; }
.btn-link.text-warning { color: var(--color-accent-orange) !important; }
.btn-link.text-warning:hover { color: var(--color-accent-orange-hover) !important; }
.btn-link.text-primary { color: var(--color-primary) !important; }
.btn-link.text-primary:hover { color: var(--color-primary-hover) !important; }
.btn-link.text-muted { color: var(--color-neutral-medium) !important; }
.btn-link.text-muted:hover { color: var(--color-neutral-dark) !important; }

/* ============================================
   TABLE STYLES
   ============================================ */
.table {
    font-family: var(--font-primary);
    font-size: var(--fs-sm);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    font-weight: 600;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-neutral-medium);
    padding: 0.75rem 0.5rem;
}

.table tbody td {
    padding: 0.6rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(107, 114, 128, 0.05);
}
.table-hover tbody tr:hover {
    background-color: var(--color-primary-tint);
}
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    max-width: 100%;
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow var(--transition-speed);
    background: #ffffff;
    max-width: 100%;
}

.card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); }

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--fs-md);
    color: var(--color-primary);
}

.card-body { padding: 1.25rem; }
.card-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--color-border);
    padding: 0.75rem 1.25rem;
}

.card-footer .btn-link {
    font-size: var(--fs-lg) !important;
    padding: 6px 8px !important;
    min-width: 32px;
}

/* ============================================
   SIMPLE STAT CARDS (invoice/customer summaries)
   A small bordered card: a number + a label,
   used by pages other than the dashboard.
   ============================================ */
.stat-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-speed);
    border-left: 4px solid var(--color-primary);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-number {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-family: var(--font-primary);
    font-size: var(--fs-base);
    color: var(--color-neutral-medium);
    margin-top: 0.25rem;
}

.stat-card .stat-icon {
    font-size: var(--fs-xl);
    opacity: 0.3;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-label {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--fs-sm);
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.form-control, .form-select {
    font-family: var(--font-primary);
    font-size: var(--fs-base);
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    padding: 0.6rem 0.75rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    max-width: 100%;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-accent-teal);
    box-shadow: 0 0 0 3px rgba(27, 122, 65, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--color-neutral-medium);
    font-size: var(--fs-sm);
}
.form-text { font-size: var(--fs-xs); color: var(--color-neutral-medium); }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary-custom { color: var(--color-primary); }
.text-secondary-custom { color: var(--color-secondary); }
.text-accent-orange { color: var(--color-accent-orange); }
.text-accent-teal { color: var(--color-accent-teal); }
.text-neutral-medium { color: var(--color-neutral-medium); }

.bg-primary-custom { background-color: var(--color-primary); }
.bg-secondary-custom { background-color: var(--color-secondary); }
.bg-accent-orange { background-color: var(--color-accent-orange); }
.bg-accent-teal { background-color: var(--color-accent-teal); }
.bg-neutral-light { background-color: var(--color-neutral-light); }

.border-primary-custom { border-color: var(--color-primary); }
.border-accent-teal { border-color: var(--color-accent-teal); }

/* ============================================
   BOOTSTRAP UTILITY OVERRIDES
   Bootstrap's own text-*/badge bg-* utilities
   (loaded from the CDN) still carry Bootstrap's
   stock blue/cyan/yellow/green unless remapped
   here, so icons and status badges built with
   them don't silently bypass the 3-color system.
   text-danger/bg-danger are left as Bootstrap's
   red - the deliberate destructive/error
   exception described at the top of this file.
   ============================================ */
.text-primary { color: var(--color-primary) !important; }
.text-info { color: var(--color-accent-teal) !important; }
.text-success { color: var(--color-secondary) !important; }
.text-warning { color: var(--color-accent-orange) !important; }

.badge.bg-primary { background-color: var(--color-primary) !important; color: #ffffff !important; }
.badge.bg-info { background-color: var(--color-accent-teal) !important; color: #ffffff !important; }
.badge.bg-success { background-color: var(--color-secondary) !important; color: #ffffff !important; }
.badge.bg-warning { background-color: var(--color-accent-orange-tint) !important; color: var(--color-accent-orange-hover) !important; }

/* ============================================
   TOAST / ALERT STYLES
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 1rem);
    right: 1rem;
    z-index: 9999;
    max-width: 350px;
}

.alert {
    border-radius: var(--border-radius);
    border: none;
    font-family: var(--font-primary);
    font-size: var(--fs-base);
}

.alert-success { background-color: var(--color-secondary); color: #ffffff; }
.alert-danger { background-color: var(--color-danger); color: #ffffff; }
.alert-warning { background-color: var(--color-accent-orange); color: #ffffff; }
.alert-info { background-color: var(--color-accent-teal); color: #ffffff; }

/* ============================================
   BADGE & AVATAR STYLES
   ============================================ */
.badge i { font-size: var(--fs-xs); margin-right: 3px; }

.avatar-sm {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.avatar-sm .bg-primary-custom {
    font-size: var(--fs-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* ============================================
   FOOTER STYLES
   ============================================ */
.footer {
    margin-top: 1rem;
    padding: 1rem 0;
    border-top: 2px solid var(--color-accent-orange);
    background-color: var(--color-secondary) !important;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.footer.expanded { margin-left: var(--sidebar-collapsed-width); }

.sidebar-toggle:focus-visible,
.sidebar .sidebar-link:focus-visible {
    outline: 3px solid var(--color-accent-orange);
    outline-offset: 2px;
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar .sidebar-link,
    .sidebar .dropdown-menu-sidebar,
    .main-content,
    .footer,
    .topbar .sidebar-toggle i {
        transition-duration: 0.01ms !important;
    }
}

.footer .text-muted {
    color: #ffffff !important;
    font-size: var(--fs-sm);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet & Mobile - Sidebar becomes overlay */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        transition: transform 0.3s ease;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
    .main-content.expanded { margin-left: 0; }
    .footer { margin-left: 0 !important; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 1010;
    }
    .sidebar-overlay.active { display: block; }
    body.sidebar-open { overflow: hidden; }
}

/* Mobile */
@media (max-width: 767.98px) {
    .topbar .brand span { display: none; }
    .main-content { padding: 0.75rem; }

    .table thead th { font-size: var(--fs-xs); padding: 0.5rem 0.3rem; }
    .table tbody td { font-size: var(--fs-sm); padding: 0.4rem 0.3rem; }

    .btn-link {
        font-size: 20px !important;
        padding: 6px 8px !important;
        min-width: 36px;
    }

    .badge { font-size: 10px !important; padding: 3px 6px !important; }
    .badge i { font-size: 9px !important; }

    .card-body { padding: 0.75rem; }
    .modal-dialog { margin: 0.5rem; }
    .modal-body { padding: 1rem; }

    .footer .text-md-end,
    .footer .text-md-start { text-align: center !important; margin-top: 0.5rem; }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table th,
    .table td {
        white-space: nowrap;
        font-size: var(--fs-sm);
        padding: 0.5rem 0.4rem;
    }

    /* Mobile Tabs */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.25rem;
        padding-bottom: 0.5rem;
    }
    .nav-tabs .nav-item { flex: 0 0 auto; }
    .nav-tabs .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: var(--fs-xs);
        white-space: nowrap;
    }
    .nav-tabs .nav-link i {
        font-size: 10px;
        margin-right: 3px;
    }
}

/* Very Small Phones */
@media (max-width: 480px) {
    .table th, .table td {
        font-size: 10px;
        padding: 0.3rem 0.2rem;
    }
    .table td .btn-link i { font-size: 14px !important; }

    .avatar-sm {
        width: 24px !important;
        height: 24px !important;
    }
    .avatar-sm .bg-primary-custom {
        font-size: 10px !important;
        width: 24px !important;
        height: 24px !important;
    }

    .nav-tabs .nav-link {
        font-size: 10px;
        padding: 0.3rem 0.4rem;
    }
    .nav-tabs .nav-link i { font-size: 9px; }
}

/* Print Styles (both report and general pages share one block) */
@media print {
    .no-print { display: none !important; }
    .btn, .btn-group, .btn-sm { display: none !important; }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    .card-header { background: white !important; border-bottom: 2px solid var(--color-primary) !important; }
    body {
        background: #ffffff;
        padding: 10px !important;
    }
    .table thead th { background: #f3f4f6; }
    table { font-size: 10px !important; }
    .table th, .table td { padding: 0.3rem 0.4rem !important; }
    .report-header { display: block !important; }
    .report-header h4 { color: var(--color-primary); }
    .report-header .text-muted { color: var(--color-neutral-medium) !important; }
}

/* ============================================
   POS - Complete Styles
   ============================================ */

/* Main POS Wrapper - Side by Side */
.pos-wrapper {
    display: flex;
    flex-direction: row;
    gap: 0;
    height: calc(100vh - var(--topbar-height) - 2rem);
    background: var(--color-neutral-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* LEFT PANEL - 60% */
.pos-left {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid var(--color-border);
}

/* RIGHT PANEL - 40% */
.pos-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    min-width: 320px;
}

/* ============================================
   POS TOOLBAR
   ============================================ */
.pos-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: #fafbfc;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pos-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pos-mode {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-primary);
}

.pos-mode i {
    margin-right: 0.5rem;
}

.pos-sales-receipt {
    font-size: 0.875rem;
    color: var(--color-neutral-medium);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.pos-sales-receipt:hover {
    background: var(--color-border);
}

.pos-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pos-toolbar-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    color: var(--color-neutral-medium);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pos-toolbar-btn:hover {
    background: var(--color-neutral-light);
    border-color: var(--color-accent-teal);
}

/* ============================================
   POS SEARCH AREA (with dropdown results)
   ============================================ */
.pos-search-area {
    position: relative;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: #ffffff;
    flex-shrink: 0;
}

.pos-search-wrapper {
    display: flex;
    align-items: center;
    background: var(--color-neutral-light);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pos-search-wrapper:focus-within {
    border-color: var(--color-accent-teal);
    box-shadow: 0 0 0 3px rgba(27, 122, 65, 0.1);
    background: #ffffff;
}

.pos-search-icon {
    color: var(--color-neutral-medium);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.pos-search-input {
    border: none;
    outline: none;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    flex: 1;
    background: transparent;
}

.pos-search-input::placeholder {
    color: #9ca3af;
}

.pos-search-hint {
    color: var(--color-neutral-medium);
    font-size: 0.65rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--color-border);
    white-space: nowrap;
}

/* ============================================
   POS SEARCH RESULTS (Dropdown)
   ============================================ */
.pos-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0 0 6px 6px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    display: none;
}

.pos-search-results:not(:empty) {
    display: block;
}

.pos-search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f3f4f6;
}

.pos-search-result-item:last-child {
    border-bottom: none;
}

.pos-search-result-item:hover {
    background: var(--color-neutral-light);
}

.pos-search-result-item:active {
    background: var(--color-border);
}

.pos-search-result-info {
    flex: 1;
}

.pos-search-result-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-primary);
}

.pos-search-result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.1rem;
    font-size: 0.7rem;
    color: var(--color-neutral-medium);
}

.pos-search-result-grade {
    font-weight: 600;
    color: var(--color-primary);
}

.pos-search-result-separator {
    color: var(--color-neutral-medium);
}

.pos-search-result-stock {
    font-size: 0.7rem;
    color: var(--color-neutral-medium);
}

.pos-search-result-desc {
    font-size: 0.7rem;
    color: var(--color-neutral-medium);
}

.pos-search-result-price {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-secondary);
    padding-left: 1rem;
}

.pos-search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--color-neutral-medium);
    font-size: 0.875rem;
}

/* ============================================
   POS CART WRAPPER
   ============================================ */
.pos-cart-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
    min-height: 150px;
    max-height: 45%;
}

/* ============================================
   POS CART HEADER
   ============================================ */
.pos-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: #fafbfc;
    flex-shrink: 0;
}

.pos-cart-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pos-cart-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-primary);
}

.pos-cart-badge {
    background: var(--color-primary);
    color: #ffffff;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.pos-cart-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pos-cart-btn {
    padding: 0.15rem 0.6rem;
    border: none;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pos-cart-btn-suspended {
    background: var(--color-accent-orange-tint);
    color: var(--color-accent-orange-hover);
}

.pos-cart-btn-suspended:hover {
    background: #fbd9bd;
}

.pos-cart-btn-delete {
    background: #fee2e2;
    color: var(--color-danger-hover);
}

.pos-cart-btn-delete:hover {
    background: #fecaca;
}

/* ============================================
   POS CART BODY
   ============================================ */
.pos-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.3rem 1.25rem;
}

.pos-cart-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--color-neutral-medium);
}

.pos-cart-empty i {
    font-size: 2rem;
}

/* ============================================
   POS CART TABLE
   ============================================ */
.pos-cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.pos-cart-table thead th {
    text-align: left;
    padding: 0.4rem 0.4rem;
    font-weight: 600;
    color: var(--color-neutral-medium);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.pos-cart-table thead th:first-child {
    text-align: center;
}

.pos-cart-table thead th:nth-child(3),
.pos-cart-table thead th:nth-child(4),
.pos-cart-table thead th:nth-child(5),
.pos-cart-table thead th:nth-child(6) {
    text-align: center;
}

.pos-cart-table thead th:last-child {
    text-align: center;
}

.pos-cart-table tbody td {
    padding: 0.3rem 0.4rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.pos-cart-table tbody td:first-child {
    text-align: center;
}

.pos-cart-table tbody td:nth-child(3),
.pos-cart-table tbody td:nth-child(5),
.pos-cart-table tbody td:nth-child(6),
.pos-cart-table tbody td:last-child {
    text-align: center;
}

.pos-cart-item-name {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--color-primary);
}

.pos-cart-item-stock {
    font-size: 0.6rem;
    color: var(--color-neutral-medium);
}

.pos-cart-item-desc {
    font-size: 0.6rem;
    color: var(--color-neutral-medium);
}

.pos-qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
}

.pos-qty-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--color-neutral-dark);
}

.pos-qty-btn:hover {
    background: var(--color-neutral-light);
    border-color: var(--color-accent-teal);
}

.pos-qty-value {
    font-weight: 600;
    font-size: 0.7rem;
    min-width: 18px;
    text-align: center;
}

.pos-qty-input {
    width: 36px;
    font-weight: 600;
    font-size: 0.7rem;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 1px 2px;
    color: var(--color-neutral-dark);
    -moz-appearance: textfield;
}

.pos-qty-input:focus {
    outline: none;
    border-color: var(--color-accent-teal);
}

.pos-qty-input::-webkit-outer-spin-button,
.pos-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-cart-remove {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.1rem;
    transition: all 0.15s;
    font-size: 0.7rem;
}

.pos-cart-remove:hover {
    color: var(--color-danger);
}

/* ============================================
   RIGHT PANEL - Customer + Summary + Payment
   ============================================ */
.pos-customer-area {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: #ffffff;
    flex-shrink: 0;
}

.pos-customer-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-neutral-medium);
    margin-bottom: 0.25rem;
}

.pos-customer-label i {
    margin-right: 0.25rem;
}

.pos-customer-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pos-customer-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.pos-customer-input:focus {
    border-color: var(--color-accent-teal);
}

.pos-customer-add {
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.pos-customer-add:hover {
    background: var(--color-primary-hover);
}

/* ============================================
   POS CART SUMMARY
   ============================================ */
.pos-cart-summary {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: #fafbfc;
    flex-shrink: 0;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.875rem;
}

.pos-summary-total {
    font-weight: 700;
    font-size: 1.1rem;
    border-top: 2px solid var(--color-primary);
    padding-top: 0.4rem;
    margin-top: 0.1rem;
}

.pos-summary-due {
    color: var(--color-accent-orange);
    font-weight: 600;
    font-size: 1rem;
}

.pos-summary-label {
    color: var(--color-neutral-medium);
}

.pos-summary-amount {
    font-weight: 600;
}

/* ============================================
   POS PAYMENT - COMPACT LAYOUT WITH DROPDOWNS
   ============================================ */
.pos-payment-section {
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
}

/* Compact Row - Flex Layout */
.pos-payment-compact-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Amount Group */
.pos-payment-amount-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.pos-payment-amount-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

.pos-payment-amount-label i {
    color: var(--color-accent-teal);
    font-size: 0.8rem;
}

.pos-payment-amount-label small {
    font-weight: 400;
    font-size: 0.6rem;
    color: var(--color-neutral-medium);
}

.pos-payment-amount-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.pos-currency-symbol {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-primary);
    padding-right: 0.15rem;
}

.pos-payment-amount-input {
    flex: 1;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 80px;
    max-width: 140px;
    height: 32px;
}

.pos-payment-amount-input:focus {
    border-color: var(--color-accent-teal);
    box-shadow: 0 0 0 3px rgba(27, 122, 65, 0.15);
}

.pos-payment-amount-input::placeholder {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.7rem;
}

.pos-payment-add-btn {
    background: var(--color-secondary);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.pos-payment-add-btn:hover {
    background: var(--color-primary-hover);
}

/* ============================================ */
/* PAYMENT & DELIVERY - COMPACT DROPDOWNS      */
/* ============================================ */
.pos-payment-options-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.3rem 0;
    flex-wrap: wrap;
    border-top: 1px solid var(--color-border);
    margin-top: 0.3rem;
}

.pos-option-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pos-option-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-neutral-medium);
    white-space: nowrap;
}

.pos-option-label i {
    font-size: 0.65rem;
    margin-right: 0.1rem;
}

.pos-option-select {
    padding: 0.2rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #ffffff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    min-width: 90px;
    height: 28px;
}

.pos-option-select:focus {
    border-color: var(--color-accent-teal);
    box-shadow: 0 0 0 2px rgba(27, 122, 65, 0.1);
}

/* Action Buttons */
.pos-payment-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pos-btn {
    flex: 1;
    padding: 0.4rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pos-btn-suspend {
    background: var(--color-accent-orange-tint);
    color: var(--color-accent-orange-hover);
}

.pos-btn-suspend:hover {
    background: #fbd9bd;
}

.pos-btn-cancel {
    background: var(--color-neutral-light);
    color: var(--color-neutral-dark);
}

.pos-btn-cancel:hover {
    background: var(--color-border);
}

.pos-btn-complete {
    background: var(--color-primary);
    color: #ffffff;
}

.pos-btn-complete:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 83, 45, 0.3);
}

/* ============================================
   POS DELIVERY - Partial Quantity
   ============================================ */
.pos-partial-quantity {
    margin-top: 0.4rem;
    padding: 0.4rem;
    background: var(--color-neutral-light);
    border-radius: 4px;
}

.pos-partial-quantity-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-neutral-medium);
    margin-bottom: 0.3rem;
}

.pos-partial-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
}

.pos-partial-item-name {
    font-size: 0.75rem;
    font-weight: 500;
    flex: 1;
}

.pos-partial-item-input {
    width: 60px;
    padding: 0.15rem 0.3rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.7rem;
    text-align: center;
}

.pos-partial-item-max {
    font-size: 0.65rem;
    color: var(--color-neutral-medium);
}

/* ============================================
   POS DISCOUNT CONTROLS
   ============================================ */
.pos-discount-control {
    display: flex;
    align-items: center;
    gap: 2px;
    justify-content: center;
}

.pos-discount-input {
    width: 60px;
    padding: 2px 4px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.7rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
}

.pos-discount-input:focus {
    border-color: var(--color-accent-teal);
    box-shadow: 0 0 0 3px rgba(27, 122, 65, 0.1);
}

.pos-discount-input::placeholder {
    color: #9ca3af;
    font-size: 0.6rem;
}

.pos-discount-toggle {
    width: 32px;
    height: 24px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: var(--color-neutral-light);
    font-size: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--color-neutral-dark);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-discount-toggle:hover {
    background: var(--color-accent-orange);
    color: #ffffff;
    border-color: var(--color-accent-orange);
}

.pos-discount-toggle:active {
    transform: scale(0.95);
}

/* ============================================
   POS CUSTOMER SEARCH RESULTS
   ============================================ */
.pos-customer-area {
    position: relative;
}

.pos-customer-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    display: none;
}

.pos-customer-results:not(:empty) {
    display: block;
}

.pos-customer-result-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.pos-customer-result-item:hover {
    background: var(--color-neutral-light);
}

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

.pos-customer-result-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-primary);
}

.pos-customer-result-detail {
    font-size: 0.7rem;
    color: var(--color-neutral-medium);
}

.pos-customer-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--color-neutral-medium);
    font-size: 0.875rem;
}

/* ============================================
   POS BALANCE DISPLAY
   ============================================ */
.pos-summary-balance {
    font-weight: 600;
    padding: 0.3rem 0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pos-summary-balance.due {
    color: var(--color-accent-orange-hover);
}

.pos-summary-balance.due .pos-summary-amount {
    color: var(--color-accent-orange-hover);
}

.pos-summary-balance.change {
    color: var(--color-primary);
}

.pos-summary-balance.change .pos-summary-amount {
    color: var(--color-primary);
}

.pos-summary-balance.zero {
    color: var(--color-neutral-medium);
}

.pos-summary-balance.zero .pos-summary-amount {
    color: var(--color-neutral-medium);
}

/* ============================================
   COMPACT RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .pos-wrapper {
        flex-direction: column;
        height: auto;
        border-radius: 0;
    }

    .pos-left {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        max-height: 60vh;
    }

    .pos-right {
        min-width: unset;
        border-left: none;
    }

    .pos-cart-wrapper {
        max-height: 40%;
    }

    .pos-payment-compact-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .pos-payment-amount-group {
        flex-wrap: wrap;
    }

    .pos-payment-amount-input {
        max-width: 100%;
        flex: 1;
    }

    .pos-payment-options-row {
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .pos-left {
        max-height: 50vh;
    }

    .pos-cart-wrapper {
        max-height: 35%;
    }

    .pos-toolbar {
        padding: 0.4rem 0.75rem;
    }

    .pos-toolbar-btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .pos-search-area {
        padding: 0.4rem 0.75rem;
    }

    .pos-search-results {
        max-height: 200px;
    }

    .pos-search-result-item {
        padding: 0.35rem 0.5rem;
    }

    .pos-search-result-name {
        font-size: 0.75rem;
    }

    .pos-search-result-price {
        font-size: 0.85rem;
    }

    .pos-cart-header {
        padding: 0.3rem 0.75rem;
    }

    .pos-cart-body {
        padding: 0.2rem 0.75rem;
    }

    .pos-cart-table thead th {
        font-size: 0.55rem;
        padding: 0.2rem 0.2rem;
    }

    .pos-cart-table tbody td {
        padding: 0.2rem 0.2rem;
        font-size: 0.65rem;
    }

    .pos-cart-item-name {
        font-size: 0.65rem;
    }

    .pos-qty-btn {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

    .pos-qty-value {
        font-size: 0.65rem;
        min-width: 16px;
    }

    .pos-qty-input {
        width: 30px;
        font-size: 0.65rem;
    }

    .pos-cart-item-price {
        font-size: 0.65rem;
    }

    .pos-cart-item-total {
        font-size: 0.65rem;
    }

    .pos-customer-area {
        padding: 0.5rem 0.75rem;
    }

    .pos-cart-summary {
        padding: 0.5rem 0.75rem;
    }

    .pos-payment-section {
        padding: 0.5rem 0.75rem;
    }

    .pos-payment-amount-input {
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
        height: 28px;
    }

    .pos-payment-add-btn {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
        height: 28px;
    }

    .pos-option-select {
        font-size: 0.6rem;
        min-width: 70px;
        height: 24px;
        padding: 0.15rem 0.4rem;
    }

    .pos-option-label {
        font-size: 0.6rem;
    }

    .pos-payment-actions {
        flex-wrap: wrap;
    }

    .pos-btn {
        flex: 1 1 100%;
        padding: 0.3rem;
        font-size: 0.65rem;
    }

    .pos-cart-btn {
        font-size: 0.55rem;
        padding: 0.1rem 0.4rem;
    }

    .pos-cart-title {
        font-size: 0.75rem;
    }

    .pos-cart-badge {
        font-size: 0.6rem;
        padding: 0.05rem 0.4rem;
    }

    .pos-summary-row {
        font-size: 0.75rem;
    }

    .pos-summary-total {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .pos-left {
        max-height: 40vh;
    }

    .pos-toolbar-left {
        flex-wrap: wrap;
    }

    .pos-mode {
        font-size: 0.7rem;
    }

    .pos-sales-receipt {
        font-size: 0.7rem;
    }

    .pos-search-hint {
        display: none;
    }

    .pos-search-input {
        font-size: 0.75rem;
        padding: 0.35rem 0;
    }

    .pos-cart-actions {
        flex-wrap: wrap;
    }

    .pos-qty-btn {
        width: 16px;
        height: 16px;
        font-size: 0.55rem;
    }

    .pos-cart-item-price {
        font-size: 0.6rem;
        min-width: 35px;
    }

    .pos-cart-item-total {
        font-size: 0.6rem;
        min-width: 45px;
    }

    .pos-summary-row {
        font-size: 0.65rem;
    }

    .pos-summary-total {
        font-size: 0.8rem;
    }

    .pos-payment-label {
        font-size: 0.6rem;
    }

    .pos-payment-type,
    .pos-payment-amount {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
    }

    .pos-payment-add {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }

    .pos-btn {
        font-size: 0.65rem;
        padding: 0.3rem;
    }

    .pos-option-select {
        font-size: 0.55rem;
        min-width: 60px;
        height: 22px;
        padding: 0.1rem 0.3rem;
    }

    .pos-option-label {
        font-size: 0.55rem;
    }

    .pos-option-label i {
        font-size: 0.5rem;
    }

    .pos-payment-options-row {
        gap: 0.5rem;
    }
}

/* Override Modal */
#overrideModal .modal-content {
    border: 2px solid var(--color-accent-orange);
}
#overrideModal .modal-header {
    border-bottom: 1px solid var(--color-accent-orange);
}
#overrideModal .btn-warning {
    background-color: var(--color-accent-orange);
    color: #ffffff;
}
#overrideModal .btn-warning:hover {
    background-color: var(--color-accent-orange-hover);
    color: #ffffff;
}

/* ============================================
   DASHBOARD STAT CARDS - Compact KPI cards
   (namespaced separately from the plain .stat-card
   used elsewhere, since the two layouts differ)
   ============================================ */

.dashboard-stat-card {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.6rem 0.7rem 0.3rem;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    min-height: 82px;
    height: 100%;
}

.dashboard-stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--color-primary-tint);
}

.dashboard-stat-card-content {
    flex: 1;
    min-width: 0;
}

.dashboard-stat-card-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-neutral-medium);
    margin-bottom: 0.1rem;
}

.dashboard-stat-card-number {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: 0.1rem;
}

.dashboard-stat-card-change {
    font-size: 0.62rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.dashboard-stat-card-change.positive {
    color: var(--color-primary);
}

.dashboard-stat-card-change.negative {
    color: var(--color-danger);
}

.dashboard-stat-card-change i {
    font-size: 0.55rem;
}

.dashboard-stat-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: 0.4rem;
}

.dashboard-stat-card-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-tint);
    color: var(--color-primary);
}

.dashboard-stat-card-icon i {
    font-size: 0.65rem;
}

.dashboard-stat-card-sparkline {
    width: 100%;
    height: 28px;
    margin-top: 0.2rem;
    flex: 0 0 100%;
    order: 3;
}

.dashboard-stat-card-sparkline canvas {
    width: 100%;
    height: 100%;
}

/* Icon color variants - alternate green/orange, red only for expenses */
.dashboard-stat-card-sales .dashboard-stat-card-icon,
.dashboard-stat-card-profit .dashboard-stat-card-icon,
.dashboard-stat-card-portfolio .dashboard-stat-card-icon {
    background: var(--color-primary-tint);
    color: var(--color-primary);
}

.dashboard-stat-card-today .dashboard-stat-card-icon,
.dashboard-stat-card-purchases .dashboard-stat-card-icon {
    background: var(--color-accent-orange-tint);
    color: var(--color-accent-orange-hover);
}

.dashboard-stat-card-expenses .dashboard-stat-card-icon {
    background: #fee2e2;
    color: var(--color-danger);
}

/* ============================================
   DASHBOARD STAT CARDS - RESPONSIVE
   ============================================ */

@media (max-width: 767.98px) {
    .dashboard-stat-card {
        padding: 0.5rem 0.6rem 0.25rem;
        min-height: 72px;
        border-radius: 8px;
    }

    .dashboard-stat-card-number {
        font-size: 0.8rem;
    }

    .dashboard-stat-card-label {
        font-size: 0.55rem;
    }

    .dashboard-stat-card-change {
        font-size: 0.55rem;
    }

    .dashboard-stat-card-icon {
        width: 22px;
        height: 22px;
        border-radius: 6px;
    }

    .dashboard-stat-card-icon i {
        font-size: 0.55rem;
    }

    .dashboard-stat-card-sparkline {
        height: 22px;
    }
}

@media (max-width: 480px) {
    .dashboard-stat-card {
        padding: 0.4rem 0.5rem 0.2rem;
        min-height: 62px;
        border-radius: 6px;
    }

    .dashboard-stat-card-number {
        font-size: 0.7rem;
    }

    .dashboard-stat-card-label {
        font-size: 0.5rem;
    }

    .dashboard-stat-card-change {
        font-size: 0.5rem;
        flex-wrap: wrap;
    }

    .dashboard-stat-card-icon {
        width: 18px;
        height: 18px;
        border-radius: 5px;
    }

    .dashboard-stat-card-icon i {
        font-size: 0.45rem;
    }

    .dashboard-stat-card-sparkline {
        height: 18px;
    }
}

/* ============================================
   LOGIN / GUEST PAGES
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--color-neutral-light);
}

.auth-panel-brand {
    flex: 1 1 45%;
    background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-panel-brand::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(234, 88, 12, 0.15);
    top: -140px;
    right: -140px;
}

.auth-panel-brand::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    bottom: -100px;
    left: -80px;
}

.auth-panel-brand .brand-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.auth-panel-brand .brand-mark i {
    font-size: 1.75rem;
    color: var(--color-accent-orange);
}

.auth-panel-brand .brand-tagline {
    position: relative;
    z-index: 1;
    max-width: 380px;
}

.auth-panel-brand .brand-tagline h2 {
    color: #ffffff;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.auth-panel-brand .brand-tagline p {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--fs-md);
    line-height: 1.6;
}

.auth-panel-brand .brand-features {
    list-style: none;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.auth-panel-brand .brand-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--fs-sm);
}

.auth-panel-brand .brand-features i {
    color: var(--color-accent-orange);
}

.auth-panel-brand .brand-footer {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--fs-xs);
}

.auth-panel-form {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-form-card {
    width: 100%;
    max-width: 400px;
}

.auth-form-card .form-label {
    font-size: var(--fs-sm);
}

.auth-input-group {
    position: relative;
}

.auth-input-group .form-control {
    padding-left: 2.5rem;
}

.auth-input-group .auth-input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-neutral-medium);
    font-size: var(--fs-base);
}

.auth-input-group .auth-input-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-neutral-medium);
    cursor: pointer;
    padding: 0.25rem;
}

.auth-input-group .auth-input-toggle:hover { color: var(--color-primary); }

@media (max-width: 991.98px) {
    .auth-panel-brand { display: none; }
    .auth-panel-form { flex: 1 1 100%; }
}
