/* ============================================================
   LUCENTO Telegram Web App — Styles
   Brand: #61243C (wine) — identical to Android app
   ============================================================ */

:root, [data-theme="light"] {
    --brand: #61243C;
    --brand-light: #8B3A5A;
    --brand-dark: #3E1527;
    --bg: #F7F2EF;
    --bg-primary: #FEFBF9;
    --bg-card: #FFFFFF;
    --text: #1A1119;
    --text2: #7D6B78;
    --text3: #B8A5B2;
    --separator: #EDE5E9;
    --red: #C62828;
    --green: #2E7D32;
    --orange: #E65100;
    --blue: #61243C;
}

[data-theme="dark"] {
    --bg: #1C1C1E;
    --bg-primary: #1C1C1E;
    --bg-card: #2C2C2E;
    --text: #F2F2F7;
    --text2: #AEAEB2;
    --text3: #636366;
    --separator: #38383A;
}

/* Auto theme — light by default, dark only if user explicitly sets it */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overscroll-behavior: none; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    position: relative;
}

/* 56px = Telegram header height on Android/iOS */
.screen { display: none; padding: 8px 16px; padding-top: var(--safe-top, 50px); padding-bottom: 110px; overflow-y: auto; overflow-x: hidden; height: 100%; }
.screen.active { display: block; }

/* Главная — всё в один экран без скролла */

/* Маска под шапкой Telegram — контент уходит под неё при скролле */
.screen::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--safe-top, 50px);
    background: var(--bg);
    z-index: 10;
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 28px;
    position: relative;
    width: 100%;
    min-height: calc(100vh - var(--safe-top, 50px) - 60px);
}

.login-spacer { flex: 1; }

.login-logo { text-align: center; margin-bottom: 40px; width: 100%; }

.logo-img { width: 85%; max-width: 360px; height: auto; }

/* Логотип: светлая тема — обычный, тёмная — настоящий белый (с верными цветами флага) */
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: inline-block; }

.lang-selector {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--separator);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    width: 100%;
}

.phone-input {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1.5px solid var(--separator);
    border-radius: 18px;
    padding: 0 14px;
    height: 56px;
    width: 100%;
    margin-bottom: 8px;
}

.country-code {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid var(--separator);
    cursor: pointer;
    white-space: nowrap;
}

.phone-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 17px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
}

.error-text {
    color: var(--red);
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 8px;
}

.sms-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.sms-subtitle { font-size: 14px; color: var(--text2); text-align: center; margin-bottom: 24px; }

/* Ввод кода — 4 отдельных бокса, идентично Android (56×64dp, рамка 1.5px, радиус 16) */
.sms-boxes { display: flex; gap: 12px; justify-content: center; margin-bottom: 24px; }

.sms-box {
    width: 56px;
    height: 64px;
    border: 1.5px solid var(--separator);
    border-radius: 16px;
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.2s;
}

.sms-box:focus { border-color: var(--brand); }

.login-footer { font-size: 11px; color: var(--text3); text-align: center; padding-bottom: 16px; }

/* ============================================================
   POLICY
   ============================================================ */

.policy-container { padding: 20px; max-height: 70vh; overflow-y: auto; }
.policy-text { font-size: 14px; line-height: 1.7; color: var(--text2); white-space: pre-line; }
.policy-buttons { display: flex; gap: 12px; padding: 16px 20px; }
.btn-decline {
    flex: 1; height: 56px; border: 1.5px solid var(--separator); border-radius: 18px;
    background: var(--bg-card); color: var(--text2); font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand), var(--brand-light));
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    margin-top: 12px;
    transition: opacity 0.2s;
}

.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; }

.btn-link { background: none; border: none; color: var(--brand); font-size: 14px; font-family: inherit; cursor: pointer; padding: 12px; margin-top: 8px; }
.btn-link:disabled { color: var(--text3); }

.btn-back { background: none; border: none; font-size: 24px; cursor: pointer; padding: 8px; color: var(--text); display: flex; align-items: center; }

.btn-send { width: 44px; height: 44px; background: var(--brand); color: white; border: none; border-radius: 50%; font-size: 20px; cursor: pointer; }

.btn-confirm { margin-top: 20px; }
.btn-confirmed { background: var(--green) !important; pointer-events: none; }

