:root {
  color-scheme: light;
  --bg: #eef2ff;
  --bg-soft: #f8faff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --surface-muted: rgba(248, 250, 255, 0.82);
  --surface-inverse: rgba(17, 24, 39, 0.9);
  --stroke: rgba(99, 102, 241, 0.12);
  --stroke-strong: rgba(99, 102, 241, 0.22);
  --text: #101828;
  --muted: #667085;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-lg: 0 24px 60px rgba(79, 70, 229, 0.12);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081120;
  --bg-soft: #0d1728;
  --surface: rgba(10, 18, 32, 0.82);
  --surface-strong: rgba(14, 24, 40, 0.92);
  --surface-muted: rgba(17, 28, 46, 0.88);
  --surface-inverse: rgba(241, 245, 249, 0.95);
  --stroke: rgba(148, 163, 184, 0.16);
  --stroke-strong: rgba(129, 140, 248, 0.34);
  --text: #e7ecf5;
  --muted: #94a3b8;
  --accent: #818cf8;
  --accent-2: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --shadow-lg: 0 30px 80px rgba(2, 6, 23, 0.48);
  --shadow-md: 0 16px 44px rgba(2, 6, 23, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.09), transparent 20%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}

body {
  position: relative;
  transition: background 220ms ease, color 220ms ease;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(72px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.ambient-a {
  top: -40px;
  left: -20px;
  width: 320px;
  height: 320px;
  background: rgba(129, 140, 248, 0.18);
}

.ambient-b {
  top: 18%;
  right: 6%;
  width: 420px;
  height: 420px;
  background: rgba(99, 102, 241, 0.12);
}

.ambient-c {
  bottom: 4%;
  left: 24%;
  width: 320px;
  height: 320px;
  background: rgba(14, 165, 233, 0.1);
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(238, 242, 255, 0.82);
  backdrop-filter: blur(18px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

:root[data-theme="dark"] .loading-screen {
  background: rgba(5, 10, 20, 0.82);
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  width: min(460px, 100%);
  padding: 32px;
  border-radius: 28px;
  text-align: center;
}

.loading-mark,
.brand-icon,
.profile-avatar {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.loading-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 20px;
  font-family: "Sora", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.loading-card h2,
.auth-copy h1,
.panel-head h2,
.brand-lockup h2,
.topbar-copy h1,
.catalog h3,
.detail-card h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  letter-spacing: -0.04em;
}

.loading-copy {
  margin: 10px auto 0;
  max-width: 32ch;
  color: var(--muted);
  line-height: 1.6;
}

.loading-bar {
  width: 100%;
  height: 9px;
  margin-top: 22px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--accent-soft);
}

.loading-bar span {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: loading-slide 1.4s ease-in-out infinite;
}

@keyframes loading-slide {
  0%,
  100% {
    transform: translateX(-25%);
  }

  50% {
    transform: translateX(185%);
  }
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px;
}

.glass-card,
.module-card,
.inventory-section,
.register-card,
.fact,
.store-item {
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.auth-screen {
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 24px;
}

.auth-copy,
.auth-panel,
.sidebar,
.catalog,
.detail-card,
.registers-card {
  border-radius: var(--radius-xl);
}

.auth-copy {
  padding: 44px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(79, 70, 229, 0.94), rgba(67, 56, 202, 0.84)),
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.3), transparent 36%);
  color: white;
}

:root[data-theme="dark"] .auth-copy {
  background:
    linear-gradient(155deg, rgba(26, 35, 67, 0.96), rgba(37, 49, 86, 0.94)),
    radial-gradient(circle at top right, rgba(129, 140, 248, 0.24), transparent 36%);
}

.auth-copy p {
  margin-top: 14px;
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
}

.auth-copy h1 {
  margin-top: 16px;
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  line-height: 0.98;
}

.auth-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.auth-highlights div {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-highlights strong {
  display: block;
  font-size: 1.8rem;
}

.auth-highlights span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.78);
}

.auth-panel {
  align-self: center;
  padding: 32px;
  background: var(--surface-strong);
}

.panel-head p,
.topbar-copy p,
.detail-card p,
.register-card p,
.inline-note {
  color: var(--muted);
}

.panel-head p {
  margin: 10px 0 0;
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

label span,
.section-label,
.pill,
.feedback,
.store-code,
.store-meta,
.eyebrow,
.sidebar-subtle {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 68%, transparent);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--stroke-strong);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 26px rgba(99, 102, 241, 0.22);
}

