/* ===================================================================
   PROPOSTAS — Dashboard e Login
   Paleta grafite + dourado (alinhada com as propostas)
   =================================================================== */

:root {
  --ink:        #0F172A;
  --ink-soft:   #1E293B;
  --ink-2:      #334155;
  --text:       #475569;
  --text-soft:  #64748B;
  --line:       #E2E8F0;
  --line-soft:  #F1F5F9;
  --bg:         #FFFFFF;
  --bg-app:     #F8FAFC;
  --bg-warm:    #FAF7F2;
  --gold:       #B8862E;
  --gold-soft:  #D4A356;
  --gold-pale:  #FAEED1;
  --gold-mist:  #FBF7EC;
  --success:    #047857;
  --danger:     #BE123C;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 2px rgba(15,23,42,0.04);
  --shadow:     0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg:  0 12px 32px rgba(15,23,42,0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-app);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.display { font-family: 'Manrope', sans-serif; letter-spacing: -0.02em; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font: inherit; }

/* ================= LOGIN ================= */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg-app);
  position: relative;
}
.login-wrap::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(184,134,46,0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(15,23,42,0.04) 0%, transparent 40%);
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: #FFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-header {
  background: var(--ink);
  padding: 36px 32px 32px 32px;
  text-align: center;
  position: relative;
}
.login-header::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}
.login-header img.logo { height: 72px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); }
.login-header h1 {
  font-family: 'Manrope', sans-serif;
  color: #FFF; font-size: 18px; font-weight: 700;
  margin: 16px 0 4px 0; letter-spacing: -0.01em;
}
.login-header p {
  color: var(--gold-soft);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  margin: 0; font-weight: 600;
}
.login-form { padding: 32px; display: grid; gap: 18px; }
.field label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 6px;
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #FFF; color: var(--ink);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,163,86,0.18);
}
.checkbox-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  user-select: none;
}
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}
.alert {
  padding: 10px 14px;
  background: #FEF2F2; color: #991B1B;
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  font-size: 13px;
}
.btn-primary {
  width: 100%; padding: 13px 18px;
  background: var(--ink); color: #FFF;
  border: 0; border-radius: var(--radius);
  font-weight: 600; font-size: 14px;
  cursor: pointer; transition: opacity .15s, transform .04s;
  letter-spacing: 0.01em;
}
.btn-primary:hover { opacity: .92; }
.btn-primary:active { transform: scale(0.99); }

.login-foot {
  text-align: center; font-size: 11px;
  color: var(--text-soft); margin-top: 18px;
  letter-spacing: 0.04em;
}

/* ================= TOPBAR ================= */
.topbar {
  background: #FFF;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.brand::before {
  content: ''; width: 6px; height: 30px;
  background: var(--gold); border-radius: 2px;
}
.brand .brand-stack {
  display: flex; flex-direction: column;
  line-height: 1.1;
}
.brand small {
  font-family: 'Manrope', sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--gold);
}
.brand strong {
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 1px;
}
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text); text-decoration: none;
}
.nav a:hover { background: var(--line-soft); color: var(--ink); }
.nav a.active { background: var(--gold-mist); color: var(--gold); font-weight: 600; }
.user {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}
.user-info { text-align: right; line-height: 1.25; display: none; }
@media (min-width: 720px) { .user-info { display: block; } }
.user-info .nm { font-size: 13px; font-weight: 600; color: var(--ink); }
.user-info .em { font-size: 11px; color: var(--text-soft); }
.btn-ghost {
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 8px;
  background: #FFF; color: var(--text); cursor: pointer;
  text-decoration: none;
}
.btn-ghost:hover { background: var(--line-soft); border-color: var(--ink-2); color: var(--ink); }

