/* ============================================
   FitFocused — Dashboard Stylesheet
   ============================================ */

:root {
  --green:       #2D6345;
  --green-dark:  #1e4530;
  --green-light: #3D8A5E;
  --green-pale:  #EBF2ED;
  --gold:        #C9963E;
  --cream:       #FAF8F3;
  --dark:        #1A1A1A;
  --mid:         #555555;
  --light:       #999999;
  --white:       #FFFFFF;
  --border:      #E2DDD5;
  --sidebar-w:   240px;
  --danger:      #C44B4B;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--dark);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ── Login Screen ── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a3d2b 0%, #2D6345 100%);
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 44px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  text-align: center;
}
.login-logo {
  height: 48px;
  width: auto;
  margin: 0 auto 20px;
}
.login-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 20px;
}
.login-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  color: var(--dark);
  margin-bottom: 6px;
}
.login-sub {
  font-size: 0.85rem;
  color: var(--light);
  margin-bottom: 32px;
}
.login-error {
  color: var(--danger);
  font-size: 0.82rem;
  min-height: 20px;
  margin-bottom: 8px;
}
.btn-login {
  width: 100%;
  background: var(--green);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px;
  border-radius: 50px;
  transition: background 0.2s;
  margin-top: 8px;
}
.btn-login:hover { background: var(--green-light); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Field Group (shared) ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-bottom: 16px;
}
.field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field-group input,
.field-group select,
.field-group textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--green);
}
.field-group textarea { resize: vertical; }
.req { color: var(--gold); }

/* ── Dashboard Layout ── */
.dashboard {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo img {
  height: 36px;
  width: auto;
}
.sidebar-brand-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-item svg {
  width: 20px; height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}
.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}
.nav-item.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
  border-left-color: var(--gold);
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#user-email-display {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sign-out-btn {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  background: none;
  padding: 0;
  text-align: left;
  transition: color 0.15s;
}
#sign-out-btn:hover { color: var(--white); }

/* ── Main Content ── */
.dash-main {
  flex: 1;
  overflow-y: auto;
  background: var(--cream);
}
.panel {
  display: none;
  padding: 36px 40px;
  min-height: 100%;
}
.panel.active { display: block; }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.panel-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  color: var(--dark);
  line-height: 1.2;
}
.panel-sub {
  font-size: 0.85rem;
  color: var(--light);
  margin-top: 4px;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--green);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 50px;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--green-light); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--green); color: var(--white); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px;
  transition: all 0.2s;
}
.btn-danger:hover { background: var(--danger); color: var(--white); }

/* ── Calendar ── */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.month-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.month-nav h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--dark);
  min-width: 200px;
  text-align: center;
}
.month-btn {
  width: 36px; height: 36px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.month-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.platform-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--mid);
  transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--chip, var(--green)); color: var(--chip, var(--green)); }
.filter-chip.active {
  background: var(--chip, var(--green));
  border-color: var(--chip, var(--green));
  color: var(--white);
}
.filter-chip[data-platform="all"].active { background: var(--green); border-color: var(--green); }

