/* ============================================
   KAY STATIONARY - Design System
   Colors, Typography & Styles
   ============================================ */

/* ----- Google Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ----- Material Symbols ----- */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
    /* Brand Colors */
    --primary:  #dc643c;
    --primary-dark:  #a24e32;
    --primary-hover: #B84A28;
    --primary-light: rgba(211, 90, 51, 0.1);
    --secondary: #F9C6D1;
    --secondary-hover: #F5B0C0;
    --tertiary: #FDFBD4;
    --tertiary-hover: #FCF9B8;

    /* Neutral / Text */
    --dark: #43322D;
    --text: #43322D;
    --text-light: #8A7A75;
    --text-lighter: #B5A8A4;

    /* Surfaces */
    --bg: #FFF0EB;
    --card-bg: #FFFFFF;
    --card-bg-alt: #FFF8F5;
    --border: #F0E0DA;
    --border-light: #F8ECE8;

    /* Semantic */
    --success: #4CAF50;
    --success-bg: #E8F5E9;
    --warning: #FF9800;
    --warning-bg: #FFF3E0;
    --danger: #EF5350;
    --danger-bg: #FFEBEE;
    --info: #42A5F5;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(67, 50, 45, 0.08);
    --shadow: 0 2px 12px rgba(67, 50, 45, 0.1);
    --shadow-lg: 0 8px 30px rgba(67, 50, 45, 0.12);

    /* Radius */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-full: 50px;

    /* Typography */
    --font-heading: 'Bricolage Grotesque', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Transitions */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Dark Mode ----- */
[data-theme="dark"] {
    --bg: #2A1F1C;
    --card-bg: #3A2C28;
    --card-bg-alt: #332622;
    --dark: #F0E8E5;
    --text: #F0E8E5;
    --text-light: #B5A8A4;
    --text-lighter: #8A7A75;
    --border: #4D3C37;
    --border-light: #42332E;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    --primary-light: rgba(211, 90, 51, 0.2);
    --secondary: #6B3D48;
    --tertiary: #4A4430;
    --success-bg: #1B3A1E;
    --warning-bg: #3A2E18;
    --danger-bg: #3A1A1A;
}

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

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* ----- Material Icons ----- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 24px;
    vertical-align: middle;
    line-height: 1;
}

.icon-filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.icon-sm { font-size: 18px; }
.icon-lg { font-size: 32px; }
.icon-xl { font-size: 48px; }

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-lighter); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(145deg, var(--primary) 0%, #B84A28 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    pointer-events: none;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo .logo-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

.login-logo h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* ----- Form Elements ----- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}

input.form-control,
input[type="text"].form-control,
input[type="email"].form-control,
input[type="password"].form-control,
input[type="number"].form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--card-bg);
    color: var(--text);
    outline: none;
}

input.form-control:focus,
input[type="text"].form-control:focus,
input[type="email"].form-control:focus,
input[type="password"].form-control:focus,
input[type="number"].form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

input.form-control::placeholder,
input[type="text"].form-control::placeholder,
input[type="email"].form-control::placeholder,
input[type="password"].form-control::placeholder,
input[type="number"].form-control::placeholder {
    color: var(--text-lighter);
    font-weight: 400;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%238A7A75' d='M5 7L1 2h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 10px;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn .material-symbols-outlined {
    font-size: 20px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 90, 51, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-dark {
    background: var(--dark);
    color: white;
}

.btn-dark:hover {
    background: #362A26;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #43A047;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #E53935;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn-sm .material-symbols-outlined { font-size: 18px; }
.btn-lg { padding: 18px 36px; font-size: 17px; }

/* ----- Form Check (Toggle / Checkbox) ----- */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}

.form-check label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
    width: 270px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-logo {
    text-align: center;
    padding: 12px 8px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.sidebar-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: white;
}

.sidebar-logo h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--dark);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-menu a.active {
    background: var(--primary);
    color: white;
}

.sidebar-menu a .material-symbols-outlined {
    font-size: 22px;
}

/* ----- Main Content ----- */
.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 24px 32px;
    min-height: 100vh;
}

/* ----- Top Bar ----- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--card-bg-alt);
    cursor: pointer;
    transition: background var(--transition);
}

.user-info:hover {
    background: var(--primary-light);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}



/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

/* ============================================
   GRID & STAT CARDS
   ============================================ */
.grid {
    display: grid;
    gap: 20px;
}

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

