/* ===== APP SHELL ===== */
.app-body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* ===== NAV ===== */
.app-nav {
  background: rgba(10, 14, 23, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 2rem;
  height: 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  margin-right: 0.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

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

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

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

.nav-actions { margin-left: auto; }

/* ===== MAIN LAYOUT ===== */
.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.page-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-primary {
  background: var(--accent);
  color: #0a0e17;
}

.btn-primary:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--terminal-red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

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

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  flex: 1;
  min-width: 100px;
  text-align: center;
}

.stat-card--accent { border-color: rgba(56, 189, 248, 0.2); background: var(--bg-card-accent); }
.stat-card--success { border-color: rgba(74, 222, 128, 0.2); background: rgba(74, 222, 128, 0.04); }

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-card--success .stat-number { color: var(--terminal-green); }

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

/* ===== CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

.card-header-actions { display: flex; gap: 0.5rem; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }

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

.data-table th {
  text-align: left;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.table-link {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}

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

.fw-600 { font-weight: 600; }
.muted { color: var(--fg-muted); }

.row-actions {
  display: flex;
  gap: 1rem;
  white-space: nowrap;
}

.action-link {
  font-size: 0.82rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
}

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

.notes-col { max-width: 200px; }

/* ===== BADGES ===== */
.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.status-active    { background: rgba(74,222,128,0.12);  color: var(--terminal-green); border: 1px solid rgba(74,222,128,0.25); }
.status-discovery { background: rgba(251,191,36,0.1);   color: var(--terminal-yellow); border: 1px solid rgba(251,191,36,0.25); }
.status-in-progress { background: rgba(56,189,248,0.12); color: var(--accent); border: 1px solid rgba(56,189,248,0.25); }
.status-completed { background: rgba(74,222,128,0.12);  color: var(--terminal-green); border: 1px solid rgba(74,222,128,0.25); }
.status-prospect  { background: rgba(56,189,248,0.1);   color: var(--accent); border: 1px solid rgba(56,189,248,0.2); }
.status-inactive  { background: rgba(255,255,255,0.05); color: var(--fg-muted); border: 1px solid rgba(255,255,255,0.1); }

.type-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  text-transform: capitalize;
  letter-spacing: 0.03em;
}

.type-cloud-migration { background: rgba(56,189,248,0.12); color: var(--accent); }
.type-assessment      { background: rgba(167,139,250,0.12); color: #a78bfa; }
.type-strategy        { background: rgba(251,191,36,0.1);  color: var(--terminal-yellow); }

.platform-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  text-transform: uppercase;
}

.platform-aws        { background: rgba(251,191,36,0.12); color: var(--terminal-yellow); }
.platform-azure      { background: rgba(56,189,248,0.12); color: var(--accent); }
.platform-gcp        { background: rgba(74,222,128,0.1);  color: var(--terminal-green); }
.platform-multicloud { background: rgba(167,139,250,0.12); color: #a78bfa; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--fg-muted);
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.4rem;
}

.badge-num {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
}

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

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

.empty-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ===== CLIENT GRID ===== */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}

.client-card {
  background: var(--bg-card-light);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
  display: block;
}

.client-card:hover {
  border-color: rgba(56,189,248,0.25);
  transform: translateY(-1px);
}

.client-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

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

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--active   { background: var(--terminal-green); box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.status-dot--prospect { background: var(--accent); }
.status-dot--inactive { background: var(--fg-muted); }

.client-meta {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 0.2rem;
}

.client-stats {
  display: flex;
  gap: 0.4rem;
  font-size: 0.8rem;
  margin-top: 0.75rem;
  color: var(--fg-muted);
}

.client-stats span:first-child { color: var(--accent); font-weight: 600; }

/* ===== DETAIL VIEW ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.detail-grid--single { grid-template-columns: 1fr; max-width: 640px; }

.detail-card { padding: 1.5rem; }

.detail-rows { display: flex; flex-direction: column; gap: 0; margin-top: 1.25rem; }

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.detail-row:last-child { border-bottom: none; }
.detail-row--full { flex-direction: column; gap: 0.5rem; }

.detail-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 90px;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.notes-text {
  color: var(--fg);
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ===== ENGAGEMENT LIST (on client show) ===== */
.engagement-list { display: flex; flex-direction: column; gap: 0; }

.engagement-item {
  display: block;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
  color: var(--fg);
  transition: background 0.12s;
}

.engagement-item:last-child { border-bottom: none; }
.engagement-item:hover { background: rgba(255,255,255,0.02); }

.engagement-item-top { display: flex; gap: 0.5rem; margin-bottom: 0.4rem; }
.engagement-platform { margin-top: 0.3rem; }
.engagement-date, .engagement-notes { font-size: 0.82rem; margin-top: 0.2rem; }

/* ===== FORMS ===== */
.form-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 680px;
}

.form-group { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.form-group--wide { grid-column: 1 / -1; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.required { color: var(--terminal-red); }

.form-input, .form-select, .form-textarea {
  background: rgba(255,255,255,0.04);
  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.65rem 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(56,189,248,0.5);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--fg-muted); }

.form-select option { background: var(--bg-card); color: var(--fg); }

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

.form-hint { font-size: 0.82rem; color: var(--fg-muted); margin-top: 0.25rem; }

.form-select--sm { font-size: 0.85rem; padding: 0.45rem 0.75rem; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ===== FILTER BAR ===== */
.filter-bar {
  margin-bottom: 1.25rem;
}

.filter-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group { display: flex; flex-direction: column; gap: 0.35rem; }

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

/* ===== ALERTS ===== */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  color: var(--terminal-red);
}

/* ===== LINKS ===== */
.link-accent { color: var(--accent); text-decoration: none; }
.link-accent:hover { text-decoration: underline; }

/* ===== DANGER ZONE ===== */
.danger-zone {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ===== ERROR PAGE ===== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  text-align: center;
  gap: 1rem;
}

.error-icon { font-size: 3rem; }

.error-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-main { padding: 1.25rem 1rem 3rem; }

  .nav-inner { padding: 0 1rem; gap: 1rem; }
  .nav-links { gap: 0; }
  .nav-link { padding: 0.35rem 0.6rem; font-size: 0.82rem; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .stats-bar { flex-wrap: wrap; }
  .stat-card { min-width: calc(50% - 0.5rem); }

  .form-row { grid-template-columns: 1fr; }

  .detail-grid { grid-template-columns: 1fr; }

  .client-grid { grid-template-columns: 1fr 1fr; }

  .filter-form { flex-direction: column; align-items: flex-start; }

  .data-table th:nth-child(5),
  .data-table td:nth-child(5),
  .data-table th:nth-child(6),
  .data-table td:nth-child(6) { display: none; }
}

@media (max-width: 480px) {
  .stats-bar { flex-direction: column; }
  .stat-card { min-width: 100%; }
  .client-grid { grid-template-columns: 1fr; }
  .nav-actions { display: none; }
}
