/* ══════════════════════════════════════════
   МОБИЛ ФИСКАЛ — Premium Dark Design System
   Matching design-preview/index.html
   ══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
  --bg-base:       #03080F;
  --bg-surface:    #060D1A;
  --bg-card:       #0B1628;
  --bg-elevated:   #0E1C34;
  --blue:          #3D7FFF;
  --blue-dim:      #3D7FFF25;
  --blue-glow:     #3D7FFF40;
  --copper:        #E8621C;
  --copper-dim:    #E8621C20;
  --copper-light:  #FFAB60;
  --steel:         #1E3A5F;
  --text-primary:  #EDF2F8;
  --text-secondary:#7A9BB8;
  --text-muted:    #3D5E80;
  --glass-border:  rgba(255,255,255,0.07);
  --glass-teal:    rgba(0,201,167,0.15);
  --font-display:  'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --radius-card:   16px;
  --radius-btn:    10px;
  --sidebar-width: 240px;
}

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

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

/* ── NOISE GRAIN ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── AMBIENT ORBS ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.orb-teal { width: 500px; height: 500px; background: radial-gradient(circle, #3D7FFF18 0%, transparent 70%); top: -150px; right: -150px; }
.orb-gold { width: 400px; height: 400px; background: radial-gradient(circle, #E8621C10 0%, transparent 70%); bottom: 100px; left: -120px; }
.orb-blue { width: 350px; height: 350px; background: radial-gradient(circle, #7C5BF00D 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%,-50%); }

/* ══════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 32px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 24px;
}

.sidebar-favicon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px var(--blue));
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

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

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--blue-dim);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-glow);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.version-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 1px;
}

/* ── CONTENT AREA ── */
.content-area {
  flex: 1;
  padding: 40px 48px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════
   SHARED COMPONENTS
   ══════════════════════════════════════════ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 36px;
}

.label-caps {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #6699FF 60%, #E8621C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.see-all {
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.see-all:hover { opacity: 0.7; }

/* ── CARDS ── */
.glass-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 24px;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--blue), #2D5FDF);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px var(--blue-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--blue-glow);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-btn);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── LOADING ── */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.empty-icon { font-size: 40px; }

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 100px;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ══════════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════════ */
.page-home {}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: transform 0.2s ease;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card--primary {
  border-color: rgba(61, 127, 255, 0.2);
  background: linear-gradient(135deg, var(--bg-card), #0A1930);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-display);
  margin-bottom: 10px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-value--blue { color: var(--blue); }
.stat-value--copper { color: var(--copper-light); }

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.action-card--primary {
  border-color: rgba(61, 127, 255, 0.3);
  box-shadow: 0 0 30px rgba(61, 127, 255, 0.06);
}

.action-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 0 8px 30px var(--blue-glow);
}

.action-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-icon svg {
  width: 22px;
  height: 22px;
  color: var(--blue);
}

.action-icon--copper { background: var(--copper-dim); }
.action-icon--copper svg { color: var(--copper-light); }

.action-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.action-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Receipt Cards */
.receipts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.receipt-card:hover { border-color: rgba(61, 127, 255, 0.2); transform: translateX(2px); }

.receipt-store {
  display: flex;
  align-items: center;
  gap: 14px;
}

.store-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-dim), var(--copper-dim));
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--blue);
  flex-shrink: 0;
}

.store-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.store-location {
  font-size: 12px;
  color: var(--text-muted);
}

.receipt-meta {
  text-align: right;
}

.receipt-total {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.receipt-date, .items-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
   HISTORY PAGE
   ══════════════════════════════════════════ */
.receipts-full-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-card--expandable {
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
}

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.expand-icon {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  margin-left: 12px;
}

.expand-icon.rotated { transform: rotate(180deg); }

.receipt-items {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.items-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: var(--font-display);
  border-bottom: 1px solid var(--glass-border);
}

.items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
}

.items-table td:first-child { color: var(--text-primary); }

.item-total { color: var(--text-primary) !important; font-weight: 600; }

.items-table tfoot td {
  border-top: 1px solid var(--glass-border);
  border-bottom: none;
  font-weight: 700;
  color: var(--text-primary);
}

.total-label { font-family: var(--font-display); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.total-amount { font-size: 15px; color: var(--copper-light) !important; }

.receipt-image-preview {
  margin-top: 16px;
  max-width: 280px;
}

.receipt-image-preview img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

/* ══════════════════════════════════════════
   PRICE COMPARISON PAGE
   ══════════════════════════════════════════ */

.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-btn);
  padding: 11px 14px 11px 40px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--blue); }
.search-input::placeholder { color: var(--text-muted); }

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-btn);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.filter-select:focus { border-color: var(--blue); }

