:root {
  --sb-gold: #f4b400;
  --sb-gold-dark: #bb8700;
  --sb-ink: #121212;
  --sb-text: #24272c;
  --sb-muted: #66707b;
  --sb-bg: #eef2f4;
  --sb-panel: #ffffff;
  --sb-line: #dbe1e6;
  --sb-soft: #f7f9fa;
  --sb-teal: #167b72;
  --sb-blue: #245a86;
  --sb-green: #147d4f;
  --sb-red: #b42318;
  --sb-warn: #a15c00;
  --sb-focus: rgba(244, 180, 0, .32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--sb-text);
  background:
    linear-gradient(135deg, rgba(8, 10, 12, .88), rgba(24, 28, 31, .58)),
    url("../../assets/bg-900x900.webp") center / cover fixed,
    var(--sb-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.sb-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
}

.sb-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  color: #fff;
  background: rgba(11, 12, 14, .96);
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.sb-brand-symbol {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  object-fit: contain;
  transform: translateX(-5px) scale(1.43) scaleX(-1);
  transform-origin: center center;
}

.sb-brand-wordmark {
  width: 140px;
  height: 70px;
  min-width: 0;
  object-fit: contain;
  object-position: left center;
  transform: translateX(-20px);
}

.sb-brand-product {
  display: none;
}

.sb-menu {
  display: grid;
  gap: 8px;
}

.sb-menu-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  padding: 8px 10px;
  text-align: left;
  font-weight: 800;
}

.sb-menu-link.is-active {
  border-color: var(--sb-gold);
  background: var(--sb-gold);
  color: #111;
}

.sb-menu-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
  font-size: 11px;
  font-weight: 900;
}

.sb-menu-link.is-active .sb-menu-ico {
  background: rgba(0, 0, 0, .12);
}

.sb-sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.sb-main {
  min-width: 0;
  padding: 22px;
}

.sb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: #fff;
}

.sb-eyebrow {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.sb-topbar h1 {
  margin: 0;
  color: #fff;
  font-size: calc(30px - 6pt);
  line-height: 1.12;
}

.sb-top-actions,
.sb-filter-row,
.sb-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sb-top-actions {
  justify-content: flex-end;
}

.sb-role-switch {
  display: inline-flex;
  min-height: 42px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
}

.sb-role {
  min-width: 82px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #222;
  padding: 6px 10px;
  font-weight: 800;
}

.sb-role.is-active {
  background: var(--sb-gold);
  color: #111;
}

.sb-login-panel,
.sb-panel,
.sb-metric,
.sb-notice {
  border: 1px solid var(--sb-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 42px rgba(8, 10, 12, .16);
}

.sb-login-panel {
  width: min(100%, 780px);
}

.sb-loading {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--sb-muted);
}

.sb-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dde1e5;
  border-top-color: var(--sb-gold);
  border-radius: 50%;
  animation: sb-spin .8s linear infinite;
}

@keyframes sb-spin {
  to { transform: rotate(360deg); }
}

.sb-panel {
  overflow: hidden;
}

.sb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sb-line);
}

.sb-panel-head h2 {
  margin: 0;
  color: var(--sb-ink);
  font-size: 19px;
  line-height: 1.2;
}

.sb-panel-body {
  padding: 16px;
}

.sb-status {
  color: var(--sb-muted);
  font-size: 13px;
}

.sb-status.is-error {
  color: var(--sb-red);
}

.sb-status.is-ok {
  color: var(--sb-green);
}

.sb-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fff8dd;
  color: #3b2b00;
  font-size: 13px;
}

.sb-notice strong {
  color: #111;
}

.sb-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sb-metric {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
}

.sb-metric strong {
  color: var(--sb-ink);
  font-size: 23px;
  line-height: 1.1;
}

.sb-metric span,
.sb-kpi span,
.sb-draw-meta,
.sb-card small,
.sb-ticket small,
.sb-flow-item span {
  color: var(--sb-muted);
  font-size: 12px;
}

.sb-form-grid,
.sb-admin-grid,
.sb-summary-grid,
.sb-support-grid,
.sb-join-strip {
  display: grid;
  gap: 12px;
}

