/* Portal-specific styles (dashboard, widgets, admin). Header, body, brand,
   and design tokens live in /static/shared/* — synced from
   packages/pique-app-shell/src/. Do not redefine those here. */

/* ---------- Tailwind-style utility shims used by templates ---------- */

.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-white { background-color: var(--pq-panel-bg); }
.bg-gray-900 { background-color: var(--pq-accent); }
.text-white { color: #ffffff; }
.text-gray-900 { color: var(--pq-text); }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: #6b7280; }
.text-gray-400 { color: #9ca3af; }
.border-0 { border: 0; }
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-gray-200 { border-color: #e5e7eb; }
.rounded-lg { border-radius: var(--pq-radius-sm); }
.rounded-xl { border-radius: var(--pq-radius-md); }
.shadow-sm { box-shadow: var(--pq-shadow-sm); }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-5 { margin-top: 1.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-8 { margin-bottom: 2rem; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.min-h-screen { min-height: 100vh; }
.min-w-0 { min-width: 0; }
.max-w-5xl { max-width: 64rem; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 1rem; }
.p-6 { padding: 1.5rem; }
.p-10 { padding: 2.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.tracking-tight { letter-spacing: -0.025em; }
.underline { text-decoration-line: underline; }
.underline-offset-2 { text-underline-offset: 2px; }
.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-duration: 150ms;
}
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-gray-900:hover { color: var(--pq-text); }
.hover\:bg-gray-800:hover { background-color: var(--pq-accent-hover); }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }

.sm\:grid-cols-2 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Dashboard ---------- */

.dashboard-page {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 4rem;
}

.dashboard-greeting {
  margin: 0 0 1.5rem;
}

.dashboard-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pq-text);
  margin: 0;
}

.dashboard-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pq-muted-faint);
  margin: 1.75rem 0 0.65rem;
}

.dashboard-app-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dashboard-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--pq-panel-bg);
  border: 1px solid var(--pq-line);
  border-radius: var(--pq-radius-md);
  padding: 0.7rem 0.9rem 0.7rem 0.7rem;
  transition: border-color var(--pq-transition), background var(--pq-transition);
  margin-bottom: 0.4rem;
}

.dashboard-row:last-child {
  margin-bottom: 0;
}

.dashboard-row:hover {
  border-color: var(--pq-line-strong);
}

.dashboard-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  background: #f0f0f0;
  color: #6b7280;
  flex-shrink: 0;
}

.dashboard-row-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.dashboard-row-icon-google {
  background: var(--pq-panel-bg);
  border: 1px solid #ececec;
}

.dashboard-row-icon-google svg {
  width: 1rem;
  height: 1rem;
}

.dashboard-row-body {
  flex: 1;
  min-width: 0;
}

.dashboard-row-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--pq-text);
  line-height: 1.25;
}

