/* FoundryHQ Dashboard Styles - Matches landing page design tokens */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:ital,wght@0,400;0,500;1,400&display=swap');

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

:root {
  --ink: #0a0a0a;
  --paper: #faf9f7;
  --ember: #e8490f;
  --ember-glow: #ff6b35;
  --slate: #4a4a4a;
  --muted: #8a8a8a;
  --line: #e0ddd8;
  --surface: #f0eeea;
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.08);
  --yellow: #ca8a04;
  --yellow-bg: rgba(202, 138, 4, 0.08);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.08);
  --blue: #2563eb;
  --blue-bg: rgba(37, 99, 235, 0.08);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

/* LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--ink);
  color: var(--paper);
  padding: 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.sidebar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.sidebar-logo span { color: var(--ember); }

.sidebar-tag {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.sidebar-nav {
  list-style: none;
  flex: 1;
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: rgba(250, 249, 247, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
}

.sidebar-nav a.active {
  background: var(--ember);
  color: white;
}

.sidebar-nav .nav-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.sidebar-bottom {
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
}

.sidebar-bottom a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: rgba(250, 249, 247, 0.5);
  text-decoration: none;
  font-size: 0.8rem;
  border-radius: 8px;
  transition: all 0.15s;
}

.sidebar-bottom a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper);
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem 2.5rem;
  max-width: 1100px;
}

/* PAGE HEADER */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.page-header p {
  color: var(--slate);
  font-size: 0.95rem;
}

/* CARDS */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

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

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

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

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

.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
}

.stat-card .stat-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* PROGRESS BAR */
.progress-bar-wrapper {
  margin-bottom: 1.5rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.progress-label span:first-child { font-weight: 500; }
.progress-label span:last-child { color: var(--muted); }

.progress-track {
  height: 8px;
  background: var(--surface);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ember), var(--ember-glow));
  border-radius: 100px;
  transition: width 0.5s ease;
}

.progress-fill.green { background: var(--green); }
.progress-fill.low { background: var(--yellow); }

/* CATEGORY GRID */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.category-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover {
  border-color: var(--ember);
  box-shadow: 0 2px 12px rgba(232, 73, 15, 0.08);
}

.category-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.category-icon {
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 8px;
}

.category-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.category-card p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.category-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-progress .progress-track {
  flex: 1;
  height: 6px;
}

.category-progress span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate);
  white-space: nowrap;
}

/* KNOWLEDGE ENTRY LIST */
.entry-list {
  list-style: none;
}

.entry-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.entry-item:last-child { border-bottom: none; }

.entry-type-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 0.15rem;
}

.badge-process { background: var(--blue-bg); color: var(--blue); }
.badge-cost { background: var(--green-bg); color: var(--green); }
.badge-supplier { background: var(--yellow-bg); color: var(--yellow); }
.badge-staff { background: var(--ember); color: white; background: rgba(232, 73, 15, 0.1); color: var(--ember); }
.badge-equipment { background: var(--surface); color: var(--slate); }
.badge-metric { background: var(--green-bg); color: var(--green); }
.badge-policy { background: var(--red-bg); color: var(--red); }
.badge-default { background: var(--surface); color: var(--slate); }

.entry-content { flex: 1; }

.entry-content h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.entry-content p {
  font-size: 0.85rem;
  color: var(--slate);
  line-height: 1.55;
}

.entry-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.confidence-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.confidence-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.confidence-dot.high { background: var(--green); }
.confidence-dot.medium { background: var(--yellow); }
.confidence-dot.low { background: var(--red); }

/* INTERVIEW LIST */
.interview-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}

.interview-item:hover {
  border-color: var(--ember);
  background: rgba(232, 73, 15, 0.02);
}

.interview-icon {
  width: 3rem;
  height: 3rem;
  background: var(--surface);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.interview-info { flex: 1; }

.interview-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.interview-info p {
  font-size: 0.8rem;
  color: var(--muted);
}

.interview-stats {
  text-align: right;
}

.interview-stats .count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ember);
}

.interview-stats .label {
  font-size: 0.7rem;
  color: var(--muted);
}

/* STATUS BADGES */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-completed { background: var(--green-bg); color: var(--green); }
.status-processing { background: var(--yellow-bg); color: var(--yellow); }
.status-draft { background: var(--surface); color: var(--slate); }
.status-verified { background: var(--green-bg); color: var(--green); }
.status-pending { background: var(--yellow-bg); color: var(--yellow); }

/* FOLLOW-UP QUESTIONS */
.question-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.question-item:last-child { border-bottom: none; }

.question-priority {
  width: 4px;
  min-height: 2rem;
  border-radius: 2px;
  margin-top: 0.1rem;
}

.priority-high { background: var(--red); }
.priority-medium { background: var(--yellow); }
.priority-low { background: var(--green); }

.question-text {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.5;
}

.question-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--ember);
  color: white;
}

.btn-primary:hover {
  background: var(--ember-glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

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

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 1.25rem;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
}

.modal h2 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--slate);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s;
}

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

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

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

/* TRANSCRIPT VIEW */
.transcript-block {
  background: var(--surface);
  border-radius: 10px;
  padding: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--slate);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  z-index: 300;
  transform: translateY(120%);
  transition: transform 0.3s ease;
}

.toast.show { transform: translateY(0); }

/* SEARCH */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.search-box input {
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  background: transparent;
  flex: 1;
}

/* SECTION DIVIDER */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.section-title:first-child { margin-top: 0; }

/* TABS */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'DM Sans', sans-serif;
}

.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ember);
  border-bottom-color: var(--ember);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 1.5rem; }
  .stats-grid { grid-template-columns: 1fr; }

  .mobile-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--ink);
    color: var(--paper);
    position: sticky;
    top: 0;
    z-index: 40;
  }
}

.mobile-header { display: none; }
