/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}
a { text-decoration: none; color: inherit; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); min-height: 100vh; }
.login-page  { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box   {
  background: #fff; border-radius: 20px; padding: 40px 44px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3); text-align: center;
}
.login-logo  {
  background: #6366f1; color: #fff; font-size: 18px; font-weight: 800;
  padding: 10px 20px; border-radius: 12px; display: inline-block;
  margin-bottom: 6px; letter-spacing: -0.5px;
}
.login-tagline { font-size: 13px; color: #94a3b8; margin-bottom: 28px; }
.login-title   { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-sub     { font-size: 13px; color: #64748b; margin-bottom: 24px; }
.login-footer  { font-size: 12px; color: #94a3b8; margin-top: 18px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group  { text-align: left; margin-bottom: 16px; }
.form-label  { font-size: 12px; font-weight: 600; color: #475569; display: block; margin-bottom: 6px; }
.form-input  {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; font-size: 14px; color: #0f172a;
  font-family: inherit; transition: border-color 0.15s; outline: none;
  background: #fff;
}
.form-input:focus { border-color: #6366f1; }
.form-select { 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='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all 0.15s; }
.btn-primary  { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-success  { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger   { background: #fff; color: #dc2626; border: 2px solid #e2e8f0; }
.btn-danger:hover { border-color: #dc2626; background: #fff5f5; }
.btn-ghost    { background: #f1f5f9; color: #64748b; }
.btn-ghost:hover { background: #e2e8f0; }
.btn-sm       { padding: 5px 10px; font-size: 12px; }
.btn-login    { width: 100%; padding: 13px; border-radius: 10px; border: none; background: #6366f1; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.15s; }
.btn-login:hover { background: #4f46e5; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: #fee2e2; color: #dc2626; }
.alert-success { background: #dcfce7; color: #16a34a; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 60px; background: #0f172a; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; gap: 4px; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100;
}
.sidebar-logo {
  width: 36px; height: 36px; background: #6366f1; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800; margin-bottom: 14px;
}
.nav-item {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); font-size: 18px; cursor: pointer;
  transition: all 0.15s; position: relative; text-decoration: none;
}
.nav-item:hover:not(.active) { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
.nav-item.active { background: #6366f1; color: #fff; }
.nav-item .badge {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: #ef4444; border: 2px solid #0f172a;
}
.nav-spacer { flex: 1; }
.nav-tooltip {
  position: absolute; left: 52px; background: #1e293b; color: #fff;
  font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.nav-item:hover .nav-tooltip { opacity: 1; }

/* Main area */
.main { flex: 1; margin-left: 60px; display: flex; flex-direction: column; min-height: 100vh; }

/* Topbar */
.topbar {
  background: #fff; height: 60px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; color: #0f172a; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-search {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; color: #0f172a; width: 220px;
  font-family: inherit; outline: none;
}
.topbar-search:focus { border-color: #6366f1; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #64748b; }
.avatar { width: 34px; height: 34px; background: #6366f1; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }

/* Client topbar (sem sidebar) */
.client-topbar {
  background: #0f172a; height: 60px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.client-logo-img { height: 36px; object-fit: contain; }
.client-logo-text { background: #6366f1; color: #fff; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 8px; }

/* Content area */
.content { flex: 1; padding: 28px; }
.content-narrow { max-width: 960px; margin: 0 auto; }

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-label { font-size: 11px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: #0f172a; }
.stat-sub   { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.stat-pending  { color: #d97706; }
.stat-approved { color: #16a34a; }
.stat-rejected { color: #dc2626; }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title  { font-size: 14px; font-weight: 600; color: #0f172a; }

/* ============================================================
   CARDS GRID (clientes)
   ============================================================ */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); cursor: pointer; transition: box-shadow 0.15s; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.client-logo-badge { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; background: #6366f1; overflow: hidden; }
.client-logo-badge img { width: 100%; height: 100%; object-fit: cover; }
.card-name   { font-size: 13px; font-weight: 600; color: #0f172a; }
.card-sub    { font-size: 11px; color: #94a3b8; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-pending  { background: #fef3c7; color: #d97706; }
.badge-approved { background: #dcfce7; color: #16a34a; }
.badge-rejected { background: #fee2e2; color: #dc2626; }

/* ============================================================
   TABLE
   ============================================================ */
.table-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.table-head, .table-row { display: grid; gap: 0; padding: 12px 18px; align-items: center; }
.table-head { background: #f8fafc; border-bottom: 1px solid #f1f5f9; font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; }
.table-row  { border-bottom: 1px solid #f8fafc; font-size: 13px; color: #475569; }
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: #f8fafc; }

/* ============================================================
   POST CARD (aprovação)
   ============================================================ */
.post-card { background: #fff; border-radius: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); overflow: hidden; margin-bottom: 16px; }
.post-card-inner { display: flex; }
.post-image {
  width: 260px; flex-shrink: 0; background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 220px;
}
.post-image img { width: 100%; height: 100%; object-fit: cover; }
.post-image-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #94a3b8; font-size: 13px; }
.version-tag { position: absolute; top: 10px; left: 10px; background: rgba(15,23,42,0.75); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.post-info  { flex: 1; padding: 20px 24px; display: flex; flex-direction: column; }
.post-meta  { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-date  { font-size: 12px; color: #94a3b8; }
.post-title-text { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.post-caption-box { font-size: 13px; color: #475569; line-height: 1.6; background: #f8fafc; border-radius: 8px; padding: 12px; margin-bottom: 14px; flex: 1; }
.caption-label { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.version-history { margin-bottom: 14px; }
.version-label { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.versions { display: flex; gap: 8px; flex-wrap: wrap; }
.version-chip { padding: 4px 10px; border-radius: 8px; font-size: 12px; border: 1px solid #e2e8f0; color: #64748b; }
.version-chip.current { border-color: #6366f1; color: #6366f1; font-weight: 600; background: #eef2ff; }
.version-chip.rejected { border-color: #fecaca; color: #dc2626; text-decoration: line-through; }
.post-actions { display: flex; gap: 10px; }
.btn-approve { flex: 1; padding: 12px; border-radius: 10px; border: none; cursor: pointer; background: #16a34a; color: #fff; font-size: 14px; font-weight: 700; }
.btn-approve:hover { background: #15803d; }
.btn-reject  { flex: 1; padding: 12px; border-radius: 10px; border: 2px solid #e2e8f0; cursor: pointer; background: #fff; color: #dc2626; font-size: 14px; font-weight: 700; }
.btn-reject:hover { border-color: #dc2626; background: #fff5f5; }
.rejection-form { margin-top: 12px; padding: 14px; background: #fff5f5; border-radius: 10px; border: 1px solid #fecaca; display: none; }
.rejection-form.open { display: block; }
.rejection-form label { font-size: 12px; font-weight: 600; color: #dc2626; display: block; margin-bottom: 8px; }
.rejection-form textarea { width: 100%; border: 1px solid #fecaca; border-radius: 8px; padding: 10px; font-size: 13px; resize: none; font-family: inherit; background: #fff; outline: none; }
.approved-banner { background: #f0fdf4; border-top: 1px solid #bbf7d0; padding: 14px 24px; display: flex; align-items: center; gap: 8px; color: #16a34a; font-size: 13px; font-weight: 600; }
.rejected-banner { background: #fff5f5; border-top: 1px solid #fecaca; padding: 14px 24px; color: #dc2626; font-size: 13px; }
.rejected-comment { margin-top: 6px; font-weight: 400; font-style: italic; }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.tab { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid #e2e8f0; background: #fff; color: #64748b; transition: all 0.15s; }
.tab.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.tab-count { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10px; margin-left: 6px; background: rgba(0,0,0,0.08); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header { margin-bottom: 28px; }
.page-title  { font-size: 22px; font-weight: 700; color: #0f172a; }
.page-sub    { font-size: 14px; color: #64748b; margin-top: 4px; }

/* ============================================================
   POST TYPE TAG
   ============================================================ */
.type-tag {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(15,23,42,0.80); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; pointer-events: none;
}

/* ============================================================
   CAROUSEL SLIDER
   ============================================================ */
.carousel-slider { position: relative; width: 100%; height: 100%; overflow: hidden; }
.carousel-slides  { display: flex; height: 100%; transition: transform 0.3s ease; }
.carousel-slides img {
  flex-shrink: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(15,23,42,0.65); color: #fff; border: none;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; z-index: 10;
}
.carousel-btn:hover { background: rgba(15,23,42,0.9); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.carousel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.5); cursor: pointer; border: none;
  transition: background 0.15s; padding: 0;
}
.carousel-dot.active { background: #fff; }

/* ============================================================
   UPLOAD DROPDOWN
   ============================================================ */
.upload-menu { position: relative; display: inline-block; }
.upload-options {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: #fff; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); border: 1px solid #e2e8f0;
  min-width: 150px; z-index: 200; overflow: hidden;
}
.upload-menu.open .upload-options { display: block; }
.upload-options a {
  display: block; padding: 10px 14px; font-size: 13px;
  color: #0f172a; font-weight: 500; transition: background 0.1s;
}
.upload-options a:hover { background: #f8fafc; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .stats      { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: 1fr; }
  .post-card-inner { flex-direction: column; }
  .post-image { width: 100%; min-height: 200px; }
}
