:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #050b14;
  --panel-2: #07111f;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.18);
  --text: #ecfeff;
  --muted: #93a4b8;
  --line: rgba(34, 211, 238, 0.22);
  --danger: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 32rem), var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

select,
select option {
  background-color: #020617;
  color: #f8fafc;
}

select option:checked {
  background-color: #7c3aed;
  color: #ffffff;
}

button {
  cursor: pointer;
}

a.secondary,
a.icon,
a.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.login-card,
.panel,
.modal {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(7, 17, 31, 0.98), rgba(0, 0, 0, 0.96));
  box-shadow: 0 0 32px var(--cyan-soft);
  border-radius: 10px;
}

.login-card {
  width: min(460px, 100%);
  padding: 1.25rem;
}

.brand {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.28rem;
}

h2 {
  font-size: 0.98rem;
}

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

.stack {
  display: grid;
  gap: 0.58rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.8);
  color: var(--text);
  min-height: 34px;
  padding: 0.48rem 0.58rem;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.suggestion-strip {
  display: flex;
  gap: 0.38rem;
  margin-top: -0.15rem;
  overflow-x: auto;
  padding: 0.05rem 0 0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.suggestion-strip::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  min-height: 30px;
  padding: 0.32rem 0.62rem;
  font-size: 0.74rem;
  font-weight: 900;
}

.suggestion-chip:active {
  background: var(--cyan);
  color: #001015;
}

.phone-field,
.date-field {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: minmax(92px, 0.85fr) minmax(0, 1.15fr);
}

.phone-field {
  grid-template-columns: 74px minmax(0, 1fr);
}

.phone-field select,
.date-field select {
  min-width: 0;
}

.primary,
.secondary,
.danger,
.icon {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 34px;
  padding: 0.42rem 0.68rem;
  font-weight: 900;
}

.primary {
  background: var(--cyan);
  color: #001015;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.5);
}

.secondary,
.icon {
  border-color: var(--line);
  background: rgba(2, 6, 23, 0.6);
  color: var(--text);
}

.danger {
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(127, 29, 29, 0.35);
  color: #fecdd3;
}

.mini {
  min-height: 28px;
  padding: 0.22rem 0.45rem;
  font-size: 0.72rem;
}

.square {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.9);
  padding: 0.55rem 0.75rem;
  box-shadow: 0 0 28px var(--cyan-soft);
}

.tabs,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.access-chip {
  display: grid;
  min-width: 132px;
  gap: 0.05rem;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.78);
  padding: 0.35rem 0.55rem;
  line-height: 1.15;
}

.access-chip span,
.access-chip small {
  color: var(--muted);
  font-size: 0.68rem;
}

.access-chip strong {
  color: var(--cyan);
  font-size: 0.9rem;
}

.access-chip.ok strong {
  color: var(--ok);
}

.access-chip.warn strong {
  color: var(--warn);
}

.access-chip.danger strong {
  color: var(--danger);
}

.message-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.section-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-head h2,
.section-head p {
  margin: 0;
}

.section-head p {
  margin-top: 0.25rem;
}

.token-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.token-button {
  min-height: 28px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  color: #a5f3fc;
  padding: 0.22rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 900;
}

.token-button:hover {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.2);
  color: white;
}

.tab {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.75);
  color: var(--text);
  padding: 0.42rem 0.62rem;
  font-weight: 900;
}

.tab.active {
  background: var(--cyan);
  color: #001015;
}

.badge-dot {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #020617;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
}

.content {
  display: grid;
  gap: 0.7rem;
  padding: 0.7rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 200px;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.filters input,
.filters select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.8);
  color: var(--text);
  min-height: 34px;
  padding: 0.45rem 0.55rem;
  outline: none;
}

.grid-2 {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 300px minmax(0, 1fr);
}

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

.panel {
  min-width: 0;
  padding: 0.72rem;
}

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

.compact-form h2,
.compact-form p,
.compact-form .actions,
.compact-form .product-preview,
.compact-form button[type="submit"] {
  grid-column: 1 / -1;
}

.product-preview {
  display: grid;
  gap: 0.18rem;
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.08);
  padding: 0.5rem 0.58rem;
  font-size: 0.76rem;
}

.product-preview strong {
  color: #a5f3fc;
}

.product-preview span {
  color: var(--muted);
}

.profile-editor {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.45rem;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.5);
  padding: 0.55rem;
}

.profile-row span {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: space-between;
}

.profile-row small {
  font-size: 0.7rem;
}

.profile-summary {
  display: grid;
  gap: 0.2rem;
  min-width: 150px;
}

.profile-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.ok-text {
  color: var(--ok);
}

.warn-text {
  color: var(--warn);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

th,
td {
  border-bottom: 1px solid rgba(34, 211, 238, 0.14);
  padding: 0.48rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: #a5f3fc;
  font-size: 0.66rem;
  text-transform: uppercase;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.58);
  padding: 0.62rem;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--cyan);
  font-size: 1.16rem;
}

.stat small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-weight: 900;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.stock-card {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.58);
  padding: 0.58rem;
}