.stat-card {
    text-align: center;
    padding: 28px 20px;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: var(--primary);
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 6px;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 12px;
    background: var(--card-bg-alt);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    cursor: pointer;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.quick-action-btn .material-symbols-outlined {
    font-size: 36px;
    color: var(--primary);
}

.quick-action-btn .qa-label {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
    margin: 0 -4px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table th,
table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    vertical-align: middle;
}

table th {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    background: var(--card-bg-alt);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
}

table th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
table th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

table tr:hover td {
    background: var(--card-bg-alt);
}

table tr:last-child td {
    border-bottom: none;
}

table tr.inactive {
    opacity: 0.5;
}

table tr.inactive td {
    color: var(--text-lighter) !important;
}

/* ----- Badges ----- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-good { background: var(--success-bg); color: var(--success); }
.badge-low { background: var(--warning-bg); color: var(--warning); }
.badge-out { background: var(--danger-bg); color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding: 16px 0;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}

.pagination a:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar .form-control {
    flex: 1;
    min-width: 200px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-group select {
    padding: 10px 36px 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    background: var(--card-bg);
    color: var(--text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%238A7A75' d='M5 7L1 2h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 10px;
    cursor: pointer;
    transition: border-color var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(67, 50, 45, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.95) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* ============================================
   PRODUCT CARDS (Mobile)
   ============================================ */
.product-grid-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    user-select: none;
}

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

.product-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.product-card.inactive {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.product-card.inactive * {
    color: var(--text-lighter) !important;
}

.product-card .pc-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--card-bg-alt);
    flex-shrink: 0;
}

.product-card .pc-info {
    flex: 1;
    min-width: 0;
}

.product-card .pc-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .pc-sku {
    font-size: 12px;
    color: var(--text-lighter);
    font-weight: 500;
}

.product-card .pc-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 13px;
}

.product-card .pc-price {
    font-weight: 700;
    color: var(--primary);
}

.product-card .pc-quantity {
    color: var(--text-light);
}

/* ============================================
   SCAN OPTIONS
   ============================================ */
.scan-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--primary-light);
    color: var(--primary);
}

.scan-option:hover {
    background: rgba(211, 90, 51, 0.15);
    border-color: var(--primary-hover);
}

.scan-option .scan-icon .material-symbols-outlined {
    font-size: 56px;
}

#scanner-container {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
}

#scanner-container video {
    width: 100%;
    border-radius: var(--radius);
}

#scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 280px;
    height: 120px;
    z-index: 10;
    pointer-events: none;
}

.scanner-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #fff;
    border-style: solid;
}

.scanner-corner.tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.scanner-corner.tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.scanner-corner.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.scanner-corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

.scanner-line {
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: rgba(211, 90, 51, 0.9);
    box-shadow: 0 0 8px rgba(211, 90, 51, 0.6);
    animation: scanMove 2s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes scanMove {
    0%, 100% { top: 0; }
    50% { top: calc(100% - 2px); }
}

.scan-box {
    background-color: #fdf5f1;
    border: 2px dashed #dca58a;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
}
.scan-box:hover { background-color: #faece5; }
.scan-box-title { font-size: 18px; font-weight: 700; color: #b55e2d; margin-top: 10px; }
.scan-box-subtitle { font-size: 13px; color: #6b7280; margin-top: 4px; }

#scanner-section {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
}

#scanner-view, #sale-scanner-view {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 80vh;
}

#scanner-view video,
#scanner-view canvas,
#sale-scanner-view video,
#sale-scanner-view canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .cart-item-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .cart-item-row .incremental-input {
        align-self: center;
    }
    .cart-item-row > span {
        text-align: center;
    }
    .cart-item-row .btn-ghost {
        align-self: flex-end;
    }
}

/* ============================================
   TICKET
   ============================================ */
.ticket {
    background: white;
    color: #333;
    padding: 28px;
    max-width: 340px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border-radius: 8px;
}

[data-theme="dark"] .ticket {
    background: #fff;
    color: #333;
}

.ticket-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px dashed #333;
}

.ticket-header h2 {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: #333;
}

.ticket-items { margin-bottom: 16px; }

.ticket-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    align-items: flex-start;
}

.ticket-total {
    border-top: 2px dashed #333;
    padding-top: 14px;
    text-align: right;
    font-size: 18px;
    font-weight: bold;
}

.ticket-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 2px dashed #333;
    font-size: 11px;
    color: #666;
}

/* ============================================
   INCREMENTAL INPUT
   ============================================ */
.incremental-input {
    display: flex;
    align-items: center;
    gap: 0;
}

.incremental-input button {
    width: 40px;
    height: 42px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    font-size: 20px;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all var(--transition);
}

.incremental-input button:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.incremental-input button:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.incremental-input button:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.incremental-input input {
    width: 56px;
    height: 42px;
    border: 2px solid var(--border);
    border-left: none;
    border-right: none;
    text-align: center;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    background: var(--card-bg);
    color: var(--text);
}

/* ============================================
   PRODUCT FORM
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.image-upload-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 12px;
    transition: border-color var(--transition);
}

.image-upload-wrapper:hover {
    border-color: var(--primary);
}

.image-upload-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-wrapper input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.image-upload-wrapper .upload-placeholder {
    text-align: center;
    color: var(--text-lighter);
}

.image-upload-wrapper .upload-placeholder .material-symbols-outlined {
    font-size: 36px;
    margin-bottom: 4px;
}
/* ============================================
   Select
   ============================================ */
