@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #f0f1f7;
  --border: #e3e5ee;
  --text: #1c1f2e;
  --text-muted: #6b7086;
  --accent: #ff4800;
  --accent-hover: #d3d3d3;
  --accent-soft: #ebddce;
  --green: #16a34a;
  --green-soft: #e8f8ee;
  --amber: #2166de;
  --amber-soft: #e5edfb;
  --red: #dc2626;
  --red-soft: #fdeaea;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(20, 22, 40, 0.04), 0 8px 24px rgba(20, 22, 40, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.hidden { display: none !important; }

/* --- Layout shells --------------------------------------------------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 32px;
}

.auth-card .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--text-muted); }

.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card p.lead { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }

.app-shell { min-height: 100vh; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand { display: flex; align-items: center; gap: 10px; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.topbar nav {
  display: flex;
  gap: 4px;
}

.topbar nav a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
}

.topbar nav a.active, .topbar nav a:hover { background: var(--surface-alt); color: var(--text); }

.main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-header h1 { font-size: 22px; margin: 0 0 4px; }
.page-header p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* --- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease, opacity .15s ease;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.btn-secondary { background: var(--surface-alt); color: var(--text); }
.btn-secondary:hover { background: #e6e8f4; }

.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface-alt); }

.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbdada; }

.btn-approve { background: var(--green-soft); color: var(--green); }
.btn-approve:hover { background: #d7f3e2; }

.btn-changes { background: var(--amber-soft); color: var(--amber); }
.btn-changes:hover { background: #d3e0f8; }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

/* --- Forms --------------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 70px; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.error-box {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.success-box {
  background: var(--green-soft);
  color: var(--green);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* --- Cards / tables -------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-pad { padding: 22px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* --- Badges -------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--amber-soft); color: var(--amber); }
.badge-approved { background: var(--green-soft); color: var(--green); }
.badge-changes_requested { background: var(--red-soft); color: var(--red); }

.type-tag {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 6px;
}

/* --- Calendar ------------------------------------------------------------ */

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.calendar-nav h2 { font-size: 17px; margin: 0; min-width: 170px; text-align: center; text-transform: capitalize; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-weekday {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 4px;
}

.calendar-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 92px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.calendar-day.is-empty { background: transparent; border-color: transparent; cursor: default; }
.calendar-day.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.calendar-day.is-today .day-number { color: var(--accent); }

.day-number { font-size: 13px; font-weight: 700; }

.day-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.day-dot { width: 7px; height: 7px; border-radius: 50%; }
.day-dot.pending { background: var(--amber); }
.day-dot.approved { background: var(--green); }
.day-dot.changes_requested { background: var(--red); }

.agenda-list { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

.agenda-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.agenda-item:hover { border-color: var(--accent); }
.agenda-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 52px;
}
.agenda-main { flex: 1; min-width: 0; }
.agenda-title { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.agenda-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* --- Modal --------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 40, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.modal-header h2 { font-size: 16px; margin: 0 0 6px; }
.modal-close {
  border: none;
  background: var(--surface-alt);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.modal-body { padding: 20px 24px; max-height: 70vh; overflow-y: auto; }

.media-preview {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-alt);
  margin-bottom: 16px;
}
.media-preview img, .media-preview video { width: 100%; max-height: 420px; display: block; object-fit: contain; background: #0c0d16; }
.media-placeholder {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* --- Carrossel (múltiplos arquivos por conteúdo) -------------------------- */

.carousel-track {
  display: flex;
  transition: transform .25s ease;
}
.carousel-slide { width: 100%; flex-shrink: 0; }
.carousel-slide img, .carousel-slide video { width: 100%; max-height: 420px; display: block; object-fit: contain; background: #0c0d16; }

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(12, 13, 22, 0.55);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-arrow:hover { background: rgba(12, 13, 22, 0.75); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.carousel-dot.is-active { background: #fff; }

.media-zoom-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(12, 13, 22, 0.6);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-zoom-btn:hover { background: rgba(12, 13, 22, 0.8); }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 200;
}
.lightbox-media {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  display: block;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}
.lightbox-arrow:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
}

/* --- Grade de miniaturas (tela de admin, ao adicionar arquivos) ----------- */

.media-grid-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.media-grid-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.media-grid-item img, .media-grid-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(12, 13, 22, 0.7);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-grid-remove:hover { background: var(--red); }

.copy-block {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 14px;
}
.copy-block strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 6px; }

.action-row { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }

.comments-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: 22px 0 10px; }

.comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.comment-author { font-weight: 700; color: var(--text); }
.comment-body { font-size: 14px; line-height: 1.5; }

.comment-form { display: flex; gap: 10px; margin-top: 14px; align-items: flex-start; }
.comment-form textarea { flex: 1; }

.changes-form { background: var(--amber-soft); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.changes-form textarea { width: 100%; margin-bottom: 10px; }

/* --- Misc ------------------------------------------------------------- */

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; background: var(--surface); }

.muted { color: var(--text-muted); }
.spinner { font-size: 13px; color: var(--text-muted); padding: 30px; text-align: center; }

@media (max-width: 720px) {
  .calendar-day { min-height: 64px; padding: 6px; }
  .day-number { font-size: 12px; }
  .topbar { padding: 12px 16px; }
  .topbar-user span.only-desktop { display: none; }
  .main { padding: 20px 14px 60px; }
}
