/* ===== DASHBOARD LAYOUT ===== */

.dash-body {
  background: var(--bg);
  min-height: 100vh;
}

/* Nav */
.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}

.nav-brand:hover { color: var(--accent); }

.nav-links { display: flex; gap: 2rem; }

.nav-link {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active { color: var(--accent); }

/* Main content */
.dash-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* Header row */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.dash-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

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

/* ===== STATS ROW ===== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===== CLIENT TABLE ===== */
.client-table-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.client-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.client-table thead {
  background: var(--bg-elevated);
}

.client-table th {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.875rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.client-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.client-table tbody tr:last-child td { border-bottom: none; }

.client-row {
  cursor: pointer;
  transition: background 0.15s;
}

.client-row:hover { background: var(--bg-elevated); }

.client-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.muted { color: var(--fg-muted); }

.fee {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent);
}

.arrow {
  color: var(--fg-muted);
  text-align: right;
}

/* ===== TIER PILLS ===== */
.tier-pill {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  white-space: nowrap;
}

.tier-content_engine {
  background: rgba(138, 133, 127, 0.12);
  color: var(--fg-muted);
  border: 1px solid rgba(138, 133, 127, 0.2);
}

.tier-full_digital {
  background: rgba(255, 107, 53, 0.1);
  color: var(--accent-light);
  border: 1px solid rgba(255, 107, 53, 0.25);
}

.tier-autopilot {
  background: rgba(255, 107, 53, 0.18);
  color: var(--accent);
  border: 1px solid rgba(255, 107, 53, 0.4);
}

/* ===== STATUS DOTS ===== */
.status-dot {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  display: inline-block;
}

.status-pending {
  color: var(--fg-muted);
  background: rgba(138, 133, 127, 0.1);
}

.status-in_progress {
  color: #f5a623;
  background: rgba(245, 166, 35, 0.1);
}

.status-live, .status-done {
  color: #5dca7a;
  background: rgba(93, 202, 122, 0.1);
}

.status-n\/a {
  color: var(--fg-muted);
  background: transparent;
}

/* ===== PROGRESS PILL ===== */
.progress-pill {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  background: rgba(138, 133, 127, 0.1);
  color: var(--fg-muted);
}

.progress-pill.done {
  background: rgba(93, 202, 122, 0.1);
  color: #5dca7a;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: 3px;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover { background: var(--accent-light); }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover { border-color: var(--fg-muted); color: var(--fg); }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  margin: 1rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover { color: var(--fg); }

/* ===== FORM ===== */
.client-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-row { display: flex; flex-direction: column; gap: 0.4rem; }

.form-row label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.form-hint {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-muted);
}

.form-row input,
.form-row select,
.form-row textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.625rem 0.875rem;
  width: 100%;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* ===== CLIENT DETAIL ===== */
.back-link {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  display: inline-block;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

.client-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.section-block {
  margin-bottom: 2.5rem;
}

.section-header {
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-title .accent { color: var(--accent); }

/* Deliverables grid */
.deliverables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.deliverable-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
}

.deliverable-wide {
  grid-column: 1 / -1;
}

.deliverable-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.875rem;
}

.deliverable-value-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.inline-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  width: 3.5rem;
  text-align: center;
  transition: border-color 0.2s;
}

.inline-input-sm { font-size: 1rem; font-weight: 500; width: 3rem; }

.inline-input:focus { outline: none; border-color: var(--accent); }

.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  min-width: 0;
}

.save-btn {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: 3px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.save-btn:hover { border-color: var(--accent); color: var(--accent); }

.status-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.4rem 0.625rem;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.2s;
}

.status-select:focus { outline: none; border-color: var(--accent); }

.notes-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.625rem;
  width: 100%;
  resize: vertical;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.notes-textarea:focus { outline: none; border-color: var(--accent); }

/* Save toast */
.save-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #5dca7a;
  color: #0a0a0a;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 3px;
  z-index: 300;
  transition: opacity 0.3s;
}

.save-toast.hidden { display: none; }

.history-table-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

/* Landing page nav link (add Dashboard button to landing) */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(10,10,10,0.9), transparent);
}

.landing-nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.landing-nav-link {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-glow);
  border: 1px solid rgba(255, 107, 53, 0.3);
  padding: 0.4rem 1rem;
  border-radius: 2px;
  transition: background 0.2s;
}

.landing-nav-link:hover { background: rgba(255, 107, 53, 0.25); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .dash-header { flex-direction: column; gap: 1rem; }
  .client-table th:nth-child(4),
  .client-table td:nth-child(4) { display: none; }
  .deliverables-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .dash-main { padding: 1.5rem 1rem; }
  .dash-nav { padding: 1rem; }
}
