@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;700;800&family=Nunito+Sans:wght@400;600;700;800&display=swap');

:root {
  --background: #fff6f6;
  --background-alt: #ffe8e8;
  --card: #ffffff;
  --surface: #fff1f1;
  --primary: #d62828;
  --primary-dark: #a61e1e;
  --primary-soft: #fde2e2;
  --secondary: #ff8f8f;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --text: #2b1111;
  --muted: #8a5b5b;
  --border: rgba(214, 40, 40, 0.14);
  --input: #fff8f8;
  --white: #ffffff;
  --shadow: rgba(122, 17, 17, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 143, 143, 0.32), transparent 24%),
    radial-gradient(circle at left center, rgba(214, 40, 40, 0.08), transparent 30%),
    linear-gradient(180deg, #fff8f8 0%, var(--background) 100%);
  font-family: 'Nunito Sans', sans-serif;
}

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

h1,
h2,
h3,
strong {
  font-family: 'Sora', sans-serif;
}

.app-shell,
.login-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar,
.login-hero,
.login-card,
.panel-card,
.stat-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 18px 40px var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  background: linear-gradient(135deg, var(--primary), #ee4d4d);
  color: var(--white);
}

.brand-box h1,
.login-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.brand-box p,
.login-hero p {
  margin: 10px 0 0;
  max-width: 650px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.brand-kicker,
.hero-kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.85);
}

.user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.18);
  padding: 14px 16px;
  border-radius: 22px;
  align-self: flex-start;
}

.user-box p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.88);
}

.user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--primary);
  font-weight: 900;
}

.tabbar,
.meta-row,
.filter-row,
.hero-chip-row,
.badge-row,
.chip-cloud,
.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tabbar {
  margin-top: 18px;
}

.tab,
.button,
.meta-pill,
.hero-chip,
.info-chip {
  border-radius: 999px;
}

.tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: transparent;
}

.meta-row {
  justify-content: space-between;
  align-items: center;
  margin: 18px 0;
}

.meta-pill,
.hero-chip,
.info-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 10px 14px;
}

.button {
  border: 1px solid transparent;
  background: var(--card);
  color: var(--text);
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  background: var(--primary);
  color: var(--white);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.24);
}

.button.wide {
  width: 100%;
}

.page-grid,
.stats-grid,
.dual-grid,
.form-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.stat-card {
  padding: 18px;
  background: linear-gradient(180deg, var(--card), #fffafa);
}

.stat-label,
.stat-hint,
.section-head p,
.cell-note,
.list-card p,
.login-help {
  color: var(--muted);
}

.stat-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.stat-value {
  display: block;
  font-size: 30px;
  margin-bottom: 8px;
}

.panel-card {
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,248,248,0.96));
}

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-head p {
  margin: 6px 0 0;
}

.dual-grid {
  grid-template-columns: 1.35fr 1fr;
}

.stack-column,
.list-stack {
  display: grid;
  gap: 14px;
}

.list-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
}

.list-card.spacious {
  align-items: flex-start;
}

.list-side {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.align-end {
  text-align: right;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-block span {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.field,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  padding: 13px 14px;
  border-radius: 16px;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

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

.field-block.full {
  grid-column: 1 / -1;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b76b00;
}

.badge.info {
  background: rgba(214, 40, 40, 0.12);
  color: var(--primary);
}

.badge.rose {
  background: rgba(255, 143, 143, 0.22);
  color: var(--primary-dark);
}

.badge.danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.badge.neutral {
  background: rgba(138, 91, 91, 0.1);
  color: var(--muted);
}

.error-box {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.07);
  color: var(--danger);
}

.error-box.main {
  margin-bottom: 18px;
}

.loading-screen {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 22px;
}

.login-hero {
  padding: 36px;
  background: linear-gradient(135deg, var(--primary), #ef5353);
  color: var(--white);
}

.login-card {
  padding: 28px;
  background: linear-gradient(180deg, var(--card), #fffafa);
}

.login-card-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.login-card-header p {
  margin: 6px 0 18px;
  color: var(--muted);
}

.lojista-grid {
  align-items: start;
}

.form-card {
  position: sticky;
  top: 18px;
}

@media (max-width: 1120px) {
  .stats-grid,
  .stats-grid.small,
  .dual-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .login-shell {
    width: min(100% - 20px, 1380px);
    padding-top: 14px;
  }

  .topbar {
    flex-direction: column;
  }

  .user-box {
    width: 100%;
    justify-content: space-between;
  }

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

  th,
  td {
    min-width: 120px;
  }
}
