/* ==========================================================================
   WALMART-GRADE DESIGN SYSTEM - BAKERY & SHOP MANAGEMENT (RWANDA)
   High-performance, touch-friendly UI for Desktop, Tablets & Mobile
   ========================================================================== */

:root {
    --wm-blue: #0071dc;
    --wm-blue-hover: #005bb5;
    --wm-blue-light: #e6f1fc;
    --wm-dark: #002244;
    --wm-navy: #0f172a;
    --wm-spark: #ffc220;
    --wm-spark-hover: #e5ac10;
    --wm-bg: #f3f4f6;
    --wm-card-bg: #ffffff;
    --wm-border: #e2e8f0;
    --wm-border-focus: #3b82f6;
    --wm-text-main: #1e293b;
    --wm-text-muted: #64748b;
    --wm-text-light: #94a3b8;
    
    --status-success: #10b981;
    --status-success-bg: #d1fae5;
    --status-warning: #f59e0b;
    --status-warning-bg: #fef3c7;
    --status-danger: #ef4444;
    --status-danger-bg: #fee2e2;
    --status-pastry: #8b5cf6;
    --status-pastry-bg: #ede9fe;
    --status-retail: #0ea5e9;
    --status-retail-bg: #e0f2fe;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-touch: 0 6px 12px rgba(0, 113, 220, 0.15);

    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --header-height: 64px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--wm-bg);
    color: var(--wm-text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.wm-navbar {
    background-color: var(--wm-dark);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    gap: 0.75rem;
}

.wm-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: #ffffff;
    flex-shrink: 0;
}

.wm-brand-icon {
    width: 38px;
    height: 38px;
    background: var(--wm-spark);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wm-dark);
    font-size: 1.25rem;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wm-brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wm-brand-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.wm-nav-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    flex: 1 1 auto;
    padding: 0.25rem 0.5rem;
    margin: 0 0.5rem;
}

.wm-nav-links::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
    width: 0;
    height: 0;
}

.wm-nav-item {
    flex-shrink: 0;
}

.wm-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.wm-nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.wm-nav-item.active a {
    background-color: var(--wm-blue);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 113, 220, 0.4);
}

.wm-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.wm-user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
}

.wm-user-avatar {
    width: 24px;
    height: 24px;
    background: var(--wm-spark);
    border-radius: 50%;
    color: var(--wm-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.wm-logout-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.15s ease;
}

.wm-logout-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

.wm-mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.4rem;
}

/* ==========================================================================
   LAYOUT & CONTAINER
   ========================================================================== */
.wm-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    max-width: 1680px;
    margin: 0 auto;
    width: 100%;
}

.wm-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.wm-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wm-navy);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wm-page-subtitle {
    font-size: 0.85rem;
    color: var(--wm-text-muted);
    margin-top: 0.15rem;
}

/* ==========================================================================
   STAT CARDS & METRIC WIDGETS
   ========================================================================== */
.wm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.wm-stat-card {
    background: var(--wm-card-bg);
    border: 1px solid var(--wm-border);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wm-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.wm-stat-icon.blue { background: var(--wm-blue-light); color: var(--wm-blue); }
.wm-stat-icon.green { background: var(--status-success-bg); color: var(--status-success); }
.wm-stat-icon.amber { background: var(--status-warning-bg); color: var(--status-warning); }
.wm-stat-icon.purple { background: var(--status-pastry-bg); color: var(--status-pastry); }
.wm-stat-icon.red { background: var(--status-danger-bg); color: var(--status-danger); }

.wm-stat-info { flex: 1; }

.wm-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wm-stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--wm-navy);
    line-height: 1.2;
    margin-top: 0.15rem;
}

/* ==========================================================================
   BUTTONS & ACTIONS
   ========================================================================== */
.wm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    min-height: 42px;
}

.wm-btn-primary {
    background-color: var(--wm-blue);
    color: #ffffff;
    border-color: var(--wm-blue);
    box-shadow: 0 2px 4px rgba(0, 113, 220, 0.25);
}

