@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Outfit:wght@600;700&display=swap");

:root {
  /* Verde extraído da logo Minerita */
  --green: #06bc61;
  --green-rgb: 6, 188, 97;
  --green-dark: #04964d;
  --green-soft: #e6f8ef;
  --navy: #2b2b4a;
  --navy-soft: #3d3d66;
  --bg: #f3faf6;
  --bg-2: #e6f3eb;
  --surface: #ffffff;
  --text: #2b2b4a;
  --muted: #6b6b8a;
  --border: rgba(43, 43, 74, 0.12);
  --danger: #c0392b;
  --ok: #04964d;
  --shadow: 0 12px 40px rgba(43, 43, 74, 0.08);
  --radius: 18px;
  --font: "DM Sans", sans-serif;
  --display: "Outfit", "DM Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(var(--green-rgb), 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(43, 43, 74, 0.12), transparent 50%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-2) 100%);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--navy);
  font-weight: 600;
}

button,
input,
select,
textarea {
  font: inherit;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.auth-shell {
  width: min(440px, 100%);
  animation: rise 0.55s ease both;
}

.brand-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: min(220px, 70vw);
  height: auto;
  margin: 0 auto 1rem;
  background: #000;
  border-radius: 20px;
  padding: 0.85rem 1.1rem;
  filter: drop-shadow(0 8px 24px rgba(43, 43, 74, 0.15));
  animation: logoIn 0.7s ease both;
}

.brand-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  margin: 0 0 0.35rem;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.brand-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: rgba(43, 43, 74, 0.04);
  padding: 0.35rem;
  border-radius: 999px;
}

.tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

.tab-btn.active {
  background: var(--green);
  color: #fff;
}

.form-stack {
  display: grid;
  gap: 0.9rem;
}

.form-stack.hidden,
.hidden {
  display: none !important;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-soft);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: #fafbf7;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.28);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 12px;
  padding: 0.8rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--navy);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-danger {
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.link-btn {
  background: none;
  border: 0;
  color: var(--navy-soft);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

.message {
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
}

.message-info {
  background: rgba(43, 43, 74, 0.06);
  color: var(--navy);
}

.message-ok {
  background: rgba(var(--green-rgb), 0.14);
  color: var(--ok);
}

.message-error {
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(243, 250, 246, 0.88);
  border-bottom: 1px solid var(--border);
}

.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.header-brand img {
  width: 54px;
  height: auto;
  background: #000;
  border-radius: 12px;
  padding: 0.35rem;
}

.header-brand strong {
  font-family: var(--display);
  display: block;
  font-size: 1.05rem;
  line-height: 1.2;
}

.header-brand span {
  color: var(--muted);
  font-size: 0.85rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: right;
}

.user-chip b {
  color: var(--navy);
  display: block;
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page-title {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.section {
  margin-bottom: 2rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
}

.grid-combos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.combo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s;
  animation: rise 0.45s ease both;
}

.combo-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--green-rgb), 0.55);
}

.combo-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.28), var(--shadow);
}

.combo-media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--navy);
  min-height: 160px;
}

.combo-media figure {
  margin: 0;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #1f1f38;
}

.combo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.combo-media figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}

.combo-body {
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
  flex: 1;
}

.combo-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.combo-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.combo-list b {
  color: var(--navy);
  font-weight: 600;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  color: var(--green-dark);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(43, 43, 74, 0.03);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.item-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #eee;
}

.item-card .item-body {
  padding: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.item-card h4 {
  margin: 0;
  font-size: 0.98rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(var(--green-rgb), 0.16);
  color: var(--green-dark);
}

.badge-off {
  background: rgba(43, 43, 74, 0.08);
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .form-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.combo-builder {
  display: grid;
  gap: 1rem;
}

.combo-slot {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.55);
}

.combo-slot h4 {
  margin: 0 0 0.75rem;
}

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
}

.preview-img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: none;
}

.preview-img.show {
  display: block;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes logoIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .app-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}
