/* ─── Canada LUX Portal v3.3 - Tile-Based Mobile App ─── */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #1a237e; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif; background: #f2f4f7; color: #1d1d1f; -webkit-font-smoothing: antialiased; min-height: 100vh; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }

/* ─── Login ─── */
.screen { min-height: 100vh; }
#login-screen { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0d1442 0%, #1a237e 50%, #283593 100%); padding: 24px; }
.login-container { background: white; padding: 40px 28px; border-radius: 20px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo img { border-radius: 18px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.login-container h1 { font-size: 24px; font-weight: 700; color: #1a237e; margin: 16px 0 4px; }
.login-container .subtitle { color: #8c8c8c; font-size: 14px; margin-bottom: 28px; }
.error-msg { background: #fef2f2; color: #dc2626; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }

/* ─── App Header ─── */
.app-header { background: #1a237e; color: white; padding: 12px 16px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 100; min-height: 56px; padding-top: calc(12px + env(safe-area-inset-top)); }
.header-left-action { display: flex; align-items: center; }
.header-left-action .header-action-btn { position: relative; }
.header-back { cursor: pointer; padding: 4px; display: flex; align-items: center; -webkit-tap-highlight-color: transparent; }
.header-title { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.header-icon { width: 30px; height: 30px; border-radius: 8px; background: white; padding: 2px; }
.header-section-name { font-weight: 600; font-size: 17px; }
.header-actions { display: flex; gap: 4px; align-items: center; }
.header-action-btn { background: none; border: none; color: white; padding: 8px; cursor: pointer; position: relative; border-radius: 50%; -webkit-tap-highlight-color: transparent; font-size: 20px; line-height: 1; }
.header-action-btn:active { background: rgba(255,255,255,0.15); }
.notif-dot { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; background: #ef4444; border-radius: 9px; border: 2px solid #1a237e; font-size: 10px; font-weight: 700; color: #fff; text-align: center; line-height: 14px; padding: 0 4px; }

/* ─── Settings Menu ─── */
.settings-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.2); z-index: 150; }
.settings-menu { position: fixed; top: calc(56px + env(safe-area-inset-top, 0px)); right: 12px; background: white; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.18); z-index: 160; min-width: 210px; overflow: hidden; }
.settings-item { padding: 14px 18px; font-size: 15px; cursor: pointer; color: #374151; -webkit-tap-highlight-color: transparent; }
.settings-item:active { background: #f3f4f6; }
.settings-logout { color: #dc2626; }
.settings-divider { height: 1px; background: #f3f4f6; }

/* Bio Login setup */
.bio-setup { text-align: center; padding: 8px 0; }
.bio-icon { font-size: 48px; margin-bottom: 12px; }
.bio-desc { font-size: 14px; color: #6b7280; line-height: 1.5; margin-bottom: 8px; }
.bio-status { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-top: 12px; }
.bio-active { background: #dcfce7; color: #166534; }
.bio-unavailable { background: #fff7ed; color: #c2410c; }

/* ─── Install App Banner ─── */
.install-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #0d1442, #283593); color: white; padding: 12px 16px; margin: 0; }
.install-banner-text { flex: 1; }
.install-banner-text strong { display: block; font-size: 14px; }
.install-banner-text span { font-size: 12px; opacity: 0.8; }
.install-dismiss { background: none; border: none; color: rgba(255,255,255,0.6); font-size: 20px; padding: 4px 8px; cursor: pointer; }

/* ─── Welcome Bar ─── */
.welcome-bar { padding: 18px 20px 6px; font-size: 20px; color: #374151; font-weight: 400; }
.welcome-bar strong { font-weight: 700; color: #1a237e; }

/* ─── Balance Banner ─── */
.balance-banner { margin: 12px 16px 8px; background: white; border-radius: 16px; padding: 16px 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.balance-row { display: flex; align-items: center; justify-content: space-around; }
.balance-item { text-align: center; flex: 1; }
.balance-label { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-bottom: 4px; }
.balance-value { font-size: 18px; font-weight: 700; color: #1a237e; }
.balance-value.credit { color: #059669; }
.balance-divider { width: 1px; height: 36px; background: #e5e7eb; flex-shrink: 0; }

/* ─── Tile Grid ─── */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.tile-grid.lite-mode { grid-template-columns: 1fr; }
.tile { background: white; border-radius: 14px; padding: 16px 10px; text-align: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: transform 0.15s ease, box-shadow 0.15s ease; -webkit-tap-highlight-color: transparent; position: relative; overflow: hidden; }
.tile:active { transform: scale(0.96); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.tile-icon { font-size: 28px; margin-bottom: 6px; }
.tile-label { font-size: 13px; font-weight: 700; color: #1f2937; letter-spacing: -0.2px; }
.tile-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.tile-count { font-size: 11px; font-weight: 700; color: #1a237e; background: #e8eaf6; padding: 2px 8px; border-radius: 10px; display: inline-block; margin-top: 3px; }

/* Action tiles */
.tile-action { background: linear-gradient(135deg, #eef2ff, #e0e7ff); border: 1px solid #c7d2fe; }
.tile-action .tile-label { color: #3730a3; }
.tile-action2 { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border: 1px solid #bbf7d0; }
.tile-action2 .tile-label { color: #166534; }

/* ─── Section Container ─── */
#section-container { padding: 12px 16px 24px; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Common UI ─── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #4b5563; margin-bottom: 6px; }
.input, .textarea, select.input { width: 100%; padding: 12px 14px; border: 1.5px solid #e5e7eb; border-radius: 12px; font-size: 15px; font-family: inherit; background: white; color: #1d1d1f; appearance: none; -webkit-appearance: none; }
.input:focus, .textarea:focus, select.input:focus { border-color: #1a237e; outline: none; box-shadow: 0 0 0 3px rgba(26,35,126,0.1); }
.textarea { resize: vertical; min-height: 80px; }
select.input { background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* Buttons */
.btn { padding: 10px 20px; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; -webkit-tap-highlight-color: transparent; }
.btn-primary { background: #1a237e; color: white; }
.btn-primary:active { background: #0d1442; }
.btn-primary:disabled { opacity: 0.5; }
.btn-outline { background: white; color: #4b5563; border: 1.5px solid #e5e7eb; }
.btn-outline:active { background: #f3f4f6; }
.btn-full { width: 100%; padding: 14px; }
.btn-small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.badge-paid, .badge-closed { background: #dcfce7; color: #166534; }
.badge-open, .badge-sent, .badge-partially_paid { background: #dbeafe; color: #1e40af; }
.badge-overdue { background: #fef2f2; color: #dc2626; }
.badge-void, .badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-pending, .badge-new { background: #fff7ed; color: #c2410c; }

/* Cards */
.card-row { background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: background 0.1s; -webkit-tap-highlight-color: transparent; }
.card-row:active { background: #f9fafb; }
.card-row-left { flex: 1; min-width: 0; }
.card-row-title { font-size: 14px; font-weight: 600; color: #1f2937; margin-bottom: 3px; }
.card-row-sub { font-size: 13px; color: #9ca3af; }
.card-row-right { text-align: right; flex-shrink: 0; margin-left: 12px; }
.card-row-amount { font-size: 15px; font-weight: 700; color: #1a237e; }
.card-row-amount.overdue { color: #dc2626; }

/* Tab header / filter */
.tab-header { margin-bottom: 12px; }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-group select { flex: 1; min-width: 0; font-size: 13px; padding: 10px 32px 10px 12px; border-radius: 10px; }

/* Pagination */
.pagination { text-align: center; padding: 16px 0; display: flex; justify-content: center; gap: 8px; }

/* Form card */
.form-card { background: white; border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.customer-banner { background: #e8eaf6; color: #1a237e; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.customer-banner.quote { background: #dcfce7; color: #166534; }
.upload-btns { display: flex; gap: 10px; margin-bottom: 8px; }
.images-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.images-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.images-preview .img-wrap { position: relative; }
.images-preview .img-remove { position: absolute; top: -6px; right: -6px; background: #ef4444; color: white; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.form-message { padding: 10px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.form-message.success { background: #dcfce7; color: #166534; }
.form-message.error { background: #fef2f2; color: #dc2626; }

/* Search dropdown */
.search-wrap { position: relative; }
.dropdown { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1.5px solid #e5e7eb; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 50; display: none; max-height: 200px; overflow-y: auto; margin-top: 4px; }
.dropdown.show { display: block; }
.dropdown-item { padding: 12px 14px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #f3f4f6; }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:active { background: #f3f4f6; }
.dropdown-new { color: #1a237e; font-weight: 600; }

/* Summary cards on old dashboard (kept for compatibility) */
.summary-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: white; padding: 16px; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.card-label { font-size: 12px; color: #9ca3af; text-transform: uppercase; }
.card-value { font-size: 22px; font-weight: 700; color: #1a237e; margin-top: 4px; }
.card-value.credit { color: #059669; }

/* Loading */
.loading { text-align: center; padding: 40px 20px; color: #9ca3af; font-size: 14px; }

/* ─── Modal ─── */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal-content { background: white; width: 100%; max-width: 600px; max-height: 90vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: slideUp 0.25s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: #f3f4f6; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #6b7280; }
.modal-body { padding: 16px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f3f4f6; display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

/* Modal detail grid */
.detail-grid { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin-bottom: 16px; font-size: 14px; }
.detail-label { font-weight: 600; color: #6b7280; }
.detail-value { color: #1f2937; }

/* Statement table */
.statement-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.statement-table th { background: #f9fafb; padding: 10px 8px; text-align: left; font-weight: 600; color: #6b7280; border-bottom: 2px solid #e5e7eb; font-size: 12px; }
.statement-table td { padding: 10px 8px; border-bottom: 1px solid #f3f4f6; }
.statement-table .amount { text-align: right; font-variant-numeric: tabular-nums; }

/* Statement responsive — use data-table on all screens */
.statement-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.statement-wrap .data-table { font-size: 12px; }
.statement-wrap .data-table th,
.statement-wrap .data-table td { padding: 8px 6px; white-space: nowrap; }
.statement-wrap .data-table .amount { min-width: 56px; }

/* On small phones hide the Number column to fit 5 columns */
@media (max-width: 400px) {
    .statement-wrap .data-table .col-number { display: none; }
    .statement-wrap .data-table th,
    .statement-wrap .data-table td { padding: 7px 4px; font-size: 11px; }
    .statement-wrap .data-table .amount { min-width: 46px; }
}

/* Notification items */
.notif-item { background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.notif-item.unread { border-left: 3px solid #1a237e; }
.notif-item[onclick] { cursor: pointer; }
.notif-item[onclick]:active { background: #f5f5f5; }
.notif-ref { font-size: 11px; color: #1a237e; font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.notif-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.notif-body { font-size: 13px; color: #6b7280; }
.notif-time { font-size: 12px; color: #9ca3af; margin-top: 6px; }

/* Request Cards */
.request-card { background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); cursor: pointer; transition: box-shadow 0.15s; }
.request-card:active { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.request-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.request-card-id { font-weight: 700; font-size: 14px; color: #1a237e; }
.request-card-type { font-weight: 600; font-size: 15px; color: #333; margin-bottom: 4px; }
.request-card-notes { font-size: 13px; color: #666; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.request-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #9ca3af; }
.request-card-meta { color: #666; }
.notif-actions { display: flex; gap: 8px; margin-bottom: 12px; }

/* Request items */
.req-item { background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); cursor: pointer; }
.req-item:active { background: #f9fafb; }
.req-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.req-type { font-size: 12px; font-weight: 600; color: #1a237e; text-transform: uppercase; }
.req-date { font-size: 12px; color: #9ca3af; }
.req-desc { font-size: 14px; color: #374151; line-height: 1.4; }

/* Activity items in request detail */
.activity-list { margin-top: 16px; }
.activity-item { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; border-left: 3px solid #e5e7eb; background: #f9fafb; }
.activity-customer-note { background: #eff6ff; border-left-color: #1a237e; }
.activity-staff-note { background: #fff7ed; border-left-color: #ea580c; }
.activity-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.activity-who { font-weight: 600; }
.activity-when { color: #9ca3af; }
.activity-text { font-size: 14px; color: #374151; line-height: 1.4; }

.add-note-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.add-note-section textarea { margin-bottom: 8px; }
.note-footer { display: flex; justify-content: space-between; align-items: center; }
.char-count { font-size: 12px; color: #9ca3af; }

/* Promo & Featured cards */
.promo-card, .featured-card { background: white; border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); cursor: pointer; }
.promo-card:active, .featured-card:active { background: #f9fafb; }
.promo-title, .featured-title { font-size: 15px; font-weight: 700; color: #1f2937; margin-bottom: 4px; }
.promo-desc, .featured-desc { font-size: 13px; color: #6b7280; line-height: 1.4; }
.promo-badge { display: inline-block; background: #fef2f2; color: #dc2626; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 8px; margin-top: 8px; }
.promo-dates { font-size: 12px; color: #9ca3af; margin-top: 6px; }

/* Points */
.points-card { background: linear-gradient(135deg, #1a237e, #283593); color: white; border-radius: 16px; padding: 24px; text-align: center; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(26,35,126,0.3); }
.points-balance { font-size: 36px; font-weight: 800; }
.points-label { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.points-dollars { font-size: 16px; margin-top: 8px; opacity: 0.9; }
.points-info { background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.points-info-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.points-info-label { color: #6b7280; }
.points-info-value { font-weight: 600; color: #1f2937; }

/* Tab content visibility */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Standalone PWA adjustments */
@media all and (display-mode: standalone) {
    body { padding-top: 0; }
}

@supports (padding: env(safe-area-inset-top)) {
    .modal-content { padding-bottom: env(safe-area-inset-bottom); }
}

/* Touch optimizations */
.tile, .card-row, .btn, .header-action-btn, .modal-close {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.tab-content, .modal-body {
    -webkit-overflow-scrolling: touch;
}

/* Draft note */
.draft-note { font-size: 13px; color: #9ca3af; margin-top: 8px; text-align: center; }

/* Points redeem button */
.points-redeem-btn { margin-top: 16px; width: 100%; padding: 14px; font-size: 15px; border-radius: 12px; background: white; color: #1a237e; font-weight: 700; }
.points-redeem-btn:disabled { background: rgba(255,255,255,0.4); color: rgba(255,255,255,0.7); }

/* Points history */
.points-history { margin-top: 8px; }
.points-history-item { display: flex; justify-content: space-between; align-items: center; background: white; padding: 12px 14px; border-radius: 12px; margin-bottom: 6px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.points-date { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.pts-earned { color: #059669; font-weight: 700; font-size: 14px; }
.pts-redeemed { color: #dc2626; font-weight: 700; font-size: 14px; }

/* Data table - responsive */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: #f9fafb; padding: 8px 6px; text-align: left; font-weight: 600; color: #6b7280; border-bottom: 2px solid #e5e7eb; font-size: 12px; white-space: nowrap; }
.data-table td { padding: 8px 6px; border-bottom: 1px solid #f3f4f6; }
.data-table .amount { text-align: right; font-variant-numeric: tabular-nums; }
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }

/* Statement */
.statement-summary { background: white; padding: 14px 16px; border-radius: 12px; margin: 10px 0; box-shadow: 0 1px 4px rgba(0,0,0,0.04); font-size: 15px; }
.totals { text-align: right; margin-top: 12px; font-size: 15px; }

/* Project filter summary */
.project-summary { background: white; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-left: 4px solid #1a237e; }
.project-summary-title { font-size: 15px; font-weight: 700; color: #1a237e; margin-bottom: 10px; }
.project-summary-title span { font-weight: 400; color: #9ca3af; font-size: 13px; }
.project-summary-row { display: flex; gap: 16px; }
.project-summary-item { flex: 1; }
.project-summary-label { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-bottom: 2px; }
.project-summary-value { font-size: 18px; font-weight: 700; color: #1a237e; }
.project-summary-value.overdue { color: #dc2626; }

/* ─── Product Grid (Promotions & Featured) ─── */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product-card { background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.15s; -webkit-tap-highlight-color: transparent; display: flex; flex-direction: column; }
.product-card:active { transform: scale(0.97); }
.product-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f3f4f6; display: block; }
.product-img-placeholder { display: flex; align-items: center; justify-content: center; color: #d1d5db; font-size: 13px; background: #f9fafb; aspect-ratio: 1; }
.product-info { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 13px; font-weight: 700; color: #1f2937; line-height: 1.3; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-code { font-size: 11px; color: #9ca3af; margin-bottom: 6px; }
.product-prices { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.price-sale { font-size: 16px; font-weight: 800; color: #1a237e; }
.price-original { font-size: 13px; color: #9ca3af; text-decoration: line-through; }
.price-discount { font-size: 11px; font-weight: 700; color: white; background: #dc2626; padding: 2px 6px; border-radius: 6px; }

/* Promo/Featured detail modal */
.promo-detail-img { width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px; background: #f9fafb; margin-bottom: 14px; }
.promo-detail .product-code { font-size: 13px; color: #9ca3af; margin-bottom: 8px; }
.promo-detail p { font-size: 14px; color: #4b5563; line-height: 1.5; margin-bottom: 12px; }
.empty-state { text-align: center; color: #9ca3af; padding: 40px 20px; font-size: 14px; }

/* Error state with retry */
.error-state { text-align: center; padding: 40px 20px; }
.error-state .error-icon { font-size: 40px; margin-bottom: 10px; }
.error-state .error-msg { font-size: 14px; color: #6b7280; margin-bottom: 16px; line-height: 1.5; }

/* Offline banner */
.offline-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #fbbf24; color: #78350f; text-align: center; padding: 10px 16px; font-size: 13px; font-weight: 600; z-index: 200; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

/* Profile modal */
.profile-form .form-group { margin-bottom: 14px; }
.profile-form label { display: block; font-size: 13px; font-weight: 600; color: #6b7280; margin-bottom: 4px; }
.profile-form input { width: 100%; padding: 10px 12px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px; font-family: inherit; }
.profile-form input:focus { border-color: #1a237e; outline: none; }
.profile-form input:disabled { background: #f9fafb; color: #9ca3af; }

/* Responsive for tablets */
@media (min-width: 600px) {
    .tile-grid { grid-template-columns: repeat(3, 1fr); max-width: 600px; margin: 0 auto; }
    .tile-grid.lite-mode { grid-template-columns: 1fr; max-width: 400px; }
    .balance-banner { max-width: 600px; margin: 12px auto 8px; }
    .welcome-bar { max-width: 600px; margin: 0 auto; padding: 18px 20px 6px; }
    #section-container { max-width: 600px; margin: 0 auto; }
}

/* Print */
@media print {
    .app-header, .modal-footer, .header-actions { display: none !important; }
    .modal { position: static; background: none; }
    .modal-content { max-height: none; border-radius: 0; box-shadow: none; }
}
