/* Own My Ideas — Admin Workspace
   Light theme matching ownmyideas.com
   Brand: navy text, electric blue, mint→cyan→blue accents
   Fonts: Bree Serif (headlines) + Barlow (UI)
*/

:root {
  --bg: #f5f8fc;
  --bg-soft: #eef3fa;
  --surface: #ffffff;
  --ink: #011627;
  --ink-2: #142e54;
  --text: #1b1b1b;
  --muted: #5a6b7d;
  --faint: #8a97a8;
  --line: #e2e8f0;
  --line-strong: #c9d4e3;
  --blue: #0047e1;
  --blue-bright: #0038ff;
  --blue-soft: rgba(0, 71, 225, 0.08);
  --mint: #00dc82;
  --cyan: #36e4da;
  --cyan-soft: rgba(54, 228, 218, 0.12);
  --brand-grad: linear-gradient(45deg, #00dc82, #36e4da 50%, #0047e1);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.1);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.08);
  --sky: #188bf6;
  --good: #059669;
  --good-soft: rgba(5, 150, 105, 0.1);
  --warn: #d97706;
  --bad: #e11d48;
  --sidebar-w: 292px;
  --content-max: 1180px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 8px 28px rgba(1, 22, 39, 0.06);
  --shadow-sm: 0 1px 3px rgba(1, 22, 39, 0.04);
  --font-display: "Bree Serif", Georgia, serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

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

body.app-shell {
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(0, 71, 225, 0.06), transparent 55%),
    radial-gradient(700px 360px at -5% 100%, rgba(0, 220, 130, 0.05), transparent 50%),
    var(--bg);
  background-attachment: fixed;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  color: var(--blue-bright);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ——— Admin login ——— */
.login-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(700px 360px at 100% 0%, rgba(0, 71, 225, 0.07), transparent 55%),
    radial-gradient(560px 300px at 0% 100%, rgba(0, 220, 130, 0.05), transparent 50%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: var(--font-body);
  color: var(--text);
}

.login-shell {
  width: 100%;
  max-width: 420px;
}

.login-card-admin {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(1, 22, 39, 0.08);
  padding: 2rem 1.75rem 1.75rem;
}

.login-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.login-card-admin .brand-logo {
  height: 72px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  object-position: left center;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 71, 225, 0.18);
  flex-shrink: 0;
}

.login-card-admin h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}

.login-sub {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 1.5rem;
}

.login-foot {
  text-align: center;
  margin: 1.15rem 0 0;
  font-size: 0.78rem;
  color: var(--faint);
}

.password-field {
  position: relative;
}
.password-field .form-control {
  padding-right: 2.75rem;
}
.password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.password-toggle:hover {
  color: var(--blue);
  background: var(--blue-soft);
}
.password-toggle:focus-visible {
  outline: 2px solid rgba(0, 71, 225, 0.35);
  outline-offset: 1px;
}
.password-toggle i {
  font-size: 1.1rem;
}

.form-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.form-control,
.form-select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  max-width: 100%;
}

.form-control:focus,
.form-select:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 71, 225, 0.12);
  color: var(--text);
}

.form-control::placeholder {
  color: var(--faint);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.btn-omi {
  --bs-btn-bg: var(--blue);
  --bs-btn-border-color: var(--blue);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--blue-bright);
  --bs-btn-hover-border-color: var(--blue-bright);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #0030d6;
  --bs-btn-active-border-color: #0030d6;
  --bs-btn-active-color: #fff;
  font-weight: 650;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.1rem;
  white-space: nowrap;
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--blue);
  color: var(--blue);
}

.btn-amber {
  background: var(--brand-grad);
  border: none;
  color: #011627;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.95rem;
  white-space: nowrap;
}
.btn-amber:hover {
  filter: brightness(1.05);
  color: #011627;
}

