:root {
  --ink: #10241d;
  --ink-soft: #294139;
  --forest: #0f5b43;
  --forest-dark: #0a3d2e;
  --mint: #dff4e8;
  --lime: #c8ef7a;
  --orange: #ff7849;
  --cream: #f5f4ee;
  --white: #fff;
  --line: #dfe6df;
  --muted: #71817b;
  --font-display: "Manrope", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font-body);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font: 800 25px var(--font-display);
  letter-spacing: -1.3px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--forest);
  transform: rotate(-7deg);
}

.brand-mark span {
  position: absolute;
  bottom: 6px;
  width: 4px;
  border-radius: 4px;
  background: var(--lime);
}

.brand-mark span:nth-child(1) {
  left: 7px;
  height: 9px;
}

.brand-mark span:nth-child(2) {
  height: 16px;
}

.brand-mark span:nth-child(3) {
  right: 7px;
  height: 12px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1.15fr 0.85fr;
}

.auth-brand {
  display: flex;
  padding: 60px 9vw;
  flex-direction: column;
  justify-content: space-between;
  color: var(--white);
  background:
    radial-gradient(circle at 20% 80%, rgba(200, 239, 122, 0.14), transparent 30%),
    var(--ink);
}

.auth-brand .brand {
  color: var(--white);
}

.auth-brand h1 {
  margin: 18px 0 22px;
  font: 800 clamp(45px, 5vw, 68px)/1 var(--font-display);
  letter-spacing: -4px;
}

.auth-brand p {
  max-width: 500px;
  margin: 0;
  color: #aebdb7;
  font-size: 16px;
  line-height: 1.7;
}

.eyebrow,
.panel-kicker {
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.auth-card {
  display: grid;
  padding: 60px max(40px, 8vw);
  place-items: center;
  background: var(--white);
}

.auth-card > div {
  width: 100%;
  max-width: 420px;
}

.auth-card h2 {
  margin: 13px 0 7px;
  font: 800 30px var(--font-display);
  letter-spacing: -1.5px;
}

.auth-card > div > p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 12px;
}

.panel-kicker {
  color: var(--forest);
}

.auth-card form,
.auth-card label {
  display: flex;
  flex-direction: column;
}

.auth-card form {
  gap: 16px;
}

.auth-card label span {
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 700;
}

.auth-card input {
  min-height: 49px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

.auth-card input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(15, 91, 67, 0.1);
}

.auth-card button,
.dialog-actions button,
.topbar-actions button {
  min-height: 47px;
  border: 0;
  border-radius: 10px;
  color: var(--white);
  background: var(--forest);
  font-weight: 700;
}

.form-message,
.dialog-message {
  display: none;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  font-size: 10px;
  text-align: center;
}

.form-message.visible,
.dialog-message.visible {
  display: block;
}

.form-message.error,
.dialog-message.error {
  color: #9a3428;
  background: #fbe9e5;
}

.form-message.success,
.dialog-message.success {
  color: var(--forest-dark);
  background: var(--mint);
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  padding: 26px 18px 18px;
  flex-direction: column;
  color: var(--white);
  background: var(--ink);
}

.sidebar-brand {
  margin: 0 10px 42px;
  color: var(--white);
}

.workspace-label {
  margin: 0 12px 10px;
  color: #71877e;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 45px;
  padding: 0 12px;
  gap: 11px;
  border: 0;
  border-radius: 10px;
  color: #9fb0a9;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}

.nav-item.active {
  color: var(--ink);
  background: var(--lime);
}

.nav-item:disabled {
  cursor: default;
  opacity: 0.65;
}

.nav-item span {
  display: grid;
  width: 22px;
  place-items: center;
  font-weight: 800;
}

.nav-item small {
  margin-left: auto;
  font-size: 7px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding: 13px 10px 0;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--lime);
  font-weight: 800;
}

.sidebar-user > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.sidebar-user strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user span {
  color: #768c83;
  font-size: 7px;
}

.sidebar-user button {
  border: 0;
  color: #91a59d;
  background: transparent;
}

.main-panel {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 94px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.topbar span,
.section-title span,
.table-head span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 4px 0 0;
  font: 800 24px var(--font-display);
  letter-spacing: -1px;
}

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

.system-status {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--forest) !important;
  background: var(--mint);
}

.system-status i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #2fa86d;
}

.topbar-actions button {
  min-height: 37px;
  padding: 0 15px;
  font-size: 9px;
}

.content {
  padding: 28px 38px 55px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metrics-grid article,
.status-card,
.table-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--white);
}

.metrics-grid article {
  display: flex;
  min-height: 132px;
  padding: 20px;
  flex-direction: column;
}

.metrics-grid article > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.metrics-grid strong {
  margin: 10px 0 4px;
  font: 800 31px var(--font-display);
  letter-spacing: -1.5px;
}

.metrics-grid small {
  margin-top: auto;
  color: var(--forest);
  font-size: 8px;
}

.status-grid {
  display: grid;
  margin-top: 14px;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
}

.status-card {
  padding: 23px;
}

.section-title h2,
.table-head h2 {
  margin: 4px 0 0;
  font: 800 17px var(--font-display);
}

.status-bars {
  display: grid;
  margin-top: 20px;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.status-bars div {
  padding: 13px;
  border-radius: 10px;
  background: #f6f8f5;
}

.status-bars span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 8px;
}

