:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --paper: #f7f8f7;
  --card: rgba(255, 255, 255, 0.92);
  --line: #e4e7ec;
  --gold: #b98a2e;
  --gold-dark: #8b641c;
  --green: #087a62;
  --red: #b42318;
  --orange: #b54708;
  --blue: #175cd3;
  --shadow: 0 18px 55px rgba(17, 24, 39, 0.09);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(185, 138, 46, 0.11), transparent 28rem),
    radial-gradient(circle at 5% 90%, rgba(8, 122, 98, 0.08), transparent 25rem),
    var(--paper);
  font-family: Tahoma, Arial, sans-serif;
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
.ambient { position: fixed; border-radius: 999px; filter: blur(60px); opacity: .25; pointer-events: none; }
.ambient-one { width: 18rem; height: 18rem; background: #d9b76f; top: -8rem; right: 12%; }
.ambient-two { width: 15rem; height: 15rem; background: #83c7b7; bottom: -7rem; left: 10%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: .9rem clamp(1rem, 4vw, 4rem);
  background: rgba(247, 248, 247, 0.86);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(145deg, var(--ink), #2f3b50); color: #f0d69d; font-size: 1.4rem; font-weight: 800;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .16);
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: .15rem; color: var(--muted); font-size: .72rem; }
.top-nav { display: flex; align-items: center; gap: .6rem; }
.nav-link { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: .65rem .85rem; border-radius: 10px; }
.nav-link:hover { color: var(--ink); background: white; }

.page-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 5rem) 0 4rem; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 7vw, 6rem); align-items: center; min-height: 68vh; }
.eyebrow { margin: 0 0 1rem; color: var(--gold-dark); font-weight: 800; font-size: .84rem; letter-spacing: .03em; }
h1 { margin: 0; font-size: clamp(2.25rem, 6vw, 5rem); line-height: 1.08; letter-spacing: -.04em; }
.hero-copy > p:not(.eyebrow) { max-width: 650px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.95; }
.hero-actions, .row-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: .5rem; min-height: 46px;
  padding: .75rem 1.1rem; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--ink); box-shadow: 0 10px 30px rgba(17, 24, 39, .18); }
.button-gold { color: #201708; background: linear-gradient(135deg, #e3c378, #c3953c); box-shadow: 0 10px 28px rgba(185, 138, 46, .22); }
.button-secondary { color: var(--ink); background: white; border-color: var(--line); }
.button-danger { color: white; background: var(--red); }
.button-warning { color: white; background: var(--orange); }
.button-small { min-height: 34px; padding: .45rem .7rem; font-size: .78rem; border-radius: 9px; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.hero-card, .card {
  position: relative; background: var(--card); border: 1px solid rgba(255,255,255,.85); border-radius: 22px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.hero-card { padding: 1.2rem; transform: rotate(-1deg); }
.preview-bar { display: flex; justify-content: space-between; align-items: center; padding: .35rem .2rem 1rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #d0d5dd; margin-left: 4px; }
.dot.live { background: #12b76a; box-shadow: 0 0 0 5px rgba(18, 183, 106, .12); }
.preview-order { padding: 1rem; margin-top: .7rem; background: #f9fafb; border: 1px solid var(--line); border-radius: 15px; }
.preview-order strong, .preview-order span { display: block; }
.preview-order span { color: var(--muted); margin-top: .4rem; font-size: .86rem; }
.preview-order .ready { color: var(--green); font-weight: 800; }

.auth-wrap { display: grid; place-items: center; min-height: 68vh; }
.auth-card { width: min(520px, 100%); padding: clamp(1.4rem, 4vw, 2.4rem); }
.auth-card h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.lead { color: var(--muted); line-height: 1.8; }
.form-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: .45rem; color: #344054; font-size: .87rem; font-weight: 700; }
input, textarea, select {
  width: 100%; min-height: 46px; padding: .75rem .9rem; border: 1px solid #d0d5dd; border-radius: 11px;
  background: white; color: var(--ink); outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(185, 138, 46, .12); }
.form-note { color: var(--muted); font-size: .8rem; line-height: 1.7; }
.error-box, .notice-box { padding: .9rem 1rem; border-radius: 11px; line-height: 1.7; }
.error-box { color: #7a271a; background: #fef3f2; border: 1px solid #fecdca; }
.notice-box { color: #175cd3; background: #eff8ff; border: 1px solid #b2ddff; }

.dashboard-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.dashboard-head h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); }
.dashboard-head p { color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; margin: 1.2rem 0; }
.metric { padding: 1rem; background: white; border: 1px solid var(--line); border-radius: 15px; }
.metric span { display: block; color: var(--muted); font-size: .78rem; }
.metric strong { display: block; margin-top: .35rem; font-size: 1.7rem; }
.card { padding: 1.2rem; margin-top: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; font-size: 1.1rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 820px; background: white; }
th, td { padding: .8rem; text-align: right; border-bottom: 1px solid #eaecf0; vertical-align: middle; }
th { background: #f9fafb; color: #475467; font-size: .75rem; }
td { font-size: .83rem; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 800; }
.badge-active, .badge-sent { color: #05603a; background: #ecfdf3; }
.badge-pending { color: #854a0e; background: #fffaeb; }
.badge-suspended { color: #93370d; background: #fff4ed; }
.badge-blocked, .badge-cancelled { color: #912018; background: #fef3f2; }
.badge-missing { color: #93370d; background: #fff4ed; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.link { color: var(--blue); font-weight: 700; }
.mono { direction: ltr; unicode-bidi: embed; font-family: Consolas, monospace; }
.connect-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; padding: 1.2rem; background: linear-gradient(135deg, #111827, #26344a); color: white; border-radius: 18px; }
.connect-panel p { color: #d0d5dd; margin-bottom: 0; }
.pending-view { text-align: center; padding: 3rem 1rem; }
.pending-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 1.2rem; border-radius: 50%; background: #fffaeb; color: var(--orange); font-size: 2rem; }
.toast { position: fixed; left: 1.2rem; bottom: 1.2rem; z-index: 30; max-width: min(420px, calc(100% - 2.4rem)); padding: .9rem 1rem; border-radius: 12px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-card { transform: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-head { display: grid; }
}
@media (max-width: 620px) {
  .site-header { min-height: 66px; }
  .brand small { display: none; }
  .page-shell { width: min(100% - 1rem, 1180px); padding-top: 1.3rem; }
  .form-grid.two { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .connect-panel { grid-template-columns: 1fr; }
  .top-nav .nav-link:first-child { display: none; }
}