.btn-danger-soft {
  background: var(--rose-soft);
  border: 1px solid rgba(225, 29, 72, 0.25);
  color: var(--rose);
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.btn-danger-soft:hover {
  background: rgba(225, 29, 72, 0.14);
  color: #be123c;
}

/* ——— Shell ——— */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem 1rem;
}

.sidebar-brand .brand-logo {
  height: 78px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  object-position: left center;
}

.sidebar-brand .tag {
  font-size: 0.78rem;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
}

.nav-section {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  padding: 0.9rem 0.85rem 0.4rem;
  font-weight: 700;
}

.nav-link-omi {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.68rem 0.85rem;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.15s ease, color 0.15s ease;
  margin-bottom: 2px;
  min-width: 0;
}
.nav-link-omi i {
  width: 1.25rem;
  font-size: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}
.nav-link-omi:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.nav-link-omi.active {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 2px 0 0 var(--blue);
  font-weight: 700;
}

.nav-badge {
  margin-left: auto;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(0, 220, 130, 0.14);
  color: #047857;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.sidebar-foot {
  display: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--blue-soft);
  border: 1px solid rgba(0, 71, 225, 0.18);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--blue);
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-meta .u-name,
.profile-trigger-meta .u-name,
.profile-dropdown-head .u-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta .u-role,
.profile-trigger-meta .u-role {
  font-size: 0.8rem;
  color: var(--muted);
}

.main {
  min-width: 0;
  max-width: 100%;
  padding: 1.25rem clamp(1rem, 2vw, 1.75rem) 2rem;
  overflow-x: clip;
}

.main-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1100;
  flex-wrap: wrap;
}

.topbar > .d-flex:first-child {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 100%;
}

.topbar > .d-flex:first-child > div {
  min-width: 0;
  flex: 1;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.topbar .subtitle {
  color: var(--muted);
  margin: 0;
  max-width: 42rem;
  line-height: 1.4;
  font-size: 0.9rem;
}

.topbar-right {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  flex: 0 1 auto;
  flex-shrink: 0;
  position: relative;
  z-index: 1110;
  margin-left: auto;
}

.topbar-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: min(100%, 34rem);
}

.topbar-actions .btn,
.topbar-actions .btn-omi,
.topbar-actions .btn-ghost,
.topbar-actions .badge {
  white-space: nowrap;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  line-height: 1.2;
}

.invention-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
}

@media (max-width: 1100px) {
  .topbar-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .topbar-actions {
    max-width: none;
    flex: 1;
    justify-content: flex-start;
  }
}

.profile-menu {
  position: relative;
  z-index: 1120;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--ink);
  font-family: var(--font-body);
}
.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
  border-color: rgba(0, 71, 225, 0.28);
  box-shadow: var(--shadow);
}
.profile-trigger-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 140px;
  text-align: left;
}
.profile-caret {
  color: var(--faint);
  font-size: 0.75rem;
  margin-right: 0.15rem;
}

.profile-dropdown.dropdown-menu {
  min-width: 240px;
  padding: 0.5rem 0;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 16px 40px rgba(1, 22, 39, 0.14) !important;
  z-index: 2000 !important;
  margin-top: 0.4rem !important;
  inset: auto 0 auto auto !important;
  transform: none !important;
}
.profile-dropdown-head {
  padding: 0.55rem 1rem 0.4rem;
}
.profile-dropdown-head .u-email {
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}
.profile-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  font-weight: 600;
  color: var(--ink) !important;
  font-size: 0.92rem;
  background: transparent;
}
.profile-dropdown .dropdown-item i {
  color: var(--blue);
  width: 1rem;
  text-align: center;
}
.profile-dropdown .dropdown-item:hover,
.profile-dropdown .dropdown-item:focus,
.profile-dropdown .dropdown-item:active {
  background: var(--blue-soft) !important;
  color: var(--blue) !important;
}
.profile-dropdown .dropdown-item-danger {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--rose) !important;
  text-align: left;
  cursor: pointer;
}
.profile-dropdown .dropdown-item-danger i {
  color: var(--rose);
}
.profile-dropdown .dropdown-item-danger:hover,
.profile-dropdown .dropdown-item-danger:focus {
  background: var(--rose-soft) !important;
  color: var(--rose) !important;
}
.profile-dropdown .dropdown-divider {
  margin: 0.35rem 0;
  border-color: var(--line);
  opacity: 1;
}

