/* ── APP SHELL ── */
.app-body {
  min-height: 100vh;
  background: var(--bg);
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--fg);
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #0c0e12;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; }

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

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.25); }

.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { opacity: 0.85; }

/* ── 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: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--fg);
  line-height: 1.15;
}

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

.back-link {
  display: inline-block;
  color: var(--fg-muted);
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 0.5rem;
}
.back-link:hover { color: var(--fg); }

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ── ALERTS ── */
.alert {
  border-radius: 8px;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--fg-muted); margin-bottom: 1.5rem; }

.empty-state-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

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

.client-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, transform 0.12s;
}
.client-card:hover {
  border-color: rgba(245,158,11,0.35);
  transform: translateY(-2px);
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.client-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(245,158,11,0.2);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.client-avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
  border-radius: 12px;
}
.client-avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  border-radius: 7px;
}

.client-name {
  font-weight: 600;
  font-size: 1rem;
}
.client-trade {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 0.1rem;
}

.client-status {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  white-space: nowrap;
}
.status-active { background: rgba(34,197,94,0.12); color: var(--green); }
.status-inactive { background: rgba(138,135,128,0.12); color: var(--fg-muted); }

.client-card-body { display: flex; flex-direction: column; gap: 0.3rem; }
.client-meta { font-size: 0.83rem; color: var(--fg-muted); }

.client-card-footer {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; }
.stat-label { font-size: 0.75rem; color: var(--fg-muted); }
.accent { color: var(--accent); }
.green { color: var(--green); }
.fg-muted { color: var(--fg-muted); }

/* ── CLIENT DETAIL ── */
.client-detail-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

.client-meta-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.client-meta-row a { color: var(--fg-muted); text-decoration: none; }
.client-meta-row a:hover { color: var(--accent); }

.badge-trade {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  border: 1px solid rgba(245,158,11,0.15);
}

.notes-block {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent-dim);
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

/* ── STATS ROW ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.stat-card-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}
.stat-card-label {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 0.35rem;
}

/* ── SECTION CARD ── */
.section-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--fg);
}

/* ── LOG FORM ── */
.log-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.log-form-row .form-group { min-width: 90px; }
.log-form-row .form-group-notes { flex: 1; min-width: 160px; }
.log-form-row .form-group-submit { min-width: auto; }

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.form-group-full { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.15s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(245,158,11,0.5);
}
.form-group textarea { resize: vertical; }
.form-group select option { background: var(--bg-surface); }

.required { color: var(--accent); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--fg);
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.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.06);
}

/* ── DATA TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.data-table td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.text-right { text-align: right; }

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

/* ── MONTH PICKER ── */
.month-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.month-picker select {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
}

/* ── UNTRACKED LIST ── */
.untracked-list { display: flex; flex-direction: column; gap: 0.5rem; }
.untracked-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.9rem;
  transition: background 0.12s;
}
.untracked-item:hover { background: rgba(255,255,255,0.04); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .app-nav { padding: 0 1rem; }
  .nav-links { gap: 0.75rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .log-form-row { flex-direction: column; }
}
