:root {
  --primary:       #7B3F5E;
  --primary-dark:  #5C2E46;
  --gold:          #C4A16B;
  --gold-dark:     #A8854A;
  --bg:            #FBF8F4;
  --bg-alt:        #F3EDE6;
  --border:        #E8DDD5;
  --text:          #2A2A2A;
  --text-light:    #6B6B6B;
  --white:         #FFFFFF;
  --wpp:           #25D366;
  --radius:        10px;
  --shadow:        0 4px 24px rgba(123,63,94,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'Raleway', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
.hidden { display: none !important; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
}
.login-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo { height: 56px; width: auto; margin: 0 auto 20px; display: block; object-fit: contain; }
.login-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--primary);
  font-weight: 600;
}
.login-sub { color: var(--text-light); font-size: .85rem; margin-bottom: 28px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-erro { color: #c0392b; font-size: .85rem; margin-top: 4px; }

/* ── FIELDS ── */
.field { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.field label { font-size: .78rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Raleway', sans-serif;
  font-size: .95rem;
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--primary); background: var(--white); }

.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline label { font-size: .82rem; font-weight: 700; color: var(--text-light); white-space: nowrap; }
.field-inline input { padding: 7px 10px; font-size: .88rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: .75rem 1.6rem;
  border-radius: 50px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: var(--white); width: 100%; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-light); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: .45rem 1rem; font-size: .82rem; width: auto; }

/* ── DASHBOARD HEADER ── */
.dash-header {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  padding: 14px 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.dash-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-logo { height: 44px; width: auto; object-fit: contain; flex-shrink: 0; }
.dash-header-sub { font-size: .68rem; letter-spacing: .15em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.dash-title { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; color: var(--primary); font-weight: 600; }
.dash-user-area { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.dash-usuario { font-size: .82rem; color: var(--text-light); font-weight: 600; }

/* ── DASHBOARD MAIN ── */
.dash-main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }

/* ── CARDS ── */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-gold { border-left: 4px solid var(--gold); }
.card-primary { border-left: 4px solid var(--primary); }
.card-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-light); font-weight: 600; margin-bottom: 8px; }
.card-val { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 600; color: var(--primary); }
.card-gold .card-val { color: var(--gold-dark); }

/* ── FILTROS ── */
.filtros {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ── TABS ── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 24px;
  font-family: 'Raleway', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--primary); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
thead th {
  background: var(--primary);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--bg-alt); }
tbody td { padding: 10px 14px; color: var(--text); }
.empty { text-align: center; color: var(--text-light); padding: 32px !important; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-orc     { background: #EEF2FF; color: #4F46E5; }
.badge-fechado { background: #ECFDF5; color: #059669; }

.vendas-resumo {
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.resumo-item { display: flex; flex-direction: column; gap: 4px; }
.resumo-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-light); font-weight: 600; }
.resumo-val { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; color: var(--primary); font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .dash-header-inner { flex-wrap: wrap; }
  .login-card { padding: 32px 24px; }
}