.profile-grid {
  align-items: start;
}

@media (max-width: 700px) {
  .profile-trigger-meta {
    display: none;
  }
}

/* ——— Surfaces ——— */
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.surface-pad {
  padding: 1rem 1.15rem;
}

.surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: #fafcfe;
}
.surface-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.surface-head .hint {
  color: var(--faint);
  font-size: 0.78rem;
  white-space: nowrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 1.05rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: rise 0.45s ease both;
  min-width: 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  z-index: 1;
}
.stat:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.stat::after { display: none; }

.stat-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stat-icon.activity-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 1rem;
}

.soft-blue { background: rgba(0, 71, 225, 0.1); color: #0047e1; }
.soft-mint { background: rgba(0, 220, 130, 0.12); color: #059669; }
.soft-cyan { background: rgba(54, 228, 218, 0.16); color: #0e7490; }
.soft-amber { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.soft-rose { background: rgba(225, 29, 72, 0.1); color: #e11d48; }
.soft-sky { background: rgba(24, 139, 246, 0.12); color: #0284c7; }
.soft-violet { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.soft-green { background: rgba(5, 150, 105, 0.12); color: #047857; }

.stat .label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin: 0;
}
.stat .value {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.2vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  word-break: break-word;
}
.stat .delta {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--faint);
  line-height: 1.3;
}

.surface-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.soft-head-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.funnel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
  padding: 1rem 1.05rem 1.15rem;
}
.funnel-step {
  text-align: center;
  padding: 0.95rem 0.5rem 0.85rem;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  min-width: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.funnel-step:hover {
  background: #fff;
  border-color: rgba(0, 71, 225, 0.22);
}
.funnel-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin: 0 auto 0.55rem;
  font-size: 1rem;
}
.funnel-step .n {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
}
.funnel-step .l {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 650;
}

.int-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.int-card .svc {
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
  color: var(--ink);
}
.int-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.table-omi {
  width: 100%;
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  border-collapse: collapse;
}
.table-omi thead th {
  color: var(--faint);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem;
  background: #f8fafc;
  white-space: nowrap;
}
.table-omi tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  max-width: 280px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.table-omi tbody td:last-child {
  max-width: none;
  white-space: nowrap;
  width: 1%;
}
.table-omi tbody tr:hover {
  background: rgba(0, 71, 225, 0.03);
}
.table-omi tbody tr:last-child td {
  border-bottom: none;
}

.badge-omi {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.48rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-pending { background: var(--amber-soft); color: var(--amber); }
.badge-approved, .badge-good { background: var(--good-soft); color: var(--good); }
.badge-rejected, .badge-bad { background: var(--rose-soft); color: var(--rose); }
.badge-info { background: rgba(24, 139, 246, 0.1); color: #0369a1; }
.badge-muted { background: #f1f5f9; color: var(--muted); }
.badge-teal { background: var(--cyan-soft); color: #0e7490; }

.source-flags {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 110px;
}
.rec-sheet-top .source-flags {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.65rem;
  min-width: 0;
  margin-top: 0.35rem;
}
.source-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}
.source-flag.on {
  color: var(--good);
}
.source-flag.off {
  color: #94a3b8;
}
.source-flag i {
  font-size: 0.9rem;
}

.score {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 96px;
  max-width: 140px;
}
.score-bar {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: #e8eef5;
  overflow: hidden;
}
.score-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-grad);
  transform-origin: left;
  animation: growBar 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.score-bar.medium > span {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.score-bar.low > span {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}
.score-n {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 2.2rem;
  color: var(--ink-2);
  flex-shrink: 0;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #e8f0ff, #dffaf5);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--blue);
  flex-shrink: 0;
}
.person .p-name {
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.person .p-sub {
  font-size: 0.76rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  align-items: center;
}
.search-bar .form-control,
.search-bar .form-select {
  width: auto;
  flex: 1 1 180px;
  max-width: 260px;
  min-width: 140px;
}

.alert-omi {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
}
.alert-omi.success { border-color: rgba(5, 150, 105, 0.3); background: var(--good-soft); color: #065f46; }
.alert-omi.info { border-color: rgba(0, 71, 225, 0.25); background: var(--blue-soft); color: #1e3a8a; }
.alert-omi.danger { border-color: rgba(225, 29, 72, 0.25); background: var(--rose-soft); color: #9f1239; }

.warn-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 0.18rem 0.4rem;
  border-radius: 5px;
  font-weight: 650;
  white-space: nowrap;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}
.bubble {
  max-width: min(640px, 100%);
  width: fit-content;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.bubble.outbound {
  margin-left: auto;
  background: var(--blue-soft);
  border-color: rgba(0, 71, 225, 0.2);
}
.bubble.inbound {
  margin-right: auto;
  background: var(--cyan-soft);
  border-color: rgba(54, 228, 218, 0.35);
}
.bubble .meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.bubble .body {
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 0.9rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  padding: 1rem;
}
.int-card {
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  min-width: 0;
}
.int-card .svc {
  font-weight: 700;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.3rem;
}
.dot.healthy { background: var(--good); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); }
.dot.degraded { background: var(--warn); }
.dot.down { background: var(--bad); }
.dot.not_configured { background: var(--faint); }

.empty {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--muted);
}
.empty i {
  font-size: 1.6rem;
  color: var(--faint);
  margin-bottom: 0.5rem;
  display: block;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 0.9rem;
  align-items: start;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.9rem;
  align-items: start;
}

.text-muted {
  color: var(--muted) !important;
}

.modal-content {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
}
.modal-header,
.modal-footer {
  border-color: var(--line) !important;
}
.btn-close {
  filter: none;
}

.mobile-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 9px;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

code {
  font-size: 0.82em;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes growBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 1100px) {
  :root { --content-max: 100%; }
}

@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    width: min(280px, 86vw);
    max-width: min(280px, 86vw);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .mobile-toggle { display: inline-grid; place-items: center; }
  .main { padding: 1rem; }
  .person .p-name,
  .person .p-sub { max-width: 160px; }
  .login-card-admin { padding: 1.5rem 1.25rem; }
}

/* ——— Pagination OMI ——— */
.pagination-omi {
  display: flex;
  gap: 0.35rem;
}
.pagination-omi .page-link {
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  transition: all 0.15s ease;
}
.pagination-omi .page-link:hover {
  background: var(--bg-soft);
  border-color: var(--blue);
  color: var(--blue);
}
.pagination-omi .page-item.active .page-link {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 71, 225, 0.25);
}
.pagination-omi .page-item.disabled .page-link {
  background: var(--bg);
  color: var(--faint);
  border-color: var(--line);
  opacity: 0.6;
}

/* ——— Inventor Card & Badges ——— */
.inventor-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.inventor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(1, 22, 39, 0.08);
}
.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}
.badge-sky {
  background: rgba(24, 139, 246, 0.1);
  color: #0284c7;
  border: 1px solid rgba(24, 139, 246, 0.2);
}

/* ——— Clickable Dashboard Widgets ——— */
.stat-link,
.funnel-link,
.int-card-link {
  text-decoration: none !important;
  color: inherit !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat-link:hover,
.funnel-link:hover,
.int-card-link:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 24px rgba(1, 22, 39, 0.08) !important;
  border-color: var(--blue) !important;
}



/* Demo research ranking */
.rank-pill{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;padding:0 .55rem;border-radius:8px;background:rgba(0,71,225,.1);color:#0047e1;font-weight:700;font-size:.85rem;margin-right:.65rem;white-space:nowrap;line-height:1}
.rank-pill.sm{min-width:1.85rem;height:1.7rem;font-size:.75rem;margin-right:0;padding:0 .45rem}
.rank-pill.sm.is-top{background:#10b981;color:#fff}

.candidate-row.is-top td{background:rgba(16,185,129,0.04)}
.candidate-co{display:flex;flex-direction:column;align-items:flex-start;gap:0.28rem;min-width:0}
.candidate-co-name{
  display:inline-flex;align-items:flex-start;gap:0.35rem;
  color:var(--ink);text-decoration:none;font-weight:700;line-height:1.3;max-width:100%
}
.candidate-co-name span{overflow-wrap:anywhere}
.candidate-co-name i{flex-shrink:0;margin-top:0.2rem;font-size:0.72rem;color:var(--brand,#0047e1)}
.candidate-co-name:hover{color:var(--brand,#0047e1)}
.candidate-top-badge{
  display:inline-flex;align-items:center;
  font-size:0.68rem;font-weight:700;letter-spacing:0.02em;
  padding:0.15rem 0.45rem;border-radius:6px;
  background:rgba(16,185,129,0.12);color:#047857;border:1px solid rgba(16,185,129,0.25)
}
.score-lg{min-width:170px;text-align:right}
.score-label{font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:var(--faint);margin-bottom:.25rem}
.score-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.5rem}
.score-grid div{background:rgba(1,22,39,.03);border:1px solid rgba(1,22,39,.06);border-radius:10px;padding:.55rem .65rem}
.score-grid span{display:block;font-size:.68rem;text-transform:uppercase;letter-spacing:.03em;color:var(--faint)}
.score-grid strong{font-size:.95rem;color:var(--ink)}
@media (max-width:768px){.score-grid{grid-template-columns:repeat(2,1fr)}}

/* ——— Selection queue detail cards ——— */
.rec-sheet{
  background:var(--surface,#fff);
  border:1px solid rgba(1,22,39,.08);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 10px 28px rgba(1,22,39,.04);
}
.rec-sheet-top{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:flex-start;
  padding:1.15rem 1.25rem 1rem;
  background:linear-gradient(180deg,#f7fbff 0%,#fff 100%);
  border-bottom:1px solid rgba(1,22,39,.06);
}
.rec-sheet-id{display:flex;gap:.85rem;align-items:flex-start;min-width:0}
.rec-co-name{
  font-family:"Bree Serif",serif;
  font-size:1.35rem;
  margin:0 0 .35rem;
  color:var(--ink,#011627);
  line-height:1.2;
}
.rec-meta{display:flex;flex-wrap:wrap;gap:.35rem .7rem;color:var(--faint,#64748b);font-size:.82rem}
.rec-meta span:not(:last-child)::after{content:""; }
.rec-fit-ring{
  --fit:70;
  width:76px;height:76px;border-radius:50%;
  display:grid;place-items:center;
  background:
    radial-gradient(circle at center,#fff 58%,transparent 59%),
    conic-gradient(#0047e1 calc(var(--fit) * 1%), #e2e8f0 0);
  flex-shrink:0;
}
.rec-fit-ring.medium{background:radial-gradient(circle at center,#fff 58%,transparent 59%),conic-gradient(#0d9488 calc(var(--fit)*1%),#e2e8f0 0)}
.rec-fit-ring.low{background:radial-gradient(circle at center,#fff 58%,transparent 59%),conic-gradient(#f59e0b calc(var(--fit)*1%),#e2e8f0 0)}
.rec-fit-ring strong{font-size:1.25rem;line-height:1;color:#011627}
.rec-fit-ring span{display:block;font-size:.65rem;text-transform:uppercase;letter-spacing:.04em;color:#64748b;text-align:center}
.rec-approve-banner{
  display:flex;gap:.75rem;align-items:flex-start;
  margin:0;padding:.85rem 1.25rem;
  background:rgba(0,71,225,.06);
  border-bottom:1px solid rgba(0,71,225,.12);
  color:#1e3a8a;font-size:.9rem;line-height:1.45;
}
.rec-approve-banner i{font-size:1.15rem;margin-top:.1rem}
.rec-approve-banner em{font-style:normal;font-weight:700;color:#011627}
.rec-sheet-grid{
  display:grid;
  grid-template-columns:1.1fr 1fr;
  gap:0;
  border-bottom:1px solid rgba(1,22,39,.06);
}
.rec-sheet-grid-2{border-bottom:0}
.rec-panel{padding:1.1rem 1.25rem;border-right:1px solid rgba(1,22,39,.06)}
.rec-panel:last-child{border-right:0}
.rec-panel h3{
  margin:0 0 .65rem;
  font-size:.72rem;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:#64748b;
}
.rec-inv-title{font-weight:700;font-size:1.02rem;color:#011627;margin-bottom:.25rem}
.rec-body{margin:0 0 .75rem;color:#475569;line-height:1.55;font-size:.92rem}
.rec-kv{margin-bottom:.65rem}
.rec-kv span{display:block;font-size:.68rem;text-transform:uppercase;letter-spacing:.04em;color:#94a3b8;margin-bottom:.15rem}
.rec-kv p{margin:0;color:#334155;font-size:.9rem;line-height:1.45}
.rec-links{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.5rem}
.rec-links a{
  display:inline-flex;align-items:center;gap:.35rem;
  padding:.35rem .7rem;border-radius:8px;
  border:1px solid rgba(1,22,39,.12);color:#0047e1;
  text-decoration:none;font-size:.82rem;font-weight:600;background:#fff;
}
.rec-tags{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.35rem}
.rec-tags span{
  background:rgba(1,22,39,.04);border:1px solid rgba(1,22,39,.08);
  border-radius:999px;padding:.2rem .55rem;font-size:.75rem;color:#334155;
}
.rec-bars{display:flex;flex-direction:column;gap:.45rem}
.rec-bar-row{display:grid;grid-template-columns:76px 1fr 36px;gap:.55rem;align-items:center;font-size:.8rem}
.rec-bar-row span{color:#64748b}
.rec-bar-row b{text-align:right;color:#011627}
.rec-bar{height:8px;border-radius:99px;background:#e8eef5;overflow:hidden}
.rec-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#0047e1,#18a0fb)}
.rec-contact{display:flex;gap:.75rem;align-items:center}
.rec-sources{list-style:none;margin:0;padding:0}
.rec-sources li{margin-bottom:.55rem}
.rec-sources a{font-weight:600;color:#0047e1;text-decoration:none;font-size:.88rem}
.rec-sources span{display:block;color:#64748b;font-size:.8rem;margin-top:.15rem;line-height:1.4}
.rec-actions{padding:1rem 1.25rem 1.15rem;background:#f8fafc;border-top:1px solid rgba(1,22,39,.06)}
.rec-actions-form{display:flex;flex-wrap:wrap;gap:.75rem;align-items:flex-end}
.rec-action-btns{display:flex;flex-wrap:wrap;gap:.45rem;align-items:center}
.rec-contact-edit{margin-top:.35rem}
.rec-contact-edit .form-control{max-width:100%}
.rec-contact-edit .btn{margin-top:.15rem}
.contact-field{margin-bottom:.7rem}
.contact-field-head{
  display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.15rem
}
.contact-field-head span{
  font-size:.68rem;text-transform:uppercase;letter-spacing:.04em;color:#94a3b8
}
.contact-edit-btn{
  border:0;background:transparent;color:#0047e1;font-size:.75rem;font-weight:600;
  padding:0;cursor:pointer;line-height:1
}
.contact-edit-btn:hover{text-decoration:underline}
.contact-field-text{margin:0;color:#334155;font-size:.9rem;line-height:1.45;word-break:break-word}
.contact-field-text.is-missing{color:#94a3b8}
.contact-field-edit{display:none}
.contact-field.is-editing .contact-field-view{display:none}
.contact-field.is-editing .contact-field-edit{display:block}
.contact-field.is-editing .contact-edit-btn{color:#047857}
.contact-field-status{font-size:.72rem;margin-top:.25rem;min-height:1em}
.contact-field-status.is-ok{color:#047857}
.contact-field-status.is-error{color:#b91c1c}
.email-missing-flash{
  display:inline-flex;align-items:center;align-self:center;
  padding:.2rem .55rem;border-radius:.35rem;
  background:#0f2744;color:#fff;font-size:.72rem;font-weight:600;
  opacity:0;transform:translateY(2px);transition:opacity .2s ease,transform .2s ease;
  pointer-events:none;
}
.email-missing-flash.is-visible{opacity:1;transform:none}
.rec-action-btns{display:flex;flex-wrap:wrap;gap:.5rem}
@media (max-width:900px){
  .rec-sheet-grid{grid-template-columns:1fr}
  .rec-panel{border-right:0;border-bottom:1px solid rgba(1,22,39,.06)}
  .rec-panel:last-child{border-bottom:0}
}

.portal-opp-list{display:flex;flex-direction:column;gap:.65rem;padding:1rem 1.15rem}
.portal-opp-card{
  display:flex;justify-content:space-between;gap:1rem;align-items:center;
  padding:.9rem 1rem;border-radius:12px;border:1px solid rgba(1,22,39,.08);
  text-decoration:none;color:inherit;background:#fff;
  transition:border-color .15s,box-shadow .15s,transform .15s;
}
.portal-opp-card:hover{border-color:rgba(0,71,225,.35);box-shadow:0 8px 22px rgba(1,22,39,.06);transform:translateY(-1px)}
.portal-opp-main{display:flex;gap:.8rem;align-items:flex-start;min-width:0}
.portal-opp-note{margin:.35rem 0 0;color:#64748b;font-size:.85rem;line-height:1.4}
.portal-opp-side{display:flex;flex-direction:column;align-items:flex-end;gap:.35rem;flex-shrink:0}

.portal-opp-filters{
  display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;
  gap:.85rem 1.25rem;padding:.85rem 1.15rem;border-bottom:1px solid rgba(1,22,39,.08);
  background:rgba(248,250,252,.85);
}
.portal-opp-filter-controls{display:flex;flex-wrap:wrap;gap:.75rem 1rem;align-items:flex-end}
.portal-opp-filter-field{min-width:160px}
.portal-opp-filter-field .form-select{min-width:160px;max-width:220px}
.portal-opp-month{min-width:160px}
.portal-opp-month .form-select{min-width:160px}
.portal-opp-tabs{display:flex;flex-wrap:wrap;gap:.4rem}
.portal-opp-tab{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.4rem .75rem;border-radius:999px;border:1px solid rgba(1,22,39,.1);
  background:#fff;color:var(--muted,#64748b);font-size:.82rem;font-weight:600;
  text-decoration:none;transition:all .15s ease;
}
.portal-opp-tab:hover{border-color:rgba(0,71,225,.35);color:var(--blue,#0047e1)}
.portal-opp-tab.active{
  background:var(--blue,#0047e1);border-color:var(--blue,#0047e1);color:#fff;
}
.portal-opp-tab-count{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:1.35rem;height:1.35rem;padding:0 .35rem;border-radius:999px;
  background:rgba(15,23,42,.08);font-size:.72rem;font-weight:700;
}
.portal-opp-tab.active .portal-opp-tab-count{background:rgba(255,255,255,.22);color:#fff}
@media (max-width:640px){
  .portal-opp-filters{align-items:stretch}
  .portal-opp-filter-controls{width:100%}
  .portal-opp-filter-field{width:100%;min-width:0}
  .portal-opp-filter-field .form-select{max-width:none;width:100%}
  .portal-opp-month{width:100%}
  .portal-opp-tabs{width:100%}
}
