/* Roth's Screen Manager */
:root {
	--red: #c8102e;
	--red-dark: #a50d25;
	--bg: #f4f5f7;
	--card: #ffffff;
	--ink: #1c2128;
	--ink-soft: #5b6472;
	--line: #e2e5ea;
	--ok: #1a7f37;
	--warn: #b35c00;
	--radius: 10px;
	--shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	background: var(--bg);
	color: var(--ink);
	font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; }
a { color: var(--red); }

/* ---- login ---- */
#login-view {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(160deg, #22262c 0%, #3a3f47 60%, #55210f 100%);
	padding: 20px;
}
.login-card {
	background: var(--card);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
	padding: 38px 34px 30px;
	width: 100%;
	max-width: 380px;
	text-align: center;
}
.login-logo { max-width: 150px; margin-bottom: 8px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-sub { margin: 0 0 24px; color: var(--ink-soft); font-size: 14px; }
.login-card label { display: block; text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 14px; }
.login-card input { margin-top: 4px; }

/* ---- app frame ---- */
#topbar {
	background: #22262c;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 0 22px;
	height: 56px;
	position: sticky;
	top: 0;
	z-index: 50;
}
#topbar .brand { font-weight: 700; font-size: 17px; white-space: nowrap; }
#topbar .brand span { color: #ff6b81; }
#topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
#topbar nav button {
	background: none;
	border: 0;
	color: #c8cdd4;
	font: inherit;
	font-size: 14px;
	padding: 8px 14px;
	border-radius: 8px;
	cursor: pointer;
	white-space: nowrap;
}
#topbar nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
#topbar nav button.on { background: var(--red); color: #fff; }
#topbar .who { font-size: 13px; color: #aab1ba; text-align: right; line-height: 1.25; }
#topbar .who b { color: #fff; display: block; }
main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 22px; }
.page-head .sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }

