/* Deskwell — shared stylesheet
   Typography: Satoshi (body) + Instrument Serif (headings)
   Palette: warm off-white bg, charcoal text, sage-green accents, amber highlights
*/

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Satoshi:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f3ef;
  --bg-card: #ffffff;
  --text-primary: #1c1917;
  --text-secondary: #6b6560;
  --text-muted: #a09891;
  --accent: #3d7a5c;       /* sage green */
  --accent-hover: #326348;
  --accent-light: #eaf3ed;
  --amber: #c47f17;
  --amber-light: #fef7e7;
  --red: #c0392b;
  --red-light: #fde8e6;
  --border: #e5e0d8;
  --shadow: 0 1px 3px rgba(28, 25, 23, 0.08), 0 4px 16px rgba(28, 25, 23, 0.05);
  --shadow-lg: 0 4px 24px rgba(28, 25, 23, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font-body: 'Satoshi', sans-serif;
  --font-serif: 'Instrument Serif', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

/* ── Form styles ── */
.form-page {
  min-height: 100vh;
  background: var(--bg);
  padding: 3rem 1rem;
}

.form-container {
  max-width: 680px;
  margin: 0 auto;
}

.form-header { margin-bottom: 2.5rem; }

.form-header .eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.form-header h1 {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.form-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.form-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  border: 1px solid var(--border);
}

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

.form-section:last-of-type { margin-bottom: 0; }

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field-full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

label .required {
  color: var(--accent);
  margin-left: 2px;
}

input, select, textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea { resize: vertical; min-height: 100px; }

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-group label {
  margin-bottom: 0;
  cursor: pointer;
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.availability-grid label {
  font-size: 0.8125rem;
  font-weight: 400;
}

.availability-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(61, 122, 92, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(61, 122, 92, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-full { width: 100%; }

.btn-loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.submit-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-error {
  background: var(--red-light);
  color: var(--red);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.form-success {
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ── Dashboard styles ── */
.dashboard-page {
  min-height: 100vh;
  background: #0f0e0c;
  color: #e8e4dc;
}

.dashboard-nav {
  background: #1a1814;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dashboard-nav .logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
}

.dashboard-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.dashboard-nav .nav-links a {
  color: #8a8580;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.dashboard-nav .nav-links a:hover, .dashboard-nav .nav-links a.active {
  color: #fff;
}

.dashboard-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #1a1814;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6560;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.stat-sub {
  font-size: 0.8rem;
  color: #6b6560;
  margin-top: 0.25rem;
}

/* Filters */
.dashboard-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.375rem 1rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #8a8580;
  transition: all 0.15s;
  text-decoration: none;
}

.filter-btn:hover { color: #fff; border-color: rgba(255,255,255,0.25); }
.filter-btn.active {
  background: #3d7a5c;
  color: #fff;
  border-color: #3d7a5c;
}

/* Intake list */
.intake-list { display: flex; flex-direction: column; gap: 1rem; }

.intake-card {
  background: #1a1814;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

.intake-card:hover { border-color: rgba(255,255,255,0.15); }

.intake-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
  cursor: pointer;
}

.intake-card-body {
  display: none;
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 1rem;
}

.intake-card-body.open { display: block; }

.intake-info { flex: 1; min-width: 0; }

.intake-name {
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.intake-email {
  font-size: 0.8125rem;
  color: #6b6560;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.625rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-urgency-critical { background: rgba(192,57,43,0.2); color: #e87b74; }
.tag-urgency-high { background: rgba(196,127,23,0.2); color: #d4a24a; }
.tag-urgency-medium { background: rgba(61,122,92,0.2); color: #6dbe8a; }
.tag-urgency-low { background: rgba(255,255,255,0.07); color: #8a8580; }

.tag-status-pending { background: rgba(196,127,23,0.2); color: #d4a24a; }
.tag-status-processed { background: rgba(61,122,92,0.2); color: #6dbe8a; }
.tag-status-approved { background: rgba(61,122,92,0.3); color: #6dbe8a; }
.tag-status-rejected { background: rgba(192,57,43,0.2); color: #e87b74; }
.tag-status-scheduled { background: rgba(59,130,246,0.2); color: #7ab3f7; }
.tag-status-waitlist { background: rgba(255,255,255,0.07); color: #8a8580; }

.intake-date {
  font-size: 0.75rem;
  color: #6b6560;
  white-space: nowrap;
}

.intake-expand {
  background: none;
  border: none;
  color: #6b6560;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.intake-expand:hover { color: #fff; }

/* Card body content */
.intake-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.intake-detail-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6560;
  margin-bottom: 0.75rem;
}

.intake-detail-section p {
  font-size: 0.9rem;
  color: #c8c3bb;
  line-height: 1.5;
}

.themes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.theme-chip {
  padding: 0.2rem 0.625rem;
  border-radius: 100px;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.07);
  color: #8a8580;
}

.ai-analysis-box {
  background: rgba(61,122,92,0.1);
  border: 1px solid rgba(61,122,92,0.2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.ai-analysis-box h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6dbe8a;
  margin-bottom: 0.5rem;
}

.ai-analysis-box p {
  font-size: 0.875rem;
  color: #a8c4b2;
  line-height: 1.5;
}

/* Schedule form */
.schedule-form {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.schedule-form h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
}

.schedule-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.schedule-fields input, .schedule-fields select {
  background: #0f0e0c;
  border-color: rgba(255,255,255,0.1);
  color: #e8e4dc;
  font-size: 0.875rem;
}

.schedule-fields input:focus, .schedule-fields select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.intake-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-approve {
  background: #3d7a5c;
  color: #fff;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-approve:hover { background: #326348; }

.btn-reject {
  background: transparent;
  color: #8a8580;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reject:hover { background: rgba(192,57,43,0.15); color: #e87b74; border-color: rgba(192,57,43,0.3); }

.btn-waitlist {
  background: transparent;
  color: #8a8580;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-waitlist:hover { background: rgba(255,255,255,0.07); color: #fff; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b6560;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  color: #8a8580;
  margin-bottom: 0.5rem;
}

.empty-state p { font-size: 0.9rem; }

/* Notification toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1a1814;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: #e8e4dc;
  display: none;
  z-index: 100;
}

.toast.success { border-color: rgba(61,122,92,0.4); }
.toast.success::before { content: '✓ '; color: #6dbe8a; }

/* Mobile */
@media (max-width: 768px) {
  .form-page { padding: 1.5rem 1rem; }
  .form-card { padding: 1.5rem; }
  .field-group { grid-template-columns: 1fr; }
  .intake-detail-grid { grid-template-columns: 1fr; }
  .schedule-fields { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .submit-row { flex-direction: column; gap: 1rem; }
  .submit-row .btn { width: 100%; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}