.btn-share {
    width: 100%; height: 48px; background: var(--bg); color: var(--text); border: 1.5px solid var(--separator);
    border-radius: 14px; font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer; margin-top: 8px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ============================================================
   HOME
   ============================================================ */

.home-header {
    display: flex; justify-content: space-between; align-items: flex-start; padding: 2px 0 6px; flex-shrink: 0;
}

.greeting { font-size: 14px; color: var(--text2); }
.user-name { font-size: 24px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.updated { font-size: 11px; color: var(--text3); margin-top: 4px; }

.notification-bell {
    position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--brand);
}

.notification-dot {
    position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; background: var(--red); border-radius: 50%; border: 2px solid var(--bg);
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, #3E1527, #61243C, #8B3A5A);
    border-radius: 20px;
    padding: 22px;
    color: white;
    margin-bottom: 16px;
    min-height: 210px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(61,36,60,0.35), 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


.balance-card.loading {
    background: linear-gradient(135deg, #9E9E9E, #BDBDBD, #E0E0E0);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.balance-card.red {
    background: linear-gradient(135deg, #6D1919, #B71C1C, #E53935);
    box-shadow: 0 8px 24px rgba(183,28,28,0.3), 0 2px 8px rgba(0,0,0,0.15);
}
.balance-card.green {
    background: linear-gradient(135deg, #1B5E20, #2E7D32, #43A047);
    box-shadow: 0 8px 24px rgba(46,125,50,0.3), 0 2px 8px rgba(0,0,0,0.15);
}
.balance-card.orange {
    background: linear-gradient(135deg, #BF360C, #E65100, #F4511E);
    box-shadow: 0 8px 24px rgba(230,81,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
}

.balance-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.balance-logo-img {
    height: 30px;
    width: auto;
}

.balance-status {
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.1);
}


.balance-chip {
    width: 38px;
    height: 28px;
    background: linear-gradient(135deg, #C8952E, #E8C84A, #C8952E);
    border-radius: 5px;
    margin: 10px 0;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.balance-chip::after {
    content: '';
    position: absolute;
    top: 5px; left: 6px; right: 6px; bottom: 5px;
    border: 1.5px solid rgba(180,140,50,0.5);
    border-radius: 2px;
}

.ban-alert {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.balance-amount {
    font-size: clamp(20px, 7vw, 28px);
    font-weight: bold;
    font-style: normal !important;
    font-family: system-ui, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}

.balance-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.balance-currency {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.4;
    letter-spacing: 2px;
}

/* Menu Grid */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; grid-auto-rows: 1fr; align-items: stretch; }

.menu-card {
    background: var(--bg-card); border-radius: 16px; padding: 14px; cursor: pointer;
    position: relative; transition: transform 0.15s;
}

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

.menu-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}

.menu-icon svg { width: 20px; height: 20px; }

/* Exact Android gradient colors from bg_icon_sq_*.xml */
.menu-icon.red { background: linear-gradient(135deg, #EF5350, #C62828); }
.menu-icon.wine { background: linear-gradient(135deg, #8B3A5A, #61243C); }
.menu-icon.green { background: linear-gradient(135deg, #66BB6A, #2E7D32); }
.menu-icon.orange { background: linear-gradient(135deg, #FFA726, #E65100); }
.menu-icon.gold { background: linear-gradient(135deg, #8B3A5A, #61243C); }
.menu-icon.blue { background: linear-gradient(135deg, #8B3A5A, #61243C); }

.menu-title { font-size: 15px; font-weight: 600; }
.menu-sub { font-size: 12px; color: var(--text2); margin-top: 3px; line-height: 1.3; }

.menu-badge {
    position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px;
    background: var(--red); color: white; border-radius: 11px; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; padding: 0 6px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

/* ============================================================
   CONTENT SCREENS
   ============================================================ */

.content-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.content-title { font-size: 18px; font-weight: 700; flex: 1; }

.content-actions { display: flex; gap: 4px; }
.content-actions button {
    width: 36px; height: 36px; border: none; background: none; cursor: pointer; border-radius: 50%; color: var(--text);
    display: flex; align-items: center; justify-content: center;
}
.content-actions button:active { background: var(--separator); }

/* Search bar */
.search-bar {
    display: none; align-items: center; background: var(--bg-card); border: 1.5px solid var(--separator);
    border-radius: 14px; padding: 0 14px; height: 44px; margin-bottom: 12px;
}
.search-bar.visible { display: flex; }
.search-bar input { flex: 1; border: none; outline: none; font-size: 14px; font-family: inherit; color: var(--text); background: transparent; margin-left: 8px; }
.search-bar .btn-clear { border: none; background: none; font-size: 16px; color: var(--text3); cursor: pointer; display: none; }

/* Date badge */
.date-badge { display: flex; justify-content: center; margin-bottom: 12px; }
.date-badge span { background: var(--bg-card); border: 1px solid var(--separator); border-radius: 20px; padding: 6px 16px; font-size: 12px; color: var(--text2); }

/* Period bar */
.period-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 4px; }
.period-bar button { width: 36px; height: 36px; border: none; background: none; color: var(--brand); font-size: 24px; cursor: pointer; border-radius: 50%; }
.period-bar button:active { background: var(--separator); }
.period-bar span { font-size: 13px; font-weight: 500; color: var(--text); }

/* Shimmer skeleton */
.shimmer-item { background: var(--bg-card); border-radius: 14px; padding: 16px; margin-bottom: 8px; }
.shimmer-line { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--separator) 25%, #F0F0F0 50%, var(--separator) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.shimmer-line.w60 { width: 60%; }
.shimmer-line.w40 { width: 40%; margin-top: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Document list */
.doc-list { display: flex; flex-direction: column; gap: 8px; }

.doc-item {
    display: flex; align-items: center; gap: 12px; background: var(--bg-card);
    border-radius: 14px; padding: 16px; cursor: pointer; transition: transform 0.1s;
}
.doc-item:active { transform: scale(0.98); }

.doc-icon {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.doc-icon svg { width: 22px; height: 22px; }
.doc-icon.sale { background: rgba(97,36,60,0.12); color: var(--brand); }
.doc-icon.return { background: rgba(230,81,0,0.12); color: var(--orange); }
.doc-icon.payment { background: rgba(46,125,50,0.12); color: var(--green); }
.doc-icon.pending { background: rgba(230,81,0,0.12); color: var(--orange); }

.doc-info { flex: 1; min-width: 0; }
.doc-number { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-type { font-size: 13px; color: var(--text2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-sum { font-size: 16px; color: var(--brand); margin-top: 5px; white-space: nowrap; }
.doc-status { font-size: 12px; color: var(--orange); font-weight: 700; margin-top: 3px; }
.doc-chevron { color: var(--text3); font-size: 16px; margin-left: 4px; }

/* Detail — Android style (label top, value bottom, dividers) */
/* Detail — matches Android activity_detail.xml */
.detail-card { background: var(--bg-card); border-radius: 16px; padding: 20px; margin-bottom: 16px; }

.detail-field { padding: 0; }
.detail-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.7px; }
.detail-value { font-size: 14px; color: var(--text); margin-top: 2px; }
.detail-value-lg { font-size: 17px; font-weight: 700; color: var(--text); margin-top: 2px; }
.detail-value-sum { font-size: 20px; font-weight: 700; color: var(--brand); margin-top: 2px; }
.detail-divider { height: 1px; background: var(--separator); margin: 16px 0; }

.detail-section-title { font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--text2); }

/* Products — flat list like Android */
.products-card { background: var(--bg-card); border-radius: 16px; overflow: hidden; }
.product-row { display: flex; align-items: center; padding: 12px 16px; cursor: pointer; }
.product-row:active { background: var(--separator); }
.product-index { width: 24px; height: 24px; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--text2); flex-shrink: 0; margin-right: 12px; }
.product-info { flex: 1; min-width: 0; }
.product-name { font-size: 13px; color: var(--text); max-lines: 2; overflow: hidden; text-overflow: ellipsis; }
.product-qty { font-size: 11px; color: var(--text2); margin-top: 2px; }
.product-sum { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; margin-left: 8px; }
.product-divider { height: 1px; background: var(--separator); margin-left: 52px; }
.product-detail-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--separator); }
.product-detail-row:last-child { border: none; }
.product-detail-row span:first-child { color: var(--text2); }

/* Confirmation animation */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 200; animation: fadeIn 0.3s; }
.confirm-success { width: 120px; height: 120px; background: var(--green); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 50px; color: white; animation: bounceIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Price */
.price-item {
    display: flex; justify-content: space-between; align-items: center; background: var(--bg-card);
    border-radius: 14px; padding: 14px 16px; animation: staircase 0.4s ease-out both;
}
.price-info { flex: 1; }
.price-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-article { font-size: 11px; color: var(--text2); margin-top: 2px; }
.price-value { font-size: 15px; font-weight: 700; color: var(--brand); white-space: nowrap; }
@keyframes staircase { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */

.notif-item { display: flex; gap: 12px; background: var(--bg-card); border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; position: relative; }
.notif-stripe { width: 4px; border-radius: 2px; flex-shrink: 0; }
.notif-stripe.info { background: var(--brand); }
.notif-stripe.success { background: var(--green); }
.notif-stripe.warning { background: var(--orange); }
.notif-stripe.error { background: var(--red); }
.notif-content { flex: 1; }
.notif-message { font-size: 14px; font-weight: 600; }
.notif-details { font-size: 12px; color: var(--text2); margin-top: 4px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 6px; }
.notif-unread { width: 8px; height: 8px; background: var(--brand); border-radius: 50%; position: absolute; top: 16px; right: 16px; }

/* ============================================================
   INFO
   ============================================================ */

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 8px; }
.info-card { background: var(--bg-card); border-radius: 20px; padding: 18px; cursor: pointer; transition: transform 0.15s; min-height: 130px; }
.info-card:active { transform: scale(0.97); }
.info-icon { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.info-icon svg { width: 24px; height: 24px; }
.info-icon svg { width: 24px; height: 24px; }
.info-icon.red { background: linear-gradient(135deg, #E53935, #C62828); }
.info-icon.green { background: linear-gradient(135deg, #43A047, #2E7D32); }
.info-icon.gold { background: linear-gradient(135deg, var(--brand-light), var(--brand)); }
.info-icon.blue { background: linear-gradient(135deg, var(--brand-light), var(--brand)); }
.info-title { font-size: 15px; font-weight: 700; }

/* ============================================================
   SETTINGS
   ============================================================ */

.settings-section { padding-top: 8px; }

/* QR Card — dark wine background like Android */
.qr-container {
    background: var(--brand);
    border-radius: 28px;
    padding: 28px 24px 24px;
    text-align: center;
    margin-bottom: 12px;
    cursor: pointer;
}

.qr-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.87);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.qr-code-wrapper {
    display: inline-block;
    background: white;
    border-radius: 20px;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.qr-code-wrapper svg,
.qr-code-wrapper div {
    border-radius: 16px;
}

.qr-label {
    font-size: 14px;
    color: rgba(255,255,255,0.4);
    margin-top: 20px;
    line-height: 1.4;
}

/* QR Grid (6 cards, 2x3) */
.qr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
    height: calc(100vh - var(--safe-top, 50px) - 160px);
}

.qr-grid-card {
    background: var(--bg-card);
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.qr-grid-card:active { transform: scale(0.97); }

.qr-card-number {
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text3);
}

.qr-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.qr-card-tap {
    font-size: 11px;
    color: var(--text2);
    text-align: center;
    max-width: 100px;
    line-height: 1.3;
}

.qr-card-code {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 12px 12px;
    width: 100%;
    height: 100%;
}

.qr-card-code svg {
    max-width: 100%;
    max-height: 100%;
}

.settings-card { background: var(--bg-card); border-radius: 24px; margin-bottom: 12px; overflow: hidden; }

.settings-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 16px; height: 56px; font-size: 14px; border-bottom: 1px solid var(--separator);
}
.settings-row:last-child { border: none; }
.settings-row.clickable { cursor: pointer; }
.settings-row.clickable:active { background: var(--separator); }
.settings-row.logout span { color: var(--red); }

.settings-label { display: flex; align-items: center; gap: 14px; }
.settings-label svg { flex-shrink: 0; color: var(--brand); }
.settings-row.logout .settings-label svg { color: var(--red); }

.settings-version { text-align: center; font-size: 11px; color: var(--text3); margin-top: 16px; }

/* ============================================================
   BOTTOM SHEET (reusable)
   ============================================================ */

.bottom-sheet-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 200;
    transition: background 0.3s;
}
.bottom-sheet-overlay.open { background: rgba(0,0,0,0.4); }

.bottom-sheet {
    position: fixed; bottom: -100%; left: 0; right: 0;
    background: var(--bg-card); border-radius: 20px 20px 0 0;
    padding: 0 20px 32px; max-height: 80vh; overflow-y: auto;
    transition: bottom 0.3s ease-out; z-index: 201;
}
.bottom-sheet-overlay.open .bottom-sheet { bottom: 0; }

.sheet-handle { width: 36px; height: 4px; background: var(--separator); border-radius: 2px; margin: 10px auto 16px; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sheet-title { font-size: 18px; font-weight: 700; }
.sheet-close { background: none; border: none; font-size: 24px; color: var(--text3); cursor: pointer; padding: 4px; }
.sheet-body { }
.sheet-text { font-size: 14px; line-height: 1.7; color: var(--text2); word-break: break-word; }
.sheet-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 0; border-bottom: 1px solid var(--separator);
    font-size: 15px; cursor: pointer; color: var(--brand);
}
.sheet-btn:last-child { border: none; }
.sheet-btn.active { font-weight: 700; }
.sheet-btn svg { width: 20px; height: 20px; }

/* ============================================================
   OFFLINE BANNER
   ============================================================ */

.offline-banner {
    position: fixed; top: 0; left: 0; right: 0;
    background: var(--red); color: white;
    padding: 8px 16px; font-size: 13px; font-weight: 600;
    text-align: center; z-index: 999;
    display: flex; align-items: center; justify-content: center;
}

/* Баннер «слабое соединение» — янтарный, поверх контента (как в Android) */
.weak-banner {
    position: fixed; top: 0; left: 0; right: 0;
    background: #B26A00; color: white;
    padding: 8px 16px; font-size: 13px; font-weight: 600;
    text-align: center; z-index: 998;
    display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   POLICY SECTIONS
   ============================================================ */

/* Политика компании — единая карточка с разделителями (как в Android) */
.policy-sections { background: var(--bg-card); border-radius: 16px; overflow: hidden; }
.policy-section {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; cursor: pointer; transition: background 0.1s;
    border-bottom: 1px solid var(--separator);
}
.policy-section:last-child { border-bottom: none; }
.policy-section:active { background: var(--bg); }
.policy-section-title { font-size: 14px; font-weight: 500; flex: 1; }
.policy-section svg { color: var(--text3); flex-shrink: 0; }

/* ============================================================
   DATE PICKER
   ============================================================ */

.date-input {
    width: 100%; height: 48px; border: 1.5px solid var(--separator);
    border-radius: 14px; padding: 0 14px; font-size: 15px;
    font-family: inherit; color: var(--text); background: var(--bg);
    outline: none; margin-top: 6px;
}
.date-input:focus { border-color: var(--brand); }

/* ============================================================
   ERROR CODE
   ============================================================ */

.error-code {
    font-size: 11px; color: var(--text3); font-family: monospace;
    margin-top: 8px;
}

/* ============================================================
   CHAT
   ============================================================ */

.chat-container { display: flex; flex-direction: column; height: calc(100vh - var(--safe-top, 50px) - 150px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 8px 0; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 16px; margin-bottom: 8px; font-size: 14px; }
.chat-bubble.user { background: var(--brand); color: white; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-text { line-height: 1.4; }
.chat-time { font-size: 10px; opacity: 0.6; margin-top: 4px; text-align: right; }

.chat-input-bar { display: flex; gap: 8px; padding: 8px 0; align-items: center; flex-shrink: 0; }
.chat-input-bar input { flex: 1; height: 44px; border: 1.5px solid var(--separator); border-radius: 22px; padding: 0 16px; font-size: 14px; font-family: inherit; outline: none; background: var(--bg-card); }
.chat-input-bar input:focus { border-color: var(--brand); }

/* ============================================================
   BOTTOM NAV
   ============================================================ */

#bottomNav {
    display: none; justify-content: space-around;
    background: var(--bg-card); border-top: 1px solid var(--separator);
    padding: 6px 0;
    padding-bottom: var(--safe-bottom, 48px);
    z-index: 100; position: fixed; bottom: 0; left: 0; right: 0;
}

.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
    padding: 4px 16px; color: var(--text3); font-size: 10px; font-weight: 500; transition: color 0.2s;
}
.nav-item.active { color: var(--brand); }

/* Catalog — нативная сетка товаров (как на сайте lucento.uz) */
.catalog-head { padding: 4px 0 12px; }
.catalog-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; }

/* Панель фильтра + сортировка */
.catalog-bar { display: flex; gap: 8px; align-items: center; }
.cat-filter-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 14px; border: 1px solid var(--separator); border-radius: 12px;
    background: var(--bg-card); color: var(--text); font-size: 13px; font-weight: 600;
    font-family: inherit; cursor: pointer; white-space: nowrap;
}
.cat-filter-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cat-filter-ic { display: flex; }
.cat-filter-ic svg { width: 16px; height: 16px; }
.cat-sort {
    flex: 1; min-width: 0; padding: 9px 30px 9px 12px;
    border: 1px solid var(--separator); border-radius: 12px;
    background: var(--bg-card); color: var(--text); font-size: 13px; font-family: inherit;
    -webkit-appearance: none; appearance: none; cursor: pointer; outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B8A5B2' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}

/* Кнопка «Наверх» */
.cat-scroll-top {
    position: fixed; right: 16px; bottom: calc(70px + var(--safe-bottom, 48px));
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: var(--brand); color: #fff; cursor: pointer; z-index: 60;
    box-shadow: 0 4px 14px rgba(61,36,60,0.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.cat-scroll-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.cat-scroll-top svg { width: 22px; height: 22px; transform: rotate(90deg); }

/* Шторка фильтра */
.filter-sheet {
    background: var(--bg-card); width: 100%; max-height: 80vh; overflow-y: auto;
    border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + var(--safe-bottom, 20px));
}
.filter-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--separator); margin: 4px auto 12px; }
.filter-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.filter-section { margin-bottom: 16px; }
.filter-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); font-weight: 700; margin-bottom: 8px; }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip {
    padding: 8px 14px; border: 1px solid var(--separator); border-radius: 20px;
    background: var(--bg); color: var(--text2); font-size: 13px; font-family: inherit;
    cursor: pointer; white-space: nowrap; transition: all .15s;
}
.fchip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.filter-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn-reset {
    flex: 1; height: 52px; border: 1.5px solid var(--separator); border-radius: 16px;
    background: var(--bg-card); color: var(--text2); font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.filter-apply { flex: 2; margin-top: 0 !important; height: 52px; }

.catalog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.catalog-empty { text-align: center; color: var(--text2); padding: 40px 16px; font-size: 14px; }
.catalog-empty .btn-link { margin-top: 8px; }

.cat-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.cat-card:active { transform: scale(0.97); }

.cat-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.cat-card-img img { width: 100%; height: 100%; object-fit: cover; }

.cat-card-body { padding: 10px 12px 12px; }
.cat-card-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.cat-card-meta { font-size: 11px; color: var(--text2); margin-bottom: 2px; }
.cat-card-proba { font-size: 11px; color: var(--text2); margin-bottom: 2px; }
.cat-card-weight { font-size: 11px; color: var(--brand); font-weight: 600; }

/* Подробная карточка товара (экран «Подробнее») */
.cat-prod { padding-bottom: 24px; }
.cat-prod-img { width: 100%; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; margin-bottom: 16px; background: var(--bg-card); }
.cat-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-prod-name { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.cat-prod-row { font-size: 14px; color: var(--text2); padding: 3px 0; }
.cat-prod-cat { color: var(--brand); font-weight: 600; }
.cat-prod-block { margin-top: 18px; }
.cat-prod-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); font-weight: 700; margin-bottom: 8px; }
.cat-prod-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.cat-variant { background: var(--bg-card); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.cat-variant-desc { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cat-variant-weight { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.cat-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-size { font-size: 12px; background: var(--bg); border: 1px solid var(--separator); border-radius: 8px; padding: 4px 10px; color: var(--text); }
.nav-icon { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.nav-icon svg { width: 24px; height: 24px; }

/* ============================================================
   UTILS
   ============================================================ */

.loader { width: 32px; height: 32px; border: 3px solid var(--separator); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }

.refresh-spinner {
    position: fixed; top: var(--safe-top, 50px); left: 0; right: 0;
    display: none; justify-content: center; padding: 12px 0;
    z-index: 200;
}
.refresh-spinner .loader { width: 24px; height: 24px; margin: 0; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; color: var(--text2); padding: 40px 20px; font-size: 14px; line-height: 1.6; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* Telegram safe area */