.btn-search {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.btn-search:hover { background: #2D5FDF; }

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.price-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.price-card:hover, .price-card.expanded {
  border-color: rgba(61, 127, 255, 0.25);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.price-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.store-count-badge {
  background: var(--blue-dim);
  border: 1px solid var(--blue-glow);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--blue);
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
}

.price-range {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.price-item {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.price-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.price-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-value--low { color: #22c55e; }
.price-value--high { color: var(--copper-light); }

.best-deal {
  border-top: 1px solid var(--glass-border);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.best-deal-badge {
  background: var(--copper-dim);
  border: 1px solid rgba(232,98,28,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  color: var(--copper-light);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.best-deal-store {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.best-deal-location {
  font-size: 11px;
  color: var(--text-muted);
}

.all-prices {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.all-prices-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-family: var(--font-display);
  margin-bottom: 10px;
}

.store-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.store-price-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.store-price-location {
  font-size: 11px;
  color: var(--text-muted);
}

.store-price-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
}

/* ══════════════════════════════════════════
   SCAN PAGE
   ══════════════════════════════════════════ */

.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  background: var(--bg-card);
  transition: all 0.25s ease;
  position: relative;
}

.upload-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.upload-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--blue-dim);
  border: 1px solid var(--blue-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.upload-icon svg {
  width: 32px;
  height: 32px;
  color: var(--blue);
}

.upload-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upload-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.file-input { display: none; }
.file-input-hidden { display: none; }

.upload-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-btn);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.btn-primary.btn-file-label {
  background: linear-gradient(135deg, var(--blue), #2D5FDF);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px var(--blue-glow);
}

.btn-primary.btn-file-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--blue-glow);
}

.btn-secondary.btn-file-label {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary.btn-file-label:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* Processing */
.processing-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
}

.processing-animation {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 32px;
}

.scan-line {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  animation: scan 1.5s ease-in-out infinite;
}

@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.processing-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
}

.processing-text p {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.processing-text small {
  font-size: 12px;
  color: var(--text-muted);
}

/* Review Form */
.review-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.review-header {}
.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #22c55e;
}

.review-form {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-display);
}

.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--blue); }

.items-review {
  margin-top: 8px;
}

.item-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.item-name { flex: 1; }
.item-qty { width: 80px; }
.item-price { width: 100px; }

.btn-remove {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 8px;
  width: 32px;
  height: 36px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-remove:hover { background: rgba(239, 68, 68, 0.1); }

.review-total {
  text-align: right;
  font-size: 16px;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.review-total strong {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--copper-light);
}

.review-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Error / Success Cards */
.error-card, .success-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.error-card { border: 1px solid rgba(239, 68, 68, 0.3); }
.success-card { border: 1px solid rgba(34, 197, 94, 0.3); }

.error-icon, .success-icon { font-size: 40px; }

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  border: 2px solid rgba(34, 197, 94, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #22c55e;
}

.error-title, .success-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.error-title { color: #ef4444; }
.success-title { color: #22c55e; }

.error-message {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
}

.success-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ══════════════════════════════════════════
   MOBILE HEADER & BOTTOM NAV
   ══════════════════════════════════════════ */
.mobile-header {
  display: none;
}

.bottom-nav {
  display: none;
}

/* ══════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  animation: fade-in 0.2s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 0 80px rgba(0,0,0,0.8);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* Image preview with overlay */
.receipt-image-preview {
  position: relative;
  cursor: pointer;
  display: inline-block;
  margin-top: 16px;
  max-width: 280px;
  border-radius: 10px;
  overflow: hidden;
}

.receipt-image-preview img {
  width: 100%;
  display: block;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  transition: opacity 0.2s;
}

.receipt-image-preview:hover img { opacity: 0.7; }

.image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
}

.receipt-image-preview:hover .image-overlay { opacity: 1; }

/* ══════════════════════════════════════════
   CARD TEXT OVERFLOW FIX
   ══════════════════════════════════════════ */
.store-text {
  min-width: 0;
  flex: 1;
}

.store-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.store-location {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.td-product {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-num {
  white-space: nowrap;
  text-align: right;
}

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET
   ══════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { display: none; }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--blue);
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-surface);
    border-top: 1px solid var(--glass-border);
    z-index: 100;
    backdrop-filter: blur(20px);
  }

  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    padding: 8px 4px;
  }

  .tab-item svg {
    width: 22px;
    height: 22px;
  }

  .tab-item.active, .tab-item:hover { color: var(--blue); }

  .tab-item--scan {
    position: relative;
  }

  .tab-item--scan svg {
    background: linear-gradient(135deg, var(--blue), #2D5FDF);
    padding: 10px;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    margin-top: -18px;
    box-shadow: 0 4px 20px var(--blue-glow);
    color: #fff;
  }

  .tab-item--scan.active svg, .tab-item--scan:hover svg {
    box-shadow: 0 6px 24px var(--blue-glow);
  }

  .app-shell {
    flex-direction: column;
  }

  .content-area {
    padding: 20px 16px 80px;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }

  .store-name, .store-location { max-width: 120px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE
   ══════════════════════════════════════════ */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .price-grid { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: auto; }
  .item-row { flex-wrap: wrap; }
  .item-qty, .item-price { width: calc(50% - 4px); }
  .receipt-row { gap: 8px; }
  .store-name, .store-location { max-width: 100px; }
  .receipt-total { font-size: 14px; }
  .receipt-date, .items-count { font-size: 11px; }
}
