:root {
  --bg: #f2f5fb;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --surface-strong: #edf2fb;
  --text: #0f172a;
  --muted: #55627b;
  --line: #dbe4f1;
  --accent: #1e3a8a;
  --ok: #166534;
  --error: #991b1b;
  --warning: #b45309;
  --shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 20px 46px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 8%, rgba(59, 130, 246, 0.14), transparent 38%),
    radial-gradient(circle at 92% 12%, rgba(16, 185, 129, 0.12), transparent 34%),
    var(--bg);
  min-height: 100vh;
}

.bg-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(65px);
  opacity: 0.42;
}

.bg-glow-a {
  width: 340px;
  height: 340px;
  right: -70px;
  top: -90px;
  background: #93c5fd;
}

.bg-glow-b {
  width: 280px;
  height: 280px;
  left: -90px;
  bottom: 8%;
  background: #99f6e4;
}

.container {
  width: min(1280px, 100% - 40px);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.header {
  padding: 18px 0;
  border-bottom: 1px solid rgba(228, 216, 202, 0.72);
  backdrop-filter: blur(10px);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
}

h2 {
  font-size: 1.18rem;
}

h3 {
  font-size: 1rem;
}

.badge {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--surface);
}

.main {
  padding: 24px 0 34px;
}

.main.main-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px 0;
}

body.auth-only .header {
  display: none;
}

body.auth-only .main.container {
  width: min(540px, 100% - 40px);
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.auth-card {
  width: min(520px, 100%);
  margin: 0 auto 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 255, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.11);
}

.auth-card--login h1 {
  margin-top: 8px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
}

.auth-card--login p {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.auth-card--login label {
  margin-bottom: 7px;
  font-size: .8rem;
  font-weight: 700;
}

.auth-card--login input {
  min-height: 48px;
  border-radius: 13px;
  padding: 12px 14px;
  background: #fcfdff;
}

.auth-card--login input::placeholder {
  color: #7b879d;
}

.auth-card--login input:focus {
  border-color: #9fb4de;
  box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.12);
  outline: none;
}

.auth-card--login .input-with-action {
  grid-template-columns: 1fr 52px;
}

.auth-card--login .icon-action {
  border-radius: 13px;
  background: #ffffff;
}

.auth-card--login .turnstile-wrap {
  border-style: solid;
  border-color: #d8e1ee;
}

.auth-card--login .message {
  margin-top: 10px;
  min-height: 22px;
  font-size: .84rem;
  font-weight: 600;
  padding: 2px 2px 0;
}

.auth-card--login .message.error {
  color: #a11c1c;
}

.auth-card--login .message.ok {
  color: #1f6f43;
}

.hidden {
  display: none !important;
}

.panel-space {
  display: grid;
  gap: 14px;
}

.super-layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 16px;
  align-items: start;
}

.super-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94));
  box-shadow: var(--shadow-soft);
}

.super-sidebar__brand strong {
  font-size: 1rem;
}

.super-sidebar__brand p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.super-sidebar__nav {
  display: grid;
  gap: 8px;
}

.super-nav-btn {
  text-align: left;
  border-radius: 12px;
  padding: 10px 12px;
}

.super-nav-btn.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.12);
  background: #fff;
}

.super-main {
  display: grid;
  gap: 14px;
}

.super-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.super-topbar h2 {
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  letter-spacing: -0.01em;
}

.super-topbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.super-topbar__actions button {
  width: auto;
  min-width: 140px;
}

