﻿:root {
  --bg-900: #071025;
  --bg-850: #0b1730;
  --bg-800: #112041;
  --surface: rgba(13, 27, 54, 0.72);
  --surface-strong: rgba(10, 23, 47, 0.9);
  --line: rgba(140, 184, 255, 0.22);
  --text-main: #eaf2ff;
  --text-muted: #9eb4d2;
  --accent: #32d8d8;
  --accent-2: #ff8a5b;
  --ok: #63d792;
  --warn: #f2c46f;
  --danger: #ff7d8c;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 40px rgba(6, 13, 26, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: 'Sora', 'Trebuchet MS', sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 16%, rgba(50, 216, 216, 0.12), transparent 44%),
    radial-gradient(circle at 90% 0%, rgba(255, 138, 91, 0.18), transparent 36%),
    linear-gradient(145deg, var(--bg-900), var(--bg-850) 44%, var(--bg-800));
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

.app-shell::before,
.app-shell::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: -1;
  filter: blur(50px);
}

.app-shell::before {
  width: 340px;
  height: 340px;
  background: rgba(50, 216, 216, 0.18);
  top: -120px;
  right: -80px;
}

.app-shell::after {
  width: 280px;
  height: 280px;
  background: rgba(255, 138, 91, 0.15);
  bottom: -110px;
  left: -80px;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  backdrop-filter: blur(12px);
  background: rgba(4, 10, 22, 0.75);
  border-bottom: 1px solid rgba(147, 183, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 2.5vw, 2rem);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: #062633;
  background: linear-gradient(135deg, var(--accent), #8af0f0);
  box-shadow: 0 8px 22px rgba(50, 216, 216, 0.3);
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 700;
}

.brand-copy small {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar-name {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: min(36vw, 260px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(156, 196, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(50, 216, 216, 0.14);
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(50, 216, 216, 0.16);
  color: var(--accent);
}

.topbar-logout {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffe5db;
  background: rgba(255, 138, 91, 0.16);
  border: 1px solid rgba(255, 138, 91, 0.35);
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.topbar-logout:hover {
  background: rgba(255, 138, 91, 0.3);
  transform: translateY(-1px);
}

.app-layout-wrap {
  width: 100%;
  margin: 1.15rem 0 1.6rem;
  padding: 0 1rem 0 0;
}

.app-layout-row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
  margin: 0;
  align-items: flex-start;
}

.app-col-aside {
  padding-left: 0;
}

.app-layout-public {
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 0 1rem;
}

.app-layout-public .app-layout-row {
  --bs-gutter-x: 0;
}

.app-layout-public .app-content {
  min-height: calc(100dvh - 2rem);
  display: grid;
  align-content: center;
}

.app-sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(8px);
  padding: 1rem 0.8rem;
  box-shadow: var(--shadow-soft);
}

.sidebar-title {
  margin: 0 0 0.55rem;
  padding: 0 0.48rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-admin {
  margin-top: 0.65rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(143, 190, 255, 0.2);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.32rem;
}

.sidebar-menu a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.56rem 0.58rem;
  border-radius: 11px;
  color: #d7e9ff;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-menu a i {
  font-size: 0.92rem;
  color: rgba(173, 214, 255, 0.92);
}

.sidebar-menu a:hover {
  background: rgba(50, 216, 216, 0.1);
  border-color: rgba(50, 216, 216, 0.25);
  transform: translateX(1px);
}

.sidebar-menu a.is-active {
  background: linear-gradient(135deg, rgba(50, 216, 216, 0.24), rgba(50, 216, 216, 0.1));
  border-color: rgba(50, 216, 216, 0.45);
  color: #e9fcff;
}

.app-content {
  min-width: 0;
}

.pos-alert {
  position: sticky;
  top: 0.75rem;
  z-index: 900;
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pos-alert .alert {
  margin-bottom: 0;
  border-radius: 10px;
  border-width: 0;
}

.app-page,
.example-wrapper {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.page-panel,
.login-container,
.example-wrapper,
.container.bg-white,
.container.py-5,
.container.my-4 {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.page-panel,
.example-wrapper {
  padding: clamp(1rem, 2.3vw, 1.6rem);
}

.login-container {
  max-width: 520px;
  width: 100%;
  margin-inline: auto;
}

.container.bg-white,
.container.py-5,
.container.my-4 {
  padding: clamp(1rem, 2.3vw, 1.6rem) !important;
}

.page-header {
  margin-bottom: 1rem;
}

.page-title,
.example-wrapper > h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: #f1f7ff;
}

.page-subtitle {
  margin-top: 0.42rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.card,
.list-group-item,
.table,
.table thead,
.table tbody,
.table tr,
.table td,
.table th {
  border-color: rgba(144, 185, 255, 0.16) !important;
}

.card {
  background: rgba(9, 19, 39, 0.84) !important;
  color: var(--text-main);
}

.card-header,
.card-footer {
  background: rgba(7, 16, 32, 0.6) !important;
}

.list-group-item {
  background: rgba(9, 19, 39, 0.78);
  color: var(--text-main);
}

.list-group-item:hover {
  background: rgba(13, 27, 54, 0.96);
  color: #fff;
}

.table {
  color: var(--text-main) !important;
  margin-bottom: 0;
}

.table-light,
.table-light > tr > th,
.table-light > tr > td,
.table-light th,
.table-light td {
  background: rgba(17, 32, 65, 0.85) !important;
  color: #e9f4ff !important;
}

.form-control,
.form-select,
.form-check-input {
  border-color: rgba(146, 187, 255, 0.28);
  background: rgba(5, 12, 26, 0.56);
  color: #f1f7ff;
}

.form-control::placeholder,
.form-select::placeholder {
  color: rgba(200, 220, 247, 0.5);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: rgba(50, 216, 216, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(50, 216, 216, 0.2);
  background: rgba(4, 12, 24, 0.72);
  color: #fff;
}

.form-text,
.text-muted {
  color: rgba(185, 208, 240, 0.78) !important;
}

.alert-warning,
.alert-info,
.alert-success,
.alert-danger {
  border: 0;
}

.link-grid {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.link-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(152, 191, 255, 0.2);
  background: rgba(7, 18, 38, 0.76);
  padding: 0.8rem;
}

.link-card label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.link-copy-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.link-copy-group input {
  min-width: 0;
}

.command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 0.6rem;
}

.command-actions {
  display: inline-flex;
  gap: 0.5rem;
}

.command-actions form {
  margin: 0;
}

.switch-panel {
  margin-top: 1.2rem;
  max-width: 420px;
  border: 1px solid rgba(142, 188, 255, 0.22);
  border-radius: var(--radius-md);
  background: rgba(7, 19, 40, 0.72);
  padding: 1rem;
}

.switch {
  width: 100px;
  height: 45px;
}

.switch input {
  display: none;
}

.slider {
  cursor: pointer;
  position: relative;
  width: 100%;
  height: 100%;
  background-color: rgba(8, 8, 8, 0.5);
  transition: all 0.4s cubic-bezier(0.99, 0.1, 0.1, 0.99);
  border-radius: 5px;
  box-shadow:
    inset 0 0 1px 0 rgba(0, 0, 0, 1),
    inset 90px 0 50px -50px rgba(126, 4, 4, 0.56);
  border: 1px solid #000;
}

.slider-btn {
  position: absolute;
  aspect-ratio: 6/4;
  border-radius: 3px;
  left: 2px;
  top: 2px;
  bottom: 2px;
  background: linear-gradient(to bottom, #333333, #242323);
  border: 1px solid #2b2b2b;
  box-shadow:
    0 10px 5px 1px rgba(0, 0, 0, 0.15),
    inset 10px 0 10px -5px rgba(126, 4, 4, 0.1);
  transition: all 0.4s cubic-bezier(0.99, 0.1, 0.1, 0.99);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.texture {
  width: 2px;
  height: 70%;
  background-color: #202020ea;
  box-shadow:
    -0.7px -1.5px 1px 0 rgba(192, 192, 192, 0.3),
    0 2px 3px rgba(0, 0, 0, 0.3);
}

.light {
  width: 4px;
  height: 4px;
  border: 1px solid #222121;
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.99, 0.1, 0.1, 0.99);
  background-color: rgb(230, 14, 14);
  box-shadow: 0 0 10px 1px rgb(241, 28, 28);
}

.switch input:checked + .slider {
  box-shadow:
    inset 0 0 1px 0 rgba(0, 0, 0, 1),
    inset -85px 0 50px -50px rgba(1, 78, 4, 0.6);
}

.switch input:checked + .slider .slider-btn {
  transform: translateX(66%);
  box-shadow:
    0 10px 5px 1px rgba(0, 0, 0, 0.15),
    inset -10px 0 10px -5px rgba(1, 112, 4, 0.1);
}

.switch input:checked + .slider .slider-btn .light {
  background-color: rgb(35, 158, 4);
  box-shadow: 0 0 10px 0 rgb(57, 230, 14);
}

.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.btn-remove-img {
  display: none !important;
  bottom: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 1rem;
  border-radius: 50%;
}

.img-rem:hover .btn-remove-img {
  display: block !important;
}

.wheel-preview {
  width: min(96px, 24vw);
  margin-inline: auto;
}

.options-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.items {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: none;
  border: 1px solid rgba(146, 187, 255, 0.24);
  background: rgba(5, 12, 26, 0.45);
  overflow-y: auto;
}

.option-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.55rem;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  border: 1px solid rgba(145, 188, 255, 0.18);
  background: rgba(9, 19, 39, 0.65);
}

.option-entry:last-child {
  margin-bottom: 0;
}

.option-input-wrap {
  min-width: 0;
}

.option-input {
  margin: 0 !important;
}

.option-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  min-width: 86px;
}

.option-switch-wrap .form-check-input {
  margin: 0;
  float: none;
}

.option-switch-wrap .form-check-input:focus {
  box-shadow: none;
}

.option-switch-wrap .form-check-label {
  margin: 0;
  color: rgba(206, 224, 249, 0.95);
  font-size: 0.79rem;
  white-space: nowrap;
}

.tier-compact-card {
  background: rgba(7, 18, 38, 0.78);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.kpi-card {
  border-radius: 14px;
  border: 1px solid rgba(155, 196, 255, 0.18);
  padding: 1rem;
  background: rgba(7, 18, 38, 0.76);
}

.kpi-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.kpi-value {
  margin: 0.35rem 0 0;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .topbar-name {
    display: none;
  }
}

@media (max-width: 992px) {
  .app-layout-wrap {
    width: 100%;
    margin-top: 0.8rem;
    padding: 0 0.5rem;
  }

  .app-layout-public {
    width: 100%;
    padding: 0 0.5rem;
  }
}

@media (max-width: 767px) {
  .app-sidebar {
    position: static;
    top: auto;
    padding: 0.65rem;
  }

  .sidebar-title {
    display: none;
  }

  .sidebar-admin {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
  }

  .sidebar-menu {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
  }

  .sidebar-menu li {
    flex-shrink: 0;
  }

  .sidebar-menu a {
    width: auto;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-topbar {
    padding: 0.65rem 0.75rem;
  }

  .brand-copy small {
    display: none;
  }

  .topbar-logout {
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
  }

  .page-panel,
  .example-wrapper,
  .container.bg-white,
  .container.py-5,
  .container.my-4,
  .login-container {
    padding: 0.9rem !important;
  }

  .page-actions,
  .form-actions,
  .command-actions {
    width: 100%;
  }

  .command-row {
    grid-template-columns: 1fr;
  }

  .command-actions {
    justify-content: stretch;
  }

  .command-actions .btn,
  .command-actions form,
  .command-actions button {
    width: 100%;
  }

  .link-copy-group {
    grid-template-columns: 1fr;
  }

  .link-copy-group button {
    width: 100%;
  }

  .option-entry {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .option-input-wrap {
    grid-column: 1 / -1;
  }
}
