/* ==========================================================
   ANZEN MALL KASET - Global Styles
   Minimal, white/light gray tone, desktop-first
   ========================================================== */

/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --sidebar-width: 240px;
    --header-height: 60px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ensure all form elements use the same font */
input,
button,
select,
textarea,
option {
    font-family: var(--font-family);
}

/* Small inline icons */
.icon-sm {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-900);
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================
   Layout - Sidebar + Main Content
   ========================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: center;
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.nav-section {
    padding: 0.5rem 1rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: 0.5rem 0;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.staff-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.staff-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100%;
}

.page-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
}

.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* ==========================================================
   Components
   ========================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 0.5rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

/* Use row border instead of cell border for perfect alignment */
.table thead tr {
    border-bottom: 2px solid var(--gray-300);
}

.table tbody tr {
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
    white-space: nowrap;
}

/* Remove border from last row */
.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    min-width: 80px;
    text-align: center;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-gray {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--gray-500);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Confirm Modal */
.confirm-message {
    text-align: center;
    padding: 1rem 0;
}

.confirm-message p {
    font-size: 1rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.confirm-message .text-muted {
    color: var(--gray-500);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* ==========================================================
   POS Specific Styles
   ========================================================== */

.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    height: calc(100vh - var(--header-height) - 3rem);
}

.pos-items {
    display: flex;
    flex-direction: column;
}

.pos-cart {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 0;
    /* Critical for flex scrolling */
}

.cart-summary {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1.25rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    /* Subtle shadow to indicate layering */
    z-index: 5;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--gray-300);
}

.payment-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.payment-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    gap: 0.25rem;
    height: auto;
}

/* Cart Item Styles */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item.has-promo {
    background-color: #f0fdf4;
}

.cart-item.is-excluded {
    background-color: #fffbeb;
    border-left: 3px solid var(--warning);
}

.cart-item-info {
    flex: 1;
    overflow: hidden;
    padding-right: 0.5rem;
}

.cart-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-barcode {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: monospace;
}

.cart-item-promo {
    font-size: 0.75rem;
    color: var(--success);
}

.cart-item-price {
    text-align: right;
    font-weight: 600;
    min-width: 70px;
}

.original-price {
    display: block;
    font-size: 0.7rem;
    text-decoration: line-through;
    color: var(--gray-400);
    font-weight: normal;
}

.promo-info,
.promo-hint {
    margin-bottom: 0.5rem;
    padding: 0 1.25rem;
}

.promo-tag {
    font-size: 0.75rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hint-tag {
    font-size: 0.75rem;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.promo-selection {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.barcode-input-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.barcode-input {
    flex: 1;
    font-size: 1.25rem;
    padding: 0.75rem 1rem;
    text-align: center;
    font-family: monospace;
    letter-spacing: 0.1em;
}

/* POS Product Browser */
.pos-product-browser {
    margin-top: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    max-height: calc(100vh - 280px);
    display: flex;
    flex-direction: column;
}

.browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.browser-title {
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.browser-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 500;
}

#pos-browser-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.pos-groups-grid,
.pos-categories-grid,
.pos-lots-grid,
.pos-items-grid {
    display: grid;
    gap: 0.5rem;
}

.pos-groups-grid {
    grid-template-columns: repeat(2, 1fr);
}

.pos-lots-grid {
    grid-template-columns: repeat(2, 1fr);
}

.pos-categories-grid {
    grid-template-columns: repeat(3, 1fr);
}

.pos-items-grid {
    grid-template-columns: repeat(5, 1fr);
}

.pos-lot-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.pos-lot-btn:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.pos-lot-btn .lot-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-800);
}

.pos-lot-btn .lot-info {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.pos-lot-btn .lot-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--success);
}

.pos-group-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    color: var(--gray-700);
}

.pos-group-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pos-category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.pos-category-btn:hover {
    border-color: var(--success);
    background: #f0fdf4;
    transform: translateY(-1px);
}

.pos-category-btn .cat-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--gray-700);
    line-height: 1.2;
}

.pos-category-btn .cat-price {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

.pos-item-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
}