.wm-btn-primary:hover {
    background-color: var(--wm-blue-hover);
    box-shadow: var(--shadow-touch);
}

.wm-btn-spark {
    background-color: var(--wm-spark);
    color: var(--wm-dark);
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(255, 194, 32, 0.35);
}

.wm-btn-spark:hover { background-color: var(--wm-spark-hover); }

.wm-btn-success { background-color: var(--status-success); color: #ffffff; }
.wm-btn-success:hover { background-color: #059669; }

.wm-btn-danger { background-color: var(--status-danger); color: #ffffff; }
.wm-btn-danger:hover { background-color: #dc2626; }

.wm-btn-outline {
    background: transparent;
    border-color: var(--wm-border);
    color: var(--wm-text-main);
}

.wm-btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }

.wm-btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    min-height: 34px;
}

.wm-btn-lg {
    padding: 0.85rem 1.6rem;
    font-size: 1.05rem;
    min-height: 52px;
    border-radius: var(--radius-lg);
}

.wm-btn-block { width: 100%; }

/* ==========================================================================
   CARDS, TABLES & CONTAINERS
   ========================================================================== */
.wm-card {
    background: var(--wm-card-bg);
    border: 1px solid var(--wm-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.wm-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--wm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.wm-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wm-navy);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wm-card-body { padding: 1.25rem; }

.wm-table-responsive {
    overflow-x: auto;
    width: 100%;
}

.wm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.wm-table th {
    background: #f8fafc;
    color: var(--wm-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--wm-border);
    white-space: nowrap;
}

.wm-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--wm-border);
    color: var(--wm-text-main);
    vertical-align: middle;
}

.wm-table tbody tr:hover { background-color: #f8fafc; }

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */
.wm-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.wm-badge-success { background: var(--status-success-bg); color: var(--status-success); }
.wm-badge-warning { background: var(--status-warning-bg); color: #d97706; }
.wm-badge-danger { background: var(--status-danger-bg); color: var(--status-danger); }
.wm-badge-pastry { background: var(--status-pastry-bg); color: var(--status-pastry); }
.wm-badge-retail { background: var(--status-retail-bg); color: #0284c7; }
.wm-badge-dark { background: #e2e8f0; color: #334155; }

/* ==========================================================================
   SEARCH & FILTERS
   ========================================================================== */
.wm-search-box {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 260px;
}

.wm-search-box input {
    width: 100%;
    height: 40px;
    padding: 0.5rem 1rem 0.5rem 2.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--wm-border);
    background: #ffffff;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.15s ease;
}

.wm-search-box input:focus {
    border-color: var(--wm-blue);
    box-shadow: 0 0 0 3px var(--wm-blue-light);
}

.wm-search-icon {
    position: absolute;
    left: 0.8rem;
    color: var(--wm-text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.wm-filter-tabs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.wm-filter-tab {
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--wm-border);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--wm-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.wm-filter-tab:hover { background: #f1f5f9; color: var(--wm-navy); }

.wm-filter-tab.active {
    background: var(--wm-blue);
    color: #ffffff;
    border-color: var(--wm-blue);
    box-shadow: 0 2px 4px rgba(0, 113, 220, 0.3);
}

/* ==========================================================================
   POINT OF SALE (POS) LAYOUT
   Optimized for Tablets, Laptops & Mobile
   ========================================================================== */
.wm-pos-container {
    display: grid;
    grid-template-columns: 1fr 430px;
    gap: 1.25rem;
    height: calc(100vh - var(--header-height) - 2.5rem);
    min-height: 650px;
}

.wm-pos-catalog-panel {
    background: var(--wm-card-bg);
    border: 1px solid var(--wm-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wm-pos-catalog-header {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--wm-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #fafbfc;
}

.wm-pos-search-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wm-pos-search-input {
    flex: 1;
    height: 46px;
    padding: 0 1rem 0 2.6rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--wm-border);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.15s ease;
}

.wm-pos-search-input:focus {
    border-color: var(--wm-blue);
    box-shadow: 0 0 0 3px var(--wm-blue-light);
}

.wm-pos-grid-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.wm-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.85rem;
}

.wm-product-card {
    background: #ffffff;
    border: 1px solid var(--wm-border);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    position: relative;
    min-height: 145px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.wm-product-card:active { transform: scale(0.97); }

.wm-product-card:hover {
    border-color: var(--wm-blue);
    box-shadow: var(--shadow-md);
}

.wm-product-card.out-of-stock {
    opacity: 0.6;
    filter: grayscale(0.8);
    cursor: not-allowed;
}

.wm-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.wm-product-sku {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--wm-text-muted);
}

.wm-product-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--wm-navy);
    line-height: 1.25;
    margin-bottom: 0.35rem;
}

.wm-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--wm-border);
}

.wm-product-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--wm-blue);
}

.wm-add-btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--wm-blue-light);
    color: var(--wm-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    border: none;
}

