/* AVW Review Link — visual system matched to Installer SOP */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a4a7a;
  --blue-light: #2563eb;
  --blue-bg: #f0f5fa;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --white: #ffffff;
  --warning: #fef3c7;
  --gold: #c9a227;
  --green: #166534;
  --green-bg: #dcfce7;
  --ease: 0.18s ease;
  /* legacy aliases used by older page CSS */
  --navy: var(--blue);
  --navy-light: #243a5e;
  --gray-50: #f8fafc;
  --gray-100: var(--border);
  --gray-500: var(--text-muted);
  --shadow: 0 1px 3px rgba(26, 74, 122, 0.08);
  --shadow-lg: 0 8px 28px rgba(26, 74, 122, 0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  min-height: 100dvh;
}

a { color: var(--blue-light); }
a:hover { color: var(--blue); }

/* Site header — matches Installer SOP */
.site-header {
  background: var(--blue);
  color: var(--white);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.header-brand img {
  height: 32px;
  width: auto;
  display: block;
}

.header-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
}

.header-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.site-footer {
  text-align: center;
  padding: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.site-footer a { color: var(--blue); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Layout shells */
.page-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.page-main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.page-main--narrow {
  max-width: 480px;
}

.page-main--wide {
  max-width: 1200px;
}

.page-hero h1 {
  font-size: 1.65rem;
  color: var(--blue);
  margin-bottom: 0.35rem;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

/* Cards / panels */
.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.panel-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 600;
}

.card-surface {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  font-family: inherit;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

.btn-primary:hover { background: var(--blue-light); color: var(--white); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--blue-bg);
  color: var(--blue);
}

.btn-secondary:hover { background: var(--blue); color: var(--white); }

.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Tiles (portal) */
.tile-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tile {
  display: block;
  padding: 1.15rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--blue-bg);
  text-decoration: none;
  color: inherit;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.tile:hover {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.tile:hover p { color: rgba(255, 255, 255, 0.85); }

.tile h2 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--blue);
}

.tile:hover h2 { color: var(--white); }

.tile p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Tables */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--blue-bg);
  font-weight: 600;
}

.empty, .team-empty-cell {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--blue-bg);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
}

.stat-card .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  margin-top: 0.15rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-rating { background: #fef3c7; color: #b45309; }
.badge-started { background: #dbeafe; color: #1d4ed8; }
.badge-confirmed { background: var(--green-bg); color: var(--green); }
.badge-opened { background: var(--blue-bg); color: var(--blue); }
.badge-rh { background: #ede9fe; color: #6d28d9; }
.badge-hp { background: #e0f2fe; color: #0369a1; }

/* Forms */
input[type="text"],
input[type="password"],
input[type="search"],
select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  color: var(--text);
  background: var(--white);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Customer review card (centered) */
.customer-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--blue-bg);
}

.customer-page .site-header { position: sticky; }

.customer-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.customer-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
  overflow: hidden;
}

.customer-card .card-body { padding: 1.75rem 1.5rem; }
.customer-card .card-foot {
  padding: 1rem 1.5rem 1.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Stars */
.rate-stars {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin: 1rem 0;
}

.rate-star {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 2rem;
  color: #cbd5e1;
  transition: color var(--ease), transform var(--ease);
}

.rate-star.on { color: var(--gold); }
.rate-star:hover { transform: scale(1.08); }

/* Platform buttons */
.platform-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  text-decoration: none;
  color: var(--text);
  margin-bottom: 0.65rem;
  transition: border-color var(--ease), background var(--ease);
}

.platform-btn:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--text);
}

.platform-btn .btn-text {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.95rem;
}

.platform-btn .btn-text span {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.tab.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

/* Manager gate */
.manager-gate {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.manager-gate.show { display: flex; }

.manager-gate-card {
  background: var(--white);
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.manager-gate-card h2 {
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.manager-gate-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.hint-error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

/* Centered portal layout */
.centered-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--blue-bg);
}
