:root {
  --bg: #0a0c09;
  --surface: #121610;
  --surface-2: #171c14;
  --surface-3: #1e241a;
  --line: rgba(235, 243, 226, 0.11);
  --line-strong: rgba(235, 243, 226, 0.2);
  --text: #f3f6ed;
  --muted: #99a393;
  --muted-2: #737d6f;
  --lime: #d8ff5f;
  --lime-deep: #bde630;
  --orange: #ff9a66;
  --blue: #91c5ff;
  --violet: #d6a8ff;
  --danger: #ff7b72;
  --danger-soft: rgba(255, 123, 114, 0.1);
  --font-sans: "Segoe UI Variable Display", "HarmonyOS Sans SC", "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono",
    monospace;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 82% 0%, rgba(216, 255, 95, 0.07), transparent 65%),
    radial-gradient(ellipse 40% 35% at 0% 40%, rgba(255, 154, 102, 0.035), transparent 70%),
    #0a0c09;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--lime);
  color: #10130b;
}

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

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

button {
  cursor: pointer;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--lime);
  color: #0f130a;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-type strong {
  font-size: 16px;
  letter-spacing: 0.03em;
}

.brand-type small {
  margin-top: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.24em;
}

.kicker,
.panel-kicker {
  margin: 0;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.17em;
}

/* Login */
.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
  min-height: 100vh;
}

.login-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 38px 48px 30px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 80%, rgba(216, 255, 95, 0.1), transparent 38%),
    linear-gradient(140deg, #11160e, #090b08 70%);
  overflow: hidden;
}

.login-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 55%, black, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 55%, black, transparent 78%);
  pointer-events: none;
}

.login-hero {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 60px;
}

.login-hero h1 {
  margin: 20px 0 18px;
  font-size: clamp(3.6rem, 6vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.login-hero h1 em {
  color: var(--lime);
  font-style: normal;
}

.login-hero > p:last-child {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.login-visual {
  position: relative;
  z-index: 1;
  height: 250px;
  margin-top: 36px;
}

.login-orbit {
  position: absolute;
  top: 10px;
  left: 10%;
  width: 300px;
  height: 300px;
  border: 1px dashed rgba(216, 255, 95, 0.22);
  border-radius: 50%;
}

.login-orbit::after {
  content: "";
  position: absolute;
  top: 12%;
  right: 11%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 20px rgba(216, 255, 95, 0.6);
}

.login-card-mini {
  position: absolute;
  top: 28px;
  left: 24%;
  display: flex;
  flex-direction: column;
  width: 208px;
  height: 268px;
  padding: 18px;
  border: 1px solid rgba(216, 255, 95, 0.32);
  border-radius: 20px;
  background:
    radial-gradient(circle at 80% 15%, rgba(216, 255, 95, 0.14), transparent 46%),
    #171d13;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.48);
  transform: rotate(-7deg);
}

.login-card-mini small,
.login-card-mini span {
  color: rgba(243, 246, 237, 0.45);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.15em;
}

.login-card-mini strong {
  display: grid;
  place-items: center;
  flex: 1;
  color: var(--lime);
  font-size: 76px;
  line-height: 1;
  letter-spacing: -0.1em;
}

.login-float {
  position: absolute;
  right: 12%;
  bottom: 24px;
  z-index: 2;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(18, 22, 16, 0.9);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

.login-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-box {
  width: 100%;
  max-width: 390px;
}

.login-mobile-brand {
  display: none;
}

.login-box h2 {
  margin: 14px 0 8px;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.login-copy {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 12px;
}

.login-hint {
  margin: 20px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 154, 102, 0.2);
  border-radius: 9px;
  background: rgba(255, 154, 102, 0.05);
  color: #e6b99f;
  font-size: 10px;
  line-height: 1.7;
}

.login-hint code,
.check-list code {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 9px;
}

.login-back {
  display: inline-block;
  margin-top: 28px;
  color: var(--muted-2);
  font-size: 11px;
  transition: color 160ms ease;
}

.login-back:hover {
  color: var(--text);
}

/* Shell */
.admin-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 16px 20px;
  border-right: 1px solid var(--line);
  background: rgba(14, 17, 13, 0.88);
  backdrop-filter: blur(14px);
}

.sidebar-brand {
  padding: 0 8px;
}

.sidebar-label {
  margin: 34px 12px 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-item .icon {
  width: 17px;
  height: 17px;
}

.nav-item > span {
  flex: 1;
  font-size: 12px;
  font-weight: 550;
}

.nav-item small {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.is-active {
  border-color: rgba(216, 255, 95, 0.17);
  background: rgba(216, 255, 95, 0.07);
  color: var(--lime);
}

.nav-item.is-active > span {
  color: var(--text);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 50%;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: var(--lime);
  transform: translateY(-50%);
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 26px 8px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.live-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(216, 255, 95, 0.45);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(216, 255, 95, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(216, 255, 95, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(216, 255, 95, 0);
  }
}

.sidebar-note div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.sidebar-note strong {
  font-size: 9px;
  font-weight: 550;
}

.sidebar-note span:last-child {
  color: var(--muted-2);
  font-size: 7px;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-store,
.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
  transition: color 160ms ease, background 160ms ease;
}

.sidebar-store {
  justify-content: space-between;
}

.sidebar-store .icon {
  width: 13px;
  height: 13px;
}

.sidebar-store:hover,
.logout-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 9, 0.82);
  backdrop-filter: blur(18px);
}

.topbar-title p {
  margin: 0 0 5px;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.topbar-title h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--lime);
  font-size: 10px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.icon-btn .icon {
  width: 16px;
  height: 16px;
}

.admin-main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 26px 32px 60px;
}

/* Buttons and forms */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease,
    color 160ms ease;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
}

.btn-primary {
  background: var(--lime);
  color: #10130b;
}

.btn-primary:hover:not(:disabled) {
  background: #e4ff8d;
  transform: translateY(-1px);
}

.btn-quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.btn-quiet:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.btn-danger {
  background: var(--danger);
  color: #260907;
}

.btn-danger:hover:not(:disabled) {
  background: #ff958e;
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.field {
  display: block;
  margin-bottom: 15px;
}

.field > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
}

.field > span small {
  color: var(--muted-2);
  font-size: 9px;
}

.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #0c0f0b;
  color: var(--text);
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #596255;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(216, 255, 95, 0.58);
  box-shadow: 0 0 0 3px rgba(216, 255, 95, 0.07);
}

.field textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.65;
}