.sb-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
}

.sb-form-stack {
  display: grid;
  gap: 12px;
}

.sb-form-title {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: var(--sb-ink);
  font-size: 16px;
}

.sb-wide {
  grid-column: 1 / -1;
}

.sb-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.sb-field span {
  color: #242424;
  font-size: 13px;
  font-weight: 800;
}

.sb-field input,
.sb-field select,
.sb-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd6dc;
  border-radius: 8px;
  background: #fff;
  color: var(--sb-text);
  padding: 10px 12px;
  outline: none;
}

.sb-field textarea {
  min-height: 116px;
  resize: vertical;
}

.sb-field input:focus,
.sb-field select:focus,
.sb-field textarea:focus {
  border-color: var(--sb-gold-dark);
  box-shadow: 0 0 0 4px var(--sb-focus);
}

.sb-field-inline {
  min-width: 160px;
}

.sb-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 900;
  text-decoration: none;
}

.sb-btn-primary {
  background: var(--sb-gold);
  color: #111;
}

.sb-btn-primary:active {
  background: var(--sb-gold-dark);
}

.sb-btn-secondary {
  background: var(--sb-teal);
  color: #fff;
}

.sb-btn-ghost {
  background: #fff;
  color: #111;
  border-color: #d8dde2;
}

.sb-btn-danger {
  background: #fff3f0;
  color: var(--sb-red);
  border-color: #ffd0c8;
}

.sb-btn-small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.sb-btn:disabled {
  cursor: wait;
  opacity: .64;
}

.sb-summary-grid {
  grid-template-columns: minmax(220px, .8fr) minmax(280px, 1fr) minmax(280px, 1fr);
}

.sb-kpi-board,
.sb-flow,
.sb-next-draws {
  display: grid;
  gap: 10px;
}

.sb-kpi,
.sb-flow-item,
.sb-draw,
.sb-card,
.sb-ticket {
  border: 1px solid #e6ebef;
  border-radius: 8px;
  background: var(--sb-soft);
  padding: 12px;
}

.sb-kpi {
  display: grid;
  gap: 3px;
}

.sb-kpi strong {
  color: var(--sb-ink);
  font-size: 21px;
}

.sb-section-label {
  color: #242424;
  font-size: 13px;
  font-weight: 900;
}

.sb-flow-list,
.sb-draw-list,
.sb-card-grid,
.sb-ticket-list,
.sb-result-grid {
  display: grid;
  gap: 10px;
}

.sb-flow-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.sb-flow-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.sb-flow-item > div > strong,
.sb-flow-item > div > span {
  display: block;
}

.sb-flow-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111;
  color: var(--sb-gold);
  font-size: 13px;
  font-weight: 900;
}

.sb-flow-item strong,
.sb-draw strong,
.sb-card strong,
.sb-ticket strong {
  color: var(--sb-ink);
}

.sb-draw {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.sb-draw-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
}

.sb-ball {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.sb-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sb-card {
  display: grid;
  gap: 10px;
}

.sb-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.sb-card h3 {
  margin: 0;
  color: var(--sb-ink);
  font-size: 17px;
  line-height: 1.2;
}

.sb-card-data {
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.sb-card-data span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .07);
  padding-bottom: 7px;
}

.sb-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebef;
}

.sb-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sb-gold), var(--sb-teal));
}

.sb-join-strip {
  grid-template-columns: minmax(220px, 1fr) 120px minmax(190px, .8fr) auto;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--sb-line);
  border-radius: 8px;
  background: #fff;
}

.sb-slip-summary {
  min-height: 44px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #e6ebef;
  border-radius: 8px;
  background: #fbfcfd;
}

.sb-slip-summary span,
.sb-slip-summary small {
  color: var(--sb-muted);
  font-size: 12px;
}

.sb-slip-summary strong {
  color: var(--sb-ink);
  font-size: 15px;
  line-height: 1.1;
}

.sb-slip {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--sb-line);
  border-radius: 8px;
  background: #fff;
}

