/* App chrome and page frame: header tabs, footer, tab-content visibility, app shell, brand cluster and the stats grid. */

/* Header tabs */
.header-nav {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  margin-left: 0;
  min-width: 0;
}
.tabs {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  height: 2.25rem;
  padding: 0 1.125rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  letter-spacing: 0.005em;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}
.tab:hover {
  color: var(--foreground);
  background: transparent;
}
.tab.active {
  color: var(--foreground);
  background: transparent;
  border-color: transparent;
}
.tab:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: -3px;
}
.tab-icon {
  font-size: 0.8125rem;
  flex: none;
  opacity: 0.8;
}

#mainPage {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#mainPage > .container {
  flex: 1 0 auto;
}

/* Footer */
.app-footer {
  position: relative;
  margin-top: auto;
  width: 100%;
  background: var(--background);
}
.app-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.375rem 1.75rem 1rem;
}
.footer-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}
.footer-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.footer-icon {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: var(--kiro-icon-filter);
  flex: none;
}
.footer-copy {
  min-width: 0;
}
.footer-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.footer-title {
  color: var(--foreground);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}
.footer-version {
  height: auto;
  padding: 0;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
}
.footer-version:empty {
  display: none;
}
.footer-version-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.75rem;
  height: 0.75rem;
  cursor: default;
}
.footer-description {
  max-width: 31rem;
  margin: 0.375rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.55;
}
.footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.125rem;
}
.app-footer .status-dot {
  width: 0.4375rem;
  height: 0.4375rem;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--muted-foreground);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.footer-link:hover,
.footer-link:focus-visible {
  background: var(--muted);
  border-color: color-mix(in oklab, var(--border) 82%, var(--muted-foreground));
  color: var(--foreground);
}
.footer-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.footer-link:disabled {
  cursor: wait;
  opacity: 0.72;
}
.footer-link[aria-busy="true"] i {
  animation: updateCheckSpin 0.8s linear infinite;
}
@keyframes updateCheckSpin {
  to {
    transform: rotate(360deg);
  }
}
.footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
}
.footer-meta span + span::before {
  content: "";
  display: inline-block;
  width: 0.25rem;
  height: 0.25rem;
  margin: 0 0.75rem 0.125rem 0;
  border-radius: 50%;
  background: var(--border);
}

@media (max-width: 760px) {
  .app-footer-inner {
    padding: 1.25rem 1.25rem 1rem;
  }
  .footer-panel {
    flex-direction: column;
    gap: 1rem;
  }
  .footer-actions {
    justify-content: center;
    gap: 1rem;
    width: 100%;
  }
  .footer-links {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .footer-identity {
    gap: 0.75rem;
  }
  .footer-icon {
    width: 2rem;
    height: 2rem;
  }
  .footer-actions {
    align-items: center;
    flex-direction: column;
  }
  .footer-link {
    flex: 0 0 auto;
    justify-content: center;
  }
}

/* Tab content */
.tab-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* App shell */
.app-header {
  position: static;
  background: var(--background);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 0;
}
.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
}
.app-header-inner .topbar-actions {
  justify-self: end;
  margin-left: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--foreground);
  text-decoration: none;
  font-feature-settings: "cv11", "ss01";
  cursor: default;
}
.brand:hover {
  color: var(--foreground);
}
.brand svg {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--foreground);
}
.brand-icon {
  color: var(--foreground);
  font-size: 1.125rem;
}
img.brand-icon {
  width: 1.375rem;
  height: 1.375rem;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: var(--kiro-icon-filter);
  display: block;
}
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.topbar-actions .divider {
  width: 1px;
  height: 1.25rem;
  background: var(--border);
  margin: 0 0.125rem;
}

/* Brand cluster */
.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}
.brand-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.875rem;
  height: 0.875rem;
  cursor: default;
  flex: none;
}
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success, #0f766e);
  position: relative;
  flex: none;
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
  border-radius: 50%;
  background: var(--success, #0f766e);
  opacity: 0.35;
  animation: statusPulse 1.8s ease-out infinite;
}
@keyframes statusPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.625rem;
  margin-bottom: 1.125rem;
}
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.625rem;
  min-width: 0;
}
.stat-card-title {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  min-height: 1rem;
}
.stat-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.stat-main {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.stat-value {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--foreground);
  font-feature-settings: "tnum";
}
.stat-sub {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  flex-wrap: nowrap;
  min-height: 1rem;
}
.stat-sub-sec {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
}
.stat-value-sm {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--foreground);
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
}
.stat-value--danger {
  color: var(--destructive) !important;
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-sep {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--muted-foreground);
  opacity: 0.4;
}
.stat-icon {
  color: var(--muted-foreground);
  font-size: 1rem;
  flex: none;
  opacity: 0.45;
  margin-top: 0.0625rem;
}
.stat-icon--danger {
  color: var(--destructive);
  opacity: 0.6;
}
@media (max-width: 640px) {
  .stat-card {
    padding: 0.75rem 0.875rem;
    gap: 0.5rem;
  }
  .stat-value {
    font-size: 1.375rem;
  }
  .stat-card-title {
    font-size: 0.6875rem;
  }
  .stat-icon {
    font-size: 0.875rem;
  }
  .stat-sub {
    flex-direction: column;
    gap: 0.125rem;
    align-items: flex-start;
  }
  .stat-sep {
    display: none;
  }
}