.field-full {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.check-field input {
  width: 15px;
  height: 15px;
  accent-color: var(--lime);
}

.form-error {
  margin: 10px 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 123, 114, 0.22);
  border-radius: 8px;
  background: var(--danger-soft);
  color: #ffaaa4;
  font-size: 10px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Metrics */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.metric-card {
  position: relative;
  min-height: 158px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.035), transparent 55%),
    var(--surface);
  overflow: hidden;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.metric-badge {
  padding: 3px 6px;
  border-radius: 99px;
  background: rgba(16, 19, 11, 0.12);
  color: #36410e;
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.1em;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-2);
}

.metric-icon .icon {
  width: 13px;
  height: 13px;
}

.metric-card > strong {
  display: block;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.metric-card > p {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 9px;
}

.metric-index {
  position: absolute;
  right: 12px;
  bottom: 2px;
  color: rgba(255, 255, 255, 0.035);
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.08em;
}

.metric-card-accent {
  border-color: transparent;
  background:
    radial-gradient(circle at 95% 0%, rgba(255, 255, 255, 0.2), transparent 50%),
    var(--lime);
  color: #10130b;
}

.metric-card-accent .metric-top,
.metric-card-accent > p {
  color: rgba(16, 19, 11, 0.58);
}

.metric-card-accent .metric-index {
  color: rgba(16, 19, 11, 0.08);
}

.metric-card-accent .metric-badge {
  background: rgba(16, 19, 11, 0.1);
}

/* Panels */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 13px;
  margin-top: 13px;
}

.dashboard-grid-even {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.panel {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.03em;
}

.panel-meta {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  transition: color 160ms ease;
}

.text-link:hover {
  color: var(--lime);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 210px;
  padding-top: 10px;
}

.chart-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  height: 100%;
  min-width: 0;
}

.chart-value {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  white-space: nowrap;
}

.chart-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 46px;
  height: 150px;
  border-radius: 6px 6px 3px 3px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.chart-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--lime), rgba(216, 255, 95, 0.28));
  box-shadow: 0 0 24px rgba(216, 255, 95, 0.08);
  transition: height 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chart-label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
}

.lowstock-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lowstock-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.012);
}

.lowstock-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
  background: rgba(255, 154, 102, 0.08);
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 10px;
}

.lowstock-info {
  flex: 1;
  min-width: 0;
}

.lowstock-info strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lowstock-info span {
  color: var(--muted-2);
  font-size: 8px;
}

.lowstock-stock {
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 13px;
}