.super-section {
  display: grid;
  gap: 12px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-grid,
.form-grid {
  align-items: start;
}

.form-grid .full,
.auth-grid .full {
  grid-column: 1 / -1;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.auth-submit-row .primary {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  font-size: 1.04rem;
  box-shadow: 0 10px 20px rgba(30, 58, 138, 0.24);
}

label {
  display: block;
  font-size: 0.77rem;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 700;
}

input,
select,
textarea,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #bfdbfe;
  outline-offset: 0;
}

textarea {
  min-height: 74px;
  resize: vertical;
}

.input-with-action {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  min-height: 66px;
  border-radius: 14px;
  border: 1px dashed #d6dfec;
  background: #ffffff;
  padding: 10px;
  cursor: pointer;
}

.turnstile-widget {
  min-height: 46px;
  width: 100%;
}

.auth-card.is-auth-loading .turnstile-wrap {
  opacity: 0.65;
  pointer-events: none;
}

.turnstile-wrap.is-invisible-mode {
  min-height: 10px;
  padding: 0;
  border-style: solid;
  border-color: transparent;
  background: transparent;
}

.turnstile-widget.is-invisible-mode {
  min-height: 0;
}

button {
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

button.secondary {
  background: var(--surface-soft);
  color: var(--text);
}

button.danger {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}

a.secondary {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

button.is-loading {
  position: relative;
}

button.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: button-spin .75s linear infinite;
}

@keyframes button-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.inline-actions button {
  width: auto;
  min-width: 170px;
}

.detail-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.subhead {
  margin: 0 0 10px;
}

.binding-preview {
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
}

.session-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.session-filter-tabs {
  display: inline-flex;
  gap: 8px;
}

.session-filter-tabs button {
  width: auto;
  min-width: 150px;
}

.session-filter-tabs button.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 38, 31, 0.08);
  background: #fff;
}

.company-filter-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.company-filter-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 3px;
}

.company-filter-item strong {
  font-size: 0.92rem;
}

.company-filter-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-card {
  box-shadow: var(--shadow-card);
}

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.status-ativa {
  color: var(--ok);
  font-weight: 700;
}

.status-inativa {
  color: var(--error);
  font-weight: 700;
}

.status-active {
  color: var(--ok);
  font-weight: 700;
}

.status-blocked {
  color: var(--error);
  font-weight: 700;
}

.status-suspended {
  color: var(--warning);
  font-weight: 700;
}

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

.account-info-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 11px;
  display: grid;
  gap: 5px;
}

.account-info-item span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.account-info-item strong {
  font-size: 0.9rem;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-actions .secondary {
  width: auto;
  padding-inline: 10px;
}

.row-actions .danger {
  width: auto;
  padding-inline: 10px;
}

.actions-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.actions-menu__trigger {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  padding: 0;
  border: 1px solid #d7e2f1;
  background: #f8fbff;
  color: #465670;
}

.actions-menu__content {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 170px;
  width: max-content;
  max-width: min(260px, calc(100vw - 16px));
  border: 1px solid #d7e3f3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.14);
  padding: 6px;
  display: none;
  z-index: 2100;
  max-height: min(320px, calc(100vh - 18px));
  overflow: auto;
}

.actions-menu.is-open .actions-menu__content {
  display: grid;
  gap: 5px;
}

.actions-menu__content button {
  width: 100%;
  min-height: 34px;
  text-align: left;
  font-size: 0.78rem;
  padding: 7px 10px;
  white-space: nowrap;
}

.message {
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 700;
}

.message.error {
  color: var(--error);
}

.message.ok {
  color: var(--ok);
}

.password-strength {
  display: grid;
  gap: 8px;
}

.password-strength__bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #ece1d2;
  overflow: hidden;
}

.password-strength__bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: #c2410c;
  transition: width 0.2s ease, background 0.2s ease;
}

.password-rules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.password-rules small {
  color: var(--muted);
}

.password-rules small.ok {
  color: var(--ok);
  font-weight: 700;
}

.config-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.config-kpis article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.config-kpis span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.config-kpis strong {
  font-size: 1rem;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

@media (max-width: 1120px) {
  .super-layout {
    grid-template-columns: 1fr;
  }

  .super-sidebar {
    position: static;
  }

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

@media (max-width: 920px) {
  .grid,
  .form-grid,
  .auth-grid,
  .config-kpis,
  .account-info-grid,
  .company-filter-list {
    grid-template-columns: 1fr;
  }

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

  .super-topbar__actions {
    width: 100%;
  }

  .super-topbar__actions button,
  .inline-actions button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1280px);
  }

  .card {
    border-radius: 14px;
    padding: 14px;
  }

  .super-sidebar__nav {
    grid-template-columns: 1fr;
  }

  th,
  td {
    font-size: 0.8rem;
  }
}