.sb-slip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sb-slip-head h3 {
  margin: 0 0 3px;
  color: var(--sb-ink);
  font-size: 17px;
  line-height: 1.2;
}

.sb-slip-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sb-slip-selected {
  min-height: 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sb-slip-selected .sb-ball {
  background: var(--sb-teal);
}

.sb-number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 7px;
}

.sb-number-button {
  min-height: 38px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #d8e0e6;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 900;
  outline: none;
}

.sb-number-button.is-selected {
  border-color: var(--sb-gold);
  background: var(--sb-gold);
  color: #111;
  box-shadow: 0 0 0 3px rgba(244, 180, 0, .22);
}

.sb-number-button.is-locked {
  opacity: .46;
}

.sb-number-button:disabled {
  cursor: not-allowed;
}

.sb-number-button:focus-visible,
.sb-number-button:hover {
  border-color: var(--sb-gold-dark);
  box-shadow: 0 0 0 4px var(--sb-focus);
}

.sb-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid #ecf0f2;
  text-align: left;
  vertical-align: top;
}

th {
  color: #32373d;
  background: var(--sb-soft);
  font-size: 12px;
  text-transform: uppercase;
}

.sb-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf0f2;
  color: #222;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sb-pill.ok {
  background: #e8f7ef;
  color: var(--sb-green);
}

.sb-pill.warn {
  background: #fff6dc;
  color: var(--sb-warn);
}

.sb-pill.bad {
  background: #fff0ed;
  color: var(--sb-red);
}

.sb-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sb-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--sb-line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.sb-result h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.sb-partner-layout,
.sb-support-grid {
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr);
}

.sb-ticket-list {
  align-content: start;
}

.sb-ticket {
  display: grid;
  gap: 6px;
}

.sb-admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.sb-admin-grid form {
  border: 1px solid var(--sb-line);
  border-radius: 8px;
  background: #fff;
}

.sb-admin-table {
  margin-top: 16px;
}

