/* Base: design tokens, reset, page layout, header, navigation and the sign-in screen. */

/* ----------------------------------------------------------------------
   Reset and base elements
   ------------------------------------------------------------------- */

:root {
  /* surfaces */
  --bg: #0c0e12;
  --card: #151921;
  --card-hi: #1a1f29;
  --inset: #10141b; /* fields and wells sunk into a card */

  /* borders */
  --line: #252b37;
  --line-hi: #394152;
  --line-focus: #5d687d; /* border of a focused field */

  /* text */
  --text: #f4f5f7;
  --text-soft: #d3d8e2;
  --muted: #8b93a3;
  --faint: #566078; /* quiet text, empty values */
  --white: #fff;

  /* brand and status colours (each with its tinted background) */
  --brand: #ff3b30;
  --red: #ff4d43;
  --red-bg: rgba(255, 77, 67, 0.12);
  --green: #34d27b;
  --green-bg: rgba(52, 210, 123, 0.12);
  --on-green: #052e16; /* dark text on a green button */
  --amber: #f5c26b;
  --amber-bg: rgba(245, 194, 107, 0.12);
  --blue: #8fb2ff;
  --blue-bg: rgba(143, 178, 255, 0.1);
  --whatsapp: #25d366;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  font-family:
    Inter,
    'Segoe UI',
    system-ui,
    -apple-system,
    Roboto,
    sans-serif;
  background:
    radial-gradient(900px 480px at 85% -8%, rgba(255, 59, 48, 0.16), transparent 65%),
    radial-gradient(700px 400px at -5% 105%, rgba(255, 59, 48, 0.07), transparent 60%), var(--bg);
  background-attachment: fixed;
}

button {
  font-family: inherit;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

header img {
  height: 36px;
  display: block;
}

h1 {
  margin: 0 0 6px;
  font-size: 32px;
  letter-spacing: -0.5px;
  font-weight: 750;
}

select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238b93a3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

select:invalid,
select option[disabled] {
  color: var(--muted);
}

option {
  background: var(--card);
  color: var(--text);
}

#rapi-txns {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}

/* locked: device in maintenance, or a request is already open */

button:disabled * {
  pointer-events: none;
}

#gd-text {
  min-height: 200px;
  white-space: pre;
  overflow: auto;
}

@media (max-width: 560px) {
  h1 {
    font-size: 26px;
  }
}

/* ----------------------------------------------------------------------
   Page layout
   ------------------------------------------------------------------- */

.wrap {
  max-width: 1760px;
  margin: 0 auto;
  padding: 26px 28px 70px;
}

/* ----------------------------------------------------------------------
   Sign-in screen
   ------------------------------------------------------------------- */

.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(1100px 620px at 82% -10%, rgba(255, 59, 48, 0.38), transparent 60%),
    radial-gradient(900px 600px at -5% 112%, rgba(255, 59, 48, 0.2), transparent 60%), #0a0c10;
}

.login::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 50% 42%, #000, transparent 72%);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  text-align: center;
  padding: 38px 34px 34px;
  border-radius: 24px;
  background: rgba(21, 25, 33, 0.92);
  border: 1px solid var(--line-hi);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.login-card img {
  height: 42px;
  margin-bottom: 26px;
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: -0.4px;
}

.login-card p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.login-err {
  background: var(--red-bg);
  color: #ffb4ae;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 18px;
  line-height: 1.45;
}

.sso {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sso a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  border-radius: 13px;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  transition: 0.15s;
}

.sso a:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.sso svg {
  width: 20px;
  height: 20px;
}

.sso .google {
  background: var(--white);
  color: #1f1f1f;
}

.sso .none {
  color: var(--muted);
  font-size: 14px;
  padding: 6px;
}

/* ----------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------- */

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.nav button {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.15s;
}

.nav button:hover {
  color: var(--text);
}

.nav button.on {
  background: var(--card-hi);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-hi);
}

.nav .lock {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: 5px;
  padding: 1px 6px;
}

.tabs {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
  flex-wrap: wrap;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 9px;
  padding: 8px 14px;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.on {
  background: var(--card-hi);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-hi);
}

.tab i {
  font-style: normal;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 1px 7px;
  color: var(--muted);
}

.tabs[hidden] {
  display: none;
}

.tab i.warn {
  color: var(--red);
  background: var(--red-bg);
}

/* ----------------------------------------------------------------------
   Header: signed-in user
   ------------------------------------------------------------------- */

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
}

.user .uname {
  font-size: 14px;
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user .badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: 6px;
  padding: 2px 7px;
}

.user button {
  border: 0;
  background: var(--card-hi);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: 0.15s;
}

.user button:hover {
  color: var(--text);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, #ff5a4f, #c92a21);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
  text-transform: uppercase;
}

.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.avatar.warn {
  background: var(--amber-bg);
  color: var(--amber);
}

.avatar.warn svg {
  width: 15px;
  height: 15px;
}

.avatar.info {
  background: var(--blue-bg);
  color: var(--blue);
}

.avatar.info svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 560px) {
  .user .uname {
    max-width: 110px;
  }
}

/* ----------------------------------------------------------------------
   Page title
   ------------------------------------------------------------------- */

.hero {
  margin: 38px 0 26px;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 560px) {
  .hero {
    margin-top: 26px;
  }
}

/* ----------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------- */

.view[hidden] {
  display: none;
}

/* ----------------------------------------------------------------------
   Header: logo and people online
   ------------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.online {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--green);
  background: var(--green-bg);
  box-shadow: inset 0 0 0 1px rgba(52, 210, 123, 0.3);
  cursor: default;
  white-space: nowrap;
}

.online .n {
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
  text-align: center;
}

.online .l {
  color: var(--muted);
  font-weight: 600;
}

.online .live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
  flex: none;
}

.online .live::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  animation: pulse 2s infinite;
}
