/* VestaTeams shared theme — Outfit / navy / mint */
:root {
  --ink: #0a1429;
  --muted: #5a6785;
  --primary: #1B3A6B;
  --accent: #6389E8;
  --mint: #2AFF8F;
  --bg: #F4F7FC;
  --surface: #ffffff;
  --line: rgba(99, 137, 232, 0.14);
  --warn-bg: #fef3c7;
  --warn-fg: #92400e;
  --err-bg: #fee2e2;
  --err-fg: #991b1b;
  --ok-bg: color-mix(in srgb, var(--mint) 28%, white);
  --radius: 12px;
  --shadow-soft: 0 12px 40px rgba(10, 20, 41, 0.06);
  --font: Outfit, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--primary); }

h1, h2, h3 { letter-spacing: -0.02em; margin: 0 0 0.75rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
.muted { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}
.brand span { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--line);
}
.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(27, 58, 107, 0.22);
}
.btn.danger { background: #b91c1c; }
.btn.sm { padding: 0.35rem 0.65rem; font-size: 0.85rem; }

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}
.field { margin-bottom: 0.85rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}
.panel.flat {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}
@media (max-width: 800px) { .kpi-row { grid-template-columns: 1fr; } }
.kpi {
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, white);
  border-radius: 0 10px 10px 0;
}
.kpi .val {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1.1;
}
.kpi .lbl { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

table.vt {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.vt th, table.vt td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.vt th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
table.vt tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--primary);
}
.badge.ok { background: var(--ok-bg); color: #065f46; }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.err, .badge.error { background: var(--err-bg); color: var(--err-fg); }

.health {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  margin: 1rem 0;
  font-weight: 600;
}
.health .dot {
  width: 12px; height: 12px; border-radius: 50%;
  margin-top: 0.35rem; flex-shrink: 0;
  background: var(--muted);
}
.health.ok { background: var(--ok-bg); }
.health.ok .dot { background: #059669; }
.health.warn { background: var(--warn-bg); color: var(--warn-fg); }
.health.warn .dot { background: #d97706; }
.health.error, .health.err { background: var(--err-bg); color: var(--err-fg); }
.health.error .dot, .health.err .dot { background: #dc2626; }
.health .title { font-size: 1.15rem; }
.health .sub { font-weight: 500; font-size: 0.9rem; opacity: 0.85; margin-top: 0.25rem; }

/* Partner shell */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 1.35rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.side .brand { font-size: 1.2rem; margin-bottom: 0.35rem; }
.side .partner-name {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding: 0 0.3rem;
}
.nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.nav button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
.nav button.active, .nav button:hover {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--primary);
}
.nav .logout { margin-top: auto; color: var(--muted); }
.main { padding: 1.35rem 1.6rem 3rem; max-width: 1100px; }

.mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.mobile-nav {
  display: none;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.mobile-nav button {
  background: color-mix(in srgb, var(--accent) 8%, white);
  border: none;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  color: var(--primary);
  cursor: pointer;
}
.mobile-nav button.active { background: var(--primary); color: #fff; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-bar, .mobile-nav { display: flex; }
  .main { padding: 1rem 1rem 2.5rem; }
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 420px at 15% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 55%),
    radial-gradient(700px 380px at 90% 10%, color-mix(in srgb, var(--mint) 18%, transparent), transparent 50%),
    var(--bg);
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-soft);
}
.login-box .brand { font-size: 1.45rem; margin-bottom: 0.5rem; }

/* Drawer / detail */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 20, 41, 0.35);
  z-index: 40;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: #fff;
  z-index: 50;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.22s ease;
}
@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.drawer-body { padding: 1.15rem 1.25rem; overflow: auto; flex: 1; }
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button {
  background: transparent;
  border: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--accent) 10%, white);
  border-bottom-color: var(--accent);
}

/* Wizard */
.wizard-steps {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.wizard-steps .step {
  flex: 1;
  min-width: 72px;
  text-align: center;
  padding: 0.45rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}
.wizard-steps .step.on {
  color: var(--primary);
  border-bottom-color: var(--accent);
}
.wizard-steps .step.done {
  color: #059669;
  border-bottom-color: var(--mint);
}

/* Assistent findings */
.findings { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.75rem; }
.finding {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, white);
}
.finding.ok { border-left-color: #059669; background: var(--ok-bg); }
.finding.warn { border-left-color: #d97706; background: var(--warn-bg); }
.finding.error, .finding.err { border-left-color: #dc2626; background: var(--err-bg); }
.finding .ft { font-weight: 700; font-size: 0.92rem; }
.finding .fd { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.4; }

.assistant {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent) 8%, white), #fff);
  margin-top: 1rem;
}
.assistant h3 { font-size: 0.95rem; margin-bottom: 0.35rem; }

details.tech {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}
details.tech pre {
  white-space: pre-wrap;
  font-size: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 8px;
  max-height: 240px;
  overflow: auto;
  color: var(--ink);
}

.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}
.empty strong { display: block; color: var(--ink); margin-bottom: 0.35rem; }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 100;
  box-shadow: var(--shadow-soft);
  max-width: min(360px, calc(100vw - 2rem));
}

/* Customer topbar */
.cust-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 15;
}
.cust-brand { display: flex; align-items: center; gap: 0.75rem; }
.cust-brand img { height: 36px; width: auto; }
.cust-brand .name {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--primary);
}
.cust-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.cust-nav button {
  background: none;
  border: none;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
}
.cust-nav button.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, white);
}
.cust-wrap { max-width: 920px; margin: 0 auto; padding: 1.35rem 1.25rem 3rem; }
.cust-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1.5rem 1rem;
}

@media (max-width: 640px) {
  .cust-nav { width: 100%; }
}
