@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0F0F0F;
  --off-white: #F5F2ED;
  --gold: #C8A96A;
  --gold-dark: #A8893A;
  --gold-light: #E8C98A;
  --gray-light: #E5E5E5;
  --gray-mid: #8A8A8A;
  --white: #FFFFFF;
  --shadow: 0 2px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --transition: 0.25s ease;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }
body { font-family: var(--font-sans); background: var(--off-white); color: var(--black); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; max-width: 100%; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
.serif { font-family: var(--font-serif); }
h1,h2,h3,h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.1rem; }
p { color: #444; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px; border-radius: var(--radius); font-weight: 500;
  font-size: 0.95rem; letter-spacing: 0.02em; border: none;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--gold); color: var(--black);
}
.btn-primary:hover { background: var(--gold-dark); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(200,169,106,0.4); }
.btn-outline {
  background: transparent; color: var(--black);
  border: 1.5px solid var(--black);
}
.btn-outline:hover { background: var(--black); color: var(--white); transform: translateY(-1px); }
.btn-outline-gold {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline-gold:hover { background: var(--gold); color: var(--black); }
.btn-ghost { background: transparent; color: var(--gray-mid); padding: 8px 16px; }
.btn-ghost:hover { color: var(--black); background: var(--gray-light); border-radius: var(--radius); }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #bb2d3b; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 18px 44px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── FORM ELEMENTS ───────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; color: var(--black); }
.form-control {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--gray-light);
  border-radius: var(--radius); font-size: 0.95rem; background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--black);
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,169,106,0.15); }
.form-control::placeholder { color: var(--gray-mid); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A8A8A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-light); }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--gray-light); background: #FAFAFA; }

/* ── GOLD LINE DIVIDER ───────────────────────────────────── */
.gold-line {
  width: 60px; height: 1.5px; background: var(--gold); margin: 20px 0;
}
.gold-line.center { margin: 20px auto; }

/* ── BADGES / STATUS ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 500;
}
.badge-planejado { background: #E8F4FD; color: #1976D2; }
.badge-em_aprovacao { background: #FFF3E0; color: #E65100; }
.badge-aprovado { background: #E8F5E9; color: #2E7D32; }
.badge-rejeitado { background: #FEECEC; color: #C62828; }
.badge-postado { background: #F3E5F5; color: #7B1FA2; }
.badge-pendente { background: #FFF3E0; color: #E65100; }
.badge-assinado { background: #E8F5E9; color: #2E7D32; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px) scale(0.98); transition: transform var(--transition);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 24px 28px 20px; border-bottom: 1px solid var(--gray-light);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-serif); font-size: 1.3rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; color: var(--gray-mid); cursor: pointer; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--black); }
.modal-body { padding: 28px; }
.modal-footer { padding: 20px 28px; border-top: 1px solid var(--gray-light); display: flex; gap: 12px; justify-content: flex-end; }

/* ── TOAST NOTIFICATION ──────────────────────────────────── */
.toast-container {
  position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); right: max(16px, env(safe-area-inset-right)); left: max(16px, env(safe-area-inset-left)); z-index: 2000;
  display: flex; flex-direction: column; gap: 12px; pointer-events: none; align-items: stretch;
}
@media (min-width: 400px) {
  .toast-container { left: auto; align-items: flex-end; }
}
.toast {
  padding: 14px 20px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 500; max-width: min(340px, calc(100vw - 32px));
  pointer-events: all; box-shadow: var(--shadow-lg);
  transform: translateX(100px); opacity: 0;
  transition: all 0.3s ease; display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { background: #0F0F0F; color: #fff; border-left: 3px solid var(--gold); }
.toast-error { background: #fff; color: #dc3545; border-left: 3px solid #dc3545; }
.toast-info { background: var(--white); color: var(--black); border-left: 3px solid var(--gold); }

/* ── TABLE ───────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; }
th { background: var(--off-white); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-mid); padding: 12px 16px; text-align: left; }
td { padding: 14px 16px; border-bottom: 1px solid var(--gray-light); vertical-align: middle; font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFAFA; }

/* ── LOADER ──────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--gray-light);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(245,242,237,0.9);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-mid); }

/* ── UTILITY ─────────────────────────────────────────────── */
.text-gold { color: var(--gold); }
.text-gray { color: var(--gray-mid); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0 !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-mid); }
.empty-state svg { opacity: 0.3; margin: 0 auto 16px; }
.divider { border: none; border-top: 1px solid var(--gray-light); margin: 24px 0; }

@media (max-width: 480px) {
  .btn { white-space: normal; text-align: center; line-height: 1.35; }
  .btn-lg { padding: 14px 22px; font-size: 1rem; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
