/* BroadTools Console para apps web (LED Calc, Signal Planner, Captioner, Talks, RF Manager).
   Mesmos tokens dos apps de computador (redesign/console.css e DESIGN.md):
   cada tela é um equipamento de régie. Chassi grafite quente, áreas de trabalho
   rebaixadas ("poços") e comandos como teclas físicas.
   Cor só com significado de operação: vermelho = programa (no ar), verde = pronto /
   ligado, âmbar = atenção, azul = seleção / edição. Nada de vermelho decorativo.

   Uso: <link rel="stylesheet" href="/_kit/bt-console.css">
   Tema escuro é o padrão; <html data-tema="claro"> troca para o claro. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..900&display=swap');

:root {
	--chassi: #17191c;      /* fundo da janela */
	--topo: #121417;        /* cabeçalho e barra de status */
	--poco: #0e0f11;        /* áreas rebaixadas: listas, editores, monitores */
	--painel: #1f2226;      /* painéis e cartões */
	--tecla: #2a2d32;       /* face da tecla */
	--tecla-topo: #30343a;  /* degradê da tecla */
	--tecla-2: #33373d;     /* tecla com o mouse em cima */
	--linha: #2e3137;
	--linha-2: #3a3e45;
	--texto: #ecebe6;
	--mudo: #8d939b;
	--apagado: #5c626a;
	--lamp-off: #3b3f46;
	--programa: #e5322d;
	--preview: #23b26a;
	--atencao: #f0a43a;
	--edicao: #4f8ef7;
	--raio: 8px;
	--raio-cartao: 10px;
	--fonte: Archivo, system-ui, -apple-system, 'Segoe UI', sans-serif;
	color-scheme: dark;
}
:root[data-tema="claro"] {
	--chassi: #eceef1; --topo: #24272d; --poco: #ffffff; --painel: #f7f8fa;
	--tecla: #e4e7eb; --tecla-topo: #f2f4f6; --tecla-2: #dde1e6;
	--linha: #d3d8de; --linha-2: #b9c0c8; --texto: #15171a; --mudo: #59606a; --apagado: #8a919b; --lamp-off: #c3c8cf;
	--programa: #d42a25; --preview: #1c7c45; --atencao: #8f5a00; --edicao: #2f6fde;
	color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	font-family: var(--fonte); font-size: 14px; font-weight: 500; font-stretch: 100%; line-height: 1.4;
	color: var(--texto); background: var(--chassi); -webkit-font-smoothing: antialiased;
	min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--edicao); }