.lowstock-empty,
.panel-empty {
  padding: 30px 12px;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

/* Mini tables */
.mini-table {
  display: flex;
  flex-direction: column;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.mini-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.mini-order-no {
  flex: 1;
  min-width: 0;
}

.mini-order-no strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
}

.mini-order-no span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-amount {
  font-family: var(--font-mono);
  font-size: 10px;
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  position: relative;
  display: flex;
  gap: 11px;
  padding: 0 0 16px;
}

.activity-item:last-child {
  padding-bottom: 0;
}

.activity-dot {
  position: relative;
  z-index: 1;
  width: 6px;
  height: 6px;
  margin-top: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(216, 255, 95, 0.07);
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 2.5px;
  top: 12px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.activity-item:last-child::before {
  display: none;
}

.activity-text {
  min-width: 0;
}

.activity-text p {
  margin: 0;
  color: #cdd5c6;
  font-size: 9px;
  line-height: 1.6;
}

.activity-text span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
}

/* Section headers and tables */
.section-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-bar h2 {
  margin: 7px 0 3px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.section-bar p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table th {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.014);
}

.align-right {
  text-align: right !important;
}

.table-message {
  padding: 50px 16px !important;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.product-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
}

.product-cell strong {
  display: block;
  overflow: hidden;
  max-width: 220px;
  font-size: 11px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-cell span {
  display: block;
  overflow: hidden;
  max-width: 220px;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.tag-lime {
  border-color: rgba(216, 255, 95, 0.22);
  background: rgba(216, 255, 95, 0.06);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.tag-muted {
  border-color: var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.tag-warn {
  border-color: rgba(255, 154, 102, 0.24);
  background: rgba(255, 154, 102, 0.06);
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 7px;
}

.payment-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 4px;
}

.payment-ready {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
}

.payment-config-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.payment-config-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.012);
}

.payment-config-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.payment-config-row strong {
  font-size: 9px;
  font-weight: 550;
}

.payment-config-row p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.payment-config-row p.is-error {
  color: var(--orange);
}

.payment-callback {
  margin: 10px 0 0 !important;
  color: var(--muted-2) !important;
  font-family: var(--font-mono);
  font-size: 7px !important;
  overflow-wrap: anywhere;
}

.mono {
  font-family: var(--font-mono);
  font-size: 10px;
}

.stock-cell strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.stock-cell span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.switch {
  position: relative;
  width: 34px;
  height: 19px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: #22281e;
  transition: background 160ms ease, border-color 160ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 160ms ease, background 160ms ease;
}

.switch.is-on {
  border-color: rgba(216, 255, 95, 0.4);
  background: rgba(216, 255, 95, 0.17);
}

.switch.is-on::after {
  left: 17px;
  background: var(--lime);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.mini-btn {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mini-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.mini-btn.is-primary {
  border-color: rgba(216, 255, 95, 0.26);
  color: var(--lime);
}

.mini-btn.is-danger {
  color: #ffaaa4;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 8px;
  font-weight: 550;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.status-pending {
  background: rgba(255, 197, 100, 0.11);
  color: #ffc56b;
}

.status-paid {
  background: rgba(216, 255, 95, 0.11);
  color: var(--lime);
}

.status-refunded {
  background: rgba(214, 168, 255, 0.11);
  color: var(--violet);
}

.status-refunding {
  background: rgba(255, 197, 100, 0.11);
  color: #ffc56b;
}

.status-expired {
  background: rgba(153, 163, 147, 0.1);
  color: var(--muted);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tab {
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  border-color: rgba(216, 255, 95, 0.22);
  background: rgba(216, 255, 95, 0.08);
  color: var(--lime);
}

.tab span {
  margin-left: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
}

.tab.is-active span {
  color: rgba(216, 255, 95, 0.6);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 220px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0f0b;
}

.search-box .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.search-box input {
  width: 100%;
  height: 33px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 10px;
}

.search-box input::placeholder {
  color: #596255;
}

.toolbar-note {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.customer-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 13px;
}

.customer-stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.customer-stat span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
}

.customer-stat strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 13px;
  align-items: start;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.info-panel h3 {
  margin: 8px 0 9px;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.info-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.75;
}

.check-list {
  margin: 10px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.9;
  list-style: none;
}

.check-list li::before {
  content: "—";
  margin-right: 6px;
  color: var(--lime);
}

/* Modals */
.admin-modal {
  width: calc(100% - 32px);
  max-width: 540px;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.admin-modal::backdrop {
  background: rgba(3, 5, 2, 0.8);
  backdrop-filter: blur(10px);
}

.admin-modal[open] {
  animation: modal-in 200ms ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card {
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #11150f;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  overflow: auto;
}

.modal-card-wide {
  max-width: 760px;
  margin: 0 auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 6px 0 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.modal-body {
  padding: 22px 24px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line);
}

.modal-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 10px;
}

.modal-hint {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.65;
}

.refund-meta {
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0f0b;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.7;
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.mini-stat {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.014);
  color: var(--muted);
  font-size: 8px;
}

.mini-stat strong {
  margin-left: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.stock-tabs {
  margin-bottom: 12px;
}

.stock-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.stock-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.stock-row:last-child {
  border-bottom: 0;
}

.stock-code {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.stock-order {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
}

.stock-status {
  color: var(--muted-2);
  font-size: 8px;
}

.stock-empty {
  padding: 30px;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.012);
}

.detail-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.detail-item strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin: 0 0 9px;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.detail-cards {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-code {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed rgba(216, 255, 95, 0.22);
  border-radius: 7px;
  background: #0c0f0b;
}

.detail-code code {
  flex: 1;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.detail-code button {
  border: 0;
  background: transparent;
  color: var(--muted-2);
}

.detail-code button:hover {
  color: var(--text);
}

.detail-code .icon {
  width: 12px;
  height: 12px;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #1a2016;
  color: var(--text);
  font-size: 10px;
  line-height: 1.55;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
  animation: toast-in 200ms ease both;
}

.toast.is-success::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--lime);
  color: #10130b;
  font-size: 9px;
  font-weight: 800;
}

.toast.is-error {
  border-color: rgba(255, 123, 114, 0.3);
}

.toast.is-error::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--danger);
  color: #260907;
  font-size: 9px;
  font-weight: 800;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

@media (max-width: 1220px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-grid-even {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 190px;
  }

  .chart-track {
    height: 130px;
  }
}

@media (max-width: 1000px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-aside {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }

  .login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 48px;
    color: var(--text);
    font-size: 13px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    height: auto;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand {
    padding: 0;
  }

  .sidebar-brand .brand-type small {
    display: none;
  }

  .sidebar-label,
  .sidebar-note,
  .sidebar-store {
    display: none;
  }

  .admin-nav {
    flex-direction: row;
    gap: 2px;
    margin-left: auto;
    overflow-x: auto;
  }

  .nav-item {
    width: auto;
    padding: 8px 10px;
  }

  .nav-item > span {
    font-size: 10px;
  }

  .nav-item small {
    display: none;
  }

  .nav-item.is-active::before {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: -11px;
    width: auto;
    height: 2px;
    transform: none;
  }

  .sidebar-footer {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .logout-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .topbar {
    min-height: 74px;
    padding: 14px 20px;
  }

  .admin-main {
    padding: 20px 20px 50px;
  }

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

  .settings-side {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sidebar {
    gap: 6px;
    padding: 9px 10px;
  }

  .sidebar-brand .brand-type {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 17px;
  }

  .admin-nav {
    gap: 0;
  }

  .nav-item {
    padding: 8px;
  }

  .nav-item > span {
    display: none;
  }

  .nav-item .icon {
    width: 16px;
    height: 16px;
  }

  .nav-item.is-active::before {
    display: none;
  }

  .topbar {
    min-height: 64px;
    padding: 10px 14px;
  }

  .topbar-title p {
    display: none;
  }

  .topbar-title h1 {
    font-size: 21px;
  }

  .topbar-user > span:last-child {
    display: none;
  }

  .admin-main {
    padding: 14px 12px 40px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .metric-card {
    min-height: 132px;
    padding: 14px;
  }

  .metric-card > strong {
    margin-top: 18px;
    font-size: 1.35rem;
  }

  .dashboard-grid {
    gap: 8px;
    margin-top: 8px;
  }

  .panel {
    padding: 16px;
    border-radius: 14px;
  }

  .panel-head {
    margin-bottom: 14px;
  }

  .chart {
    gap: 5px;
    height: 170px;
  }

  .chart-track {
    height: 115px;
  }

  .chart-value {
    display: none;
  }

  .section-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
  }

  .section-bar h2 {
    font-size: 25px;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .search-box {
    width: 100%;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .customer-stats {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .settings-side {
    grid-template-columns: 1fr;
  }

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

  .field-full {
    grid-column: auto;
  }

  .modal-head,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-foot {
    padding: 12px 16px 16px;
  }

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

  .login-panel {
    padding: 24px;
  }

  .toast-region {
    right: 10px;
    bottom: 10px;
    left: 10px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 430px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 118px;
  }

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

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