.select-kay {
  background-color: #ffffff;
  color: #374151;
  font-family: inherit;
  font-size: 14px; 
  border: 1px solid #eadcd9;
  border-radius: 8px;
  padding: 8px 36px 8px 12px;
  outline: none; 
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%238A7A75' d='M5 7L1 2h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 10px;
}
.select-kay:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 1px #9ca3af; 
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab:hover {
    color: var(--primary);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   ONBOARDING
   ============================================ */
.onboarding-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--primary), #B84A28);
    padding: 20px;
}

.onboarding-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.onboarding-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 32px 0;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background var(--transition);
}

.step-dot.active {
    background: var(--primary);
    width: 32px;
    border-radius: 5px;
}

/* ============================================
   ACTION BAR
   ============================================ */
.action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ============================================
   BACK BUTTON
   ============================================ */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    margin-bottom: 20px;
}

.back-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ============================================
   PUBLIC WEBSITE
   ============================================ */
.website-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.website-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.website-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.website-nav .nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
}

.website-nav .nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

#website-nav-links li{
    padding-bottom: 1rem;
}

.website-nav .nav-links a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.website-nav .nav-links .website-login-btn {
    background: var(--primary);
    color: white;
}

.website-nav .nav-links .website-login-btn:hover {
    background: var(--primary-dark);
    color: white;
}

.website-hero {
    background: linear-gradient(145deg, var(--primary), #B84A28);
    color: white;
    padding: 80px 24px;
    text-align: center;
}

.website-hero h1 {
    font-family: var(--font-heading);
    font-size: 52px;
    margin-bottom: 16px;
    color: white;
}

.website-hero p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.website-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    padding: 40px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.website-product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all var(--transition);
}

.website-product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.website-product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.website-product-card .wpc-info {
    padding: 18px;
}

.website-product-card .wpc-info h3 {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.website-product-card .wpc-info .price {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.website-footer {
    background: var(--dark);
    color: white;
    padding: 48px 24px;
    text-align: center;
    margin-top: 60px;
}

.website-footer p {
    opacity: 0.8;
    font-size: 14px;
}

.website-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 24px;
}

.website-section h2 {
    font-family: var(--font-heading);
    font-size: 34px;
    margin-bottom: 24px;
    color: var(--dark);
}

.terms-content {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 24px;
    line-height: 1.9;
}

.terms-content h1 {
    font-family: var(--font-heading);
    margin-bottom: 32px;
}

.terms-content h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-top: 32px;
    margin-bottom: 12px;
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
    height: 280px;
    margin-bottom: 20px;
}

.report-card { padding: 24px; }

.report-card .report-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
}

.report-card .report-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        margin-left: 0;
        padding: 0 16px 16px;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .top-bar-left {
        width: 100%;
        order: 2;
    }

    .top-bar-right {
        width: 100%;
        order: 1;
        justify-content: flex-end;
        gap: 4px;
    }

    .top-bar-right .menu-toggle {
        margin-right: auto;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 36px 28px;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar .form-control {
        min-width: auto;
    }

    .filter-group {
        flex-direction: column;
    }

    .desktop-only {
        display: none !important;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .stat-card .stat-value {
        font-size: 28px;
    }

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

    .ticket {
        padding: 16px;
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .website-hero h1 {
        font-size: 32px;
    }

    .website-nav .website-logo strong {
        font-size: 17px !important;
    }

    .website-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .website-nav .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 16px;
        gap: 2px;
        box-shadow: var(--shadow-lg);
    }

    .website-nav .nav-links.open {
        display: flex;
    }

    .website-nav {
        position: relative;
    }

    .website-nav .nav-links a {
        width: 100%;
        padding: 12px 16px;
    }

    .website-section h2 {
        font-size: 26px;
    }

    .action-bar {
        flex-direction: column;
    }

    .modal {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 16px;
    }

    .product-card {
        padding: 12px 14px;
        gap: 10px;
    }

    .product-card .pc-image {
        width: 44px;
        height: 44px;
    }

    .product-card .pc-details {
        flex-wrap: wrap;
        gap: 8px;
    }

    .product-grid-mobile {
        gap: 8px;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    table th,
    table td {
        padding: 10px 10px;
        font-size: 13px;
    }
    .table-container .btn-sm {
        font-size: 12px;
        padding: 4px 10px;
    }
    .table-container .material-symbols-outlined {
        font-size: 16px;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: block;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-light); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Content section for forms */
.content-section {
    max-width: 700px;
    margin: 0 auto;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Image previews */
.img-thumb {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* WhatsApp floating button */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-float:hover {
    transform: scale(1.1);
}
.whatsapp-float img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 64px;
        height: 64px;
    }
}