.dashboard-row-meta {
  font-size: 0.8rem;
  color: var(--pq-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.dashboard-row-meta code {
  background: var(--pq-code-bg);
  padding: 0.05rem 0.32rem;
  border-radius: 0.3rem;
  font-family: var(--pq-font-mono);
  font-size: 0.72rem;
  color: var(--pq-code-text);
}

.dashboard-row-empty {
  justify-content: center;
  color: var(--pq-muted);
  font-size: 0.88rem;
  padding: 1.6rem 1rem;
}

.dashboard-banner-action {
  background: none;
  border: 0;
  padding: 0;
  margin-left: 0.5rem;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.inline-form {
  display: inline;
}

/* ---------- Widget grid ---------- */

.widgets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.widget-card {
  background: var(--pq-panel-bg);
  border: 1px solid #e5e7eb;
  border-radius: var(--pq-radius-md);
  padding: 1.25rem;
  min-height: 14rem;
  display: flex;
  flex-direction: column;
}

.widget-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.widget-title {
  font-size: 1rem;
  font-weight: 600;
}

.widget-subtitle {
  font-size: 0.7rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.widget-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--pq-radius-pill);
  background: #f9fafb;
}

.widget-sort-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6b7280;
  border-radius: var(--pq-radius-pill);
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.widget-sort-button.is-active {
  background: var(--pq-panel-bg);
  color: #111827;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.widget-body {
  flex: 1;
  font-size: 0.875rem;
  color: #374151;
}

.widget-loading,
.widget-empty,
.widget-error {
  color: #9ca3af;
  font-size: 0.875rem;
  padding: 1rem 0;
}

.widget-error { color: #b91c1c; }

.widget-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.widget-item:last-child { border-bottom: 0; }

.widget-link-row {
  display: flex;
  border-radius: var(--pq-radius-sm);
  margin: 0 -0.35rem;
  padding: 0.7rem 0.35rem;
  transition: background-color var(--pq-transition);
}

.widget-link-row:hover {
  background: #f9fafb;
}

.widget-item-primary {
  font-weight: 500;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.widget-item-secondary {
  color: #6b7280;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.widget-item-snippet {
  color: #6b7280;
  font-size: 0.8rem;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-item-stack {
  min-width: 0;
  flex: 1;
}

.widget-item-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.widget-badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--pq-radius-pill);
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.widget-badge-unread { background: #dbeafe; color: #1d4ed8; }
.widget-badge-priority-high { background: #fee2e2; color: #b91c1c; }
.widget-badge-priority-medium { background: #fef3c7; color: #b45309; }
.widget-badge-priority-low { background: #e5e7eb; color: #4b5563; }
.widget-badge-action { background: #dcfce7; color: #15803d; }
.widget-badge-waiting { background: #dbeafe; color: #1d4ed8; }
.widget-badge-fyi { background: #eff6ff; color: #1d4ed8; }
.widget-badge-source { background: #ede9fe; color: #6d28d9; }
.widget-badge-override { background: #fce7f3; color: #9d174d; }
.widget-badge-sync { background: #ecfccb; color: #3f6212; }
.widget-badge-sync-failed { background: #fef2f2; color: #b91c1c; }

.widget-thread-count {
  color: #9ca3af;
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.widget-item-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

/* ---------- Admin · App access ---------- */

.admin-page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 4rem;
}

.admin-header {
  margin-bottom: 1.75rem;
}

.admin-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--pq-text);
}

.admin-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0.45rem 0 0;
  max-width: 38rem;
  line-height: 1.55;
}

.admin-table-wrap {
  overflow-x: auto;
}

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

.admin-table thead th {
  background: var(--pq-sidebar-bg);
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #ececec;
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--pq-line-soft);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr {
  transition: background var(--pq-transition-fast);
}

.admin-table tbody tr:hover {
  background: #f8f8f8;
}

.admin-org-cell {
  min-width: 13rem;
}

.admin-org-name {
  font-weight: 600;
  color: var(--pq-text);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.admin-org-code {
  font-family: var(--pq-font-mono);
  font-size: 0.72rem;
  color: #9ca3af;
}

.admin-empty {
  padding: 3rem 1rem !important;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
}

.admin-access-form {
  display: inline-block;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--pq-radius-pill);
  padding: 0.32rem 0.85rem;
  min-width: 5.25rem;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.admin-pill-granted {
  border: 1px solid transparent;
  background: #eaf2ec;
  color: #2f5d44;
}

.admin-pill-granted .admin-pill-check {
  font-size: 0.72rem;
  line-height: 1;
}

.admin-pill-granted .admin-pill-default {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.admin-pill-granted .admin-pill-hover {
  display: none;
  align-items: center;
  gap: 0.3rem;
}

.admin-pill-granted:hover {
  background: #fbe9e9;
  color: #a02828;
}

.admin-pill-granted:hover .admin-pill-default {
  display: none;
}

.admin-pill-granted:hover .admin-pill-hover {
  display: inline-flex;
}

.admin-pill-grant {
  border: 1px solid var(--pq-line-strong);
  background: var(--pq-panel-bg);
  color: #6b7280;
}

.admin-pill-grant:hover {
  border-color: var(--pq-text);
  color: var(--pq-text);
  background: #f5f5f5;
}

.admin-footnote {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.55;
}

.admin-footnote code {
  background: var(--pq-code-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  font-family: var(--pq-font-mono);
  font-size: 0.72rem;
  color: var(--pq-code-text);
}

/* Project docs styles moved to apps/doc-comments/src/index.css. */