/* ============ SINO DE NOTIFICAÇÕES ============ */
.notif-wrap { position: relative; }
.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: #FFF; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.notif-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-mist); }
.notif-btn.ativo { border-color: var(--gold); color: var(--gold); background: var(--gold-mist); }
.notif-btn svg { width: 18px; height: 18px; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #FFF;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #FFF;
}
.notif-drop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 380px; max-width: calc(100vw - 32px);
  background: #FFF; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 540px; overflow: hidden;
  display: flex; flex-direction: column;
}
.notif-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.notif-head h3 {
  font-family: 'Manrope', sans-serif; font-size: 15px;
  font-weight: 700; color: var(--ink); margin: 0;
}
.notif-head button {
  background: none; border: 0; color: var(--gold);
  font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 0;
}
.notif-head button:hover { text-decoration: underline; }
.notif-list { flex: 1; overflow-y: auto; }
.notif-item {
  display: flex; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .12s;
}
.notif-item:hover { background: var(--bg-warm); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.nao-lida { background: var(--gold-mist); }
.notif-item.nao-lida:hover { background: var(--gold-pale); }
.notif-ico {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.notif-ico.aceite { background: #D1FAE5; color: #065F46; }
.notif-ico.comentario { background: #DBEAFE; color: #1E40AF; }
.notif-ico svg { width: 16px; height: 16px; }
.notif-conteudo { flex: 1; min-width: 0; }
.notif-conteudo .titulo {
  font-size: 13px; font-weight: 600; color: var(--ink);
  line-height: 1.35; margin-bottom: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-conteudo .meta {
  font-size: 11px; color: var(--text-soft);
}
.notif-conteudo .preview {
  font-size: 12px; color: var(--text);
  margin-top: 4px;
  font-style: italic;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-vazio {
  padding: 40px 24px; text-align: center;
  color: var(--text-soft); font-size: 13px;
}

/* ================= LAYOUT ================= */
.container {
  max-width: 1280px; margin: 0 auto;
  padding: 32px 24px 64px 24px;
}
.page-header {
  display: flex; justify-content: space-between; align-items: end;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-title {
  font-family: 'Manrope', sans-serif;
  font-size: 32px; font-weight: 800;
  color: var(--ink); letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}
.page-subtitle {
  color: var(--text-soft); font-size: 14px;
}
.page-subtitle strong { color: var(--ink); font-weight: 700; }

/* ================= FILTROS ================= */
.filtros {
  background: #FFF; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.filtros .busca {
  flex: 1 1 280px; position: relative;
}
.filtros .busca svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-soft);
}
.filtros .busca input {
  width: 100%; padding: 10px 12px 10px 38px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background: #FFF;
}
.filtros .busca input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,163,86,0.15);
}
.filtros select {
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #FFF; color: var(--ink); font-size: 14px;
  min-width: 160px; cursor: pointer;
}
.filtros select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,163,86,0.15);
}

/* ================= CARDS DE PROPOSTAS ================= */
.grid-propostas {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.card-proposta {
  background: #FFF; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
  display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card-proposta:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-top {
  display: flex; justify-content: space-between; align-items: start;
  gap: 10px; margin-bottom: 12px;
}
.card-meta {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--gold); text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.card-meta .sep { color: var(--line); }
.card-titulo {
  font-family: 'Manrope', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.01em;
  margin: 4px 0 2px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3;
}
.card-cliente { font-size: 13px; color: var(--text); margin-bottom: 14px; }
.status-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px; white-space: nowrap;
}
.status-pill.rascunho  { background: #FEF3C7; color: #92400E; }
.status-pill.enviada   { background: #DBEAFE; color: #1E40AF; }
.status-pill.aprovada  { background: #D1FAE5; color: #065F46; }
.status-pill.recusada  { background: #FEE2E2; color: #991B1B; }

.card-info { font-size: 13px; margin-bottom: 18px; }
.card-info-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px dashed var(--line-soft);
}
.card-info-row:last-child { border-bottom: 0; }
.card-info-row .l { color: var(--text-soft); }
.card-info-row .v { color: var(--ink); font-weight: 500; }
.card-info-row .v.valor { font-weight: 700; color: var(--gold); }

.card-actions {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: flex; gap: 6px;
}
.card-actions .btn-abrir {
  flex: 1; padding: 9px 12px; text-align: center;
  background: var(--ink); color: #FFF;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: opacity .12s;
}
.card-actions .btn-abrir:hover { opacity: 0.9; text-decoration: none; }
.card-actions .btn-ext {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--text);
  text-decoration: none; background: #FFF;
  transition: border-color .12s, color .12s, background .12s;
}
.card-actions .btn-ext:hover {
  border-color: var(--gold); color: var(--gold);
  background: var(--gold-mist); text-decoration: none;
}
.card-actions a.disabled {
  pointer-events: none; opacity: 0.35;
}

/* ================= ESTADO VAZIO ================= */
.empty {
  background: #FFF; border: 1px dashed var(--line);
  border-radius: var(--radius-lg); padding: 60px 32px;
  text-align: center;
}
.empty h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 20px; color: var(--ink); margin: 0 0 8px 0;
}
.empty p { color: var(--text-soft); max-width: 480px; margin: 0 auto; }
.empty code {
  background: var(--line-soft); padding: 2px 6px; border-radius: 4px;
  color: var(--ink); font-size: 13px;
}

/* ================= MODAL ================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: #FFF; border-radius: var(--radius-lg);
  width: 100%; max-width: 720px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 18px; margin: 0; color: var(--ink);
}
.modal-close {
  background: none; border: 0;
  color: var(--text-soft); cursor: pointer;
  font-size: 22px; padding: 0; line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal-body {
  padding: 20px 24px; overflow-y: auto; flex: 1;
}
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* Categoria editor */
.cat-row {
  display: grid; grid-template-columns: 1fr 1.5fr 2fr auto;
  gap: 8px; padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
.cat-row input {
  padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 13px; background: #FFF;
}
.cat-row input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212,163,86,0.15);
}
.btn-icon {
  background: #FEF2F2; border: 1px solid #FECACA;
  border-radius: 6px; padding: 6px 9px; cursor: pointer;
  color: var(--danger); font-size: 14px;
}
.btn-icon:hover { background: #FEE2E2; }
.btn-add {
  margin-top: 10px;
  padding: 8px 14px; border: 1px dashed var(--gold);
  background: var(--gold-mist); color: var(--gold);
  border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.btn-add:hover { background: var(--gold-pale); }
.btn-save {
  padding: 9px 18px; background: var(--ink); color: #FFF;
  border: 0; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: inline-flex; align-items: center; gap: 8px;
  line-height: 1; transition: opacity .12s, transform .04s;
}
.btn-save:hover { opacity: 0.9; }
.btn-save:active { transform: scale(0.98); }

.btn-wa {
  padding: 9px 18px; background: #25D366; color: #FFF;
  border: 0; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  font-family: 'Inter', sans-serif;
  display: inline-flex; align-items: center; gap: 8px;
  line-height: 1; transition: opacity .12s, transform .04s;
  box-shadow: 0 2px 8px rgba(37,211,102,0.25);
}
.btn-wa:hover { opacity: 0.92; text-decoration: none; color: #FFF; }
.btn-wa:active { transform: scale(0.98); }

/* ================= UTIL ================= */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #FFF;
  padding: 12px 22px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

@media (max-width: 640px) {
  .container { padding: 20px 16px 40px 16px; }
  .page-title { font-size: 24px; }
  .filtros { padding: 12px; }
  .filtros select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .brand { font-size: 14px; }
}
