/* ── v57: Corporate profile redesign + Credly ───────────────── */

/* Profile hero banner */
.prof-hero {
  position: relative;
  border: 1px solid #e0e4ea;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #fff;
}
.prof-hero-bg {
  height: 100px;
  background: linear-gradient(135deg, #111827 0%, #1f2937 60%, #374151 100%);
  position: relative;
}
.prof-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 28px,
    rgba(255,255,255,.025) 28px,
    rgba(255,255,255,.025) 29px
  );
}
.prof-hero-body {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 0 28px 22px;
  flex-wrap: wrap;
}
.prof-avatar-wrap {
  position: relative;
  margin-top: -42px;
  flex-shrink: 0;
}
.prof-avatar {
  width: 84px !important;
  height: 84px !important;
  font-size: 24px !important;
  border: 3px solid #fff !important;
  box-shadow: 0 2px 12px rgba(16,24,40,.18) !important;
  margin-bottom: 0 !important;
}
.prof-avatar-edit {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 2px solid #fff;
  transition: background .15s;
}
.prof-avatar-edit:hover { background: #374151; }
.prof-hero-info { flex: 1; padding-bottom: 2px; }
.prof-hero-name {
  font-size: 22px;
  font-weight: 850;
  color: #101828;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.prof-hero-title { color: #475569; font-size: 14px; margin-top: 3px; font-weight: 500; }
.prof-hero-meta { color: #94a3b8; font-size: 12.5px; margin-top: 4px; }
.prof-hero-sep { margin: 0 5px; }
.prof-hero-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-bottom: 4px; margin-left: auto; }

/* Two-column profile body */
.prof-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .prof-body { grid-template-columns: 1fr; } }

/* Cards */
.prof-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.prof-card:last-child { margin-bottom: 0; }
.prof-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #374151;
  margin-bottom: 14px;
}
.prof-card-sub { font-size: 12.5px; color: #6b7280; margin: -8px 0 14px; line-height: 1.5; }

/* Detail rows in contact card */
.prof-detail-list { display: grid; gap: 12px; }
.prof-detail-row { display: flex; align-items: flex-start; gap: 10px; }
.prof-detail-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  display: grid;
  place-items: center;
  color: #374151;
  flex-shrink: 0;
}
.prof-detail-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; margin-bottom: 2px; }
.prof-detail-val { font-size: 13px; color: #111827; font-weight: 500; }

/* About textarea */
.prof-about-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: #111827;
  background: #f9fafb;
  resize: vertical;
  min-height: 90px;
  outline: none;
  transition: border-color .15s;
}
.prof-about-input:focus { border-color: #d62828; background: #fff; outline: 2px solid rgba(214,40,40,.1); }

/* Credly section */
.prof-credly-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d62828;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  margin-left: auto;
}
.prof-field-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #6b7280; margin-bottom: 6px; }
.prof-credly-row { display: flex; gap: 8px; }
.prof-credly-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  color: #111827;
  background: #f9fafb;
  outline: none;
  transition: border-color .15s;
}
.prof-credly-input:focus { border-color: #d62828; background: #fff; }
.prof-credly-status {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.prof-credly-status.ok { color: #027a48; }
.prof-credly-status.err { color: #b42318; }

/* Badge grid */
.prof-credly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.credly-badge-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  text-decoration: none !important;
}
.credly-badge-item:hover { border-color: #d62828; box-shadow: 0 4px 14px rgba(214,40,40,.09); }
.credly-badge-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
}
.credly-badge-placeholder {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #d62828, #111827);
  display: grid; place-items: center;
  color: #fff; font-size: 22px;
  margin: 0 auto 10px;
  border: 2px solid #e5e7eb;
}
.credly-badge-name { font-size: 11.5px; font-weight: 700; color: #111827; line-height: 1.3; margin-bottom: 4px; }
.credly-badge-issuer { font-size: 10.5px; color: #6b7280; }
.credly-badge-date { font-size: 10px; color: #9ca3af; margin-top: 4px; }

.prof-credly-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
  gap: 10px;
  flex-wrap: wrap;
}
.prof-credly-disconnect {
  border: 0; background: transparent; color: #9ca3af;
  font-size: 12px; cursor: pointer; padding: 0; font: inherit; font-weight: 600;
  transition: color .15s;
}
.prof-credly-disconnect:hover { color: #b42318; }
.prof-credly-link { font-size: 12px; font-weight: 700; color: #d62828; }

/* Dark mode additions */
body.dark-mode .prof-hero,
body.dark-mode .prof-card { background: #111827; border-color: #263445; }
body.dark-mode .prof-hero-name,
body.dark-mode .credly-badge-name { color: #f8fafc; }
body.dark-mode .prof-detail-icon { background: #1f2937; border-color: #263445; color: #cbd5e1; }
body.dark-mode .prof-about-input,
body.dark-mode .prof-credly-input { background: #0b1220; color: #f8fafc; border-color: #263445; }
body.dark-mode .credly-badge-item { background: #0f172a; border-color: #263445; }

/* ── v58: Search bar fix styles ─────────────────────────── */
.searchbar:focus-within {
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(214,40,40,.14) !important;
}
.searchbar input:focus { outline: none !important; }
.search-hint {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 600;
  pointer-events: none;
}
.searchbar:focus-within .search-hint { display: none; }
/* ── END v58 ─────────────────────────────────────────────── */

/* ── END v57 styles ─────────────────────────────────────────── */
/* Scope: visual/layout only. Login gate & MSAL logic are untouched. */

/* Topbar: thicker, more authoritative brand bar */
body:not(.auth-locked) .topbar {
  height: 62px !important;
  border-bottom: 1px solid #e0e4ea !important;
  box-shadow: 0 1px 0 #e0e4ea !important;
}
/* Red accent rule under topbar */
body:not(.auth-locked) .topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #d62828 0%, #ef3636 60%, transparent 100%);
  pointer-events: none;
}

/* Left nav: SVG icons need flex centering */
.leftnav li .ni {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}
.leftnav li .ni svg { display: block; }
.leftnav li.active .ni svg { stroke: currentColor; }

/* Topbar icon buttons: SVG variant */
.icon-btn svg { display: block; pointer-events: none; }
.icon-btn { transition: background .14s, color .14s, box-shadow .14s !important; }
.icon-btn:hover { background: #f1f5f9 !important; color: #111827 !important; box-shadow: none !important; }

/* Page title: add a subtle left accent bar */
.page-title {
  padding-left: 12px !important;
  border-left: 3px solid #d62828 !important;
  margin-left: -12px !important;
}

/* Section title rule line */
.sec-title {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.sec-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
  min-width: 20px;
}

/* Cards: tighten hover to just border lift, no transform (more enterprise) */
.card, .metric, .app-card, .tool-card, .result-card,
.employee-card, .newsletter-card, .site-card, .module-card {
  transition: border-color .15s, box-shadow .15s !important;
}
.card:hover, .app-card:hover, .tool-card:hover,
.result-card:hover, .employee-card:hover, .newsletter-card:hover {
  transform: none !important;
  box-shadow: 0 4px 18px rgba(16,24,40,.10) !important;
  border-color: #c1c8d4 !important;
}

/* Metric row: more refined */
.metric-val, .metric .num { font-variant-numeric: tabular-nums; }

/* Left nav section divider label */
.leftnav-label { margin-top: 4px; }

/* Alert/login strip: more subdued */
#loginStrip {
  background: #f0f4ff !important;
  border-bottom: 1px solid #c7d7f8 !important;
  color: #1e3a6e !important;
}
#loginStrip b { color: #1e3a6e !important; }
#loginStrip button { color: #4a6fa5 !important; }

/* Buttons: consistent font size */
.btn { font-size: 13px !important; letter-spacing: .005em !important; }
.btn.primary, .btn.black {
  background: #111827 !important;
  color: #fff !important;
  border: 1px solid #111827 !important;
}
.btn.primary:hover, .btn.black:hover {
  background: #1f2937 !important;
  border-color: #1f2937 !important;
}

/* Modal header: tighter, more enterprise */
.modal-hdr {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 14px !important;
  margin-bottom: 16px !important;
}
.modal-hdr h2 { font-size: 17px !important; font-weight: 800 !important; color: #111827 !important; }

/* Footer legal strip */
.ft-legal {
  background: #0c1118;
  border-top: 1px solid #1f2937;
  padding: 14px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: rgba(255,255,255,.38);
  gap: 16px;
  flex-wrap: wrap;
}
.ft-legal-links { display: flex; gap: 18px; }
.ft-legal-links a {
  color: rgba(255,255,255,.38) !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: color .15s;
}
.ft-legal-links a:hover { color: rgba(255,255,255,.7) !important; }
body.auth-locked .ft-legal { display: none !important; }

/* Focus visible: consistent across all interactive elements */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #d62828 !important;
  outline-offset: 2px !important;
  border-radius: 4px !important;
}

/* Print: hide chrome/interactive shell */
@media print {
  .topbar, .leftnav, .rail, footer, .ft-legal, .feedback,
  #loginStrip, .top-actions { display: none !important; }
  .main { padding: 20px !important; }
  .layout { grid-template-columns: 1fr !important; }
}