/* POS Cart / Ticket Panel */
.wm-pos-cart-panel {
    background: var(--wm-card-bg);
    border: 1px solid var(--wm-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.wm-cart-header {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--wm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
    flex-shrink: 0;
}

.wm-cart-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--wm-navy);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wm-cart-badge {
    background: var(--wm-blue);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}

.wm-cart-items-wrapper {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: calc(100vh - 460px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.6rem 0.75rem;
    background: #ffffff;
    box-sizing: border-box;
    width: 100%;
}

.wm-cart-empty {
    height: 100%;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--wm-text-light);
    text-align: center;
    padding: 1.5rem;
}

.wm-cart-empty-icon {
    font-size: 2.8rem;
    margin-bottom: 0.4rem;
    opacity: 0.5;
}

.wm-cart-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    background: #ffffff;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.wm-cart-item:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.wm-cart-item.selected {
    background-color: #f0f7ff;
    border: 1.5px solid var(--wm-blue);
    box-shadow: 0 0 0 2px rgba(0, 113, 220, 0.15);
}

.wm-cart-item.zero-qty {
    background-color: #fff1f2;
    border-color: #fecdd3;
    opacity: 0.85;
}

.wm-cart-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.wm-cart-item-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--wm-navy);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.wm-cart-sel-dot {
    color: var(--wm-blue);
    font-size: 0.85rem;
    font-weight: 900;
    flex-shrink: 0;
}

.wm-cart-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    color: #0f172a;
}

.cart-btn-remove {
    background: transparent;
    border: 1px solid #fee2e2;
    color: #ef4444;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.12s ease;
    flex-shrink: 0;
}

.cart-btn-remove:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.wm-cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.wm-cart-item-meta {
    font-size: 0.78rem;
    color: var(--wm-text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.wm-cart-unit-cost {
    font-weight: 600;
    color: #475569;
}

.wm-cart-item-unit {
    font-weight: 700;
    color: #1e293b;
}

.wm-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.wm-qty-stepper {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 2px;
}

.wm-qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #ffffff;
    color: var(--wm-navy);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.1s ease;
}

.wm-qty-btn:active { background: #cbd5e1; }

.wm-qty-val {
    min-width: 24px;
    text-align: center;
    font-weight: 800;
    font-size: 0.88rem;
    color: #0f172a;
}

.wm-qty-val.zero-val {
    color: #ef4444;
    font-weight: 900;
}

.wm-cart-item-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--wm-blue);
    text-align: right;
    white-space: nowrap;
    min-width: 65px;
}

.wm-cart-item-price.zero-price {
    color: #94a3b8;
}

.wm-cart-summary {
    background: #fafbfc;
    border-top: 2px solid var(--wm-border);
    padding: 0.75rem 1.15rem;
    flex-shrink: 0;
}

.wm-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--wm-text-muted);
    margin-bottom: 0.25rem;
}

.wm-summary-row.total {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--wm-navy);
    border-top: 1px dashed var(--wm-border);
    padding-top: 0.4rem;
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.wm-pos-actions {
    padding: 0.65rem 1rem 0.85rem 1rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid var(--wm-border);
    flex-shrink: 0;
}

