/* IP Manager + IP Search. Tokens only (design-system v2). */

/* KPI accent stripes */
.ip-kpi--err  { border-left: 3px solid var(--err); }
.ip-kpi--warn { border-left: 3px solid var(--gold); }
.ip-kpi--ok   { border-left: 3px solid var(--ok); }
.ip-kpi--info { border-left: 3px solid var(--brand); }

/* Horizontal mix bars */
.ip-bars { display: grid; gap: .5rem; }
.ip-bar { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 2.5rem; align-items: center; gap: .75rem; font-size: .875rem; color: var(--text); text-decoration: none; }
.ip-bar:hover .ip-bar__fill { filter: brightness(1.08); }
.ip-bar__track { height: .5rem; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.ip-bar__fill { height: 100%; border-radius: inherit; background: var(--brand); }
.ip-bar__n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }

/* Due-date chip */
.ip-due { display: inline-flex; align-items: center; gap: .25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ip-due--overdue { color: var(--err); font-weight: 600; }
.ip-due--soon { color: var(--gold); font-weight: 600; }
.ip-due--later { color: var(--text-muted); }
.ip-due--closed { color: var(--text-subtle); text-decoration: line-through; }

/* Mark thumbnail / monogram */
.ip-thumb {
  width: 2.5rem; height: 2.5rem; flex: none; border-radius: 10px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-container); color: var(--on-brand-container, var(--brand));
  font-weight: 700; font-size: .75rem; letter-spacing: .02em; border: 1px solid var(--border-soft);
}
.ip-thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.ip-thumb--lg { width: 5rem; height: 5rem; font-size: 1rem; border-radius: 14px; }
.ip-cell { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.ip-cell__title { font-weight: 600; color: var(--text); }
.ip-cell__meta { font-size: .75rem; color: var(--text-subtle); }

/* Right-type picker */
.ip-typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.ip-typecard {
  display: flex; gap: .75rem; align-items: flex-start; padding: 1rem;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.ip-typecard:hover, .ip-typecard:focus-visible { border-color: var(--brand); box-shadow: var(--shadow-sm); color: var(--text); }
.ip-typecard__sym {
  flex: none; width: 2.5rem; height: 2.5rem; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-container); color: var(--brand); font-weight: 700; font-size: .8rem;
}
.ip-typecard__label { font-weight: 600; }
.ip-typecard__desc { font-size: .8125rem; color: var(--text-muted); margin-top: .125rem; }

/* Facts grid on the asset page */
.ip-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .75rem 1.5rem; margin: 0; }
.ip-facts dt { font-size: .75rem; font-weight: 500; color: var(--text-subtle); }
.ip-facts dd { margin: .125rem 0 0; color: var(--text); overflow-wrap: anywhere; }

/* Deadline timeline */
.ip-timeline { list-style: none; margin: 0; padding: 0; }
.ip-timeline__item { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: .75rem; align-items: start; padding: .75rem 0; border-top: 1px solid var(--border-soft); }
.ip-timeline__item:first-child { border-top: 0; }
.ip-timeline__date { font-variant-numeric: tabular-nums; font-weight: 600; }
.ip-timeline__basis { font-size: .75rem; color: var(--text-subtle); }
.ip-timeline__actions { display: flex; gap: .375rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 575.98px) {
  .ip-timeline__item { grid-template-columns: 1fr; }
  .ip-timeline__actions { justify-content: flex-start; }
}

/* Activity */
.ip-activity { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.ip-activity li { padding: .375rem 0; border-top: 1px solid var(--border-soft); }
.ip-activity li:first-child { border-top: 0; }
.ip-activity time { color: var(--text-subtle); font-size: .75rem; }

/* Form fieldsets */
.ip-fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.ip-fieldset > legend { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; float: none; }

/* --- IP Search ----------------------------------------------------------- */
.ips-hero { max-width: 52rem; margin: 0 auto 1.5rem; text-align: center; }
.ips-tabs { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: var(--radius-pill); background: var(--surface-sunken); margin-bottom: 1rem; flex-wrap: wrap; justify-content: center; }
.ips-tab { border: 0; background: none; padding: .375rem .875rem; border-radius: var(--radius-pill); font-size: .875rem; color: var(--text-muted); display: inline-flex; gap: .375rem; align-items: center; }
.ips-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); font-weight: 600; }
.ips-tab[aria-disabled="true"] { cursor: not-allowed; opacity: .75; }
.ips-soon { font-size: .625rem; font-weight: 600; padding: 0 .375rem; border-radius: var(--radius-pill); background: var(--gold); color: #fff; }
.ips-searchbar { display: flex; gap: .5rem; }
.ips-searchbar .form-control { height: 3rem; border-radius: var(--radius-pill); padding-inline: 1.25rem; font-size: 1rem; }
.ips-searchbar .btn { border-radius: var(--radius-pill); padding-inline: 1.5rem; }
.ips-freshness { font-size: .75rem; color: var(--text-subtle); margin-top: .5rem; }

.ips-results { display: grid; gap: .75rem; }
.ips-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: start; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.ips-card__mark { font-size: 1.125rem; font-weight: 700; color: var(--text); text-decoration: none; }
.ips-card__meta { font-size: .8125rem; color: var(--text-muted); }
.ips-card__actions { display: flex; flex-direction: column; gap: .375rem; align-items: stretch; }
@media (max-width: 767.98px) {
  .ips-card { grid-template-columns: auto 1fr; }
  .ips-card__actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
.ips-score { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--text-muted); margin-top: .375rem; }
.ips-score__track { width: 6rem; height: .375rem; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.ips-score__fill { height: 100%; background: var(--brand); }
.ips-score--high .ips-score__fill { background: var(--err); }
.ips-score--mid .ips-score__fill { background: var(--gold); }
.ips-reasons { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.ips-reason { font-size: .6875rem; padding: 0 .4rem; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--text-muted); }
.ips-classes { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.ips-class { font-size: .6875rem; font-variant-numeric: tabular-nums; min-width: 1.5rem; text-align: center; padding: 0 .3rem; border-radius: 6px; border: 1px solid var(--border); color: var(--text-muted); }
.ips-class--hit { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.ips-hit--new { border-left: 3px solid var(--brand); }
.ips-hit--dismissed { opacity: .65; }