/* ---- cards / tables ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-pad { padding: 18px 20px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.muted { color: var(--ink-soft); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.num { text-align: right; }

/* ---- badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #e7f5ec; color: var(--ok); }
.badge-off { background: #f0f1f3; color: var(--ink-soft); }
.badge-warn { background: #fff3e4; color: var(--warn); }
.badge-red { background: #fdebee; color: var(--red); }
.badge-admin { background: #ede9fe; color: #5b21b6; }

/* ---- buttons / forms ---- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 8px;
	cursor: pointer;
	transition: background .12s, border-color .12s;
}
.btn:hover { background: #f4f5f7; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #eef0f2; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=number], select {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid #cfd4db;
	border-radius: 8px;
	font: inherit;
	background: #fff;
	color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(200, 16, 46, .25); border-color: var(--red); }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.form-error { color: var(--red); font-size: 13.5px; margin-top: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: auto; }

/* ---- toasts ---- */
#toast-holder { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast {
	background: #22262c;
	color: #fff;
	padding: 11px 16px;
	border-radius: 9px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
	font-size: 14px;
	max-width: 340px;
	animation: toast-in .18s ease-out;
}
.toast.err { background: var(--red-dark); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- modal ---- */
#modal-root {
	position: fixed;
	inset: 0;
	background: rgba(15, 18, 22, .55);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 7vh 16px 16px;
	z-index: 200;
	overflow-y: auto;
}
.modal {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 18px 60px rgba(0, 0, 0, .4);
	width: 100%;
	max-width: 460px;
	padding: 24px 26px;
	animation: toast-in .15s ease-out;
}
.modal h3 { margin: 0 0 16px; font-size: 19px; }
.modal-wide { max-width: 660px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---- playlist editor ---- */
.pl-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: #fff;
	margin-bottom: 8px;
}
.pl-item.inactive { opacity: .55; }
.pl-order { width: 26px; text-align: center; font-weight: 700; color: var(--ink-soft); }
.pl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-len { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.pl-tools { display: flex; gap: 3px; }
.pl-tools button { border: 0; background: none; cursor: pointer; font-size: 15px; padding: 3px 6px; border-radius: 6px; color: var(--ink-soft); }
.pl-tools button:hover { background: #eef0f2; color: var(--ink); }
.pl-total { font-weight: 700; padding: 10px 2px; }
.sync-note { font-size: 13px; padding: 10px 12px; border-radius: 9px; background: #fff8ec; border: 1px solid #f3dfb6; color: #7a5200; margin: 10px 0; }
.sync-note.ok { background: #eef8f0; border-color: #cfe8d6; color: var(--ok); }

/* ---- upload ---- */
.drop-zone {
	border: 2px dashed #cfd4db;
	border-radius: 12px;
	padding: 34px 20px;
	text-align: center;
	color: var(--ink-soft);
	cursor: pointer;
	transition: border-color .12s, background .12s;
}
.drop-zone.hover { border-color: var(--red); background: #fdf6f7; }
.progress { height: 10px; background: #edeff2; border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress > div { height: 100%; width: 0; background: var(--red); border-radius: 999px; transition: width .2s; }

/* ---- misc ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.temp-pass {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 20px;
	background: #f4f5f7;
	border: 1px dashed #cfd4db;
	border-radius: 9px;
	padding: 12px;
	text-align: center;
	user-select: all;
	margin: 12px 0;
}
.empty { text-align: center; color: var(--ink-soft); padding: 34px 10px; }
@media (max-width: 720px) {
	.grid-2 { grid-template-columns: 1fr; }
	#topbar { height: auto; flex-wrap: wrap; padding: 10px 14px; }
	#topbar .who { display: none; }
}

/* ---- video previews ---- */
.vthumb {
	width: 96px;
	height: 54px;
	object-fit: cover;
	border-radius: 6px;
	background: #191c20;
	cursor: pointer;
	display: block;
	border: 1px solid var(--line);
}
.vthumb:hover { outline: 2px solid var(--red); }
.vthumb-missing {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #8a919b;
	font-size: 11px;
	cursor: default;
}
.vplayer { width: 100%; border-radius: 9px; background: #000; display: block; }

/* ---- group cards on the TVs tab ---- */
.group-card { margin-bottom: 18px; }
.group-card + .group-card { margin-top: 0; }
.group-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 13px 20px;
	border-bottom: 1px solid var(--line);
	background: #fafbfc;
	border-radius: var(--radius) var(--radius) 0 0;
}
.group-name { font-weight: 700; font-size: 16px; margin-right: 8px; }

/* Website ads (admin.roths.com) */
.ad-thumb { width: 96px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid #e3e6ea; display: block; background: #f5f6f8; }
.ad-thumb.vthumb-missing { display: flex; align-items: center; justify-content: center; font-size: 12px; }
tr.row-dim td { opacity: .55; }
.check-inline { display: inline-flex; gap: 6px; align-items: center; margin: 4px 14px 4px 0; font-weight: 400; }
.check-inline input { width: auto; }
.card + .card { margin-top: 18px; }
.login-alt { margin: 14px 0 0; text-align: center; font-size: 14px; }
.form-note { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #e7f5ec; color: var(--ok); font-size: 14px; }
.ad-group .group-head .badge { margin-left: 8px; }
.ad-section { padding: 12px 16px; border-top: 1px solid #eef0f3; }
.ad-section-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ad-section-head .btn { margin-left: auto; }
.ad-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px dashed #eef0f3; }
.ad-item:first-of-type { border-top: 0; }
.ad-item-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ad-item-tools, .ad-order { white-space: nowrap; }
.ad-list-head { margin: 22px 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0; }
.drop-zone.dz-small { padding: 18px 14px; }
.drop-zone.picked { border-style: solid; border-color: var(--ok); background: #f3faf5; }
.drop-zone .dz-name { margin-top: 4px; color: var(--ink); font-weight: 600; }
.ad-fold { background: #fff; border: 1px solid #e3e6ea; border-radius: 12px; margin-bottom: 10px; }
.ad-fold > summary { cursor: pointer; padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.ad-fold > summary::before { content: 'B8'; color: var(--ink-soft); }
.ad-fold[open] > summary::before { content: 'BE'; }
.ad-fold > .card { margin: 0; border: 0; box-shadow: none; border-top: 1px solid #eef0f3; border-radius: 0 0 12px 12px; }