.status-bars i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-bars i.trial {
  background: #daa42f;
}

.status-bars i.active {
  background: #2fa86d;
}

.status-bars i.overdue {
  background: var(--orange);
}

.status-bars i.suspended {
  background: #8c9691;
}

.status-bars strong {
  display: block;
  margin-top: 10px;
  font: 800 21px var(--font-display);
}

.alert-card {
  color: var(--white);
  background: var(--forest);
}

.alert-card .section-title span,
.alert-card p {
  color: #b9cec5;
}

.billing-alert {
  display: flex;
  align-items: baseline;
  margin-top: 18px;
  gap: 8px;
}

.billing-alert strong {
  color: var(--lime);
  font: 800 42px var(--font-display);
}

.billing-alert span {
  font-size: 10px;
}

.alert-card p {
  margin: 12px 0 0;
  font-size: 9px;
  line-height: 1.55;
}

.table-card {
  overflow: hidden;
  margin-top: 14px;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.table-tools {
  display: flex;
  gap: 9px;
}

.table-tools input,
.table-tools select,
.table-head > select,
.dialog-actions select {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--white);
  font-size: 9px;
}

.table-tools input {
  width: 200px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf0ed;
  font-size: 9px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #fafbf9;
  font-size: 7.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

td strong,
td span {
  display: block;
}

td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7.5px;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--mint);
  font-size: 7px;
  font-weight: 700;
}

.status-pill.past_due,
.status-pill.suspended,
.status-pill.canceled,
.status-pill.invoice-overdue,
.status-pill.invoice-void {
  color: #9a3428;
  background: #fbe9e5;
}

.status-pill.invoice-pending {
  color: #815b12;
  background: #fff3d5;
}

.status-pill.invoice-refunded {
  color: #55467a;
  background: #eee9fb;
}

.detail-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--forest);
  background: var(--white);
  font-size: 8px;
  font-weight: 700;
}

.empty-state {
  padding: 35px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

dialog {
  width: min(650px, calc(100% - 30px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  box-shadow: 0 35px 100px rgba(16, 36, 29, 0.28);
}

dialog::backdrop {
  background: rgba(7, 24, 18, 0.65);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 27px;
  border-bottom: 1px solid var(--line);
}

.dialog-head span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.dialog-head h2 {
  margin: 4px 0 0;
  font: 800 22px var(--font-display);
}

.dialog-head button {
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #eef1ed;
  font-size: 20px;
}

.dialog-grid {
  display: grid;
  padding: 25px 27px;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dialog-grid div {
  padding: 15px;
  border-radius: 10px;
  background: #f5f7f4;
}

.dialog-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8px;
}

.dialog-grid strong {
  font-size: 10px;
}

.dialog-actions {
  display: flex;
  align-items: end;
  padding: 20px 27px;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.dialog-actions label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.dialog-actions label span {
  font-size: 8px;
  font-weight: 700;
}

.dialog-actions button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 9px;
}

.dialog-message {
  margin: 0 27px 22px;
}

@media (max-width: 1000px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .auth-brand {
    min-height: 380px;
    padding: 40px 28px;
  }

  .auth-card {
    padding: 45px 28px;
  }

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

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

  .sidebar nav {
    display: none;
  }

  .sidebar-brand {
    margin-bottom: 20px;
  }

  .topbar,
  .table-head {
    align-items: start;
    padding: 20px;
    flex-direction: column;
  }

  .content {
    padding: 20px;
  }

  .table-tools {
    width: 100%;
  }

  .table-tools input {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .metrics-grid,
  .status-bars,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .table-tools,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Ajuste de legibilidade do painel central */
.eyebrow,
.panel-kicker {
  font-size: 12px;
}

.auth-brand p {
  font-size: 18px;
}

.auth-card > div > p {
  font-size: 14px;
}

.auth-card label span {
  font-size: 12px;
}

.auth-card input {
  font-size: 15px;
}

.form-message,
.dialog-message {
  font-size: 12px;
}

.workspace-label {
  font-size: 10px;
}

.nav-item {
  font-size: 13px;
}

.nav-item small {
  font-size: 9px;
}

.sidebar-user strong {
  font-size: 11px;
}

.sidebar-user span {
  font-size: 9px;
}

.topbar span,
.section-title span,
.table-head span {
  font-size: 10px;
}

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

.topbar-actions button {
  font-size: 11px;
}

.metrics-grid article > span {
  font-size: 11px;
}

.metrics-grid small {
  font-size: 10px;
}

.section-title h2,
.table-head h2 {
  font-size: 20px;
}

.status-bars span {
  font-size: 10px;
}

.billing-alert span,
.alert-card p {
  font-size: 11px;
}

.table-tools input,
.table-tools select,
.table-head > select,
.dialog-actions select {
  font-size: 11px;
}

th {
  font-size: 9px;
}

td {
  font-size: 11px;
}

td span {
  font-size: 10px;
}

.status-pill,
.detail-button {
  font-size: 9px;
}

.empty-state {
  font-size: 13px;
}

.dialog-head span,
.dialog-grid span,
.dialog-actions label span {
  font-size: 10px;
}

.dialog-grid strong {
  font-size: 12px;
}

.dialog-actions button {
  font-size: 11px;
}
