[hidden] { display: none !important; }
@font-face { font-family: 'SLText'; src: url('/shared/fonts/Inter-Regular.woff') format('woff'); font-weight: 400; }
@font-face { font-family: 'SLText'; src: url('/shared/fonts/Inter-Medium.woff') format('woff'); font-weight: 500; }
@font-face { font-family: 'SLText'; src: url('/shared/fonts/Inter-SemiBold.woff') format('woff'); font-weight: 600; }
@font-face { font-family: 'SLText'; src: url('/shared/fonts/Inter-Bold.woff') format('woff'); font-weight: 700; }

:root {
  --bg: #0f1216; --panel: #171b21; --panel2: #1e232b; --line: #2a3039; --text: #e7ebf0; --muted: #8b95a3;
  --red: #ff4d43; --amber: #ffb020; --green: #2fd36a; --blue: #3d8bff; --purple: #9b7bff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 'SLText', 'Segoe UI', system-ui, sans-serif; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--panel2); color: var(--text); font-weight: 600; }
button:hover { filter: brightness(1.15); }
button:disabled { opacity: .4; cursor: default; filter: none; }
button.green { background: var(--green); color: #04210f; }
button.red { background: var(--red); color: #fff; }
button.amber { background: var(--amber); color: #2b1d00; }
button.blue { background: var(--blue); color: #fff; }
button.ghost { background: transparent; color: var(--muted); }
input, select { font: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; }
input:focus, select:focus { border-color: var(--blue); }

.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2f6df6, #ff8a3d); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; }

.login { height: 100%; display: flex; align-items: center; justify-content: center; background: radial-gradient(900px 500px at 30% 20%, #1b2a4a, var(--bg)); }
.login-box { width: 330px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.login-box label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.login-box button { background: var(--blue); color: #fff; padding: 11px; }
.login-box .err { color: var(--red); margin: 0; min-height: 18px; }
.login-box .hint { color: var(--muted); font-size: 12px; margin: 0; }

.app { height: 100%; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 20px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.lines { display: flex; gap: 8px; flex: 1; }
.line-pill { padding: 6px 12px; border-radius: 999px; background: var(--panel2); font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.line-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.line-pill.ringing i { background: var(--red); animation: blink .8s infinite; }
.line-pill.ringing.non i { background: var(--amber); }
.top-right { display: flex; gap: 14px; align-items: center; }
.conn { font-size: 12px; color: var(--amber); }
.conn.ok { color: var(--green); }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; }
@keyframes blink { 50% { opacity: .25; } }

.grid { flex: 1; display: grid; grid-template-columns: 330px 1fr 360px; grid-template-rows: 1fr 260px; gap: 12px; padding: 12px; min-height: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-height: 0; display: flex; flex-direction: column; }
.panel h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.count { background: var(--panel2); color: var(--text); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.history { grid-column: 1 / 4; overflow: auto; }

.queue-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.qcall { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.qcall.ringing { border-left-color: var(--red); animation: ringbg 1s infinite; }
.qcall.ringing.non { border-left-color: var(--amber); animation: none; }
.qcall.active { border-left-color: var(--green); }
.qcall.held { border-left-color: var(--purple); }
.qcall.sel { outline: 2px solid var(--blue); }
.qcall .q-top { display: flex; justify-content: space-between; font-weight: 600; }
.qcall .q-num { font-size: 16px; font-variant-numeric: tabular-nums; }
.qcall .q-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--line); }
.tag.e911 { background: var(--red); color: #fff; }
.tag.non { background: var(--amber); color: #2b1d00; }
.tag.cb { background: var(--blue); color: #fff; }
@keyframes ringbg { 50% { background: #3a1c1c; } }
.dial { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 10px; }
.dial input { grid-column: 1 / 3; min-width: 0; }

.current { gap: 14px; }
.current .empty { margin: auto; color: var(--muted); text-align: center; }
.current .empty b { display: block; font-size: 18px; color: var(--text); margin-bottom: 4px; }
.c-head { display: flex; justify-content: space-between; align-items: flex-start; }
.c-ani { font-size: 34px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.c-sub { color: var(--muted); }
.c-state { text-align: right; }
.c-state .timer { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ali { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; }
.ali dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.ali dd { margin: 0; font-weight: 600; }
.ali .big { font-size: 18px; }
.ali .stale { color: var(--amber); }
.c-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.c-btns button { padding: 12px 18px; font-size: 15px; }
.meter { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
.meter b { display: block; height: 100%; width: 0; background: var(--green); transition: width .08s; }
.note { color: var(--muted); font-size: 12px; }

.text-list { display: flex; flex-direction: column; gap: 6px; max-height: 40%; overflow: auto; }
.tthread { background: var(--panel2); border-radius: 10px; padding: 8px 10px; cursor: pointer; border-left: 4px solid var(--line); }
.tthread.unread { border-left-color: var(--red); }
.tthread.sel { outline: 2px solid var(--blue); }
.tthread .tt-top { display: flex; justify-content: space-between; font-weight: 600; }
.tthread .tt-last { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-view { flex: 1; display: flex; flex-direction: column; margin-top: 10px; min-height: 0; }
.text-view .msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.text-view .m { max-width: 80%; padding: 7px 11px; border-radius: 14px; background: var(--panel2); white-space: pre-wrap; }
.text-view .m.us { align-self: flex-end; background: var(--blue); }
.text-view .m small { display: block; font-size: 11px; opacity: .65; }
.text-view form { display: flex; gap: 6px; }
.text-view form input { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
td .tag { margin-right: 4px; }
tr.abandoned td:nth-child(4) { color: var(--red); font-weight: 600; }
.keys { color: var(--muted); font-size: 12px; padding: 0 16px 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #2a3039; padding: 10px 16px; border-radius: 10px; }