.pos-item-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
}

.pos-item-btn .item-barcode {
    font-size: 0.7rem;
    font-family: monospace;
    color: var(--gray-600);
}

.pos-item-btn .item-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
}

.cart-item-barcode {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: monospace;
}

.cart-item-price {
    font-weight: 600;
    text-align: right;
}

.cart-item-original {
    text-decoration: line-through;
    color: var(--gray-400);
    font-size: 0.8rem;
}

.cart-item-promo {
    font-size: 0.7rem;
    color: var(--success);
}

.cart-item.has-promo {
    background: var(--success-light);
}

.original-price {
    text-decoration: line-through;
    color: var(--gray-400);
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.promo-info {
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.promo-tag {
    font-size: 0.8rem;
    color: var(--warning);
    font-weight: 500;
}

.promo-hint {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.hint-tag {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.promo-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--gray-600);
    cursor: pointer;
}

.promo-toggle input {
    cursor: pointer;
}

.promo-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.promo-checkbox {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-700);
    cursor: pointer;
    background: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.promo-checkbox input {
    cursor: pointer;
}

.promo-checkbox:has(input:checked) {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: .3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--success);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

/* Price Settings */
.price-toggle-section {
    padding: 1rem 0;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.toggle-label {
    font-size: 1rem;
    font-weight: 500;
}

.price-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: opacity 0.3s;
}

.price-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-input-group input {
    max-width: 120px;
}

.price-unit {
    color: var(--gray-500);
}

.price-status {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.status-on {
    color: var(--success);
}

.status-off {
    color: var(--gray-500);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.item-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

.item-card.item-sold {
    opacity: 0.6;
    background: var(--gray-50);
}

.item-barcode {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
}

.item-status {
    margin: 0.25rem 0;
}

.item-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.item-price {
    font-weight: 600;
    color: var(--primary);
}

.item-card .btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* Delete Confirm Modal */
.delete-confirm {
    text-align: center;
    padding: 1rem 0;
}

.delete-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.delete-warnings {
    text-align: left;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}

.delete-warnings ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.delete-warnings li {
    margin: 0.25rem 0;
    color: var(--gray-700);
}

.cart-summary {
    background: var(--gray-50);
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.summary-total {
    font-size: 1.75rem;
    font-weight: 700;
    border-top: 2px solid #fbbf24;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: 0.5rem;
    background: #fef9c3;
    color: #92400e;
    border-radius: 8px;
}

.payment-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.payment-btn {
    padding: 1rem;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.payment-btn i {
    font-size: 1.5rem;
}

/* ==========================================================
   Mobile Styles - Responsive Design
   ========================================================== */

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-only {
    display: none;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Tablet breakpoint */
@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr 320px;
    }

    .pos-items-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        min-width: 100%;
    }
}

/* Mobile breakpoint */
@media (max-width: 768px) {

    /* Mobile menu toggle visible */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    /* Sidebar slide-in with overlay */
    .sidebar {
        position: fixed;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main content full width - force viewport width */
    .app-container {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Force all elements to respect container width */
    .page-content,
    .page-content>*,
    .card,
    .card-body,
    .table,
    .table tbody,
    .table tr {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Fix font consistency for monospace elements */
    .table td,
    .font-mono,
    [style*="monospace"] {
        font-family: var(--font-family) !important;
        word-break: break-all;
    }

    /* Page header adjustments */
    .page-header {
        padding: 1rem;
        padding-left: 60px;
        /* Space for menu button */
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .page-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .page-actions .btn {
        flex: 1;
        min-width: 120px;
    }

    /* Page content padding */
    .page-content {
        padding: 1rem;
    }

    /* Cards need small margin since no page padding */
    .page-content>.card {
        margin: 0 0.5rem 0.75rem 0.5rem;
    }

    /* Stats grid 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    /* Dashboard charts/grids responsive */
    .d-flex {
        flex-wrap: wrap;
    }

    .dashboard-row,
    .chart-grid,
    [style*="display:grid"],
    [style*="display: grid"] {
        display: block !important;
        width: 100% !important;
    }

    .dashboard-row>.card,
    .chart-grid>.card,
    .dashboard-row>div,
    .chart-grid>div {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    /* Canvas charts responsive */
    canvas {
        max-width: 100%;
        height: auto !important;
    }

    /* Flex grids with gap */
    [style*="gap"] {
        gap: 0.75rem !important;
    }

    /* Table to Card View on Mobile */
    .table {
        border: 0;
        min-width: unset;
        width: 100%;
        display: block;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: block;
        width: 100%;
    }

    .table tr {
        display: block;
        margin-bottom: 12px;
        background: var(--white);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        padding: 12px;
        border: 1px solid var(--gray-200);
    }

    .table td {
        display: block;
        padding: 6px 0;
        border-bottom: 1px solid var(--gray-100);
        font-size: 0.875rem;
        /* Override base styles to show full text */
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        max-width: none !important;
        word-wrap: break-word;
    }

    .table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .table td:first-child {
        padding-top: 0;
    }

    /* Add label before each cell using data-label */
    .table td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--gray-500);
        font-size: 0.8rem;
        display: inline;
        margin-right: 4px;
    }

    /* Hide label for empty data-label or action cells */
    .table td[data-label=""]::before,
    .table td:not([data-label])::before {
        display: none;
    }

    /* Actions cell */
    .table td.table-actions,
    .table td:has(.table-actions) {
        padding-top: 8px;
        margin-top: 4px;
        border-top: 1px solid var(--gray-200);
        border-bottom: none;
    }

    .table td.table-actions::before,
    .table td:has(.table-actions)::before {
        display: none;
    }

    .table-actions {
        display: flex;
        gap: 8px;
    }

    /* Badge stays inline */
    .table .badge {
        display: inline-flex;
    }

    /* Cards - full width on mobile */
    .card {
        border-radius: var(--radius-sm);
        width: 100% !important;
        max-width: 100% !important;
    }

    .card-body {
        width: 100%;
        padding: 1rem;
        overflow-x: hidden;
    }

    .card-header {
        padding: 1rem;
    }

    /* Force all containers to full width */
    .page-content>* {
        max-width: 100%;
    }

    .card-body {
        padding: 1rem;
    }

    /* Forms */
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .form-group {
        width: 100%;
    }

    .form-control {
        font-size: 16px;
        /* Prevent iOS zoom */
    }

    /* Buttons touch-friendly */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    .btn-sm {
        min-height: 36px;
    }

    /* Modal full-width on mobile */
    .modal-content {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        margin: 1rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    /* POS Layout - stack vertically */
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }

    .pos-browser,
    .pos-cart {
        height: auto;
        max-height: 50vh;
    }

    .pos-groups-grid,
    .pos-lots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pos-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pos-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pos-item-btn,
    .pos-category-btn,
    .pos-lot-btn {
        padding: 0.75rem;
    }

    .payment-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Items grid */
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Label size options wrap */
    .label-size-options {
        flex-direction: column;
    }

    .label-size-option {
        width: 100%;
        justify-content: center;
    }

    /* Toast positioning */
    .toast-container {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
    }

    .toast {
        width: 100%;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding-left: 60px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pos-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .payment-buttons {
        grid-template-columns: 1fr;
    }

    .summary-total {
        font-size: 1.5rem;
    }
}

/* ==========================================================
   Mobile Scan Page Specific
   ========================================================== */

.scan-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
}

.camera-view {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--gray-900);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.camera-view video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 100px;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
}

.item-edit-form {
    margin-top: 1rem;
}

/* ==========================================================
   Print Styles
   ========================================================== */

@media print {

    .sidebar,
    .page-header,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .card {
        border: none;
        box-shadow: none;
    }
}

/* ==========================================================
   Utilities
   ========================================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--gray-500);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.font-bold {
    font-weight: 600;
}

.font-mono {
    font-family: monospace;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none;
}

/* Store Status Section */
.store-status {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success);
}

.store-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.store-status-header .status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
}

.store-status-staff {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-outline-danger:hover:not(:disabled) {
    background: var(--danger-light);
}