:root {
  --bg: #fff4d6;
  --surface: #fffdf7;
  --ink: #263238;
  --muted: #6a6258;
  --line: #f0d9ae;
  --orange: #ff7a1a;
  --orange-dark: #e65300;
  --yellow: #ffd43b;
  --green: #6fbe35;
  --blue: #1584d1;
  --red: #d92d20;
  --shadow: 0 18px 44px rgba(180, 91, 18, .16);
  --shadow-strong: 0 26px 70px rgba(180, 91, 18, .24);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 212, 59, .45), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(111, 190, 53, .25), transparent 26%),
    linear-gradient(180deg, #fff3ce 0%, var(--bg) 48%, #fffaf0 100%);
}

.top {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(230, 83, 0, .2);
  background: linear-gradient(90deg, rgba(255,253,247,.98), rgba(255,247,221,.96));
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 210px;
}
.brand-logo { width: 76px; height: 50px; object-fit: contain; }
.brand strong { display: block; font-size: 18px; color: var(--orange-dark); }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.mark { display: none; }

nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav-item, .button, button {
  appearance: none;
  border: 1px solid rgba(230, 83, 0, .22);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(180, 91, 18, .08);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.nav-item:hover, .button:hover, button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(180, 91, 18, .16);
}
.nav-item.active, .primary {
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%);
  border-color: var(--orange-dark);
  color: white;
}
.secondary {
  background: linear-gradient(180deg, #7fd957 0%, #43a834 100%);
  border-color: #43a834;
  color: white;
}
.danger { color: var(--red); }
.actions, .action-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.login-shell {
  min-height: calc(100vh - 96px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  align-items: center;
  gap: 30px;
}
.login-copy {
  padding: 44px;
  min-height: 430px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 212, 59, .65), transparent 34%),
    radial-gradient(circle at 88% 20%, rgba(111, 190, 53, .28), transparent 30%),
    linear-gradient(135deg, #fff8dd 0%, #fffdf7 100%);
  border: 1px solid rgba(230, 83, 0, .22);
  box-shadow: var(--shadow-strong);
}
.login-logo { width: 180px; max-width: 48%; display: block; margin-bottom: 22px; }
.login-copy h1 { max-width: 520px; font-size: 52px; line-height: 1; margin: 0 0 16px; color: var(--orange-dark); }
.login-copy p { font-size: 20px; color: #3b342d; max-width: 500px; font-weight: 800; }

.panel, .list-card, .ticket, .stats div, .empty {
  background: rgba(255, 253, 247, .98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel {
  position: relative;
  overflow: hidden;
}
.panel:before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--yellow), var(--green), var(--blue));
}
.panel { padding: 22px; }
.login-card { display: grid; gap: 14px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
h1, h2 { margin: 0 0 10px; }
h1 { color: var(--orange-dark); font-size: 34px; }
h2 { font-size: 21px; }
p { color: var(--muted); margin: 0 0 10px; }

label { display: grid; gap: 7px; font-weight: 900; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: white;
  outline-color: var(--orange);
}
textarea { min-height: 110px; resize: vertical; }
.csv-box { min-height: 420px; font-family: Consolas, monospace; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.form-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.stack { display: grid; gap: 12px; }

.invite-note {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px dashed var(--orange);
  border-radius: 8px;
  background: #fff8e7;
  color: var(--muted);
  font-weight: 900;
}
.invite-note img { width: 110px; border-radius: 8px; border: 1px solid var(--line); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stats div { padding: 18px; border-left: 6px solid var(--orange); }
.stats div:nth-child(2) { border-left-color: var(--green); }
.stats div:nth-child(3) { border-left-color: var(--blue); }
.stats div:nth-child(4) { border-left-color: var(--yellow); }
.stats b { display: block; font-size: 36px; color: var(--orange-dark); }
.stats span { color: var(--muted); font-weight: 900; }
.stats.big b { font-size: 42px; }

.list-card {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}
.list-card strong { font-size: 18px; color: var(--orange-dark); }
.list-card span, td small { display: block; color: var(--muted); margin-top: 4px; }
.metric { text-align: center; }
.metric b { font-size: 30px; display: block; color: var(--blue); }
.copy { grid-column: 1 / -1; font-size: 14px; color: var(--blue); font-weight: 800; }
.copy-line { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-line .copy { grid-column: auto; }
.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--line);
  background: #fff8e7;
  color: var(--orange-dark);
}
.status-badge.ready { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.status-badge.live { background: #e0f2fe; border-color: #bae6fd; color: #075985; }
.status-badge.done { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.status-badge.canceled { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.ops-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffdf7;
  box-shadow: var(--shadow);
}
.ops-card h2 { color: var(--orange-dark); margin-bottom: 4px; }
.ops-card .actions { grid-column: 1 / -1; }
.ops-metrics {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  align-items: baseline;
  text-align: right;
}
.ops-metrics strong { color: var(--blue); font-size: 24px; }
.ops-metrics span { color: var(--muted); font-size: 12px; font-weight: 900; }
.mini-alert {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  text-decoration: none;
  color: inherit;
}
.mini-alert strong { color: var(--orange-dark); }
.mini-alert span { color: var(--muted); font-weight: 800; }
.operation-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.operation-strip div {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffdf7;
  box-shadow: 0 8px 20px rgba(180, 91, 18, .08);
}
.operation-strip span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.operation-strip strong { display: block; margin-top: 3px; color: var(--ink); overflow-wrap: anywhere; }

table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 13px; background: #fff3d7; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.table-head input { max-width: 320px; }
.small { padding: 7px 10px; font-size: 13px; }
.muted-row { opacity: .5; }

.scanner-card video {
  width: 100%;
  min-height: 280px;
  background: #1f2933;
  border: 3px solid var(--orange);
  border-radius: 8px;
  object-fit: cover;
}

.alert { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; padding: 12px; border-radius: 8px; }
.ok { background: #ecfdf3; border: 1px solid #bbf7d0; color: #166534; padding: 12px; border-radius: 8px; margin-bottom: 16px; font-weight: 900; }
.empty { padding: 28px; color: var(--muted); }
.success-toast {
  position: fixed;
  z-index: 30;
  top: 18px;
  left: 50%;
  width: min(520px, calc(100vw - 28px));
  transform: translate(-50%, -140%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 8px;
  color: #134e25;
  background: linear-gradient(180deg, #ecfdf3, #dcfce7);
  border: 2px solid #86efac;
  box-shadow: 0 22px 50px rgba(22, 101, 52, .24);
  transition: transform .22s ease;
}
.success-toast.show { transform: translate(-50%, 0); }
.success-toast strong { font-size: 18px; color: #166534; }
.success-toast span { grid-column: 1; font-weight: 900; }
.success-toast button {
  grid-row: 1 / span 2;
  grid-column: 2;
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}

.public-hero {
  padding: 22px 0;
  display: flex;
  align-items: center;
  gap: 18px;
}
.public-hero img { width: 150px; max-width: 35vw; }
.public-hero h1 { font-size: 42px; }
.invite-preview {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
}
.ticket { max-width: 470px; margin: 30px auto; padding: 24px; text-align: center; }
.ticket-logo { width: 160px; max-width: 70%; margin-bottom: 12px; }
.ticket img:not(.ticket-logo) { width: 280px; max-width: 100%; background: white; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.ticket code { display: block; margin: 10px 0; color: var(--blue); font-weight: 900; word-break: break-all; }
.ticket .primary { margin-top: 18px; }
.guide p { line-height: 1.45; }
.party-select-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.party-select-card {
  display: grid;
  gap: 7px;
  padding: 18px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #fffdf7;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-left: 7px solid var(--orange);
}
.party-select-card strong { color: var(--orange-dark); font-size: 22px; }
.party-select-card span { color: var(--ink); font-weight: 900; }
.party-select-card small { color: var(--muted); font-weight: 800; }
.party-select-card em { color: var(--blue); font-style: normal; font-weight: 900; }
.table-input {
  padding: 8px;
  min-width: 220px;
  font-weight: 900;
}
.table-input.phone-edit { margin-top: 7px; font-size: 14px; padding: 9px 10px; }
.manual-card input, .manual-card select { font-size: 18px; padding: 14px; }
.manual-card {
  background: linear-gradient(180deg, #fffdf7, #fff8e7);
}
.closure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.closure-guest {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8e7;
}
.closure-guest input { font-weight: 900; padding: 8px; }
.closure-guest small { color: var(--muted); font-weight: 800; }

.client-hero {
  padding: 22px;
  margin-bottom: 18px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--orange) 0%, #ff9d2f 55%, var(--green) 100%);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.client-hero h1 { color: white; margin: 0; }
.client-hero p { color: white; font-weight: 900; }
.hero-action { background: white; color: var(--orange-dark); border-color: white; white-space: nowrap; }
.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.menu-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #fffdf7;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.menu-card strong { color: var(--orange-dark); font-size: 21px; }
.menu-card span { color: var(--muted); font-weight: 800; line-height: 1.35; }
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.details-grid div {
  padding: 12px;
  border-radius: 8px;
  background: #fff8e7;
  border: 1px solid var(--line);
}
.details-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.details-grid strong { display: block; margin-top: 5px; color: var(--ink); }
.table-scroll { overflow-x: auto; }
.inline-form { display: contents; }
.danger-button {
  background: #fff1f2;
  color: var(--red);
  border-color: #fecdd3;
}
.briefing-section h2 {
  padding-left: 12px;
  border-left: 6px solid var(--orange);
}
.briefing-note {
  padding: 12px;
  margin: 0 0 14px;
  border-radius: 8px;
  background: #fff8e7;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}
.briefing-note.attention {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.briefing-field[style*="display: none"] { margin: 0; }
.review-section ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.package-card textarea { min-height: 88px; }
.attention-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.attention-tags span {
  background: #fff3d7;
  border: 1px solid var(--line);
  color: var(--orange-dark);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 900;
  font-size: 12px;
}
.print-page {
  max-width: 980px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.print-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.print-head {
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 4px solid var(--orange);
  padding-bottom: 16px;
  margin-bottom: 18px;
}
.print-head img { width: 160px; height: 90px; object-fit: contain; }
.print-block { break-inside: avoid; margin: 0 0 18px; }
.print-block h2 { color: var(--orange-dark); margin-bottom: 8px; }
.print-block th { width: 36%; }

@media (max-width: 900px) {
  .top, .page-head { align-items: flex-start; flex-direction: column; }
  nav { justify-content: flex-start; }
  main { padding: 16px; }
  .login-shell, .grid-2, .form-grid, .form-grid.compact, .stats, .list-card { grid-template-columns: 1fr; }
  .login-copy { min-height: auto; padding: 24px; }
  .login-copy h1 { font-size: 38px; }
  .brand { min-width: 0; }
  .table-head { align-items: stretch; flex-direction: column; }
  table { font-size: 14px; }
  .invite-note { grid-template-columns: 1fr; }
  .menu-grid, .details-grid, .party-select-grid, .closure-grid, .operation-strip, .ops-card { grid-template-columns: 1fr; }
  .client-hero { flex-direction: column; align-items: flex-start; }
  .hero-action { width: 100%; text-align: center; }
  .ops-metrics { grid-template-columns: repeat(3, auto); text-align: left; }
  .scanner-card video { min-height: 360px; }
  .nav-item { flex: 1 1 auto; text-align: center; }
  .brand-logo { width: 94px; }
}

@media print {
  .top, .button, button, .print-actions { display: none !important; }
  body { background: white; }
  main { max-width: none; padding: 0; }
  .ticket { box-shadow: none; border: 0; }
  .print-page { border: 0; box-shadow: none; padding: 0; }
  .print-block table { page-break-inside: avoid; }
}
