/* --- TRUSSFORCE BRAND THEME --- */
/* White-first layout with orange accents matching the Trussforce logo. */

:root {
  --brand-orange: #ff5722;
  --brand-orange-dark: #e64a19;
  --brand-orange-soft: #fff3ee;
  --brand-orange-border: #ffccbc;
  --brand-text: #1a1f2e;
  --brand-text-muted: #64748b;
  --brand-border: #e8e8e8;
  --brand-surface: #ffffff;
  --brand-page-bg: #fafafa;

  /* Workspace spacing and typography (Stripe/Linear-style scale) */
  --ws-page-bg: #fafafa;
  --ws-surface: #ffffff;
  --ws-text: #1a1f2e;
  --ws-text-muted: #64748b;
  --ws-border: #e8ecef;
  --ws-radius: 10px;
  --ws-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --ws-space-1: 4px;
  --ws-space-2: 8px;
  --ws-space-3: 12px;
  --ws-space-4: 16px;
  --ws-space-5: 20px;
  --ws-space-6: 24px;
  --ws-space-8: 32px;
  --ws-font-display-size: 1.35rem;
  --ws-font-display-weight: 650;
  --ws-font-body-size: 0.9375rem;
  --ws-font-caption-size: 0.8125rem;
  --ws-tabular: tabular-nums;
}

/* --- BUTTON PRIMITIVES --- */
.btn-primary {
  background: var(--brand-orange);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-orange-dark);
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--ws-surface);
  color: var(--ws-text);
  border: 1px solid var(--ws-border);
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ws-text-muted);
  border: 1px solid var(--ws-border);
  padding: 0.5rem 0.75rem;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.btn-ghost:hover {
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  border-color: var(--brand-orange-border);
}

/* --- APP SHELL (sidebar + main column) --- */
.app-body {
  margin: 0;
  background: var(--brand-page-bg);
  min-height: 100vh;
  color: var(--brand-text);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--brand-surface);
  border-right: 1px solid var(--brand-border);
  padding: 0.5rem 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.app-sidebar-logo-link {
  display: block;
  padding: 0 0.5rem 0;
  line-height: 0;
}

.app-sidebar-logo-image {
  display: block;
  width: 100%;
  max-width: 168px;
  height: auto;
}

.app-sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.app-sidebar-nav-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--brand-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}

.app-sidebar-nav-link:hover {
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
}

.app-sidebar-nav-link.is-active {
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  border-left-color: var(--brand-orange);
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--ws-page-bg);
}

.app-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--brand-border);
  background: var(--brand-surface);
}

.app-top-bar-titles {
  min-width: 0;
}

.app-top-bar h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--brand-text);
}

.app-top-bar p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--brand-text-muted);
}

.app-profile-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--brand-orange-border);
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  text-decoration: none;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: 700;
  font-size: 0.95rem;
}

.app-profile-menu-button:hover {
  border-color: var(--brand-orange);
  background: #ffe8df;
}

.app-profile-menu-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-profile-menu-initials {
  line-height: 1;
}

.profile-page-region[hidden] {
  display: none;
}

.profile-detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--brand-border);
}

.profile-detail-row strong {
  font-size: 0.85rem;
  color: var(--brand-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-actions-row {
  margin-top: 1.25rem;
}

.app-page-content {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
}

.app-page-content .page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

.app-body.is-dashboard-shell .app-page-content .page-shell {
  max-width: none;
}

/* Trade workspace: full-width comparison table uses the whole main column */
.app-body.is-workspace-shell .app-page-content .page-shell {
  max-width: none;
  margin: 0;
}

.app-body.is-workspace-shell.workspace-has-comparison .app-page-content {
  padding: 0;
}

.app-body.is-workspace-shell.workspace-has-comparison .app-top-bar {
  display: none;
}

.app-body.is-workspace-shell.workspace-has-comparison .trade-workspace-shell {
  min-height: 100vh;
}

@media (max-width: 720px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--brand-border);
  }

  .app-sidebar-logo-image {
    max-width: 120px;
  }

  .app-sidebar-nav-list {
    display: flex;
    gap: 0.35rem;
  }
}
