:root {
    --bg: #0f1115;
    --panel: #171a21;
    --border: #2a2e37;
    --text: #e6e8eb;
    --muted: #8b93a1;
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --success: #2ecc71;
    --error: #ef5865;
    --warn: #f0b429;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}

.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 14px; }

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

h1 { font-size: 1.5rem; margin-bottom: 16px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}
.card.narrow { max-width: 420px; margin: 40px auto; }

.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--muted);
}
label.checkbox { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; color: var(--text); }
label.checkbox input { width: auto; }

input[type=text], input[type=password], input[type=number], input[type=url], select {
    width: 100%;
    margin-top: 6px;
    padding: 9px 10px;
    background: #0d0f13;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 18px;
}
legend { padding: 0 8px; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Browsers give form controls (button/select/input) their own default UI
   font instead of inheriting the page's -- without this, buttons like
   "Preview" visibly mismatch plain links like "Edit watch" right next to
   them even though both use the same CSS font-family declared on :root. */
button, select, input {
    font-family: inherit;
}

button, .button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-block;
}
button:hover, .button:hover { background: var(--accent-hover); text-decoration: none; }

.link-button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
}
.link-button:hover { text-decoration: underline; }
.link-button.danger { color: var(--error); }

.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; }
.search-row button { flex-shrink: 0; }

.event-results { list-style: none; padding: 0; margin: 10px 0; max-height: 320px; overflow-y: auto; }
.event-result {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
}
.event-result:hover { border-color: var(--accent); background: #1c2030; }

.selected-event {
    background: #12241a;
    border: 1px solid #1e4a30;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0 14px;
}

.form-actions { display: flex; gap: 14px; align-items: center; margin-top: 8px; }

table.watches { width: 100%; border-collapse: collapse; }
table.watches th, table.watches td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
table.watches th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.actions { white-space: nowrap; display: flex; gap: 10px; }

.preview-row td { background: #10131a; }
.preview-body { padding: 6px 0; }
table.preview-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.preview-table th, table.preview-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

.banner {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.banner.warn { background: #241d0d; border: 1px solid #4a3a12; color: var(--warn); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--error); }
.success { color: var(--success); }

/* Multi-filter dashboard */
.watch-card { padding: 20px; }
.watch-title { font-size: 1.1rem; }
.badge-paused {
    display: inline-block;
    background: #241d0d;
    color: var(--warn);
    border: 1px solid #4a3a12;
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 0.75rem;
    margin-left: 8px;
    vertical-align: middle;
}

table.filters-table { width: 100%; border-collapse: collapse; margin: 14px 0 8px; }
table.filters-table th, table.filters-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
table.filters-table th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }

.preview-row { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.preview-body { padding: 6px 0; }
.preview-filter { margin-bottom: 14px; }
table.preview-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
table.preview-table th, table.preview-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

/* Filter form helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1c2030;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 6px 4px 12px;
    font-size: 0.85rem;
}
.chip-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 6px;
}
.chip-remove:hover { color: var(--error); }

kbd {
    background: #0d0f13;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.85em;
}

/* Interactive seat map */
.seatmap-wrap {
    background: #0d0f13;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    margin: 10px 0;
    max-height: 520px;
    overflow: auto;
}
.seatmap-svg { width: 100%; height: auto; display: block; user-select: none; }
.seat-section {
    fill: #2a3550;
    stroke: #454f6e;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.1s;
}
.seat-section:hover { fill: #3a4770; }
.seat-section.selected { fill: var(--accent); stroke: #7c86f7; }

.seat-label {
    fill: #e6e8eb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    pointer-events: none;
}

.rubber-band {
    position: fixed;
    border: 1px dashed var(--accent);
    background: rgba(88, 101, 242, 0.15);
    pointer-events: none;
    z-index: 999;
}
