:root { --bg: #000; --card: #151517; --accent: #FF8C00; --border: #242426; --text-muted: #8e8e93; }
body { background: var(--bg); color: #fff; font-family: sans-serif; margin: 0 auto; max-width: 600px; padding-bottom: 90px; position: relative; min-height: 100vh; box-shadow: 0 0 20px rgba(0,0,0,0.8); }

.header { display: flex; justify-content: center; align-items: center; padding: 130px 20px 20px 20px; border-bottom: 1px solid var(--border); font-weight: bold; position: relative; }
.logo { position: absolute; right: 20px; width: 35px; height: 35px; border-radius: 50%; object-fit: cover; bottom: 12px; transition: outline 0.3s ease; }
.logo.premium-ring { outline: 2px solid var(--accent); outline-offset: 2px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px; }
.grid-item { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; text-align: center; cursor: pointer; transition: 0.2s; }
.grid-item:active { opacity: 0.7; }

.admin-btn { background: rgba(255, 140, 0, 0.1); border: 1px solid var(--accent); color: var(--accent); padding: 15px; border-radius: 16px; text-align: center; font-weight: bold; margin: 0 20px 20px 20px; cursor: pointer; display: none; transition: 0.2s; }
.admin-btn:active { opacity: 0.7; }
.admin-btn.support-mode { background: #1c1c1e; border: 1px solid #2c2c2e; color: #fff; }

.section-title { padding: 0 20px; font-size: 18px; font-weight: bold; margin-top: 10px; margin-bottom: 10px;}

.spy-container { padding: 0 20px; display: flex; flex-direction: column; gap: 12px; }
.spy-item, .promo-item { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; justify-content: space-between; align-items: center; position: relative; transition: transform 0.2s ease; touch-action: pan-y; overflow: hidden; }
.spy-item.swiping, .promo-item.swiping { transition: none; }
.spy-info { display: flex; flex-direction: column; gap: 4px; }
.spy-title { font-weight: bold; font-size: 15px; color: #fff; }
.spy-sku { color: var(--text-muted); font-size: 12px; }
.spy-prices { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 12px; }
.price-new { color: #32d74b; font-weight: bold; font-size: 16px; }
.price-normal { color: #fff; font-weight: bold; font-size: 16px; }

.swipe-hint { text-align: center; color: var(--text-muted); font-size: 12px; font-style: italic; margin-top: 15px; display: none; }
.empty-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 600px; background: #0c0c0d; display: flex; justify-content: space-around; padding: 10px 0 calc(10px + var(--tg-safe-area-inset-bottom, 0px)) 0; border-top: 1px solid var(--border); z-index: 90; }
.nav-item { text-align: center; color: var(--text-muted); font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nav-item.active { color: var(--accent); }
.nav-item img, .nav-item span.icon { font-size: 20px; }

.overlay { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 600px; height: 100%; background: rgba(0,0,0,0.9); display: none; flex-direction: column; justify-content: flex-end; z-index: 3000; }
.form { background: var(--card); padding: 30px 20px calc(30px + var(--tg-safe-area-inset-bottom, 0px)) 20px; border-radius: 25px 25px 0 0; max-height: 85vh; overflow-y: auto; }
input, select, textarea { width: 100%; padding: 16px; background: #2c2c2e; border: none; border-radius: 12px; color: #fff; margin-bottom: 15px; box-sizing: border-box; font-size: 16px; font-family: sans-serif; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }
textarea { resize: vertical; min-height: 100px; }
.btn { background: var(--accent); color: #000; padding: 18px; border-radius: 12px; text-align: center; font-weight: bold; cursor: pointer; margin-bottom: 10px; transition: 0.2s; display: flex; justify-content: center; align-items: center; gap: 8px;}
.btn:active { opacity: 0.8; }
.btn-secondary { background: #2c2c2e; color: #fff; padding: 18px; border-radius: 12px; text-align: center; font-weight: bold; cursor: pointer; margin-bottom: 15px; display: flex; justify-content: center; align-items: center; gap: 8px;}

.accordion-btn { display: flex; justify-content: space-between; align-items: center; }
.chevron { width: 8px; height: 8px; border-right: 2px solid #8e8e93; border-bottom: 2px solid #8e8e93; transform: rotate(45deg); transition: transform 0.3s; }
.chevron.expanded { transform: rotate(-135deg); }

.info-link { color: var(--accent); text-align: center; font-size: 14px; margin-bottom: 20px; cursor: pointer; text-decoration: underline; }
.security-text { font-size: 12px; color: var(--text-muted); font-style: italic; text-align: center; margin-top: 15px; line-height: 1.4; }
.store-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.store-item { background: #2c2c2e; padding: 15px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; }
.delete-btn { color: #ff3b30; cursor: pointer; font-size: 18px; padding: 5px; }

.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 15px; padding: 0 20px 20px 20px; -ms-overflow-style: none; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel-card { flex: 0 0 85%; scroll-snap-align: center; }
.carousel-spacer { flex: 0 0 10%; scroll-snap-align: center; } 
.dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 25px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3a3a3c; transition: 0.3s; }
.dot.active { background: var(--accent); }
.plan-card { background: #2c2c2e; border: 1px solid var(--border); border-radius: 16px; padding: 20px; text-align: left; height: 100%; display: flex; flex-direction: column; box-sizing: border-box;}
.plan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.plan-title { font-size: 18px; font-weight: bold; color: #fff; }
.plan-price { font-size: 16px; font-weight: bold; color: var(--accent); }
.plan-features { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 15px; flex-grow: 1; }
.plan-features span { color: #fff; font-weight: bold; }
.plan-card .btn, .plan-card .btn-secondary { padding: 14px; font-size: 15px !important; margin-bottom: 0; min-height: auto; }
.qty-control { display: flex; justify-content: space-between; align-items: center; background: #2c2c2e; padding: 10px 20px; border-radius: 12px; margin-bottom: 20px; }
.qty-btn { background: var(--card); color: #fff; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; border-radius: 8px; font-size: 20px; font-weight: bold; cursor: pointer; user-select: none; }
.qty-btn.disabled { opacity: 0.3; cursor: not-allowed; }
.qty-value { font-size: 18px; font-weight: bold; }
.breakdown-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.breakdown-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: bold; color: #fff; margin-top: 15px; border-top: 1px solid var(--border); padding-top: 15px; margin-bottom: 20px; }

/* === АДМИН ПАНЕЛЬ === */
.admin-tabs { display: flex; gap: 10px; padding: 0 20px; margin-bottom: 20px; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { padding: 10px 15px; background: #2c2c2e; border-radius: 12px; font-size: 14px; color: var(--text-muted); white-space: nowrap; cursor: pointer; transition: 0.2s; }
.admin-tab.active { background: var(--accent); color: #000; font-weight: bold; }
.admin-panel-content { padding: 0 20px; display: none; }
.admin-panel-content.active { display: block; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 15px;}
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 15px; text-align: center; display: flex; flex-direction: column; justify-content: center;}
.stat-value { font-size: 24px; font-weight: bold; color: var(--accent); margin-bottom: 5px; }
.stat-label { font-size: 12px; color: var(--text-muted); line-height: 1.2;}

.ticket-item { background: #2c2c2e; padding: 16px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; cursor: pointer; position: relative; }
.granted-item { background: #2c2c2e; padding: 16px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; cursor: pointer; position: relative; transition: transform 0.2s ease; touch-action: pan-y; }
.granted-item.swiping { transition: none; }

.ticket-info { display: flex; flex-direction: column; gap: 3px; flex-grow: 1; overflow: hidden; }
.ticket-name { font-weight: bold; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-id { font-size: 12px; color: var(--text-muted); }
.unread-badge { background: #ff3b30; color: #fff; font-size: 12px; font-weight: bold; padding: 4px 8px; border-radius: 12px; margin-left: 10px;}

.avatar-circle { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 140, 0, 0.2); border: 1px solid var(--accent); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; flex-shrink: 0; margin-right: 15px; text-transform: uppercase;}

.attach-btn { font-size: 24px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; padding: 0 10px; transition: 0.2s; }
.attach-btn:active { color: var(--accent); }
.preview-container { padding: 10px 0; display: none; position: relative; }
.preview-img { max-height: 100px; border-radius: 8px; border: 1px solid var(--border); }
.preview-close { position: absolute; top: 0; left: 80px; background: #ff3b30; color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 12px; cursor: pointer; }

/* === SVG АНИМАЦИЯ === */
.refresh-icon { display: flex; align-items: center; justify-content: center; }
.refresh-icon svg { width: 18px; height: 18px; fill: currentColor; }
.spin .refresh-icon svg { animation: spin 1s ease-in-out; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* === ЧАТ (Мессенджер) === */
#chatView { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: var(--bg); z-index: 2000; display: flex; flex-direction: column; touch-action: pan-y; }
.chat-header { padding: calc(60px + var(--tg-safe-area-inset-top, 0px)) 20px 15px 20px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.chat-back { color: var(--accent); cursor: pointer; font-size: 16px; display: flex; align-items: center; gap: 5px; }
.chat-info-btn { font-size: 20px; cursor: pointer; color: var(--accent); display: flex; align-items: center; justify-content: flex-end; width: 40px; }
.chat-messages { flex-grow: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: calc(100px + var(--tg-safe-area-inset-bottom, 0px)); }
.bubble { max-width: 80%; padding: 12px 16px; border-radius: 18px; font-size: 15px; line-height: 1.4; position: relative; word-wrap: break-word; }
.bubble-user { background: #2c2c2e; color: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble-admin { background: var(--accent); color: #000; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble-time { font-size: 10px; opacity: 0.6; margin-top: 5px; text-align: right; display: block; }
.bubble-img { max-width: 100%; border-radius: 8px; margin-bottom: 5px; display: block; cursor: pointer; border: 1px solid var(--border); } 

.chat-input-wrapper { position: fixed; bottom: 0; width: 100%; max-width: 600px; background: var(--card); border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.chat-input-area { padding: 10px 20px calc(10px + var(--tg-safe-area-inset-bottom, 0px)) 10px; display: flex; gap: 5px; align-items: center; box-sizing: border-box;}
.chat-input-area input { margin-bottom: 0; flex-grow: 1; border-radius: 20px; padding: 12px 16px; }
.send-btn { background: var(--accent); width: 44px; height: 44px; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #000; font-size: 20px; cursor: pointer; flex-shrink: 0;}

/* Модалка Инфо */
.info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; margin-bottom: 0; }
.info-label { color: var(--text-muted); font-size: 14px; }
.info-value { font-weight: bold; color: #fff; font-size: 15px; text-align: right; }
.info-copy { cursor: pointer; transition: 0.2s; }
.info-copy:active { color: var(--accent); opacity: 0.7; }

/* ПОЛНОЭКРАННЫЙ ПРОСМОТРЩИК ФОТО */
#imageViewerOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.95); z-index: 4000; display: none; justify-content: center; align-items: center; flex-direction: column; }
.viewer-img { max-width: 95%; max-height: 80vh; object-fit: contain; border-radius: 12px; }
/* Кнопка закрытия просмотра */
.close-viewer-btn { position: absolute; top: calc(60px + var(--tg-safe-area-inset-top, 0px)); right: 20px; color: #fff; font-size: 20px; cursor: pointer; background: rgba(255,255,255,0.2); width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
