:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #172126;
  --muted: #63727b;
  --line: #d8e1e5;
  --accent: #1b7f83;
  --accent-dark: #0f5e62;
  --sidebar-bg: #10211c;
  --sidebar-text: #ffffff;
  --sidebar-muted: #c4e6da;
  --green: #2f8f57;
  --amber: #b86b00;
  --rose: #b4485b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto 18px;
  max-width: 1360px;
}

.topbar h1,
h1 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
  margin: 0;
}

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

.eyebrow {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.user-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 10px 13px;
}

.primary-action,
.secondary-action,
.icon-action {
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  min-height: 42px;
  padding: 0 14px;
}

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

.secondary-action,
.icon-action {
  background: #e7eef0;
  color: var(--text);
}

.icon-action {
  min-width: 42px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 auto 18px;
  max-width: 1360px;
}

.summary-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
}

.summary-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.summary-grid strong {
  color: var(--accent-dark);
  font-size: 2.2rem;
  line-height: 1;
}

.toolbar,
.content-grid {
  margin: 0 auto 18px;
  max-width: 1360px;
}

.filter-form {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1fr) 180px auto auto;
  padding: 12px;
}

.filter-form input,
.filter-form select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 42px;
  min-width: 0;
  padding: 9px 11px;
  width: 100%;
}

.content-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
}

.table-panel,
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

.table-panel {
  padding: 14px;
}

.section-title-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title-row h2,
.detail-head h2 {
  font-size: 1.25rem;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.table-scroll {
  overflow: auto;
}

.data-table {
  border-collapse: collapse;
  min-width: 820px;
  width: 100%;
}

.data-table th {
  background: #17677f;
  color: #fff;
  font-size: 0.82rem;
  text-align: left;
}

.data-table th,
.data-table td {
  border: 1px solid #fff;
  padding: 12px;
  vertical-align: middle;
}

.data-table tbody tr {
  background: #e4e9ec;
}

.data-table tbody tr:nth-child(odd) {
  background: #d3dbe0;
}

.data-table tbody tr.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.data-table td span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  margin-top: 3px;
}

.empty-cell {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.status {
  border-radius: 999px;
  display: inline-flex !important;
  font-size: 0.76rem !important;
  font-weight: 900;
  margin: 0 !important;
  padding: 5px 9px;
}

.status.ativo,
.status.ativa {
  background: #e5f5ea;
  color: #206a38;
}

.status.bloqueado,
.status.bloqueada,
.status.expirada,
.status.cancelada,
.status.inativo {
  background: #fff0f2;
  color: #8f1f32;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--accent-dark);
  font-weight: 900;
  padding: 0;
}

.text-button.danger {
  color: var(--rose);
}

.detail-panel {
  align-self: start;
  overflow: hidden;
}

.empty-state {
  color: var(--muted);
  display: grid;
  gap: 6px;
  min-height: 320px;
  place-content: center;
  text-align: center;
}

.empty-state strong {
  color: var(--text);
}

.detail-head {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px;
}

.detail-head span {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}

.info-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 16px;
}

.info-list div {
  background: #f3f6f7;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

.info-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.info-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.license-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.license-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.license-card strong,
.license-card span {
  display: block;
}

.license-card span,
.license-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.license-meta,
.row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(18, 31, 38, 0.45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 10;
}

.modal {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 31, 39, 0.28);
  max-height: calc(100vh - 48px);
  max-width: 980px;
  overflow: auto;
  width: min(980px, 100%);
}

.modal-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px;
}

.modal-header h2 {
  font-size: 1.35rem;
  margin: 0;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
}

.form-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.form-grid .wide {
  grid-column: span 3;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.modal-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 14px;
}

.login-page {
  min-height: 100vh;
  overflow: auto;
}

.login-shell {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 520px);
  min-height: 100vh;
}

.login-brand-panel {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 28px;
  justify-content: space-between;
  padding: 48px;
}

.login-brand-content {
  display: grid;
  gap: 28px;
  margin: auto 0;
}

.login-brand-panel .eyebrow {
  color: var(--sidebar-muted);
}

.login-brand-panel h1 {
  color: var(--sidebar-text);
  font-size: 2.65rem;
  line-height: 1.04;
  max-width: 520px;
}

.login-brand-mark {
  align-items: center;
  background: #f4f2e8;
  border-radius: 8px;
  display: inline-flex;
  height: 66px;
  justify-content: center;
  padding: 10px 16px;
  width: 142px;
}

.login-brand-mark img {
  display: block;
  height: 44px;
  object-fit: contain;
  width: 110px;
}

.login-lead {
  color: var(--sidebar-muted);
  font-size: 1.02rem;
  line-height: 1.6;
  margin: 18px 0 0;
  max-width: 560px;
}

.login-signal-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 180px));
  margin-top: 18px;
}

.login-signal-grid span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: var(--sidebar-text);
  font-weight: 800;
  min-height: 48px;
  padding: 14px;
}

.login-copyright {
  color: var(--sidebar-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.login-card {
  align-self: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(20, 34, 42, 0.12);
  margin: 40px;
  padding: 32px;
}

.login-card-head {
  margin-bottom: 22px;
}

.login-card h2 {
  font-size: 2rem;
  line-height: 1;
  margin: 0;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.login-form input,
.forgot-password-form input {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 46px;
  padding: 0 12px;
}

.forgot-password-link {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  justify-self: start;
  padding: 0;
}

.login-error {
  background: #fff0f2;
  border: 1px solid #efb8c0;
  border-radius: 6px;
  color: #8f1f32;
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0;
  padding: 10px 12px;
}

.license-panel {
  background: #fff7e8;
  border: 1px solid #edc987;
  border-radius: 8px;
  color: #6f4a05;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
}

.forgot-password-form {
  display: grid;
  gap: 10px;
}

.forgot-password-message {
  color: #6f4a05;
  font-size: 0.86rem;
  font-weight: 800;
  margin: 0;
}

.forgot-password-message.error {
  color: #8f1f32;
}

@media (max-width: 980px) {
  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .form-grid .wide,
  .form-grid .span-2 {
    grid-column: auto;
  }

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

  .login-brand-panel {
    min-height: 340px;
    padding: 30px 22px;
  }

  .login-card {
    margin: 18px;
    padding: 22px;
  }
}