.sb-empty {
  min-height: 46px;
  display: grid;
  align-items: center;
  padding: 10px;
  border: 1px dashed #d4dce2;
  border-radius: 8px;
  color: var(--sb-muted);
  background: #fff;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .sb-metrics,
  .sb-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sb-summary-grid,
  .sb-partner-layout,
  .sb-support-grid,
  .sb-admin-grid {
    grid-template-columns: 1fr;
  }

  .sb-join-strip,
  .sb-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .sb-shell {
    grid-template-columns: 1fr;
  }

  .sb-sidebar {
    position: static;
    height: auto;
  }

  .sb-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sb-sidebar-foot {
    margin-top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sb-main {
    padding: 14px;
  }

  .sb-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sb-topbar h1 {
    display: none;
  }

  .sb-brand {
    display: grid;
    grid-template-columns: 52px minmax(80px, 140px) minmax(120px, 1fr);
    gap: 10px;
  }

  .sb-brand-symbol {
    transform: translateX(3px) scale(1.716) scaleX(-1);
  }

  .sb-brand-wordmark {
    width: 100%;
    transform: translateX(-10px);
  }

  .sb-brand-product {
    height: 70px;
    display: grid;
    align-content: center;
    justify-items: end;
    color: #fff;
    font-size: calc(clamp(16px, 5.5vw, calc(30px - 4pt)) - 6pt);
    font-weight: 700;
    line-height: 1.12;
    text-align: right;
  }

  .sb-brand-product span {
    display: block;
  }

  .sb-top-actions,
  .sb-role-switch,
  .sb-role {
    width: 100%;
  }

  .sb-role-switch {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .sb-panel-head,
  .sb-slip-head,
  .sb-draw,
  .sb-result {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .sb-metrics,
  .sb-card-grid,
  .sb-form-grid,
  .sb-join-strip,
  .sb-result-grid,
  .sb-menu,
  .sb-sidebar-foot {
    grid-template-columns: 1fr;
  }

  .sb-form-grid {
    padding: 14px;
  }

  .sb-filter-row,
  .sb-filter-row .sb-field,
  .sb-form-actions .sb-btn,
  .sb-join-strip .sb-btn,
  .sb-slip-actions,
  .sb-slip-actions .sb-btn {
    width: 100%;
  }

  .sb-draw-balls {
    justify-content: flex-start;
  }

  th,
  td {
    padding: 9px 7px;
  }
}

@media print {
  .sb-sidebar,
  .sb-top-actions,
  .sb-login-panel {
    display: none !important;
  }

  .sb-shell {
    display: block;
  }

  body {
    background: #fff;
  }
}

@media (max-width: 760px) {
  .sb-footer-links,
  .sb-footer-copyright {
    display: block !important;
    width: 100%;
  }

  .sb-footer-copyright {
    margin-top: 5px !important;
  }

  .sb-footer-desktop-separator {
    display: none !important;
  }
}

.sb-app-only {
  display: none;
}

html.sobolao-app-webview body {
  background: var(--sb-bg);
}

html.sobolao-app-webview .sb-shell {
  display: block;
}

html.sobolao-app-webview .sb-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  border-right: 0;
}

html.sobolao-app-webview .sb-sidebar .sb-menu,
html.sobolao-app-webview .sb-sidebar-foot,
html.sobolao-app-webview .sb-topbar,
html.sobolao-app-webview body > footer {
  display: none !important;
}

html.sobolao-app-webview .sb-brand {
  display: flex;
  grid-template-columns: none;
  width: 100%;
  align-items: flex-start;
  gap: 8px;
}

html.sobolao-app-webview .sb-brand-symbol {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  transform: translateX(6px) scale(1.828125) scaleX(-1);
  transform-origin: center top;
}

html.sobolao-app-webview .sb-brand-wordmark {
  width: 120px;
  height: 48px;
  transform: translate(7px, -5px) scale(1.5125);
  transform-origin: left top;
}

html.sobolao-app-webview .sb-brand-product {
  display: grid;
  align-content: center;
  justify-items: end;
  width: 140px;
  height: 48px;
  margin-left: auto;
  color: #fff;
  font-size: calc(14px - 2pt);
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

html.sobolao-app-webview .sb-brand-product span {
  display: block;
}

html.sobolao-app-webview .sb-main {
  width: 100%;
  padding: 14px max(14px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

html.sobolao-app-webview .sb-app-only {
  display: flex;
}

.sb-app-hero {
  position: relative;
  overflow: hidden;
  align-items: flex-end;
  min-height: 150px;
  margin-bottom: 14px;
  padding: 24px;
  color: #fff;
  border-radius: 20px;
  background:
    radial-gradient(circle at 82% 20%, rgba(244, 180, 0, .24), transparent 34%),
    linear-gradient(135deg, #111417 0%, #24292e 100%);
  box-shadow: 0 15px 34px rgba(15, 18, 20, .18);
}

.sb-app-hero::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(255, 255, 255, .025), 0 0 0 58px rgba(255, 255, 255, .018);
}

.sb-app-hero h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-size: clamp(29px, 7vw, 42px);
  line-height: 1.05;
  letter-spacing: -.03em;
}

html.sobolao-app-webview .sb-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html.sobolao-app-webview .sb-app-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 6px;
  overflow-x: auto;
  margin: 0 0 18px;
  padding: 6px;
  border: 1px solid var(--sb-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 8px 24px rgba(20, 26, 31, .08);
  scrollbar-width: none;
}

.sb-app-tabs::-webkit-scrollbar {
  display: none;
}

.sb-app-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  color: var(--sb-muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.sb-app-tabs button.is-active {
  color: #111;
  background: var(--sb-gold);
}

html.sobolao-app-webview .sb-panel-head {
  display: none;
}

html.sobolao-app-webview .sb-panel-head.sb-panel-head-filter {
  display: flex;
  justify-content: flex-end;
}

html.sobolao-app-webview .sb-panel-head-filter > div:first-child {
  display: none;
}

@media (max-width: 680px) {
  html.sobolao-app-webview .sb-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html.sobolao-app-webview .sb-panel-head.sb-panel-head-filter {
    align-items: stretch;
  }
}
