:root {
  color-scheme: dark;
  --bg-base: #21181c;
  --bg-deep: #120f11;
  --bg-accent: #b98491;
  --bg-gold: #d7b56d;
  --bg-muted: rgba(255, 246, 241, 0.08);
  --surface: rgba(31, 24, 28, 0.82);
  --surface-solid: #2b2226;
  --surface-soft: rgba(255, 246, 241, 0.11);
  --line: rgba(255, 232, 204, 0.18);
  --text: #fff7f4;
  --muted: rgba(255, 247, 244, 0.72);
  --quiet: rgba(255, 247, 244, 0.52);
  --gold: #e3c06e;
  --rose: #d69aaa;
  --green: #88b0a0;
  --blue: #8ea6b8;
  --danger: #e58c8c;
  --radius: 8px;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  --theme-gradient:
    linear-gradient(135deg, rgba(45, 32, 38, 0.95), rgba(18, 15, 17, 0.92)),
    linear-gradient(45deg, rgba(214, 154, 170, 0.22), rgba(227, 192, 110, 0.12));
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    var(--theme-gradient),
    repeating-linear-gradient(110deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 22px);
  transition: background 420ms ease, opacity 420ms ease;
}

.app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.42)),
    radial-gradient(ellipse at top, rgba(255, 255, 255, 0.08), transparent 55%);
  pointer-events: none;
}

.video-layer {
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0;
  transition: opacity 420ms ease;
  overflow: hidden;
}

.video-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-theme="catalog"] { --theme-gradient: linear-gradient(135deg, rgba(43, 34, 38, 0.95), rgba(17, 17, 18, 0.94)), linear-gradient(60deg, rgba(227, 192, 110, 0.16), rgba(136, 176, 160, 0.12)); }
body[data-theme="bags"] { --theme-gradient: linear-gradient(135deg, rgba(40, 28, 30, 0.95), rgba(18, 15, 17, 0.94)), linear-gradient(60deg, rgba(214, 154, 170, 0.23), rgba(227, 192, 110, 0.18)); }
body[data-theme="perfume"] { --theme-gradient: linear-gradient(135deg, rgba(35, 28, 35, 0.95), rgba(18, 15, 20, 0.94)), linear-gradient(60deg, rgba(190, 145, 178, 0.22), rgba(227, 192, 110, 0.13)); }
body[data-theme="oils"] { --theme-gradient: linear-gradient(135deg, rgba(27, 35, 31, 0.95), rgba(15, 18, 16, 0.94)), linear-gradient(60deg, rgba(136, 176, 160, 0.24), rgba(227, 192, 110, 0.14)); }
body[data-theme="accessories"] { --theme-gradient: linear-gradient(135deg, rgba(32, 31, 35, 0.95), rgba(15, 15, 18, 0.94)), linear-gradient(60deg, rgba(142, 166, 184, 0.22), rgba(227, 192, 110, 0.14)); }
body[data-theme="cart"] { --theme-gradient: linear-gradient(135deg, rgba(38, 31, 33, 0.96), rgba(16, 15, 16, 0.95)), linear-gradient(60deg, rgba(214, 154, 170, 0.14), rgba(136, 176, 160, 0.16)); }
body[data-theme="loyalty"] { --theme-gradient: linear-gradient(135deg, rgba(42, 31, 27, 0.96), rgba(18, 14, 13, 0.95)), linear-gradient(60deg, rgba(227, 192, 110, 0.25), rgba(214, 154, 170, 0.16)); }
body[data-theme="owner"] { --theme-gradient: linear-gradient(135deg, rgba(23, 23, 25, 0.97), rgba(16, 15, 17, 0.96)), linear-gradient(60deg, rgba(142, 166, 184, 0.18), rgba(227, 192, 110, 0.16)); }
body[data-theme="staff"] { --theme-gradient: linear-gradient(135deg, rgba(24, 33, 32, 0.96), rgba(15, 18, 18, 0.95)), linear-gradient(60deg, rgba(136, 176, 160, 0.2), rgba(214, 154, 170, 0.12)); }

