/* ==========================================================================
   ENMANUEL RYD - CLEAN LIGHT THEME (WHITE BACKGROUND & DARK TEXT)
   Aesthetics: Bright White Theme with High Contrast Slate Text & Emerald Accents
   ========================================================================== */

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --accent-emerald: #059669;
    --accent-emerald-hover: #047857;
    --accent-amber: #d97706;
    --accent-cyan: #0284c7;
    --accent-rose: #dc2626;
    --accent-indigo: #4f46e5;

    --border-color: #cbd5e1;
    --border-highlight: #10b981;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
}

/* App Wrapper */
.app-container {
    display: flex;
    flex-direction: column;
    max-width: 1250px;
    width: 100%;
    margin: 0 auto;
    padding: 8px;
    min-height: 100vh;
}

/* Top Rate Header */
.top-rate-header {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-card);
    margin-bottom: 10px;
    width: 100%;
}

@media (min-width: 768px) {
    .top-rate-header {
        flex-direction: row;
        justify-content: space-between;
        padding: 14px 20px;
    }
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.brand-logo-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    display: block;
}

.ticket-logo-img {
    max-width: 100%;
    height: auto;
    max-height: 65px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* Exchange Rate Control Card */
.rate-control-card {
    background: #ffffff;
    border: 2px solid var(--accent-emerald);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
}

@media (min-width: 768px) {
    .rate-control-card {
        width: auto;
        justify-content: flex-end;
    }
}

.rate-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-emerald);
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.rate-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--accent-emerald);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    gap: 4px;
}

.currency-symbol {
    color: var(--accent-emerald);
    font-weight: 800;
    font-size: 1rem;
}

.rate-input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    width: 80px;
    text-align: right;
}

.btn-icon-pulse {
    background: var(--accent-emerald);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.rate-presets {
    display: none !important;
}

.preset-btn {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.preset-btn:hover, .preset-btn:active {
    background: var(--accent-emerald);
    color: #ffffff;
    border-color: var(--accent-emerald);
}

/* Nav Tabs */
.nav-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 10px;
    background: #ffffff;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    width: 100%;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 2px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    text-align: center;
    position: relative;
    width: 100%;
}

.tab-btn i {
    font-size: 1.1rem;
}

.tab-btn.active {
    background: var(--accent-emerald);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.cart-count-badge {
    background: var(--accent-rose);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    position: absolute;
    top: 2px;
    right: 2px;
}

/* Main Content Panes */
.main-content {
    width: 100%;
}

.tab-pane {
    display: none;
    width: 100%;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

/* POS Layout Grid */
.pos-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

@media (min-width: 850px) {
    .pos-layout {
        display: grid;
        grid-template-columns: 1fr 360px;
    }
}

/* Search Bar & Category Filters */
.search-bar-container {
    margin-bottom: 10px;
    width: 100%;
}

.search-input-group {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.search-input-group i {
    color: var(--text-muted);
}

.search-input-group input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 16px;
    font-weight: 600;
}

.btn-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.category-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.pill-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.pill-btn.active {
    background: var(--accent-indigo);
    color: #ffffff;
    border-color: var(--accent-indigo);
}

/* Products Grid - 2 Columns on Mobile */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    width: 100%;
}

@media (min-width: 500px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 10px;
    }
}

.product-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    min-width: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.product-card:active {
    border-color: var(--accent-emerald);
    background: #f0fdf4;
}

.card-category-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--accent-cyan);
    margin-bottom: 2px;
}

.product-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.25;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.product-prices {
    margin-top: auto;
}

.price-usd {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.price-ves {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent-emerald);
}

.stock-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* Cart Card */
.cart-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-shadow: var(--shadow-card);
}

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

.cart-header h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.btn-text-danger {
    background: none;
    border: none;
    color: var(--accent-rose);
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 700;
}

