:root {
  --white: #ffffff;
  --bg: #fafafa;
  --ink: #17181a;
  --ink-soft: #6b6d72;
  --orange: #f29100;
  --orange-dark: #d97e00;
  --orange-tint: #fff4e3;
  --border: #ececed;
  --shadow: 0 1px 2px rgba(23, 24, 26, 0.04), 0 8px 24px rgba(23, 24, 26, 0.06);
  --shadow-hover: 0 2px 4px rgba(23, 24, 26, 0.06), 0 16px 32px rgba(23, 24, 26, 0.10);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand strong { color: var(--orange); font-weight: 700; }

.logout-btn {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.logout-btn:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
}

/* ---------- Content ---------- */
.content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.group { margin-bottom: 48px; }
.group h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* ---------- Tiles ---------- */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.tile:hover, a.tile:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--orange);
  outline: none;
}

.tile-name {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}

.tile-desc {
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.tile-badge {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef0f1;
  color: var(--ink-soft);
}
.tile-badge--external {
  background: var(--orange-tint);
  color: var(--orange-dark);
}

.tile--disabled {
  cursor: default;
  opacity: 0.62;
}
.tile--disabled .tile-name { color: var(--ink-soft); }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  text-align: center;
}

.login-card .brand {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 24px;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  margin-bottom: 14px;
  background: var(--bg);
  color: var(--ink);
}
.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--white);
}

.login-card button {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: var(--orange);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.login-card button:hover { background: var(--orange-dark); }
.login-card button:disabled { opacity: 0.6; cursor: default; }

.login-error {
  min-height: 1.2em;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #c62828;
}

@media (max-width: 480px) {
  .topbar { padding: 16px 20px; }
  .content { padding: 28px 20px 60px; }
}
