/* ============================================
   Practice Pulse — OptomEdge
   assets/style.css
   ============================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:     #1B2A4A;
  --navy-mid: #243660;
  --teal:     #00B4C8;
  --teal-lt:  #E6F8FA;
  --coral:    #FF6B6B;
  --amber:    #F5A623;
  --bg:       #F4F6F9;
  --white:    #FFFFFF;
  --text:     #1F2937;
  --muted:    #6B7280;
  --border:   #E5E7EB;
  --green:    #10B981;
  --shadow:   0 1px 4px rgba(0,0,0,0.08);
  --radius:   10px;
  --font:     'Inter', 'Segoe UI', system-ui, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Portal Header ---- */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 58px;
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.portal-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.portal-header .logo img {
  height: 32px;
}

.portal-header .logo-text {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.portal-header .logo-text span {
  color: var(--teal);
}

.header-center {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.header-center .report-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.header-center .practice-name {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.header-right a:hover { color: var(--teal); }

.header-badge {
  background: var(--teal);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- Report Frame ---- */
.report-wrapper {
  width: 100%;
  height: calc(100vh - 58px);
  background: var(--bg);
}

.report-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ---- Loading State ---- */
.loading-overlay {
  position: absolute;
  inset: 58px 0 0 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay p {
  color: var(--muted);
  font-size: 14px;
}

/* ---- Index / Portal Home ---- */
.portal-home {
  max-width: 900px;
  margin: 48px auto;
  padding: 0 24px;
}

.portal-home h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.portal-home .subtitle {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 36px;
}

/* ---- Client Cards ---- */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.client-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  border-color: var(--teal);
}

.client-card .card-icon {
  width: 40px;
  height: 40px;
  background: var(--teal-lt);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.client-card .card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.client-card .card-meta {
  font-size: 12px;
  color: var(--muted);
}

.client-card .card-badge {
  display: inline-block;
  background: var(--teal-lt);
  color: var(--teal);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ---- 404 / Not Found ---- */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 58px);
  text-align: center;
  gap: 12px;
  padding: 24px;
}

.not-found h2 { font-size: 22px; color: var(--navy); }
.not-found p  { color: var(--muted); font-size: 15px; max-width: 400px; }
.not-found a  {
  margin-top: 8px;
  color: var(--white);
  background: var(--teal);
  padding: 10px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .portal-header { padding: 0 16px; }
  .header-center .report-title { font-size: 13px; }
  .header-right { display: none; }
  .portal-home { margin: 24px auto; }
}
