/* Casley Medical — Patient results portal overrides (DashLite) */

:root {
  --cm-brand: #0f6cbd;
  --cm-brand-soft: #e8f3fb;
  --cm-ink: #101928;
  --cm-muted: #526484;
  --cm-surface: #f5f8fc;
  --cm-border: #e5e9f2;
  --cm-success: #1ee0ac;
}

body.nk-body.cm-portal {
  background: var(--cm-surface);
}

.cm-portal .nk-sidebar {
  border-right: 1px solid var(--cm-border);
}

.cm-patient-card {
  margin: 0.75rem 1.25rem 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #0f6cbd 0%, #0a4f8a 100%);
  color: #fff;
}

.cm-patient-card .label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.15rem;
}

.cm-patient-card .name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.65rem;
  word-break: break-word;
}

.cm-patient-card .folio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  font-weight: 600;
}

.cm-header-folio {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--cm-brand-soft);
  color: var(--cm-brand);
  font-size: 0.8rem;
  font-weight: 600;
}

.cm-results-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cm-results-hero h3 {
  margin: 0 0 0.35rem;
  color: var(--cm-ink);
}

.cm-results-hero p {
  margin: 0;
  color: var(--cm-muted);
  max-width: 36rem;
}

.cm-results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cm-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.cm-file-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--cm-border);
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cm-file-card:hover {
  border-color: #c9dff2;
  box-shadow: 0 10px 24px rgba(15, 108, 189, 0.08);
  transform: translateY(-2px);
}

.cm-file-card .icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cm-brand-soft);
  color: var(--cm-brand);
  margin-bottom: 0.85rem;
  font-size: 1.45rem;
}

.cm-file-card .icon-wrap.is-pdf {
  background: #fde8e8;
  color: #e85347;
}

.cm-file-card .icon-wrap.is-img {
  background: #e7faf3;
  color: #1ee0ac;
}

.cm-file-card .title {
  font-weight: 600;
  color: var(--cm-ink);
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
  margin-bottom: 0.35rem;
}

.cm-file-card .meta {
  color: var(--cm-muted);
  font-size: 0.78rem;
  margin-bottom: 1rem;
}

.cm-file-card .actions {
  margin-top: auto;
  display: flex;
  gap: 0.4rem;
}

.cm-empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  border: 1px dashed var(--cm-border);
  border-radius: 14px;
  background: #fff;
}

.cm-empty-state .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cm-brand-soft);
  color: var(--cm-brand);
  font-size: 1.75rem;
}

.cm-login-panel {
  background:
    radial-gradient(circle at top right, rgba(15, 108, 189, 0.18), transparent 45%),
    linear-gradient(160deg, #0a4f8a 0%, #0f6cbd 48%, #1479d1 100%);
  color: #fff;
}

.cm-login-panel .nk-feature-content h4,
.cm-login-panel .nk-feature-content p {
  color: #fff;
}

.cm-login-panel .nk-feature-content p {
  opacity: 0.9;
}

.cm-login-tips {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.cm-login-tip {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
}

.cm-login-tip em {
  font-size: 1.2rem;
  margin-top: 0.1rem;
}

.cm-login-tip strong {
  display: block;
  font-size: 0.9rem;
}

.cm-login-tip span {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
}

@media (max-width: 991.98px) {
  .cm-patient-card {
    margin: 0.5rem 1rem 0.75rem;
  }

  .cm-results-hero {
    flex-direction: column;
  }

  .cm-results-actions {
    width: 100%;
  }

  .cm-results-actions .btn {
    flex: 1 1 auto;
  }

  .profile-name-hidden {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .cm-file-grid {
    grid-template-columns: 1fr;
  }
}
