/* App shell — extends theme.css */

/* Shell */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-shell .footer { margin-top: auto; }

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.app-header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.app-title {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 600; color: var(--fg); margin-bottom: 2px;
}
.app-subtitle { font-size: 14px; color: var(--fg-muted); }
.header-actions { display: flex; gap: 12px; align-items: center; }

.app-content { max-width: 1100px; margin: 0 auto; padding: 32px; width: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 6px; font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer; border: none; transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.btn-primary { background: var(--nav-bg); color: var(--nav-fg); }
.btn-primary:hover { background: #162535; }
.btn-secondary { background: var(--accent); color: var(--fg); }
.btn-secondary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--fg-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--fg); }
.btn-danger { background: #c0392b; color: white; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* Stats */
.stats-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 16px; text-align: center;
  box-shadow: var(--card-shadow);
}
.stat-value {
  font-family: 'Fraunces', serif; font-size: 32px; font-weight: 700;
  color: var(--fg); line-height: 1; margin-bottom: 8px;
}
.stat-value.accent { color: var(--accent-dark); }
.stat-value.warning { color: #e67e22; }
.stat-value.success { color: #27ae60; }
.stat-label { font-size: 12px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Pending Banner */
.pending-banner {
  background: #fff8e6; border: 1px solid #f0d070; border-radius: 10px;
  padding: 20px 24px; margin-bottom: 32px;
}
.pending-banner-header {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; color: var(--fg); margin-bottom: 14px;
}
.pending-banner-header svg { color: #e67e22; flex-shrink: 0; }
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pending-item {
  display: flex; justify-content: space-between; align-items: center;
  background: white; border-radius: 6px; padding: 12px 16px;
  text-decoration: none; color: var(--fg); transition: all 0.15s;
  font-size: 14px;
}
.pending-item:hover { background: #fffce0; }
.pending-item span { color: var(--fg-muted); font-size: 13px; }

/* Section Blocks */
.section-block { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; box-shadow: var(--card-shadow); margin-bottom: 24px; }
.section-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-block-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; }
.link { font-size: 13px; color: var(--accent-dark); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Table */
.clients-table { width: 100%; border-collapse: collapse; }
.clients-table th { text-align: left; padding: 10px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); border-bottom: 1px solid var(--border); }
.clients-table td { padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.clients-table tbody tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; transition: background 0.1s; }
.clickable-row:hover { background: var(--bg); }
.client-row { transition: background 0.1s; }
.client-row:hover { background: var(--bg); }
.client-name-link { font-weight: 600; color: var(--fg); text-decoration: none; }
.client-name-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* Badges */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500; text-transform: capitalize;
}
.status-active { background: #e8f5e9; color: #2e7d32; }
.status-inactive { background: #f5f5f5; color: #757575; }
.status-prospect { background: #e3f2fd; color: #1565c0; }
.status-churned { background: #ffebee; color: #c62828; }
.monthly-pending_review { background: #fff8e6; color: #e67e22; }
.monthly-in_progress { background: #e3f2fd; color: #1565c0; }
.monthly-completed { background: #e8f5e9; color: #2e7d32; }
.monthly-paused { background: #f5f5f5; color: #757575; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-muted { background: #f5f5f5; color: #757575; }

/* Toolbar */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.search-input {
  flex: 1; max-width: 320px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: 'DM Sans', sans-serif; background: var(--surface);
  color: var(--fg); transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.filter-select {
  padding: 9px 14px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: 'DM Sans', sans-serif; background: var(--surface);
  color: var(--fg); cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

/* Empty State */
.empty-state { text-align: center; padding: 64px 32px; }
.empty-icon { color: var(--border); margin-bottom: 16px; }
.empty-state h3 { font-family: 'Fraunces', serif; font-size: 18px; margin-bottom: 8px; color: var(--fg); }
.empty-state p { color: var(--fg-muted); font-size: 15px; margin-bottom: 20px; }
.empty-state .btn { margin: 0 auto; }

/* Forms */
.form-container { max-width: 760px; margin: 0 auto; }
.form-errors { background: #ffebee; border: 1px solid #ef9a9a; border-radius: 8px; padding: 16px 20px; margin-bottom: 24px; color: #c62828; font-size: 14px; }
.form-errors p { margin-bottom: 4px; }
.form-errors p:last-child { margin-bottom: 0; }
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-bottom: 20px; box-shadow: var(--card-shadow); }
.form-section-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.form-section-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: var(--accent); color: var(--fg); border-radius: 50%; font-size: 12px; font-weight: 700; font-family: 'DM Sans', sans-serif; flex-shrink: 0; }
.form-section-desc { font-size: 13px; color: var(--fg-muted); margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--fg); }
.form-label.required::after { content: ' *'; color: #e67e22; }
.form-input { padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: 'DM Sans', sans-serif; color: var(--fg); background: var(--bg); transition: border-color 0.15s; width: 100%; }
.form-input:focus { outline: none; border-color: var(--accent); background: white; }
.form-textarea { resize: vertical; min-height: 100px; }
.form-textarea-sm { min-height: 80px; }
.form-hint { font-size: 12px; color: var(--fg-muted); }

/* Platform checkboxes */
.platforms-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.platform-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.platform-checkbox input { accent-color: var(--accent-dark); width: 16px; height: 16px; }

/* Score fields */
.score-fields { display: flex; flex-direction: column; gap: 12px; }
.score-row { display: flex; align-items: center; gap: 16px; }
.score-label { font-size: 13px; font-weight: 500; color: var(--fg); min-width: 100px; }
.score-inputs { display: flex; gap: 8px; }
.score-input { width: 100px; }
.review-count-input { width: 130px; }

/* Form actions */
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

/* Detail page */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 20px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 20px; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; box-shadow: var(--card-shadow); }
.detail-card-title { font-family: 'Fraunces', serif; font-size: 14px; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.detail-fields { display: flex; flex-direction: column; gap: 12px; }
.detail-field { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.detail-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); font-weight: 500; flex-shrink: 0; }
.detail-value { font-size: 14px; color: var(--fg); text-align: right; }

/* Review profiles */
.review-profiles { display: flex; flex-direction: column; gap: 14px; }
.review-profile-row { display: flex; align-items: center; gap: 16px; }
.review-platform-name { font-size: 13px; font-weight: 500; min-width: 110px; }
.review-score { display: flex; align-items: center; gap: 4px; min-width: 120px; }
.score-star { color: var(--accent); font-size: 14px; }
.score-value { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; }
.score-count { font-size: 12px; color: var(--fg-muted); }
.score-bar-wrap { flex: 1; height: 4px; background: var(--border); border-radius: 2px; max-width: 200px; }
.score-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }

/* Notes */
.notes-body { font-size: 14px; color: var(--fg-muted); line-height: 1.7; white-space: pre-wrap; }

/* Status form */
.status-form { display: flex; flex-direction: column; gap: 14px; }

/* Agreement signed */
.agreement-signed { display: flex; align-items: center; gap: 10px; color: #2e7d32; font-size: 14px; }
.agreement-icon { width: 24px; height: 24px; background: #e8f5e9; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

/* Danger zone */
.danger-card { border-color: #ef9a9a; }
.detail-card-title.danger { color: #c62828; border-color: #ffcdd2; }

/* Text utilities */
.text-muted { color: var(--fg-muted); font-size: 13px; }

/* Responsive */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .app-header-inner { flex-direction: column; align-items: flex-start; }
  .header-actions { flex-wrap: wrap; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .app-content { padding: 20px; }
  .form-grid-3 { grid-template-columns: 1fr; }
}