/* CPTEL Reseller Portal. Phone first; the side nav appears from 900px. */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --teal: #1ABECC; --cyan: #00DFF5; --yellow: #FBEE60; --green: #6EE09A; --red: #FF8A8A;
  --bg: #141414; --panel: #1a1c1c; --line: #1d3133; --line2: #2a3233; --field: #101212;
  --text: #fff; --muted: rgba(255,255,255,.65); --dim: rgba(255,255,255,.45);
  --mono: 'IBM Plex Mono', monospace; --sans: 'IBM Plex Sans', sans-serif; --display: 'Syne', sans-serif;
}
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--teal); } a:hover { color: var(--cyan); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }
.noscript { padding: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: rgba(20,20,20,.96); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 800 17px var(--display); letter-spacing: .06em; color: var(--text); text-decoration: none; }
.brand small { font: 500 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--teal); padding-left: 10px; border-left: 1px solid var(--line2); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--teal); background: #16312f; color: var(--text); font: 600 13px var(--sans); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.body { flex: 1; display: flex; min-height: 0; }
.side { display: none; }
.main { flex: 1; min-width: 0; padding: 20px 16px 110px; display: flex; flex-direction: column; gap: 18px; max-width: 1180px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: #111313; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0); }
.tabs a { flex: 1; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--teal); }
.tabs svg, .side svg { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .top { padding: 0 28px; height: 64px; }
  .tabs { display: none; }
  .side { display: flex; flex-direction: column; gap: 4px; width: 232px; flex-shrink: 0; padding: 20px 14px; border-right: 1px solid var(--line); position: sticky; top: 64px; height: calc(100vh - 64px); }
  .side a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 6px; color: rgba(255,255,255,.75); text-decoration: none; font-size: 14px; }
  .side a:hover { background: #1d2223; color: var(--text); }
  .side a[aria-current="page"] { background: #16312f; color: var(--text); box-shadow: inset 2px 0 0 var(--teal); }
  .side .spacer { flex: 1; }
  .side .foot { font-size: 12px; color: var(--dim); }
  .main { padding: 32px 40px 48px; gap: 22px; }
}

/* Type */
.lbl { font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }
h1 { margin: 0; font: 800 26px/1.15 var(--display); }
h2 { margin: 0; font: 700 18px var(--display); }
h3 { margin: 0; font: 700 15px var(--display); }
@media (min-width: 900px) { h1 { font-size: 32px; } }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: var(--mono); font-size: 12px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head > div:not(.acts) { display: flex; flex-direction: column; gap: 6px; }

/* Blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.split { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 900px) { .split { flex-direction: row; align-items: flex-start; } .split > .grow { flex: 1; min-width: 0; } .split > .aside { width: 360px; flex-shrink: 0; position: sticky; top: 88px; } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--teal); color: var(--text); }
.tile .num { font: 800 26px/1 var(--display); }
.tile.warn { border-color: rgba(251,238,96,.4); }
.row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: rgba(255,255,255,.82); }
.row > :last-child { text-align: right; }
.row.total { font-size: 17px; font-weight: 600; color: var(--text); border-top: 1px solid var(--line2); padding-top: 10px; }
.rule { height: 1px; background: var(--line2); }
.note { border: 1px solid rgba(251,238,96,.4); border-radius: 10px; padding: 14px; font-size: 14px; line-height: 1.55; color: rgba(255,255,255,.88); display: flex; flex-direction: column; gap: 6px; }
.note .lbl { color: var(--yellow); }
.plain { border: 1px solid var(--line2); border-radius: 10px; padding: 14px; font-size: 14px; color: rgba(255,255,255,.82); }
.err { border: 1px solid rgba(255,138,138,.5); background: rgba(255,107,107,.08); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #ffd0d0; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
/* Long status labels ("ACH processing (about 4 business days)") wrap on phones instead of widening the page. */
.chip { max-width: 100%; }
@media (max-width: 599px) { .chip { white-space: normal; } }
.c-yellow { background: rgba(251,238,96,.14); color: var(--yellow); }
.c-teal { background: rgba(26,190,204,.16); color: #38D3E0; }
.c-green { background: rgba(91,214,138,.16); color: var(--green); }
.c-grey { background: rgba(255,255,255,.08); color: var(--muted); }
.c-red { background: rgba(255,107,107,.14); color: var(--red); }

/* Controls */
.btn, .btn2 { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 6px; font: 700 14px var(--display); letter-spacing: .03em; text-decoration: none; cursor: pointer; }
.btn { border: 0; background: var(--teal); color: #000; }
.btn:hover { background: var(--cyan); color: #000; }
.btn2 { border: 1px solid rgba(255,255,255,.22); background: transparent; color: var(--text); }
.btn2:hover { border-color: var(--teal); color: var(--text); }
.btn[disabled], .btn2[disabled] { opacity: .45; cursor: not-allowed; }
.btn.block, .btn2.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; text-align: left; font-size: 14px; }
.linkbtn:hover { color: var(--cyan); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: rgba(255,255,255,.78); }
.inp, .ta, select.inp { width: 100%; min-height: 48px; border: 1px solid #33403f; background: var(--field); border-radius: 8px; color: var(--text); padding: 0 12px; font-size: 16px; }
.ta { padding: 10px 12px; min-height: 80px; resize: vertical; }
.inp:focus, .ta:focus { border-color: var(--teal); outline: none; }
.inp[aria-invalid=true], .ta[aria-invalid=true] { border-color: var(--red); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fields { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .fields.two { grid-template-columns: 1fr 1fr; } .fields.addr { grid-template-columns: 2fr 1fr 1fr; } }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 8px; cursor: pointer; }
.opt input { accent-color: var(--teal); width: 18px; height: 18px; flex-shrink: 0; }
.opt small { display: block; font-size: 12px; color: var(--muted); }
.opt:has(input:checked) { border-color: var(--teal); background: rgba(26,190,204,.08); }
.opt.off { opacity: .55; cursor: not-allowed; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { accent-color: var(--teal); width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }

/* Catalog */
.prod { display: flex; gap: 14px; align-items: center; }
.prod img, .prod .ph { width: 72px; height: 72px; flex-shrink: 0; border-radius: 8px; object-fit: cover; background: var(--field); border: 1px solid var(--line2); }
.prod img.plan { background: #fff; object-fit: contain; padding: 8px; }
.prod .ph { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--dim); text-align: center; }
.prod .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prod .name { font: 700 17px var(--display); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 40px; height: 40px; border: 1px solid #33403f; background: transparent; border-radius: 6px; font-size: 20px; cursor: pointer; }
.qty input { width: 58px; height: 40px; text-align: center; border: 1px solid #33403f; background: var(--field); border-radius: 6px; font-size: 16px; }
.prodfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Lists and tables */
.list { display: flex; flex-direction: column; gap: 10px; }
.olink { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); text-decoration: none; }
.olink:hover { border-color: var(--teal); color: var(--text); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filt { flex-shrink: 0; min-height: 36px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 999px; background: transparent; color: rgba(255,255,255,.78); font-size: 13px; cursor: pointer; }
.filt[aria-pressed="true"] { border-color: var(--teal); color: var(--text); background: rgba(26,190,204,.1); }
table.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lines th { text-align: left; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 8px 6px; }
table.lines td { padding: 10px 6px; border-top: 1px solid #242a2b; }
table.lines .r { text-align: right; }

/* Sign-in pages */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth header { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.auth main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; }
.auth .box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.auth footer { padding: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; font: 11px var(--mono); color: var(--dim); }
.auth footer a { color: var(--muted); }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font: 500 15px var(--mono); }
.codes span { padding: 8px; border: 1px solid var(--line2); border-radius: 6px; text-align: center; }
.qr { background: #fff; padding: 12px; border-radius: 8px; align-self: center; line-height: 0; }
.secret { font: 500 13px var(--mono); word-break: break-all; color: var(--muted); }
.otp { letter-spacing: .4em; font: 500 22px var(--mono); text-align: center; }

/* Misc */
.toast { position: fixed; left: 16px; right: 16px; bottom: 84px; z-index: 50; margin: 0 auto; max-width: 420px; background: var(--teal); color: #000; padding: 12px 16px; border-radius: 8px; font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
@media (min-width: 900px) { .toast { bottom: 28px; } }
.demo { background: rgba(251,238,96,.12); color: var(--yellow); font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; text-align: center; padding: 6px 12px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 24px 0; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 10px; }

/* Compact selects inside list rows (team roles) */
.olink .row select.inp { width: auto; max-width: 220px; min-height: 36px; padding: 0 10px; font-size: 14px; }

/* Reseller application */
.auth .box.wide { max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 600px) { .fields.addr4 { grid-template-columns: 1fr 1fr; } .fields.addr4 .span2 { grid-column: 1 / -1; } }
@media (min-width: 900px) { .fields.addr4 { grid-template-columns: 2fr 1fr 1fr 1fr; } .fields.addr4 .span2 { grid-column: auto; } }
.fields.addr4 .span2 { display: flex; flex-direction: column; }
.ferr { font-size: 12px; color: #ffb4b4; }
.ferr:empty { display: none; }
.phone { display: flex; gap: 8px; }
.phone select.inp.cc { width: 112px; flex-shrink: 0; padding: 0 8px; }
.phone .inp { min-width: 0; }
