/* Business Builder OS - App Page Additions
   Extends styles.css from Business Builder OS template */
:root {
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #7c3aed;
}

.app-shell {
  min-height: calc(100vh - 120px);
  padding: 2rem 0 4rem;
  background: linear-gradient(to bottom right, rgba(59,130,246,0.08), rgba(124,58,237,0.06), var(--background));
}

.page-head {
  text-align: center;
  margin-bottom: 2rem;
}

.page-head h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.page-head p {
  color: var(--muted-foreground);
  max-width: 48rem;
  margin: 0.5rem auto 0;
}

@media (min-width: 768px) {
  .page-head h1 { font-size: 2.5rem; }
}

.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px -20px rgba(0,0,0,0.2);
}

.card + .card { margin-top: 1rem; }

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.card .hint {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

.grid-2 > .card {
  height: 100%;
}

.template-grid .card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  margin-top: 0;
}

.template-grid .card .hint {
  margin-bottom: 0.75rem;
}

.template-grid .card .btn {
  margin-top: 0.25rem;
}

.template-grid {
  grid-auto-rows: 1fr;
}

.template-grid .card + .card {
  margin-top: 0;
}

.grid-3 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.input, .select, .textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--background);
  color: var(--foreground);
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.10);
}

.label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

.mini {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.stepper {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0 1.5rem;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(249,250,251,0.7);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.step .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(107,114,128,0.35);
}

.step.active {
  color: var(--foreground);
  border-color: rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.08);
}

.step.active .dot { background: var(--primary); }

.step.done {
  color: var(--foreground);
  border-color: rgba(22,163,74,0.35);
  background: rgba(22,163,74,0.08);
}

.step.done .dot { background: var(--success); }

.actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.actions .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 768px) {
  .actions .btn { width: auto; }
}

.kpi-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: rgba(249,250,251,0.65);
}

.kpi .kpi-label {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.kpi .kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  width: min(640px, 95vw);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.modal .modal-steps {
  margin: 0.75rem 0 1rem 1.25rem;
  color: var(--muted-foreground);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(249,250,251,0.7);
}

.badge.good { border-color: rgba(22,163,74,0.35); background: rgba(22,163,74,0.08); }
.badge.warn { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.10); }
.badge.risk { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.10); }

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab-btn {
  border: 1px solid var(--border);
  background: rgba(249,250,251,0.65);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted-foreground);
  font-weight: 600;
}

.tab-btn.active {
  color: var(--foreground);
  border-color: rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.10);
}

.task-list {
  display: grid;
  gap: 0.75rem;
}

.task {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(249,250,251,0.65);
}

.task .check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(107,114,128,0.35);
  margin-top: 0.15rem;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task.done .check {
  border-color: rgba(22,163,74,0.55);
  background: rgba(22,163,74,0.12);
}

.task.done .check::after {
  content: "✓";
  color: rgba(22,163,74,0.95);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.task .title {
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.task .desc {
  color: var(--muted-foreground);
  margin-bottom: 0.6rem;
}

.task .task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.task.active {
  border-color: rgba(59,130,246,0.5);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 10px 24px -20px rgba(59,130,246,0.45);
}

.task.active .title {
  color: var(--foreground);
}

.btn-sm {
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
}

.notice {
  border: 1px solid rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.08);
  border-radius: 10px;
  padding: 1rem;
  color: var(--foreground);
}

.notice p { color: var(--muted-foreground); margin-top: 0.25rem; }

.small-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.75rem;
  color: var(--muted-foreground);
}

.small-links a:hover { color: var(--foreground); }

.template-links {
  justify-content: center;
  align-items: center;
}

.template-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #eef2f7;
  border: 1px solid #d8dee8;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin: 0;
  color: var(--muted-foreground);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.template-link-btn:hover {
  color: var(--foreground);
  background: #e4eaf1;
  border-color: #c9d2df;
}

.template-link-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.progressbar {
  height: 10px;
  border-radius: 999px;
  background: rgba(107,114,128,0.15);
  overflow: hidden;
  border: 1px solid rgba(107,114,128,0.2);
}

.audit-table .user-col {
  width: 12rem;
  max-width: 12rem;
  white-space: nowrap;
}

.audit-table .meta-col {
  width: 60%;
}


.badge.tag-self { border-color: rgba(22,163,74,0.35); background: rgba(22,163,74,0.08); }
.badge.tag-gpt { border-color: rgba(59,130,246,0.35); background: rgba(59,130,246,0.08); }
.badge.tag-defer { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.10); }

.gpt-help { margin-top: 0.5rem; }

.prompt-box {
  position: relative;
}

.prompt-text {
  padding-right: 3.25rem;
}

.prompt-copy {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(249,250,251,0.9);
  color: var(--foreground);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.prompt-copy:hover {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.35);
}

.dashboard-step-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}


.task.locked {
  opacity: 0.6;
}

.task.locked .btn,
.task.locked .check {
  pointer-events: none;
}

.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  margin: 0 0.35rem 0 0.35rem;
  color: rgba(107,114,128,0.8);
}

.toast-host {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(17, 24, 39, 0.95);
  color: #f9fafb;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  box-shadow: 0 10px 25px -15px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast-success {
  border: 1px solid rgba(22, 163, 74, 0.5);
}

/* Utility classes for removing inline styles (CSP tightening) */
.u-overflow-x-auto { overflow-x: auto; }
.u-w-full { width: 100%; }
.u-text-left { text-align: left; }
.u-flex { display: flex; }
.u-gap-05 { gap: 0.5rem; }
.u-flex-1 { flex: 1; }
.u-items-center { align-items: center; }
.u-items-start { align-items: flex-start; }
.u-justify-between { justify-content: space-between; }
.u-justify-start { justify-content: flex-start; }
.u-mt-025 { margin-top: 0.25rem; }
.u-mt-035 { margin-top: 0.35rem; }
.u-mt-05 { margin-top: 0.5rem; }
.u-mt-075 { margin-top: 0.75rem; }
.u-mt-1 { margin-top: 1rem; }
.u-mb-05 { margin-bottom: 0.5rem; }
.u-mb-075 { margin-bottom: 0.75rem; }
.u-mb-1 { margin-bottom: 1rem; }
.u-ml-04 { margin-left: 0.4rem; }
.u-p-05 { padding: 0.5rem; }
.u-p-1 { padding: 1rem; }
.u-fw-700 { font-weight: 700; }
.u-fs-105 { font-size: 1.05rem; }
.u-prewrap { white-space: pre-wrap; }
.u-align-start { align-items: flex-start; }

.u-table {
  width: 100%;
  border-collapse: collapse;
}

.u-table th,
.u-table td {
  text-align: left;
  padding: 0.5rem;
}

.u-table tbody tr {
  border-top: 1px solid var(--border);
}

.sync-status {
  flex-wrap: wrap;
}

/* Progress element styling (replaces inline width updates) */
.progressbar {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.progressbar::-webkit-progress-bar {
  background: rgba(107,114,128,0.15);
  border-radius: 999px;
}

.progressbar::-webkit-progress-value {
  background: linear-gradient(to right, var(--primary), var(--accent));
  border-radius: 999px;
}

.progressbar::-moz-progress-bar {
  background: linear-gradient(to right, var(--primary), var(--accent));
  border-radius: 999px;
}

