:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #fff3e8;
  --text: #121212;
  --muted: #667085;
  --line: #e4e4e7;
  --orange: #ff7900;
  --orange-dark: #cc5f00;
  --black: #090909;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c24135;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--black);
  color: #ffffff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--orange);
  color: #111111;
  font-weight: 800;
}

.brand-block strong,
.brand-block small {
  display: block;
}

.brand-block small {
  color: #b8c4bd;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  color: #d6e1dc;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.main-content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1,
.panel h2,
.login-panel h1 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 28px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-name {
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.muted,
.hint {
  color: var(--muted);
  line-height: 1.5;
}

.hint {
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card,
.panel,
.login-panel,
.login-aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 26px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
}

.panel {
  padding: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 18px;
}

.search {
  width: min(360px, 100%);
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: #f9fafb;
}

.two-line strong,
.two-line small {
  display: block;
}

.two-line small {
  color: var(--muted);
  margin-top: 3px;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: #344054;
}

.badge-pago,
.badge-ativo,
.badge-online,
.badge-concluida,
.pill-success {
  color: #7a3500;
  background: #ffedd5;
}

.badge-pendente,
.badge-em_analise,
.badge-iniciada,
.badge-aceite {
  color: #92400e;
  background: #fef3c7;
}

.badge-cancelada,
.badge-falhou,
.badge-inativo,
.pill-danger {
  color: #991b1b;
  background: #fee2e2;
}

.badge-offline,
.pill-muted {
  color: #475467;
  background: #eef2f5;
}

.btn {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  color: #ffffff;
  background: var(--orange);
}

.btn-primary:hover {
  background: var(--orange-dark);
}

.btn-secondary {
  color: #1d2939;
  background: #e4e7ec;
}

.btn-success {
  color: #ffffff;
  background: var(--blue);
}

.btn-danger {
  color: #ffffff;
  background: var(--red);
}

.ops-list {
  display: grid;
  gap: 12px;
}

.ops-list div,
.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f9fafb;
}

.ops-list span,
.metric-line span {
  color: var(--muted);
}

.empty-state,
.alert-error {
  padding: 14px;
  border-radius: 8px;
}

.empty-state {
  background: #f9fafb;
  color: var(--muted);
}

.alert-error,
.error-text {
  color: #991b1b;
}

.success-text {
  color: #7a3500;
  margin: 0;
  font-weight: 700;
}

.alert-error {
  margin-bottom: 12px;
  background: #fee2e2;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--black);
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
}

.login-panel,
.login-aside {
  padding: 28px;
}

.login-panel {
  display: grid;
  gap: 26px;
}

.login-panel h1 {
  font-size: 32px;
}

.stack {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid button,
.permissions-field {
  grid-column: 1 / -1;
}

.permissions-field {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.permissions-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font-weight: 700;
}

.check-card input {
  min-height: 0;
  width: 16px;
  height: 16px;
  padding: 0;
}

.login-subform {
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
}

.link-button {
  border: 0;
  padding: 0;
  justify-self: start;
  color: var(--orange-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 700;
}

input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
}

select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #ffffff;
}

.mt {
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 10;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #111111;
  background: #ffedd5;
  border: 1px solid #fdba74;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.toast-error {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.provider-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  background: #ffffff;
}

.provider-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.switch-row input {
  min-height: 0;
  width: 18px;
  height: 18px;
}

code {
  display: inline-block;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f4f4f5;
}

.secret-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #fff7ed;
}

.secret-box p,
.secret-box small {
  margin: 4px 0 0;
  color: var(--muted);
}

.secret-box code {
  max-width: none;
  color: #111111;
  background: #ffffff;
  border: 1px solid #fed7aa;
  font-weight: 800;
}

.login-aside {
  display: grid;
  align-content: center;
  gap: 12px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    min-width: max-content;
  }

  .metrics-grid,
  .split-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .provider-form {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .permissions-grid {
    grid-template-columns: 1fr;
  }

  .secret-box {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .main-content {
    padding: 16px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 24px;
  }
}
