/* Zontes Hub — white default, dark via shared data-theme */

:root,
html[data-theme="light"] {
  --zh-ink: var(--za-ink, #0F172A);
  --zh-text: var(--za-text, #334155);
  --zh-muted: var(--za-muted, #64748B);
  --zh-line: var(--za-line, #E2E8F0);
  --zh-bg: var(--za-bg, #F8FAFC);
  --zh-card: var(--za-surface, #FFFFFF);
  --zh-accent: #0F766E;
  --zh-accent-dark: #115E59;
  --zh-surface-2: var(--za-surface-2, #F1F5F9);
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: var(--za-shadow, 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04));
}

html[data-theme="dark"] {
  --zh-ink: #F8FAFC;
  --zh-text: #E2E8F0;
  --zh-muted: #94A3B8;
  --zh-line: #1E293B;
  --zh-bg: #0B1220;
  --zh-card: #111827;
  --zh-surface-2: #1E293B;
  --zh-accent: #14B8A6;
  --zh-accent-dark: #0D9488;
}

body.app-hub {
  font-family: var(--font);
  color: var(--zh-text);
  background:
    radial-gradient(1100px 520px at 8% -8%, color-mix(in srgb, var(--zh-accent) 14%, transparent), transparent 55%),
    radial-gradient(900px 480px at 92% 0%, rgba(200, 16, 46, 0.07), transparent 50%),
    linear-gradient(180deg, var(--zh-card) 0%, var(--zh-bg) 100%);
  min-height: 100vh;
  line-height: 1.5;
  margin: 0;
}

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-weight: 750;
  letter-spacing: -0.025em;
  font-size: 1.2rem;
  color: var(--zh-ink);
}
.brand span { color: var(--zh-accent); }

.actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.lang a {
  color: var(--zh-muted);
  font-size: 0.86rem;
  margin-left: 0.35rem;
  font-weight: 650;
}
.lang a.active { color: var(--zh-ink); }

/* Compact theme toggle for hub topbar */
.app-hub .theme-toggle {
  width: auto;
  padding: 0.45rem 0.75rem;
  white-space: nowrap;
}

.hero {
  padding: 1.75rem 0 1.25rem;
}
.hero h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.45rem);
  color: var(--zh-ink);
  letter-spacing: -0.03em;
  margin: 0 0 0.45rem;
}
.hero p {
  color: var(--zh-muted);
  max-width: 42rem;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  padding: 0.75rem 0 2.5rem;
}
.app-card {
  background: var(--zh-card);
  border: 1px solid var(--zh-line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 220px;
}
.app-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--zh-accent) 40%, var(--zh-line));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}
.app-card h2 {
  font-size: 1.15rem;
  color: var(--zh-ink);
  margin: 0;
}
.app-card p {
  color: var(--zh-muted);
  font-size: 0.94rem;
  flex: 1;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 0;
  background: var(--zh-accent);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn:hover { background: var(--zh-accent-dark); }
.btn-ghost {
  background: var(--zh-card);
  color: var(--zh-ink);
  border: 1px solid var(--zh-line);
}
.btn-ghost:hover {
  border-color: var(--zh-accent);
  color: var(--zh-accent);
  background: color-mix(in srgb, var(--zh-accent) 8%, var(--zh-card));
}
.btn-block { width: 100%; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.panel {
  width: 100%;
  max-width: 420px;
  background: var(--zh-card);
  border: 1px solid var(--zh-line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.panel h1 {
  font-size: 1.65rem;
  margin: 0.65rem 0 1rem;
  color: var(--zh-ink);
}
.form-group { margin-bottom: 0.9rem; }
.form-group label {
  display: block;
  font-weight: 650;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--zh-ink);
}
.form-group input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--zh-line);
  border-radius: 10px;
  background: var(--zh-card);
  color: var(--zh-ink);
}
.alert {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.alert-error { background: #FEF2F2; color: #B91C1C; }
html[data-theme="dark"] .alert-error { background: rgba(185, 28, 28, 0.18); color: #FCA5A5; }

.footer {
  padding: 1rem 0 2rem;
  color: var(--zh-muted);
  font-size: 0.85rem;
  text-align: center;
}

.hub-table-wrap {
  background: var(--zh-card);
  border: 1px solid var(--zh-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.hub-table {
  width: 100%;
  border-collapse: collapse;
}
.hub-table th,
.hub-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--zh-line);
  font-size: 0.94rem;
}
.hub-table th {
  color: var(--zh-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--zh-surface-2);
}
.hub-table tr:last-child td { border-bottom: 0; }
.hub-table tr.is-warn { background: color-mix(in srgb, #B91C1C 8%, transparent); }
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--zh-accent) 16%, transparent);
  color: var(--zh-accent-dark);
  font-size: 0.78rem;
  font-weight: 650;
}

@media (max-width: 720px) {
  .topbar .theme-toggle__label { display: none; }
  .topbar { align-items: flex-start; }
  .actions { width: 100%; }
  .actions .btn, .actions .btn-ghost { min-height: 44px; flex: 1 1 auto; }
  .grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .app-card { min-height: 0; }
  .hub-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hub-table { min-width: 560px; }
}