.calendar-wrap {
  background: var(--white);
  border-radius: 16px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  margin-bottom: 32px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-header {
  padding: 10px 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1.5px solid var(--border);
  background: #f7f5f0;
}
.cal-day {
  min-height: 100px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: #f9f7f2; }
.cal-day.empty { background: #f7f5f0; cursor: default; }
.cal-day.today .cal-day-num {
  background: var(--green);
  color: var(--white);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-posts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.1s;
}
.cal-chip:hover { opacity: 0.85; }

/* ── Upcoming ── */
.upcoming-section h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 14px;
}
.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upcoming-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.upcoming-row:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.upcoming-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.upcoming-meta {
  flex: 1;
  min-width: 0;
}
.upcoming-platform {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mid);
}
.upcoming-caption {
  font-size: 0.88rem;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upcoming-date {
  font-size: 0.78rem;
  color: var(--light);
  white-space: nowrap;
}
.upcoming-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 50px;
}
.status-draft { background: #f0ece4; color: var(--mid); }
.status-scheduled { background: var(--green-pale); color: var(--green); }
.status-published { background: #e8f4ec; color: #2a7a47; }
.empty-state { font-size: 0.88rem; color: var(--light); padding: 16px 0; }

/* ── Tasks ── */
.tasks-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-ring-wrap {
  position: relative;
  width: 44px; height: 44px;
}
.progress-ring {
  width: 44px; height: 44px;
  transform: rotate(-90deg);
}
.ring-bg { fill: none; stroke: var(--border); stroke-width: 3; }
.ring-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  transition: stroke-dashoffset 0.4s ease;
}
#tasks-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--green);
}
.tasks-count-label {
  font-size: 0.9rem;
  color: var(--mid);
  font-weight: 500;
}
.tasks-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.task-group {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.task-group-header {
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mid);
  background: #f7f5f0;
  border-bottom: 1.5px solid var(--border);
}
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: #faf9f6; }
.task-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.task-item.done .task-check {
  background: var(--green);
  border-color: var(--green);
}
.task-item.done .task-check::after {
  content: '✓';
  font-size: 0.7rem;
  color: var(--white);
  font-weight: 700;
}
.task-label {
  font-size: 0.88rem;
  color: var(--dark);
  transition: color 0.15s;
}
.task-item.done .task-label {
  text-decoration: line-through;
  color: var(--light);
}
.task-platform-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Stats ── */
.stats-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stats-updated-label {
  font-size: 0.78rem;
  color: var(--light);
}
.verify-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffbeb;
  border: 1.5px solid #f6d860;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.84rem;
  color: #7a6200;
  margin-bottom: 24px;
}
.verify-dot {
  width: 8px; height: 8px;
  background: #f6d860;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.stats-edit-form {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-top: 28px;
}
.stats-edit-form h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 20px;
}
.stats-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0 20px;
}
.stats-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1.5px solid var(--border);
}
.connect-banner {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 28px;
  text-align: center;
}
.connect-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}
.connect-banner h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--dark);
  margin-bottom: 10px;
}
.connect-banner p {
  font-size: 0.88rem;
  color: var(--mid);
  max-width: 480px;
  margin: 0 auto 20px;
  line-height: 1.7;
}
.connect-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto;
  text-align: left;
}
.connect-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--mid);
}
.step-num {
  width: 26px; height: 26px;
  background: var(--green-pale);
  color: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.stats-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}
.stats-card.placeholder { opacity: 0.6; }
.stats-platform-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  padding: 3px 10px;
  border-radius: 50px;
  display: inline-block;
  margin-bottom: 12px;
}
.stats-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.stats-label {
  font-size: 0.78rem;
  color: var(--light);
}
.stats-handle {
  font-size: 0.72rem;
  color: var(--light);
  margin-top: 4px;
}

/* ── Sales ── */
.sales-products {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
  margin: 16px auto 0;
  text-align: left;
}
.sales-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--cream);
  border-radius: 10px;
  font-size: 0.88rem;
}
.product-name { font-weight: 600; color: var(--dark); }
.gumroad-link { font-size: 0.78rem; color: var(--green); font-weight: 600; }
.gumroad-link:hover { text-decoration: underline; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-card {
  background: var(--white);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.modal-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--dark);
}
.modal-close {
  width: 32px; height: 32px;
  background: var(--cream);
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--border); }
#post-form { padding: 24px 28px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0 16px;
}
.character-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.char-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.char-chip input { display: none; }
.char-chip:has(input:checked) {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1.5px solid var(--border);
}
.modal-actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo img,
  .sidebar-brand-text,
  .nav-item span,
  #user-email-display,
  #sign-out-btn { display: none; }
  .nav-item { justify-content: center; padding: 14px; }
  .nav-item svg { width: 22px; height: 22px; }
  .panel { padding: 24px 20px; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .calendar-toolbar { flex-direction: column; align-items: flex-start; }
  .cal-day { min-height: 60px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