.cart-items-list {
    overflow-y: auto;
    max-height: 220px;
    margin-bottom: 10px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
    gap: 4px;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price-unit {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 3px;
}

.btn-qty {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-qty {
    font-weight: 800;
    font-size: 0.85rem;
    min-width: 16px;
    text-align: center;
    color: var(--text-primary);
}

.item-total-ves {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--accent-emerald);
    font-size: 0.85rem;
    text-align: right;
    min-width: 65px;
}

.empty-cart-msg {
    text-align: center;
    padding: 20px 8px;
    color: var(--text-muted);
}

.empty-cart-msg i {
    font-size: 1.8rem;
    margin-bottom: 6px;
    opacity: 0.4;
}

/* Totals Box */
.cart-totals-box {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 10px;
    border: 1px solid var(--border-color);
    width: 100%;
}

.total-row-secondary {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.total-row-main {
    background: #ecfdf5;
    border: 1.5px solid var(--accent-emerald);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.total-ves-label span {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--accent-emerald);
    display: block;
}

.total-ves-label small {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 600;
}

.total-ves-amount {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-emerald);
}

/* Change Calculator */
.change-calculator {
    border-top: 1px solid var(--border-color);
    padding-top: 6px;
    margin-bottom: 8px;
}

.calc-header {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.input-with-select {
    display: flex;
    gap: 4px;
}

.input-with-select input {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
}

.input-with-select select {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--accent-amber);
    padding: 6px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 14px;
}

.calc-result {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    flex-wrap: wrap;
    font-weight: 700;
}

.calc-result strong {
    color: var(--accent-amber);
}

.btn-primary-action {
    width: 100%;
    background: var(--accent-emerald);
    color: #ffffff;
    border: none;
    padding: 10px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: var(--shadow-glow);
}

/* Inventory Table */
.inventory-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    width: 100%;
}

@media (min-width: 600px) {
    .inventory-toolbar {
        flex-direction: row;
        justify-content: space-between;
    }
}

.inv-stats {
    display: flex;
    gap: 6px;
}

.stat-badge {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.table-responsive {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    width: 100%;
    box-shadow: var(--shadow-card);
    -webkit-overflow-scrolling: touch;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

.custom-table th {
    background: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 800;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
}

/* Form Container */
.form-container-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
    width: 100%;
    box-shadow: var(--shadow-card);
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

@media (min-width: 600px) {
    .form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .span-2 { grid-column: span 2; }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-group label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.form-group input, .form-group select {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 8px;
}

.btn-submit {
    flex: 1;
    background: var(--accent-emerald);
    color: #ffffff;
    border: none;
    padding: 10px;
    border-radius: var(--radius-md);
    font-weight: 800;
}

/* Sync Grid */
.sync-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.sync-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
    text-align: center;
    width: 100%;
    box-shadow: var(--shadow-card);
}

.backup-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.btn-outline, .label-as-button {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
}

/* Modal */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
    max-width: 360px;
    width: 100%;
    color: var(--text-primary);
}

/* ==========================================================================
   ONBOARDING GUIDED TOUR STYLES
   ========================================================================== */
.btn-help-tour {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tour-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 9999;
    pointer-events: auto;
}

.tour-spotlight {
    position: absolute;
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55), 0 0 15px 3px var(--accent-emerald);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
}

.tour-card {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 340px;
    background: #ffffff;
    border: 2px solid var(--accent-emerald);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    animation: tourSlideUp 0.25s ease;
}

@keyframes tourSlideUp {
    from { opacity: 0; transform: translate(-50%, 15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.tour-step-badge {
    background: #ecfdf5;
    color: var(--accent-emerald);
    border: 1px solid var(--accent-emerald);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
}

.tour-skip-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.tour-body {
    text-align: left;
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.tour-pointer-hand {
    font-size: 1.4rem;
    line-height: 1;
    display: inline-block;
    animation: pointPulse 1.2s infinite ease-in-out alternate;
    flex-shrink: 0;
}

@keyframes pointPulse {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-4px) scale(1.15); }
}

.tour-body h3 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.2;
}

.tour-body p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.25;
}

.tour-footer {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.btn-tour-primary {
    flex: 1;
    background: var(--accent-emerald);
    color: #ffffff;
    border: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    cursor: pointer;
    font-size: 0.78rem;
}

.btn-tour-secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.78rem;
}

