/* Ticket.bot dock: built for an OBS Custom Browser Dock (narrow, dark). */
:root {
	--bg: #16161d;
	--panel: #1f1f29;
	--panel-2: #272734;
	--line: #34344a;
	--text: #ececf3;
	--muted: #9a9ab0;
	--accent: #8b5cf6;
	--accent-2: #22d3ee;
	--ok: #34d399;
	--warn: #fbbf24;
	--danger: #ef4444;
	--radius: 8px;
	color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 13px/1.4 "Segoe UI", system-ui, sans-serif;
}

body { padding: 10px; }

button, input, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.top-logo { width: 34px; height: 34px; }

.top-name { display: flex; flex-direction: column; min-width: 0; }
.top-name b { font-size: 15px; letter-spacing: .5px; }

.conn { font-size: 11px; color: var(--muted); }
.conn::before {
	content: "";
	display: inline-block;
	width: 7px; height: 7px;
	border-radius: 50%;
	margin-right: 5px;
	background: var(--danger);
	vertical-align: 1px;
}
.conn.on::before { background: var(--ok); }

.btn-stop {
	margin-left: auto;
	background: var(--danger);
	border: 0;
	border-radius: var(--radius);
	color: #fff;
	font-weight: 800;
	letter-spacing: .5px;
	padding: 9px 12px;
	cursor: pointer;
	box-shadow: 0 0 0 2px #ef444455;
}
.btn-stop:hover { filter: brightness(1.12); }
.btn-stop:active { transform: translateY(1px); }

/* ---------- banners ---------- */
.banner {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	padding: 9px 10px;
	border-radius: var(--radius);
	margin-bottom: 10px;
}
.banner.danger { background: #ef444426; border: 1px solid #ef444480; }
.banner.warn { background: #fbbf241f; border: 1px solid #fbbf2470; }

/* ---------- status ---------- */
.status {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 10px;
	margin-bottom: 10px;
}

.status-main { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.idle { background: var(--ok); }
.dot.busy { background: var(--accent-2); animation: pulse 1s infinite alternate; }
.dot.wait { background: var(--warn); }
.dot.stop { background: var(--danger); }
@keyframes pulse { to { opacity: .35; } }

.status-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	margin: 10px 0;
}
.status-grid div {
	background: var(--panel-2);
	border-radius: 6px;
	padding: 6px;
	text-align: center;
	min-width: 0;
}
.status-grid b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-grid span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

.status-actions { display: flex; align-items: center; gap: 8px; }

.pill {
	margin-left: auto;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 99px;
	background: var(--panel-2);
	color: var(--muted);
}
.pill.pdf { color: var(--accent-2); }
.pill.printer { color: var(--warn); }

/* ---------- buttons ---------- */
.btn {
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 6px 12px;
	cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); }
.danger-btn { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tabs button {
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	padding: 6px 10px;
	color: var(--muted);
	cursor: pointer;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 8px;
	border-radius: 6px;
	background: var(--panel);
	margin-bottom: 4px;
}
.list .kind {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: .5px;
	background: var(--panel-2);
	color: var(--accent-2);
	border-radius: 4px;
	padding: 1px 6px;
	flex: none;
}
.list .what { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .what small { color: var(--muted); }
.list .count { font-weight: 800; color: var(--warn); flex: none; }
.list .meta { color: var(--muted); font-size: 11px; flex: none; }
.list .x {
	background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px;
}
.list .x:hover { color: var(--danger); }
.list li.printing { outline: 1px solid var(--accent-2); }
.list .st-printed { color: var(--ok); }
.list .st-error { color: var(--danger); }
.list .st-skipped, .list .st-duplicate { color: var(--muted); }

.empty { color: var(--muted); padding: 14px 4px; text-align: center; }

.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.confirm {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 8px;
	border-radius: 6px;
	background: #ef44441c;
	border: 1px solid #ef444466;
	margin: 6px 0;
}

/* ---------- settings ---------- */
h3 {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .8px;
	color: var(--muted);
	margin: 16px 0 6px;
}
h3:first-child { margin-top: 0; }

.field {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 0;
	border-bottom: 1px solid #ffffff0a;
}
.field > span { display: flex; flex-direction: column; min-width: 0; }
.field small { color: var(--muted); font-size: 11px; }
.field input[type="text"], .field input[type="number"], .field select {
	width: 130px;
	flex: none;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 5px 7px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

.hint { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }

/* ---------- test ---------- */
.test-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

.preview-wrap {
	background: #fff;
	border-radius: var(--radius);
	padding: 8px 0;
	display: flex;
	justify-content: center;
	overflow: auto;
	max-height: 70vh;
}
#preview { border: 0; width: 272px; height: 600px; background: #fff; }

/* hidden iframe used to measure ticket height */
.measure {
	position: absolute;
	left: -9999px;
	top: 0;
	width: 272px;
	height: 100px;
	border: 0;
	visibility: hidden;
}
