:root {
  --purple: #5c0080;
  --purple-dark: #3d0055;
  --orange: #f97316;
  --orange-light: #fb923c;
  --white: #ffffff;
  --gray-50: #faf5ff;
  --gray-100: #f3e8ff;
  --gray-200: #e9d5ff;
  --text-main: #1e1b2e;
  --text-muted: #6b7280;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--gray-50);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────── */
.sidebar {
  width: 220px; min-width: 220px;
  background: var(--purple-dark);
  display: flex; flex-direction: column;
  padding: 0; overflow-y: auto;
}
.sidebar-logo {
  padding: 10px 14px 6px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nova-venda-btn {
  margin: 16px 14px;
  background: var(--orange); color: white;
  border: none; border-radius: 10px; padding: 12px 16px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14px;
  cursor: pointer; transition: background 0.2s; text-align: center;
  animation: pulse 1.5s infinite;
}
.nova-venda-btn:hover { background: var(--orange-light); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(249,115,22,0.7); transform: scale(1); }
  50%  { box-shadow: 0 0 0 8px rgba(249,115,22,0); transform: scale(1.03); }
  100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); transform: scale(1); }
}
.sidebar-section { padding: 10px 14px 6px; }
.sidebar-section-label {
  color: rgba(255,255,255,0.45); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; padding: 0 6px; margin-bottom: 6px;
}
.sidebar-item {
  display: block; width: 100%; background: none; border: none;
  border-radius: 8px; padding: 9px 12px;
  color: rgba(255,255,255,0.75);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left;
  transition: background 0.15s, color 0.15s; margin-bottom: 2px;
}
.sidebar-item:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-item.active { background: var(--orange); color: white; font-weight: 800; }
.sidebar-divider { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 10px 14px; }

/* ── MAIN ───────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  background: white; border-bottom: 1px solid var(--gray-200);
  padding: 16px 28px; display: flex; align-items: center;
  justify-content: space-between; position: relative;
}
.topbar h1 { font-size: 20px; font-weight: 800; color: var(--purple-dark); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.content { flex: 1; overflow-y: auto; padding: 24px 28px; }

/* ── TABELA ─────────────────────────────────── */
.table-wrapper {
  background: white; border-radius: 16px;
  box-shadow: 0 2px 16px rgba(92,0,128,0.07); overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--purple-dark); color: rgba(255,255,255,0.85);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; padding: 14px 20px; text-align: left;
}
tbody tr { border-bottom: 1px solid #f3e8ff; transition: background 0.13s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fdf4ff; }
tbody td { padding: 14px 20px; font-size: 14px; color: var(--text-main); font-weight: 600; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 40px; font-size: 14px; }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 800;
}
.badge-yellow { background: #fef9c3; color: #92400e; border: 1.5px solid #fde68a; }
.badge-orange { background: #fff7ed; color: #c2410c; border: 1.5px solid #fed7aa; }
.badge-green  { background: #f0fdf4; color: #166534; border: 1.5px solid #bbf7d0; }

.contact-btn {
  background: none; border: 1.5px solid #e9d5ff; border-radius: 8px;
  padding: 5px 12px; color: var(--purple);
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 5px;
}
.contact-btn:hover { background: var(--purple); color: white; border-color: var(--purple); }

/* ── MODAL ──────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(30,10,50,0.45); z-index: 100;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 18px; padding: 30px; width: 420px;
  box-shadow: 0 8px 40px rgba(92,0,128,0.18);
}
.modal h2 { font-size: 18px; font-weight: 800; color: var(--purple-dark); margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 800; color: #000000;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%; border: 1.5px solid var(--gray-200); border-radius: 10px;
  padding: 10px 14px; font-family: 'Nunito', sans-serif;
  font-size: 14px; color: var(--text-main); outline: none; transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--purple); }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.btn-primary {
  flex: 1; background: var(--orange); color: white; border: none;
  border-radius: 10px; padding: 12px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14px;
  cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: var(--orange-light); }
.btn-secondary {
  flex: 1; background: none; color: var(--text-muted);
  border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 12px;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all 0.15s;
}
.btn-secondary:hover { background: var(--gray-100); }

/* ── SENHA: OLHO E CAPS LOCK ────────────────── */
.senha-wrapper { position: relative; width: 100%; }
.senha-wrapper input { width: 100%; padding-right: 42px !important; }
.senha-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--text-muted); display: flex; align-items: center;
}
.senha-toggle:hover { color: var(--purple); }
.caps-aviso { display: none; color: #d97706; font-size: 12px; font-weight: 700; margin-top: 5px; }
.caps-aviso.visivel { display: block; }

/* ── LOGIN ──────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0; background: var(--purple-dark);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.login-box {
  background: white; border-radius: 20px; padding: 40px 36px; width: 360px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.3);
  display: flex; flex-direction: column; align-items: center;
}
.login-box p { font-size: 19.5px; color: var(--text-muted); margin-bottom: 28px; }
.login-box .form-group { width: 100%; }
.login-box label {
  display: block; font-size: 12px; font-weight: 800; color: #000;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.login-box input {
  width: 100%; border: 1.5px solid var(--gray-200); border-radius: 10px;
  padding: 10px 14px; font-family: 'Nunito', sans-serif;
  font-size: 14px; color: var(--text-main); outline: none;
  margin-bottom: 14px; transition: border-color 0.15s;
}
.login-box input:focus { border-color: var(--purple); }
.login-error { color: #dc2626; font-size: 13px; font-weight: 700; margin-bottom: 10px; display: none; }
.login-btn {
  width: 100%; background: var(--orange); color: white; border: none;
  border-radius: 10px; padding: 13px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px;
  cursor: pointer; transition: background 0.2s; margin-top: 4px;
}
.login-btn:hover { background: var(--orange-light); }
/* ── RESPONSIVO ─────────────────────────────── */
.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 4px; flex-direction: column; gap: 5px;
}
.hamburger span {
  display: block; width: 22px; height: 2.5px;
  background: var(--purple-dark); border-radius: 2px; transition: all 0.2s;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 49;
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .sidebar {
    position: fixed; left: -240px; top: 0; bottom: 0;
    z-index: 50; transition: left 0.25s ease; width: 240px; min-width: 240px;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 15px; }
  .table-wrapper { background: transparent; box-shadow: none; }
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  tbody tr {
    background: white; border-radius: 14px;
    box-shadow: 0 2px 12px rgba(92,0,128,0.08);
    margin-bottom: 14px; padding: 14px 16px; border-bottom: none;
  }
  tbody td { padding: 5px 0; font-size: 13px; display: flex; align-items: flex-start; gap: 8px; }
  tbody td::before {
    content: attr(data-label); font-size: 10px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); min-width: 110px; padding-top: 2px;
  }
  tbody td:first-child { border-bottom: 1px solid #f3e8ff; padding-bottom: 10px; margin-bottom: 4px; }
}
