/* AllWA additions on top of app.css (the single-number panel's design, unchanged). */

/* ---------- sign in / sign up */
.auth { width: min(400px, 100%); background: var(--panel); padding: 26px 26px 22px; border-radius: 18px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.login .auth form { width: auto; background: none; padding: 0; box-shadow: none; border-radius: 0; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .logo { margin: 0; }
.auth-brand b { display: block; font-size: 20px; }
.auth-brand span { color: var(--muted); font-size: 13px; }
.auth-tabs { display: flex; gap: 4px; background: var(--panel-2); border-radius: 12px; padding: 4px; }
.login .auth-tabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px; font-weight: 600; color: var(--muted); }
.login .auth-tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.login .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.login .small { margin: 0; }
.login button[disabled] { opacity: .6; }

/* ---------- support (impersonation) bar */
.imp-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 80; height: 36px; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #b7791f; color: #fff; font-size: 13px; font-weight: 600; padding: 0 12px; white-space: nowrap; overflow: hidden; }
.imp-bar span { overflow: hidden; text-overflow: ellipsis; }
.imp-bar button { border: 0; border-radius: 8px; padding: 4px 10px; background: rgba(0, 0, 0, .25); color: #fff; font-weight: 600; font-size: 12.5px; flex: none; }
body.imp .app { height: calc(100dvh - 36px); margin-top: 36px; }

/* ---------- number switcher (rail) */
.rail { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.nums { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.num { position: relative; width: 46px; height: 46px; border: 0; padding: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; flex: none; }
.num::before { content: ""; position: absolute; left: -11px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--accent); transform: translateY(-50%); transition: height .15s; }
.num.on::before { height: 28px; }
.num:hover::before { height: 12px; }
.num.on:hover::before { height: 28px; }
.num-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: none; transition: border-radius .15s; }
.num.on .num-av, .num:hover .num-av { border-radius: 13px; }
.num-av.sm { width: 30px; height: 30px; font-size: 11.5px; }
.num .pip { top: 2px; right: 2px; }
.num-badge { position: absolute; bottom: -2px; right: -4px; background: var(--danger); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--rail); }
.rail-sep { width: 28px; height: 2px; border-radius: 1px; background: var(--line); margin: 4px 0; flex: none; }
.rail-btn.add-num { border: 1.5px dashed var(--line); color: var(--accent-2); }
.rail-btn, .me-av, .rail .logo { flex: none; }
a.rail-btn { text-decoration: none; }
button.me-av { border: 0; cursor: pointer; }

/* ---------- number switcher (phones) */
.num-switch { margin: 0 14px 10px; display: none; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px;
  padding: 8px 10px; text-align: left; position: relative; }
.num-switch .ns-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 45%; }
.num-switch .ns-sub { font-size: 12px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num-switch .ns-caret { color: var(--muted); margin-left: auto; }
.num-switch .num-badge { position: static; border: 0; }

/* ---------- numbers list, team, account */
.nums-body, .team-body { padding: 14px 16px 18px; overflow-y: auto; display: grid; gap: 6px; }
.nums-body > .btn, .team-body > .btn { justify-self: start; margin-top: 8px; }
.num-row { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 9px 10px; border-radius: 12px; text-align: left; width: 100%; }
.num-row:hover { background: var(--hover); }
.num-row.on { background: var(--sel); }
.num-row svg { color: var(--accent-2); }
.nr-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-list { display: grid; gap: 4px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-row .tags { flex-wrap: wrap; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.nc-body .acts, .line-body .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.nc-body .acts { justify-content: flex-end; }
.nc-body .lab-toggles { margin-top: 2px; }
.me-who { font-size: 18px; font-weight: 700; }
.me-links { display: grid; gap: 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; }
.me-links svg { color: var(--muted); }
.pw-form { display: grid; gap: 8px; }
.pw-form h4 { margin: 0; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.pw-form input { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 9px 11px; outline: none; }
.pw-form .btn { justify-self: end; }

/* ---------- linking: QR / pairing code */
.seg { display: flex; gap: 4px; background: var(--panel-2); border-radius: 12px; padding: 4px; width: 100%; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.pair-code { font: 700 34px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 4px; background: var(--panel-2); border-radius: 14px; padding: 14px 18px; user-select: all; }
.line-body .row-gap { width: 100%; }
.line-body .row-gap input { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 9px 11px; outline: none; }
.note-line { margin: 0; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, #ffbc38 16%, var(--panel)); font-size: 13px; text-align: left; width: 100%; }
.spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.line-more { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; border-top: 1px solid var(--line); padding-top: 10px; width: 100%; }
.line-more .lp-link { border: 0; background: none; color: var(--accent-2); font-weight: 600; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; }
.line-more .lp-link:hover { background: var(--hover); }
.danger-t { color: var(--danger) !important; }
.keys { text-align: left; width: 100%; overflow-x: auto; background: var(--panel-2); border-radius: 10px; padding: 12px; font-size: 12px; margin: 0; white-space: pre; }
.line-body .state:not(.ok):not(.bad) { font-weight: 600; font-size: 16px; }
.empty .btn { margin-top: 12px; }

/* ---------- admin */
.admin { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.admin-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.admin-head .logo { width: 36px; height: 36px; margin: 0; font-size: 12px; }
.admin-head h1 { margin: 0; font-size: 18px; }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-tabs button { border: 0; background: transparent; border-radius: 9px; padding: 7px 12px; font-weight: 600; color: var(--muted); }
.admin-tabs button.on { background: var(--sel); color: var(--accent-2); }
.admin-head a { color: var(--accent-2); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.admin-body { padding: 18px; display: grid; gap: 14px; align-content: start; max-width: 1400px; width: 100%; margin: 0 auto; }
.tbl-wrap { background: var(--panel); border-radius: 14px; overflow-x: auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.tbl .r-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.tbl .btn { padding: 5px 10px; font-size: 12px; }
.st-connected, .st-active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-2); }
.st-banned, .st-error, .st-logged_out, .st-duplicate, .st-wrong_number { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.st-qr, .st-starting, .st-disconnected, .st-qr_timeout { background: color-mix(in srgb, #ffbc38 20%, transparent); color: var(--warn); }
.admin-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-tools input, .admin-tools select { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 11px; outline: none; color: var(--text); min-width: 200px; }
.kv.wide { grid-template-columns: 170px 1fr; }
.bv-card .acts { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .num-switch { display: flex; }
  .admin-body { padding: 10px; }
  .admin-tools input, .admin-tools select { min-width: 0; flex: 1; }
}
