* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f6f9;
  color: #1a1a1a;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin: 0;
}

.auth-card .subtitle {
  color: #888;
  font-size: 0.88rem;
  text-align: center;
  margin: 0.4rem 0 2rem;
}

form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 1rem 0 0.3rem;
}

form label:first-child {
  margin-top: 0;
}

form input[type='email'],
form input[type='password'],
form input[type='text'],
form textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

form textarea {
  font-family: inherit;
  resize: vertical;
}

.table-input {
  width: 100%;
  min-width: 8rem;
  padding: 0.4rem 0.6rem;
  border: 1.5px solid transparent;
  border-radius: 6px;
  font-size: 0.88rem;
  background: transparent;
  font-family: inherit;
}

.table-input:hover,
.table-input:focus {
  border-color: #d1d5db;
  background: #fff;
}

.table-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

form input.code-input {
  text-align: center;
  letter-spacing: 0.3em;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: monospace;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.7rem 1rem;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.btn:hover {
  background: #000;
}

.alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
}

.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  margin-top: 1.2rem;
}

.hint {
  background: #fffbea;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

.center-link {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.83rem;
}

.center-link.tight {
  margin-top: 0;
}

.center-link a {
  color: #888;
}

.setup-box {
  text-align: center;
  margin-bottom: 1rem;
}

.setup-box img {
  border-radius: 8px;
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 180px;
  margin: 0 auto 1rem;
  display: block;
}

.setup-box .secret-label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.setup-box code {
  font-size: 0.85rem;
  letter-spacing: 0.07em;
  font-weight: 700;
  word-break: break-all;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: #111827;
  color: #fff;
  padding: 0.9rem 1.5rem;
  flex-wrap: wrap;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.brand-logo {
  height: 28px;
  width: 28px;
  display: block;
  background: #fff;
  border-radius: 50%;
  padding: 2px;
}

.topnav-links {
  display: flex;
  gap: 1.2rem;
  flex: 1;
}

.topnav-links a {
  color: #d1d5db;
  font-size: 0.9rem;
  text-decoration: none;
}

.topnav-links a:hover {
  color: #fff;
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #f3f4f6;
  font-weight: 500;
}

.topnav-user a {
  color: #f3f4f6;
}

.session-timer {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f3f4f6;
  font-variant-numeric: tabular-nums;
  padding: 0.15em 0.55em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
}

.session-timer.session-timer-warning {
  color: #fff;
  background: #dc2626;
}

.page {
  max-width: 960px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.page h1 {
  margin-bottom: 0.3rem;
}

.page .meta {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
}

.plan-rename-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.plan-rename-input {
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border: 1.5px solid transparent;
  border-radius: 6px;
  min-width: 16rem;
  font-family: inherit;
}

.plan-rename-input:hover,
.plan-rename-input:focus {
  border-color: #d1d5db;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

table.data-table th,
table.data-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

table.data-table th {
  background: #f9fafb;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1rem;
  margin: 1rem 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.25rem;
}

.checkbox-grid label {
  font-size: 0.88rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.form-inline {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-inline label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.form-inline input,
.form-inline select {
  padding: 0.5rem 0.6rem;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
}

.btn-sm {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-sm:hover {
  background: #000;
}

.btn-sm.danger {
  background: #dc2626;
}

.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.btn-sm.danger:hover {
  background: #b91c1c;
}

.btn-sm.ghost {
  background: #fff;
  color: #111827;
  border: 1.5px solid #d1d5db;
}

.pill {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #eef2ff;
  color: #3730a3;
}

.pill-queued {
  background: #eef2ff;
  color: #3730a3;
}

.pill-retrying {
  background: #fef3c7;
  color: #92400e;
}

.pill-sent {
  background: #dcfce7;
  color: #166534;
}

.pill-failed {
  background: #fef2f2;
  color: #991b1b;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-tabs a {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: #555;
  background: #f0f0f0;
}

.filter-tabs a.active {
  background: #111827;
  color: #fff;
}

.empty-state {
  color: #888;
  font-size: 0.9rem;
  padding: 1.5rem;
  text-align: center;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.breadcrumbs a {
  color: #888;
}

.inline-form {
  display: inline;
}

.editor-toolbar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.editor-toolbar label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.editor-toolbar select,
.editor-toolbar input {
  padding: 0.45rem 0.6rem;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
}

.editor-toolbar-status {
  font-size: 0.82rem;
  color: #888;
  align-self: center;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zoom-controls span {
  font-size: 0.85rem;
  color: #555;
  min-width: 3.2em;
  text-align: center;
}

.editor-toolbar-status.is-error {
  color: #dc2626;
}

.side-panel-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.editor-layout {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.editor-canvas-wrap {
  width: 100%;
  overflow: auto;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  max-height: 640px;
}

.editor-canvas-wrap svg {
  display: block;
  cursor: crosshair;
}

.editor-side-panel {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
}

.editor-side-panel .field {
  display: flex;
  flex-direction: column;
}

.editor-side-panel label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.editor-side-panel input,
.editor-side-panel select {
  width: 160px;
  padding: 0.45rem 0.6rem;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
}

.editor-side-panel .side-panel-actions {
  margin-top: 0;
}

.panel-status {
  width: 100%;
  min-height: 1.2em;
  padding: 0;
  font-size: 0.85rem;
  transition: padding 0.15s ease;
}

.panel-status:empty {
  display: none;
}

.panel-status.is-success {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.panel-status.is-error {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.seat-circle {
  stroke: #fff;
  stroke-width: 1.5;
  cursor: grab;
}

.seat-circle.selected {
  stroke: #111827;
  stroke-width: 2.5;
}

.seat-label {
  font-size: 8px;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  font-family: monospace;
}

.stage-rect {
  fill: #374151;
  stroke: #111827;
  stroke-width: 1.5;
  rx: 6;
  cursor: grab;
}

.stage-rect.selected {
  stroke: #2563eb;
  stroke-width: 3;
}

.stage-label {
  font-size: 13px;
  font-weight: 600;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.marker-rect {
  fill: #fef9c3;
  stroke: #a16207;
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  rx: 4;
  cursor: grab;
}

.marker-rect.selected {
  stroke: #2563eb;
  stroke-width: 3;
  stroke-dasharray: none;
}

.marker-label {
  font-size: 12px;
  font-weight: 600;
  fill: #713f12;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.area-rect {
  fill-opacity: 0.35;
  stroke: #1f2937;
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  cursor: grab;
}

.area-rect.selected {
  stroke: #2563eb;
  stroke-width: 3;
  stroke-dasharray: none;
}

.area-label {
  font-size: 13px;
  font-weight: 600;
  fill: #1f2937;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.resize-handle {
  fill: #2563eb;
  stroke: #fff;
  stroke-width: 1;
}

.resize-handle.dir-n,
.resize-handle.dir-s {
  cursor: ns-resize;
}

.resize-handle.dir-e,
.resize-handle.dir-w {
  cursor: ew-resize;
}

.resize-handle.dir-nw,
.resize-handle.dir-se {
  cursor: nwse-resize;
}

.resize-handle.dir-ne,
.resize-handle.dir-sw {
  cursor: nesw-resize;
}

.color-swatch {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 0.4em;
}

/* ── News ────────────────────────────────────────────────────────────────── */

.news-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 560px;
}

.news-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.news-form label {
  font-size: 0.78rem;
  font-weight: 600;
}

.news-form textarea {
  font-family: inherit;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  resize: vertical;
}

.news-item {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
}

.news-item summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  list-style: none;
}

.news-item summary::-webkit-details-marker {
  display: none;
}

.news-item-title {
  font-weight: 600;
  flex: 1;
}

.news-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}

.news-thumb-large {
  max-width: 240px;
  max-height: 160px;
  display: block;
  border-radius: 8px;
  margin-bottom: 0.4rem;
}

.news-item form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}
