/* ── Fonts ──────────────────────────────────────────────────────────────── */
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@500,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500&display=swap');

/* ── Color tokens ───────────────────────────────────────────────────────── */
:root {
  --c-bg:        #1A1A1A;
  --c-surface:   #222222;
  --c-border:    #2E2E2E;
  --c-muted:     #D4D4D4;
  --c-text:      #F9FAFB;
  --c-purple:    #9E23B2;
  --c-purple-dim:#7A1A8A;
  --c-purple-bg: rgba(158, 35, 178, 0.12);

  /* Format chip colors */
  --c-arte:      #9E23B2;   /* purple  */
  --c-video:     #16A34A;   /* green   */
  --c-carrossel: #2563EB;   /* blue    */
  --c-reels:     #EA580C;   /* orange  */
  --c-stories:   #DB2777;   /* pink    */
  --c-gravacao:  #0891B2;   /* teal    */
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Satoshi', sans-serif;
  font-weight: 600;
  margin: 0;
}

a { color: var(--c-purple); text-decoration: none; }
a:hover { color: var(--c-purple-dim); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--c-border);
  padding: 1rem 0;
  margin-bottom: 2rem;
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header .brand {
  font-family: 'Satoshi', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-header .brand span { color: var(--c-purple); }
.site-header .brand img  { height: 28px; width: auto; display: block; }
.login-logo img          { height: 52px; width: auto; display: block; margin: 0 auto .5rem; }

/* ── Month nav ──────────────────────────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.month-nav h2 {
  font-size: 1.25rem;
  min-width: 200px;
  text-align: center;
  text-transform: capitalize;
}
.btn-nav {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.btn-nav:hover { border-color: var(--c-purple); background: var(--c-purple-bg); }

/* ── Calendar grid ──────────────────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  overflow: hidden;
}

.weekday-header {
  background: var(--c-surface);
  padding: 0.5rem;
  text-align: center;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-cell {
  background: var(--c-bg);
  min-height: 110px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.day-cell.other-month { background: #161616; }
.day-cell.today .day-num { color: var(--c-purple); font-weight: 600; }

.day-num {
  font-family: 'Satoshi', sans-serif;
  font-size: 0.85rem;
  color: var(--c-muted);
  margin-bottom: 0.25rem;
}

/* ── Post chips ─────────────────────────────────────────────────────────── */
.post-chip {
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s, transform 0.1s;
  border: none;
  text-align: left;
  width: 100%;
  color: #fff;
}
.post-chip:hover { opacity: 0.85; transform: scale(1.01); }
.post-chip.arte      { background: var(--c-arte); }
.post-chip.video     { background: var(--c-video); }
.post-chip.carrossel { background: var(--c-carrossel); }
.post-chip.reels     { background: var(--c-reels); }
.post-chip.stories   { background: var(--c-stories); }
.post-chip.gravacao  { background: var(--c-gravacao); }

/* Status dot inside chip */
.post-chip .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  margin-right: 4px;
  vertical-align: middle;
}
.post-chip.status-publicado .dot { background: #4ADE80; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-backdrop.hidden { display: none; }

.modal-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 460px;
  width: 100%;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  color: var(--c-muted); font-size: 1.25rem;
  cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--c-text); }

.modal-format-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 1rem;
}

.modal-theme {
  font-family: 'Satoshi', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.modal-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--c-muted);
}
.modal-meta .row { display: flex; gap: 0.5rem; align-items: center; }
.modal-meta .label { color: #888; min-width: 90px; }

.status-badge {
  display: inline-block;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-planejado     { background: #2E2E2E; color: var(--c-muted); }
.status-em_producao   { background: #1E3A5F; color: #93C5FD; }
.status-aprovado      { background: #14532D; color: #86EFAC; }
.status-publicado     { background: #166534; color: #4ADE80; }

/* Platform badges */
.platform-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.platform-badge {
  background: #2E2E2E;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: capitalize;
}

/* ── Legend ─────────────────────────────────────────────────────────────── */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--c-muted);
}
.legend-item {
  display: flex; align-items: center; gap: 0.35rem;
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Forms (admin) ──────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.form-group label {
  font-size: 0.85rem;
  color: var(--c-muted);
  font-weight: 500;
}
.form-control {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: var(--c-text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--c-purple);
}
.form-control option { background: #222; }

/* Checkboxes platform */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.checkbox-label {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}
.checkbox-label input { display: none; }
.checkbox-label.checked {
  border-color: var(--c-purple);
  background: var(--c-purple-bg);
  color: var(--c-text);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--c-purple); color: #fff; }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
.btn-danger  { background: #7F1D1D; color: #FCA5A5; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* ── Cards (admin) ──────────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 1.25rem;
}
.card-title {
  font-family: 'Satoshi', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.card-meta { font-size: 0.82rem; color: var(--c-muted); }

/* client grid */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ── Admin post table ───────────────────────────────────────────────────── */
.posts-table { width: 100%; border-collapse: collapse; }
.posts-table th, .posts-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.85rem;
}
.posts-table th { color: var(--c-muted); font-weight: 500; }
.posts-table tr:last-child td { border-bottom: none; }
.posts-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Alert ──────────────────────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.alert-error   { background: #450A0A; color: #FCA5A5; border: 1px solid #7F1D1D; }
.alert-success { background: #052E16; color: #86EFAC; border: 1px solid #14532D; }

/* ── Mobile list view ───────────────────────────────────────────────────── */
.mobile-list { display: none; }

@media (max-width: 640px) {
  .calendar-grid { display: none; }
  .mobile-list   { display: flex; flex-direction: column; gap: 0.75rem; }

  .mobile-day-group {}
  .mobile-day-label {
    font-size: 0.75rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
  }
  .mobile-post-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-left: 3px solid var(--c-purple);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    margin-bottom: 0.4rem;
  }
  .mobile-post-item.video     { border-left-color: var(--c-video); }
  .mobile-post-item.carrossel { border-left-color: var(--c-carrossel); }
  .mobile-post-item.reels     { border-left-color: var(--c-reels); }
  .mobile-post-item.stories   { border-left-color: var(--c-stories); }
  .mobile-post-item.gravacao  { border-left-color: var(--c-gravacao); }
}

/* ── Login page ─────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.login-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
}
.login-logo {
  font-family: 'Satoshi', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-align: center;
}
.login-logo span { color: var(--c-purple); }
.login-sub {
  text-align: center;
  font-size: 0.85rem;
  color: var(--c-muted);
  margin-bottom: 2rem;
}
