:root {
  --bg: #0b1220;
  --bg-2: #10192b;
  --card: #151d30;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef3ff;
  --mute: #8b97b0;
  --yellow: #ffe600;
  --green: #22c55e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.admin-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px 1fr;
  font-family: Manrope, sans-serif;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, .admin-brand strong, .ticket-off {
  font-family: Outfit, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }

.admin-side {
  background: #0a111e;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
}

.admin-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--yellow);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.admin-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.admin-brand small,
.side-user small { display: block; color: var(--mute); font-size: 12px; }

.side-label {
  color: var(--mute);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 16px 8px 8px;
}

.admin-side nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #c5cedf;
  font-weight: 700;
  font-size: 14px;
}

.admin-side nav a b {
  margin-left: auto;
  background: #1b2538;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}

.admin-side nav a.is-on,
.admin-side nav a:hover { background: #151d30; color: #fff; }

.side-user {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 8px 4px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1d4ed8;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.admin-main { padding: 18px 28px 48px; }

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  color: var(--mute);
}

.admin-top-actions { display: flex; gap: 8px; }

.ghost {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-grid article,
.config-card,
.cat-grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}

.stat-grid p { color: var(--mute); font-size: 13px; }
.stat-grid strong { display: block; font-size: 28px; margin: 6px 0 4px; }
.up { color: #4ade80; font-size: 12px; font-weight: 700; }
.warn { color: #fbbf24; font-size: 12px; font-weight: 700; }

.publish-wrap {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  margin-bottom: 36px;
}

.muted { color: var(--mute); margin: 8px 0 18px; line-height: 1.5; }

.publish-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}

.form-step { margin-bottom: 22px; }
.step { color: var(--mute); font-size: 12px; font-weight: 800; letter-spacing: 0.04em; margin-bottom: 10px; }

.type-toggle, .tag-row { display: flex; gap: 8px; background: #0e1626; padding: 4px; border-radius: 12px; }

.type-btn, .tag-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: #c5cedf;
  font-weight: 800;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

.type-btn.is-on { background: var(--yellow); color: #111; }
.tag-btn.is-on { background: var(--yellow); color: #111; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

label { display: block; margin-bottom: 12px; position: relative; }
label span { display: block; color: var(--mute); font-size: 12px; font-weight: 700; margin-bottom: 6px; }

input, select {
  width: 100%;
  background: #0e1626;
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 10px;
  padding: 11px 12px;
}

input.has-prefix { padding-left: 28px; }
.prefix { position: absolute; left: 12px; bottom: 11px; color: var(--mute); font-weight: 800; }
label span.prefix { display: inline; margin: 0; }

.hint { color: var(--mute); font-size: 12px; margin-top: -6px; }

.publish-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.publish-bar p { color: var(--mute); font-size: 13px; }
.publish-bar div { display: flex; gap: 8px; }

.btn-draft, .btn-pub {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-draft { background: #1b2436; color: #fff; }
.btn-pub { background: var(--yellow); color: #111; }

.preview-label { color: var(--mute); font-size: 12px; margin-bottom: 10px; }

.ticket {
  background: #f4efe4;
  color: #111;
  border-radius: 16px;
  min-height: 150px;
  display: grid;
  grid-template-columns: 1fr 42px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
}

.ticket > div:first-child { padding: 16px 18px; }
.ticket-tag {
  display: inline-block;
  background: #111;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
}
.ticket-off { font-size: 28px; margin: 10px 0 4px; }
.ticket-note, .ticket-url { color: #5b6474; font-size: 13px; }
.ticket-code {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: grid;
  place-items: center;
  border-left: 2px dashed #d7d0c3;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.preview-help {
  margin-top: 14px;
  background: #102033;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: #9fb0c9;
  font-size: 13px;
  line-height: 1.45;
}
.preview-help i { color: var(--green); margin-right: 6px; }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.table-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0e1626;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
}
.search input { border: 0; background: transparent; padding: 8px 0; }
.search i { color: var(--mute); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--mute); font-size: 12px; font-weight: 700; padding: 10px 8px; border-bottom: 1px solid var(--line); }
td { padding: 14px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td strong { display: block; }
td small { color: var(--mute); }

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state.active { background: rgba(34,197,94,.12); color: #4ade80; }
.state.soon { background: rgba(251,191,36,.12); color: #fbbf24; }
.state.expired { background: rgba(248,113,113,.12); color: #f87171; }
.state.draft { background: rgba(148,163,184,.12); color: #94a3b8; }

.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions a, .row-actions button {
  width: 32px; height: 32px; border: 0; background: transparent; color: var(--mute); cursor: pointer;
  display: grid; place-items: center;
}
.row-actions a:hover, .row-actions button:hover { color: #fff; }

.notice { border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; }
.notice.ok { background: rgba(34,197,94,.12); color: #86efac; }
.notice.err { background: rgba(248,113,113,.12); color: #fecaca; }
.empty { color: var(--mute); text-align: center; padding: 24px; }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.admin-block h1 { margin-bottom: 8px; }

.ticket-kicker {
  color: #5b6474;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-top: 8px;
}

.ticket-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.ticket-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}

button.ticket {
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.ticket-facts {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 4px 4px 0;
}

.ticket-facts span {
  display: block;
  color: var(--mute);
  font-size: 11px;
}

.ticket-facts strong {
  font-size: 13px;
}

.coupon-actions {
  margin-top: 12px;
}
.coupon-actions .btn-pub {
  justify-content: center;
  width: 100%;
}

.ticket-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.ticket-card-actions form { display: inline; }
.ghost.danger { color: #f87171; }

body.public-home, body.auth-app {
  min-height: 100vh;
  font-family: Manrope, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.pub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: #0a111e;
}

.pub-header .admin-brand { margin: 0; }
.pub-nav { display: flex; gap: 18px; color: var(--mute); font-weight: 700; font-size: 14px; }
.pub-nav a:hover { color: #fff; }

.pub-hero, .pub-section { padding: 40px 28px; max-width: 1180px; margin: 0 auto; }
.pub-hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 32px;
  align-items: center;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34,197,94,.12);
  color: #86efac;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}
.live-pill span {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
}

.pub-hero h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.05; margin-bottom: 12px; }
.pub-hero em { color: var(--yellow); font-style: normal; }
.muted { color: var(--mute); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 22px; }
.hero-actions .ghost { display: inline-flex; align-items: center; }

.pub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pub-stats div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.pub-stats strong { display: block; font-size: 22px; font-family: Outfit, sans-serif; }
.pub-stats span { color: var(--mute); font-size: 12px; }

.hero-stack {
  display: grid;
  gap: 14px;
  align-content: center;
}
.hero-stack .ticket { max-width: 360px; width: 100%; }
.stack-0 { transform: rotate(-3deg); }
.stack-1 { transform: rotate(3deg) translateX(18px); }

.pub-section h2 { font-size: 28px; margin-bottom: 6px; }
.pub-section > .muted { margin-bottom: 18px; }

.view-page-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow);
  color: #111;
  font-weight: 800;
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 14px 32px rgba(0,0,0,.35);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 20;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.auth-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}
.auth-card h1 { margin: 4px 0 8px; }
.auth-card label { display: block; margin: 12px 0; }
.auth-card label span { display: block; color: var(--mute); font-size: 12px; margin-bottom: 6px; }
.auth-card input {
  width: 100%;
  background: #0e1626;
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}
.auth-card .btn-pub { width: 100%; border: 0; padding: 12px; border-radius: 12px; font-weight: 800; cursor: pointer; margin-top: 8px; }
.auth-error { color: #fecaca; background: rgba(248,113,113,.12); padding: 8px 10px; border-radius: 10px; }
.auth-switch { margin-top: 14px; color: var(--mute); text-align: center; }
.auth-switch a { color: var(--yellow); font-weight: 800; }

@media (max-width: 1100px) {
  body.admin-app { grid-template-columns: 1fr; }
  .admin-side { min-height: auto; }
  .stat-grid, .publish-wrap, .two, .cat-grid, .pub-hero, .pub-stats { grid-template-columns: 1fr; }
  .pub-header { flex-wrap: wrap; }
  .hero-stack { min-height: auto; }
  .stack-0, .stack-1 { transform: none; }
}