.app-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(22px + env(safe-area-inset-bottom));
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(33, 24, 28, 0.98), rgba(16, 14, 15, 0.98)),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 24px);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.splash-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(227, 192, 110, 0.65);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  box-shadow: inset 0 0 28px rgba(227, 192, 110, 0.12), 0 18px 40px rgba(0, 0, 0, 0.25);
}

.splash-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 12vw, 54px);
  line-height: 1;
}

.splash-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.splash-progress {
  width: min(240px, 70vw);
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.splash-progress span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: shimmer 900ms ease-in-out infinite;
}

.splash-dots {
  display: flex;
  gap: 6px;
}

.splash-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
  animation: pulse 900ms ease-in-out infinite;
}

.splash-dots i:nth-child(2) { animation-delay: 120ms; }
.splash-dots i:nth-child(3) { animation-delay: 240ms; }

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(227, 192, 110, 0.58);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
}

.brand-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.05;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-btn,
.primary-btn,
.ghost-btn,
.tab-btn,
.chip,
.category-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.icon-btn {
  width: 40px;
  padding: 0;
}

.primary-btn {
  padding: 10px 14px;
  border-color: rgba(227, 192, 110, 0.62);
  background: linear-gradient(135deg, rgba(227, 192, 110, 0.28), rgba(214, 154, 170, 0.18));
}

.ghost-btn {
  padding: 10px 13px;
}

.tab-btn,
.chip {
  padding: 8px 11px;
  font-size: 13px;
}

.tab-btn.is-active,
.chip.is-active {
  border-color: rgba(227, 192, 110, 0.72);
  color: var(--gold);
  background: rgba(227, 192, 110, 0.12);
}

.hero-panel,
.panel,
.product-card,
.data-table-wrap,
.loyalty-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  padding: 18px;
}

.hero-title {
  margin: 0;
  max-width: 740px;
  font-size: clamp(26px, 7vw, 44px);
  line-height: 1.02;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.hero-copy {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.48;
}

.quick-actions,
.category-grid,
.product-grid,
.dashboard-grid {
  display: grid;
  gap: 10px;
}

.quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.category-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.category-btn {
  min-height: 88px;
  padding: 13px;
  text-align: left;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
}

.category-title {
  display: block;
  font-size: 16px;
  font-weight: 650;
}

.category-meta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  margin: 22px 0 10px;
  font-size: 18px;
}

.panel {
  padding: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.search-input,
.select-input {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  padding: 9px 11px;
}

.search-input {
  flex: 1 1 220px;
}

.select-input {
  flex: 0 1 180px;
}

.product-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.product-card {
  padding: 12px;
  min-height: 156px;
}

.product-card h3 {
  min-height: 44px;
  margin: 0;
  font-size: 15px;
  line-height: 1.28;
}

.product-meta,
.muted {
  color: var(--muted);
}

.product-meta {
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.35;
}

.price {
  color: var(--gold);
  font-weight: 700;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.photo-frame {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  overflow: hidden;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: cover;
}

.loyalty-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  min-height: 210px;
  background:
    linear-gradient(135deg, rgba(227, 192, 110, 0.18), rgba(214, 154, 170, 0.11)),
    linear-gradient(135deg, rgba(35, 27, 26, 0.96), rgba(18, 14, 13, 0.94));
}

.card-number {
  margin: 24px 0 8px;
  color: var(--gold);
  font-size: clamp(24px, 8vw, 38px);
  font-family: Georgia, "Times New Roman", serif;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.data-table-wrap {
  overflow-x: auto;
  padding: 0;
}

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

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 232, 204, 0.12);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--gold);
  font-weight: 650;
  background: rgba(255, 255, 255, 0.055);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.status-dot.is-off::before {
  background: var(--danger);
}

.empty-state {
  padding: 22px;
  border: 1px dashed rgba(255, 232, 204, 0.25);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.footer-nav {
  position: sticky;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 14, 16, 0.84);
  backdrop-filter: blur(18px);
}

.footer-nav button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.footer-nav button.is-active {
  color: var(--gold);
  background: rgba(227, 192, 110, 0.1);
}

@media (max-width: 720px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

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

  .product-detail {
    grid-template-columns: 1fr;
  }

  .photo-frame {
    min-height: 220px;
  }

  .footer-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .footer-nav button {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

