/* ─── App Nav ─── */
.app-nav {
  height: 60px;
  background: var(--bg-elevated);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.3em 0.8em;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--fg);
  background: rgba(255,255,255,0.05);
}

/* ─── App Shell ─── */
.app-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 60px);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Profile Panel ─── */
.profile-panel {
  background: var(--bg-elevated);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: var(--space-md);
  overflow-y: auto;
  max-height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
}

.panel-header {
  margin-bottom: var(--space-md);
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--fg);
  margin-bottom: 0.4rem;
}

.panel-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ─── Profile Selector ─── */
.profile-selector {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: var(--space-sm);
  margin-bottom: var(--space-md);
}

.selector-actions {
  margin-top: 0.5rem;
}

/* ─── Form ─── */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.required {
  color: var(--accent);
}

.field-input,
.field-textarea,
.field-select {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.65em 0.9em;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: rgba(155,151,143,0.5);
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-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='%239B978F' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9em center;
  padding-right: 2.5em;
  cursor: pointer;
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ─── Buttons ─── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  background: var(--accent);
  color: #0C0F0A;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75em 1.5em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: var(--space-xs);
}

.btn-primary:hover {
  background: #bce67e;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 1rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5em 1em;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-outline:hover {
  border-color: rgba(255,255,255,0.3);
  color: var(--fg);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.btn-ghost:hover {
  color: #bce67e;
}

/* ─── Calendar Panel ─── */
.calendar-panel {
  padding: var(--space-md);
  overflow-y: auto;
  max-height: calc(100vh - 60px);
}

/* Empty state */
.calendar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: var(--space-sm);
}

.empty-icon {
  font-size: 3.5rem;
  opacity: 0.5;
}

.empty-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--fg);
}

.empty-sub {
  color: var(--fg-muted);
  font-size: 1rem;
  max-width: 400px;
  line-height: 1.6;
}

/* Loading state */
.calendar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--space-sm);
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(168, 216, 110, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fg);
}

.loading-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* Calendar header */
.calendar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-sm);
}

.calendar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.calendar-sub {
  font-size: 0.88rem;
  color: var(--fg-muted);
}

/* Posts list */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Post card */
.post-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: var(--space-md);
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: var(--space-md);
  align-items: start;
  transition: border-color 0.15s;
}

.post-card:hover {
  border-color: rgba(168, 216, 110, 0.2);
}

.post-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.2rem;
}

.post-day-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.post-month-day {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
}

.post-body {
  min-width: 0;
}

.post-platform {
  margin-bottom: 0.5rem;
}

.platform-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 0.2em 0.7em;
}

.post-caption {
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hashtag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-dim);
  background: var(--accent-glow);
  border-radius: 4px;
  padding: 0.15em 0.5em;
}

.post-actions {
  padding-top: 0.2rem;
}

.btn-copy {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4em 0.9em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-copy:hover {
  background: rgba(255,255,255,0.1);
  color: var(--fg);
}

.btn-copy.copied {
  background: var(--accent-glow);
  border-color: var(--accent-dim);
  color: var(--accent);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .profile-panel {
    max-height: none;
    position: static;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .calendar-panel {
    max-height: none;
  }
  .post-card {
    grid-template-columns: 60px 1fr;
  }
  .post-actions {
    grid-column: 1 / -1;
    padding-top: 0;
  }
}

@media (max-width: 500px) {
  .post-card {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }
  .post-date {
    flex-direction: row;
    gap: 0.4rem;
    align-items: center;
    padding-top: 0;
  }
}