.secondary-button {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--stroke);
}

.ghost-button {
  color: var(--muted);
  background: transparent;
  border-color: var(--stroke);
}

.compact {
  min-height: 38px;
  padding: 9px 14px;
}

.danger {
  color: var(--danger);
}

.feedback {
  margin: 0;
  font-size: 0.95rem;
}

.feedback.error {
  color: var(--danger);
}

.dashboard-screen {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 36px);
  padding: 16px;
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--stroke);
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-lockup h2 {
  font-size: 0.98rem;
  line-height: 1.15;
}

.sidebar-subtle {
  font-size: 0.8rem;
}

.profile-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--stroke);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-card strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
}

.profile-card span {
  display: block;
  margin-top: 3px;
  font-size: 0.86rem;
  color: var(--muted);
}

.sidebar-section {
  display: grid;
  gap: 8px;
}

.section-label {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legend-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-muted);
  border: 1px solid var(--stroke);
}

.legend-list span {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 0.92rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
}

.legend-dot.online {
  background: var(--success);
}

.legend-dot.pending {
  background: var(--warning);
}

.legend-dot.offline {
  background: var(--danger);
}

.sidebar-footer {
  margin-top: auto;
}

.theme-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.84rem;
}

.sidebar .secondary-button,
.sidebar .ghost-button {
  width: 100%;
  justify-content: center;
}

.sidebar .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.sidebar .eyebrow::before {
  width: 14px;
}

.workspace {
  display: grid;
  gap: 14px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
}

.topbar-copy h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-top: 6px;
}

.topbar-copy p {
  margin: 10px 0 0;
  max-width: 60ch;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat {
  padding: 18px;
  border-radius: 22px;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.mini-stat strong {
  display: block;
  margin-top: 12px;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.55rem, 2vw, 2.2rem);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.catalog,
.detail-card {
  padding: 18px;
}

.catalog {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 172px);
  align-content: start;
}

.detail-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  display: grid;
  gap: 14px;
}

.registers-card {
  display: grid;
  gap: 14px;
}

.module-card {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.module-card-hero {
  padding: 20px;
}

.catalog-head,
.store-item-top,
.inventory-section-head,
.register-card-head,
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface-muted);
  font-size: 0.82rem;
}

.filters {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface-muted);
  border: 1px solid var(--stroke);
}

.filter-row,
.detail-facts,
.register-grid {
  display: grid;
  gap: 12px;
}

.filter-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.store-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 6px;
}

.store-item {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 20px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.store-item:hover,
.store-item.active {
  transform: translateY(-1px);
  border-color: var(--stroke-strong);
  background: var(--surface-strong);
}

.store-name {
  font-size: 1.02rem;
  line-height: 1.28;
}

.store-code {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
}

.store-meta {
  margin-top: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.detail-pane {
  min-width: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 340px;
}

.detail-summary h3 {
  margin: 10px 0 4px;
  font-size: 1.6rem;
}

.detail-summary p {
  margin: 0;
  line-height: 1.55;
}

.detail-facts,
.register-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fact {
  padding: 14px;
  border-radius: 18px;
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.fact strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inventory-section {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.inventory-section strong {
  font-size: 1.1rem;
}

.register-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.status-pill.online {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
}

.status-pill.pending {
  background: rgba(217, 119, 6, 0.14);
  color: var(--warning);
}

.status-pill.offline {
  background: rgba(220, 38, 38, 0.14);
  color: var(--danger);
}

.inline-note {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (max-width: 1260px) {
  .dashboard-screen,
  .content-grid,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .catalog {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .screen {
    padding: 14px;
  }

  .topbar,
  .detail-header,
  .catalog-head,
  .register-card-head {
    display: grid;
    gap: 14px;
  }

  .hero-actions,
  .detail-actions {
    justify-content: stretch;
  }

  .hero-actions > *,
  .detail-actions > * {
    width: 100%;
  }

  .stats-strip,
  .detail-facts,
  .register-grid,
  .auth-highlights,
  .filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-copy,
  .auth-panel,
  .sidebar,
  .catalog,
  .module-card,
  .register-card,
  .inventory-section,
  .loading-card {
    padding: 18px;
  }

  .brand-lockup,
  .profile-card {
    align-items: flex-start;
  }

  .loading-mark,
  .brand-icon {
    width: 52px;
    height: 52px;
  }

  .auth-copy h1 {
    font-size: 2.3rem;
  }
}