:focus-visible { outline: 2px solid var(--edicao); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ cabeçalho */
.topo {
	display: flex; align-items: center; gap: 16px; min-height: 52px; padding: 0 16px;
	background: var(--topo); border-bottom: 1px solid #2e3137; color: #ecebe6;
}
.marca { display: flex; align-items: center; gap: 10px; font-stretch: 112%; font-weight: 750; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; color: inherit; text-decoration: none; }
.marca .grade { display: grid; grid-template-columns: repeat(3, 6px); gap: 2px; }
.marca .grade i { width: 6px; height: 6px; border-radius: 1.5px; background: #3b3f46; }
.marca .grade i.on { background: var(--programa); box-shadow: 0 0 6px #e5322d88; }
.marca small { font-stretch: 100%; font-weight: 500; font-size: 12px; color: #8d939b; margin-left: 2px; }
.espaco { flex: 1; }
.topo .quem { color: #8d939b; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .quem b { color: #ecebe6; font-weight: 600; }

/* Barra de status */
.status { display: flex; align-items: center; gap: 18px; min-height: 28px; padding: 0 16px; background: var(--topo); border-top: 1px solid #2e3137; color: #8d939b; font-size: 12px; }

/* ------------------------------------------------------------ lâmpadas */
.lamp { display: inline-flex; align-items: center; gap: 7px; color: var(--mudo); font-size: 12px; white-space: nowrap; }
.lamp::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lamp-off); box-shadow: inset 0 1px 1px #0008; flex: none; }
.lamp.verde::before { background: var(--preview); box-shadow: 0 0 6px #23b26a99; }
.lamp.vermelho::before { background: var(--programa); box-shadow: 0 0 7px #e5322daa; }
.lamp.ambar::before { background: var(--atencao); box-shadow: 0 0 6px #f0a43a99; }
.lamp.azul::before { background: var(--edicao); box-shadow: 0 0 6px #4f8ef799; }
.lamp b { color: var(--texto); font-weight: 600; }

/* ------------------------------------------------------------ teclas */
.tecla, button {
	font: inherit; font-weight: 600; color: var(--texto); text-decoration: none; cursor: pointer;
	background: linear-gradient(var(--tecla-topo), var(--tecla)); border: 0; border-radius: 7px;
	box-shadow: inset 0 1px 0 #ffffff12, 0 1px 0 #00000080, 0 0 0 1px #0000004d;
	height: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.tecla:hover, button:hover { background: linear-gradient(#383c43, var(--tecla-2)); }
:root[data-tema="claro"] .tecla:hover, :root[data-tema="claro"] button:hover { background: linear-gradient(#fff, var(--tecla-2)); }
.tecla:active, button:active { transform: translateY(1px); box-shadow: inset 0 1px 2px #0008, 0 0 0 1px #0000004d; }
.tecla:disabled, button:disabled { opacity: .5; cursor: default; transform: none; }
.tecla .atalho, button .atalho { font-stretch: 75%; font-weight: 700; font-size: 11px; color: var(--mudo); background: #00000040; border-radius: 3px; padding: 1px 5px; }
.tecla.grande { height: 46px; font-size: 15px; padding: 0 18px; }
.tecla.ico { width: 36px; padding: 0; }
.tecla.larga { width: 100%; }
.tecla.fantasma { background: none; box-shadow: none; color: var(--mudo); }
.tecla.fantasma:hover { color: var(--texto); background: #ffffff0d; }
/* No ar (ativa vermelha) */
.tecla.prog { background: linear-gradient(#3a1414, #2d1011); box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 1px var(--programa), 0 0 14px #e5322d55; color: #fff; }
/* Pronto / ligado */
.tecla.prev { box-shadow: inset 0 1px 0 #ffffff12, 0 0 0 1px var(--preview), 0 0 12px #23b26a44; }
/* Atenção */
.tecla.ambar { box-shadow: inset 0 1px 0 #ffffff12, 0 0 0 1px var(--atencao), 0 0 12px #f0a43a44; color: #ffd9a3; }
/* Ação que coloca algo no ar */
.tecla.vai { background: linear-gradient(#e83a35, #cf2a25); box-shadow: inset 0 1px 0 #ffffff33, 0 1px 0 #0009; color: #fff; }
/* Ação principal comum (entrar, salvar, iniciar): verde sólido */
.tecla.ok { background: linear-gradient(#27c072, #1f9e5d); box-shadow: inset 0 1px 0 #ffffff33, 0 1px 0 #0009; color: #fff; }
.tecla.ok:hover { background: linear-gradient(#2fcc7c, #22a965); }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Controle segmentado */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--poco); box-shadow: inset 0 1px 2px #0009; }
.seg button, .seg span { height: 28px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; color: var(--mudo); font-weight: 600; white-space: nowrap; background: none; box-shadow: none; }
.seg .on, .seg [aria-pressed="true"] { color: var(--texto); background: linear-gradient(#34383e, #2c2f34); box-shadow: inset 0 1px 0 #ffffff14, 0 1px 2px #0008; }

/* ------------------------------------------------------------ superfícies */
.poco { background: var(--poco); border-radius: var(--raio); box-shadow: inset 0 1px 3px #000c, 0 0 0 1px #ffffff08; }
.painel { background: var(--painel); border-radius: var(--raio-cartao); box-shadow: inset 0 1px 0 #ffffff0d, 0 0 0 1px #0000004d; }
.rotulo { font-size: 12px; font-weight: 600; color: var(--mudo); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.rotulo .linha-fim { flex: 1; height: 1px; background: var(--linha); }
/* Leituras numéricas (timecode, contadores): condensada, algarismos tabulares */
.leitura { font-stretch: 72%; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1; }
.mudo { color: var(--mudo); }

/* ------------------------------------------------------------ campos */
.campo, input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
	font: inherit; color: var(--texto); width: 100%; min-height: 36px; padding: 0 12px;
	background: var(--poco); border: 0; border-radius: 7px; box-shadow: inset 0 1px 2px #000a, 0 0 0 1px #ffffff0a;
}
textarea { padding: 8px 12px; min-height: 80px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--apagado); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 1px 2px #000a, 0 0 0 1px var(--edicao); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mudo); }
input[type=checkbox], input[type=radio] { accent-color: var(--preview); width: 16px; height: 16px; }

/* Mensagens */
.msg { margin: 0; padding: 10px 12px; border-radius: 7px; font-size: 13px; background: var(--poco); box-shadow: inset 0 0 0 1px var(--linha); }
.msg.erro { color: #ffc9c7; box-shadow: inset 0 0 0 1px #e5322d88; background: #2a1112; }
.msg.aviso { color: #ffd9a3; box-shadow: inset 0 0 0 1px #f0a43a88; background: #2a1f0f; }
.msg.ok { color: #b9f0d2; box-shadow: inset 0 0 0 1px #23b26a88; background: #0f2219; }
:root[data-tema="claro"] .msg.erro { color: #8a1c18; background: #fdecec; }
:root[data-tema="claro"] .msg.aviso { color: #6b4300; background: #fff4e0; }
:root[data-tema="claro"] .msg.ok { color: #145c33; background: #e8f6ee; }

/* ------------------------------------------------------------ cartão de login */
.tela-login { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.cartao-login {
	width: 100%; max-width: 380px; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 14px;
	background: var(--painel); border-radius: 12px; box-shadow: inset 0 1px 0 #ffffff0d, 0 0 0 1px #0000004d, 0 24px 48px -24px #000c;
}
.cartao-login .marca { font-size: 20px; margin-bottom: 2px; }
.cartao-login h1 { margin: 0; font-stretch: 112%; font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1.15; }
.cartao-login p { margin: 0; color: var(--mudo); font-size: 13px; }
.cartao-login form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.cartao-login .rodape { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--mudo); }
.cartao-login .rodape a { color: var(--mudo); }
.cartao-login .rodape a:hover { color: var(--texto); }

@media (max-width: 560px) {
	.topo { gap: 10px; padding: 0 12px; }
	.topo .quem { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}
