:root {
  --app-bg: #eef2f7;
  --surface: #ffffff;
  --muted: #64748b;
  --border: #d9e2ec;
  --accent: #0f766e;
  --accent-soft: #e6fffb;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  background: var(--app-bg);
  color: #0f172a;
}

.app-layout {
  background: var(--app-bg);
}

.app-sidebar {
  width: 250px;
  background: linear-gradient(180deg, #0f172a 0%, #0b1221 100%);
  color: #e2e8f0;
}

.app-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.main-nav .tab-btn {
  width: 100%;
  border: 1px solid #334155;
  background: transparent;
  color: #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.86rem;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
}

.main-nav .tab-btn:hover {
  border-color: #64748b;
  color: #f8fafc;
}

.main-nav .tab-btn.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.app-workspace {
  min-width: 0;
}

.layout {
  display: grid;
  gap: 0.65rem;
}

.view {
  display: none;
  gap: 0.65rem;
}

.view.active {
  display: grid;
}

.card {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(2, 8, 20, 0.04);
  padding: 0.75rem;
}

h2,
h3,
h4 {
  font-family: "Montserrat", sans-serif;
}

h2 {
  font-size: 1rem;
  margin: 0 0 0.55rem;
}

h3 {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

h4 {
  font-size: 0.9rem;
  margin: 0 0 0.35rem;
}

.hint,
.event-meta {
  color: var(--muted);
  font-size: 0.79rem;
  margin-top: 0.3rem;
}

.grid-form {
  display: grid;
  gap: 0.5rem;
  align-items: end;
}

.grid-form label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.8rem;
}

.grid-form label > span {
  color: #475569;
  font-weight: 500;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(165px, 1fr));
}

.three-cols {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.four-cols {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.compact-grid {
  grid-auto-flow: dense;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 0.48rem;
  min-height: 2rem;
  padding: 0.26rem 0.52rem;
  font-size: 0.82rem;
}

button {
  border: 1px solid transparent;
  border-radius: 0.48rem;
  min-height: 2rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.btn-primary:hover {
  background: #0d665f;
}

.btn-secondary {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1f2937;
}

.btn-secondary:hover {
  background: #eef2f7;
}

.btn-danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: var(--danger);
}

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

.icon-row button,
#seatObjectForm .actions-inline button {
  min-width: 2rem;
  width: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: end;
}

.toolbar-row label {
  min-width: 220px;
}

.editor-grid {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(280px, 370px) minmax(420px, 1fr);
}

.panel-sub {
  border: 1px dashed #d1d9e6;
  border-radius: 0.6rem;
  padding: 0.55rem;
  background: #fff;
}

.canvas-wrap {
  min-height: 160px;
  border-radius: 0.55rem;
  border: 1px solid var(--border);
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  overflow: auto;
  padding: 0.45rem;
}

#seatingCanvasWrap,
#ticketSeatCanvasWrap {
  min-height: 420px;
}

.stack-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.stack-list.small {
  max-height: 220px;
  overflow: auto;
}

.list-item,
.event-card {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.5rem;
  background: #fff;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.pill {
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
  border: 1px solid var(--border);
  background: #fff;
}

.inline-checks {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inline-checks span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.inline-checks.tight {
  border: 1px solid var(--border);
  border-radius: 0.48rem;
  padding: 0.22rem 0.45rem;
  min-height: 2rem;
  font-size: 0.78rem;
}

.toast-container {
  z-index: 2500;
}

.toast {
  border: none;
}

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

  .four-cols {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 980px) {
  .app-layout {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
  }

  .main-nav {
    flex-direction: row !important;
    flex-wrap: wrap;
  }

  .main-nav .tab-btn {
    width: auto;
  }

  .three-cols,
  .four-cols {
    grid-template-columns: repeat(2, minmax(145px, 1fr));
  }
}

@media (max-width: 680px) {
  .two-cols,
  .three-cols,
  .four-cols {
    grid-template-columns: 1fr;
  }

  #seatingCanvasWrap,
  #ticketSeatCanvasWrap {
    min-height: 340px;
  }
}