.stock-card strong,
.stock-card span {
  display: block;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--danger));
}

.stock-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.inventory-shell {
  min-height: 70vh;
}

.section-kicker {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.add-fab {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.inventory-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(110px, 0.7fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.inventory-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(2, 6, 23, 0.76));
  padding: 0.75rem;
}

.inventory-summary span,
.inventory-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.inventory-summary strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--text);
  font-size: 1.45rem;
}

.inventory-grid {
  margin-top: 0.8rem;
}

.mixed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.65rem;
}

.folder-tile {
  min-height: 188px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.62);
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.folder-tile:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-soft);
  transform: translateY(-1px);
}

.folder-tile-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  font-size: 1.65rem;
}

.folder-tile small {
  color: var(--muted);
  font-weight: 900;
}

.product-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.folder-list {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.folder-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.56);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.folder-item.active,
.folder-item:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 16px var(--cyan-soft);
}

.folder-icon {
  color: var(--cyan);
}

.product-main {
  display: grid;
  gap: 0.8rem;
}

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

.product-account-card {
  position: relative;
  min-height: 188px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.28rem;
  border: 1px solid rgba(34, 211, 238, 0.14);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  text-align: center;
  overflow: hidden;
  cursor: pointer;
}

.product-account-card.active,
.product-account-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-soft);
  transform: translateY(-1px);
}

.product-account-card.sold-out {
  opacity: 0.84;
}

.sold-ribbon {
  position: absolute;
  top: 0;
  inset-inline: 0;
  padding: 0.28rem;
  background: rgba(244, 63, 94, 0.82);
  color: white;
  font-size: 0.62rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.platform-orb {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 999px;
  background: radial-gradient(circle at 35% 25%, rgba(34, 211, 238, 0.25), rgba(2, 6, 23, 0.95));
  color: var(--cyan);
  font-size: 1.45rem;
  font-weight: 1000;
}

.platform-orb.big {
  width: 76px;
  height: 76px;
  font-size: 2rem;
}

.product-detail {
  display: grid;
  gap: 0.85rem;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(2, 6, 23, 0.82));
  padding: 0.9rem;
}

.detail-hero {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.detail-hero h3 {
  margin: 0.35rem 0 0;
  font-size: 1.35rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.55rem;
}

.detail-grid article,
.credentials-box,
.client-mini {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.56);
  padding: 0.65rem;
}

.detail-grid span,
.credentials-box span,
.client-mini span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-grid strong,
.credentials-box strong {
  display: block;
  margin-top: 0.2rem;
}

.credentials-box {
  display: grid;
  gap: 0.5rem;
}

.credentials-box > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.profile-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-strip > span {
  min-width: 70px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.56);
  padding: 0.45rem;
  font-weight: 1000;
}

.profile-strip small {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.62rem;
}

.compact-head {
  margin-bottom: 0;
}

.client-mini-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.55rem;
}

.empty-box {
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 1rem;
  color: var(--muted);
  font-weight: 900;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 900;
}

.pill.active {
  background: rgba(52, 211, 153, 0.18);
  color: #86efac;
}

.pill.inactive,
.pill.expired,
.pill.debt {
  background: rgba(251, 113, 133, 0.18);
  color: #fda4af;
}

.pill.paused {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
}

.notice {
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.08);
  padding: 0.75rem;
  color: #cffafe;
  font-weight: 800;
}

.notice-button {
  width: 100%;
  min-height: 78px;
  display: grid;
  gap: 0.25rem;
  text-align: left;
  cursor: pointer;
}

.notice-button span {
  color: #dffbff;
  font-size: 0.82rem;
}

.notice-button strong {
  color: var(--cyan);
  font-size: 2rem;
  line-height: 1;
}

.notice-button:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 22px var(--cyan-soft);
  transform: translateY(-1px);
}

.subpanel {
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.35);
  padding: 0.65rem;
}

.subpanel h3 {
  margin: 0;
  color: #ecfeff;
  font-size: 1rem;
}

.icon.active {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 14px var(--cyan-soft);
}

.alert-today {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(113, 63, 18, 0.22);
}

.alert-soon {
  border-color: rgba(34, 211, 238, 0.42);
}

.alert-expired {
  border-color: rgba(251, 113, 133, 0.42);
  background: rgba(127, 29, 29, 0.22);
}

.error {
  color: #fecdd3;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.compact {
  margin-top: 0.4rem;
  gap: 0.3rem;
}

.debt-total {
  color: var(--danger);
  font-size: 1.15rem;
}

.pin-form input {
  width: min(220px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.8);
  color: var(--text);
  min-height: 34px;
  padding: 0.45rem 0.55rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 1rem;
}

.payment-modal {
  width: min(860px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 1rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.hide {
  display: none !important;
}

@media (max-width: 900px) {
  .grid-2,
  .grid-3,
  .filters,
  .compact-form {
    grid-template-columns: 1fr;
  }

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

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

  .inventory-summary {
    grid-template-columns: 1fr 1fr;
  }

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

  .folder-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .detail-hero {
    align-items: flex-start;
  }
}