/* ==========================================================================
   ON-SCREEN TOUCH KEYPAD (NUMPAD)
   ========================================================================== */
.wm-keypad-container {
    background: #f8fafc;
    border: 1px solid var(--wm-border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.wm-key-btn {
    height: 46px;
    border: 1px solid var(--wm-border);
    background: #ffffff;
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wm-navy);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    user-select: none;
    transition: all 0.1s ease;
}

.wm-key-btn:active {
    background: #e2e8f0;
    transform: scale(0.96);
}

.wm-key-btn.action { background: #f1f5f9; color: var(--wm-text-muted); font-size: 0.85rem; }
.wm-key-btn.primary { background: var(--wm-blue); color: #ffffff; border-color: var(--wm-blue); }
.wm-key-btn.danger { background: var(--status-danger-bg); color: var(--status-danger); border-color: #fca5a5; }
.wm-key-btn.spark { background: var(--wm-spark); color: var(--wm-dark); }

/* ==========================================================================
   MODALS & DIALOGS
   ========================================================================== */
.wm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.wm-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.wm-modal {
    background: #ffffff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.wm-modal.modal-lg { max-width: 900px; }
.wm-modal.modal-sm { max-width: 440px; }

.wm-modal-overlay.active .wm-modal { transform: translateY(0); }

.wm-modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--wm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.wm-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--wm-navy);
}

.wm-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--wm-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.wm-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--wm-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
}

/* ==========================================================================
   FORM INPUTS & CONTROLS
   ========================================================================== */
.wm-form-group { margin-bottom: 1rem; }

.wm-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--wm-navy);
    margin-bottom: 0.35rem;
}

.wm-form-input, .wm-form-select, .wm-form-textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--wm-border);
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    background: #ffffff;
    color: var(--wm-text-main);
    outline: none;
    transition: all 0.15s ease;
}

.wm-form-input:focus, .wm-form-select:focus, .wm-form-textarea:focus {
    border-color: var(--wm-blue);
    box-shadow: 0 0 0 3px var(--wm-blue-light);
}

.wm-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.wm-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.wm-toast {
    background: var(--wm-navy);
    color: #ffffff;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: slideUp 0.25s ease;
}

.wm-toast.success { background: #065f46; border-left: 4px solid var(--status-success); }
.wm-toast.error { background: #7f1d1d; border-left: 4px solid var(--status-danger); }
.wm-toast.warning { background: #78350f; border-left: 4px solid var(--status-warning); }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   PRINTABLE THERMAL RECEIPT (RWF)
   ========================================================================== */
.wm-thermal-receipt {
    width: 320px;
    margin: 0 auto;
    background: #ffffff;
    padding: 1.2rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #000000;
    border: 1px dashed #cccccc;
}

.wm-thermal-header {
    text-align: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed #000;
    padding-bottom: 0.5rem;
}

.wm-receipt-brand {
    font-size: 17px;
    font-weight: bold;
}

.wm-receipt-table {
    width: 100%;
    margin: 0.5rem 0;
    border-collapse: collapse;
}

.wm-receipt-table td { padding: 3px 0; }

.wm-receipt-divider {
    border-top: 1px dashed #000;
    margin: 6px 0;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLETS & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
    .wm-pos-container {
        grid-template-columns: 1fr 380px;
        gap: 0.85rem;
    }
    
    .wm-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.65rem;
    }
}

@media (max-width: 768px) {
    :root { var(--header-height: 56px); }

    .wm-main-content { padding: 0.75rem; }

    .wm-nav-links {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        background: var(--wm-dark);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }

    .wm-nav-links.show { display: flex; }
    .wm-mobile-menu-btn { display: block; }

    .wm-pos-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .wm-pos-cart-panel {
        min-height: 540px;
    }

    .wm-cart-items-wrapper {
        max-height: 300px;
    }

    .wm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wm-stats-grid { grid-template-columns: 1fr; }
}
