:root {
  --bg-start: #0a5f8a;
  --bg-mid: #06466a;
  --bg-end: #0a2e42;
  --green: #8bc53f;
  --orange: #f5a623;
  --cyan: #37c1d6;
  --navy-btn: #0c2e46;
  --card-bg: #ffffff;
  --text-muted: #a9c2cf;
  --text-dark: #1b1b1b;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 55%, var(--bg-end) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===================== Tela inicial (home) ===================== */

.home-body {
  min-height: 100vh;
  justify-content: center;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 24px;
}

.access-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.access-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.85);
}

.access-btn svg {
  color: #8ec9e8;
}

.home-logo {
  width: 560px;
  max-width: 82vw;
  height: auto;
}

/* ===================== Tela de sistemas ===================== */

.topbar {
  width: 100%;
  max-width: 1240px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 24px 28px;
}

.topbar-logo-link {
  display: inline-flex;
}

#header-logo {
  width: 190px;
  max-width: 38vw;
  height: auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.85);
  min-width: 280px;
}

.search-box svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.topbar-divider {
  width: 100%;
  max-width: 1240px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 24px;
}

.intro {
  width: 100%;
  max-width: 1240px;
  padding: 48px 24px 32px;
}

.intro h1 {
  font-size: 48px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.intro p {
  font-size: 17px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-weight: 300;
}

.cards {
  width: 100%;
  max-width: 1240px;
  padding: 16px 24px 56px;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 24px;
}

.card {
  --accent: var(--orange);
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  color: var(--text-dark);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  min-height: 230px;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.card-subtitle {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-category-icon {
  flex-shrink: 0;
  display: flex;
  color: var(--text-dark);
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-dark);
}

.card-description {
  font-size: 14px;
  line-height: 1.5;
  color: #6b7280;
  margin: 0;
  flex: 1;
}

.card-divider {
  border: none;
  border-top: 2px solid var(--accent);
  margin: 18px 0 14px;
  opacity: 0.55;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.card-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}

.card-btn:hover { background: var(--accent); color: #fff; }

footer {
  margin-top: auto;
  padding: 32px 24px 48px;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #6ea3c2;
}

.empty-state, .error-state {
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
  grid-column: 1 / -1;
}

@media (max-width: 820px) {
  .cards { grid-template-columns: 1fr; max-width: 460px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .search-box { width: 100%; min-width: 0; }
  .intro h1 { font-size: 36px; }
  .home-logo { width: 420px; }
}