:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: rgba(255,255,255,.12);
  --accent: #38bdf8;
  --good: #22c55e;
  --bad: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,.18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(34,197,94,.10), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  background: rgba(15,23,42,.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #22c55e);
  color: #020617;
  font-weight: 900;
  font-size: 1.35rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  margin-top: .1rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.topnav a {
  text-decoration: none;
  color: var(--muted);
  padding: .55rem .75rem;
  border-radius: .75rem;
}

.topnav a:hover {
  color: var(--text);
  background: rgba(255,255,255,.08);
}

.page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 800;
  font-size: .8rem;
  margin: 0 0 .75rem;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: .95;
  margin-bottom: 1rem;
}

.hero-text {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 780px;
}

.card,
.status-card,
.empty-state,
.mini-card {
  background: rgba(17,24,39,.78);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

.status-card {
  display: grid;
  gap: .85rem;
  align-content: center;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .75rem;
}

.status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ok {
  color: var(--good);
}

.bad {
  color: var(--bad);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}

.section-head p {
  color: var(--muted);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1rem;
}

.app-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 1rem;
  text-decoration: none;
  background: rgba(17,24,39,.82);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1rem;
  min-height: 132px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56,189,248,.65);
  background: rgba(31,41,55,.9);
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
  font-size: 1.35rem;
  font-weight: 800;
}

.app-icon img {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.app-icon span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.app-card-body {
  min-width: 0;
}

.app-card h3 {
  margin-bottom: .35rem;
  overflow-wrap: anywhere;
}

.app-card p {
  color: var(--muted);
  margin-bottom: .65rem;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  max-width: 100%;
  font-size: .75rem;
  color: var(--accent);
  background: rgba(56,189,248,.12);
  border: 1px solid rgba(56,189,248,.28);
  padding: .2rem .5rem;
  border-radius: 999px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: .45rem .75rem;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.responsive-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 1rem;
}

.responsive-table th,
.responsive-table td {
  text-align: left;
  padding: .75rem;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.responsive-table th {
  color: var(--muted);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  font-size: .85rem;
}

@media (max-width: 760px) {
  .topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .two-col {
    grid-template-columns: 1fr;
  }

  .page {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .app-card {
    min-height: auto;
  }
}

@media (max-width: 420px) {
  .app-card {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: .85rem;
  }

  .app-icon {
    width: 44px;
    height: 44px;
  }

  .app-icon img {
    width: 28px;
    height: 28px;
  }
}

/* 2.5.21 Surgical Navigation Cleanup */
.topnav a {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.035);
}

.topnav a:hover {
  text-decoration: none;
}

@media (max-width: 900px) {
  .topnav {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .topnav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .topnav a {
    justify-content: center;
    text-align: center;
  }
}

/* 2.5.27 — Tooldeck Logout Link */
.topnav a.logout-link {
  border-color: rgba(248, 113, 113, .35);
  color: #fecaca;
}

.topnav a.logout-link:hover {
  border-color: rgba(248, 113, 113, .75);
  background: rgba(127, 29, 29, .28);
  color: #fff;
}
