/* ============================================================
   Uno IDS UI kit — recreated component CSS (Tailwind expanded).
   Drop this after colors_and_type.css.
   ============================================================ */

* { box-sizing: border-box; }
html, body, #app {
  height: 100%;
  margin: 0;
}
body {
  background: var(--gray-100);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
}

/* ---------- Layout shell ---------- */
.ids-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: #fff; }
.ids-shell__main { flex: 1; display: flex; overflow: hidden; }
.ids-shell__content {
  flex: 1; overflow: auto; background: var(--gray-100);
}
.ids-shell__content-inner { padding: 24px; }

/* ---------- ids-top-bar ---------- */
.ids-top-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 24px 7px;
  background: #fff;
  border-bottom: 1px solid var(--gray-300);
  height: 50px;
  flex-shrink: 0;
  z-index: 10;
}
.ids-top-bar__left,
.ids-top-bar__center,
.ids-top-bar__right { display: flex; align-items: center; gap: 8px; flex: 1; }
.ids-top-bar__center { justify-content: center; }
.ids-top-bar__right  { justify-content: flex-end; }
.ids-top-bar__brand {
  display: inline-flex;
  align-items: center;
  height: 34px;
  color: var(--ivanti-black);
  text-decoration: none;
}
.ids-top-bar__brand img { display: block; height: 24px; width: auto; }
.dark .ids-top-bar__brand { color: #fff; }
.ids-top-bar__product-name {
  font-size: 14px; font-weight: 600; color: var(--fg-primary);
  padding-left: 4px;
}
.ids-top-bar__search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--gray-100); color: var(--gray-600);
  border-radius: 8px; font-size: 13px;
  cursor: text;
}
.ids-top-bar__search:hover { background: var(--gray-200); }
.ids-top-bar__search input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--fg-primary); font: inherit;
}
.ids-top-bar__search input::placeholder { color: var(--gray-600); font-style: italic; }

.ids-button__badge {
  position: absolute;
  top: -7px;
  right: -7px;
}
.ids-button__badge:has(.ids-badge--dot) { top: -3px; right: -3px; }

/* ---------- Top bar icon hit-target tweaks ---------- */
/* (kept for legacy `.ids-icon-btn` references — alias to canonical) */
.ids-icon-btn {
  /* deprecated — use .ids-button.ids-button--tertiary.ids-button--icon */
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 16px;
  background: transparent;
  color: var(--blue-600);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 200ms ease-in-out;
}
.ids-icon-btn:hover { background: var(--blue-100); border-color: var(--blue-100); }

.ids-avatar {
  width: 28px; height: 28px; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--plum-600), var(--ivanti-red));
  color: #fff; font-size: 11px; font-weight: 600;
  cursor: pointer;
}

/* ---------- ids-sidebar ---------- */
.ids-sidebar {
  width: 272px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 8px;
  gap: 8px;
  transition: width 200ms ease-in-out;
}
.ids-sidebar.is-collapsed { width: 72px; }
.ids-sidebar.is-collapsed .ids-sidebar__text,
.ids-sidebar.is-collapsed .ids-sidebar__title,
.ids-sidebar.is-collapsed .ids-sidebar__count { display: none; }
.ids-sidebar.is-collapsed .ids-sidebar__item { justify-content: center; }
.ids-sidebar__title {
  padding: 12px 16px 6px;
  font-size: 12px; font-weight: 600; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ids-sidebar__item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 14px; color: var(--fg-primary);
  cursor: pointer;
  user-select: none;
  transition: background 200ms ease-in-out;
}
.ids-sidebar__item:hover { background: var(--blue-100); }
.ids-sidebar__item--active {
  background: var(--blue-200);
  border-left: 4px solid var(--blue-600);
  padding-left: 12px;
  border-radius: 0 8px 8px 0;
}
.ids-sidebar__item--active .ids-sidebar__icon { color: var(--blue-700); }
.ids-sidebar__icon {
  width: 24px; min-width: 24px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600); font-size: 18px;
}
.ids-sidebar__text { flex: 1; }
.ids-sidebar__count {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; padding: 0 6px;
  border-radius: 8px; border: 2px solid var(--gray-200); background: var(--gray-100);
  color: var(--gray-600); font-size: 11px; font-weight: 600;
}
.ids-sidebar__sep { height: 1px; background: var(--gray-300); margin: 4px 8px; }

/* ---------- ids-button ---------- */
.ids-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 16px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  outline: none;
  transition: background 200ms ease-in-out, color 200ms ease-in-out, border-color 200ms ease-in-out;
}
.ids-button:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.ids-button--large { padding: 13px 16px; border-radius: 24px; line-height: 14px; }
.ids-button--small { padding: 3px 12px; font-size: 12px; }
.ids-button--icon  { min-width: 32px; padding: 8px; justify-content: center; }
.ids-button--small.ids-button--icon { min-width: 24px; padding: 4px; }
.ids-button--small i { font-size: 12px; }

.ids-button--primary {
  background: var(--blue-600); color: #fff; border-color: var(--blue-600);
}
.ids-button--primary:hover  { background: var(--blue-700); border-color: var(--blue-700); }
.ids-button--primary:active { background: var(--blue-800); border-color: var(--blue-800); }

.ids-button--primary.ids-button--critical {
  background: var(--red-600); border-color: var(--red-600);
}
.ids-button--primary.ids-button--critical:hover { background: var(--red-700); border-color: var(--red-700); }

.ids-button--secondary {
  background: transparent; color: var(--blue-600); border-color: var(--blue-600);
}
.ids-button--secondary:hover { background: var(--blue-100); border-color: var(--blue-700); }

.ids-button--secondary.ids-button--critical { color: var(--red-600); border-color: var(--red-600); }
.ids-button--secondary.ids-button--critical:hover { background: var(--red-100); border-color: var(--red-700); }

.ids-button--tertiary { color: var(--blue-600); }
.ids-button--tertiary:hover { background: var(--blue-100); border-color: var(--blue-100); }

.ids-button[disabled] {
  pointer-events: none;
  border-style: dashed;
  border-color: var(--gray-600);
  background: var(--gray-100);
  color: var(--gray-600);
}
.ids-button--secondary[disabled],
.ids-button--tertiary[disabled] { background: transparent; }
.ids-button--tertiary[disabled] { border-color: transparent; }

/* AI gradient button */
.ids-button--ai {
  background: linear-gradient(135deg, var(--ivanti-plum), var(--ivanti-ruby), var(--ivanti-orange));
  color: #fff;
  border-color: transparent;
}
.ids-button--ai:hover { filter: brightness(0.95); }

/* ---------- ids-box ---------- */
.ids-box {
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 16px;
  display: flex; flex-direction: column;
  color: var(--fg-primary);
}
.ids-box__header  { padding: 24px 24px 0; font-weight: 600; font-size: 18px; line-height: 24px; }
.ids-box__header .ids-box__header-action { float: right; font-size: 14px; font-weight: 400; line-height: 24px; }
.ids-box__content { padding: 24px; flex-grow: 1; }
.ids-box__footer  { padding: 0 24px 24px; }
.ids-box__footer--link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--gray-300);
  color: var(--blue-600); font-size: 14px; cursor: pointer;
}
.ids-box__footer--link:hover { background: var(--blue-100); }
.ids-box--secondary { background: var(--gray-100); box-shadow: var(--shadow-inner); border-color: var(--gray-200); }

/* ---------- Tag / Badge ---------- */
.ids-tag {
  display: inline-flex; align-items: center; gap: 0;
  height: 24px; padding: 0 8px;
  border: 1px solid var(--gray-600);
  background: var(--gray-100); color: var(--gray-800);
  border-radius: 4px; font-size: 13px;
  font-weight: 400; line-height: 22px;
  white-space: nowrap;
}
.ids-tag .ids-tag__value { padding-left: 4px; font-weight: 600; }
.ids-tag--primary { border-color: var(--blue-600);   background: var(--blue-100);   color: var(--blue-800); }
.ids-tag--success { border-color: var(--green-600);  background: var(--green-100);  color: var(--green-800); }
.ids-tag--warning { border-color: var(--yellow-600); background: var(--yellow-100); color: var(--yellow-800); }
.ids-tag--error   { border-color: var(--red-600);    background: var(--red-100);    color: var(--red-800); }
.ids-tag--purple  { border-color: var(--purple-600); background: var(--purple-100); color: var(--purple-800); }
.ids-tag--teal    { border-color: var(--teal-600);   background: var(--teal-100);   color: var(--teal-800); }
.ids-tag--plum    { border-color: var(--plum-600);   background: var(--plum-100);   color: var(--plum-800); }
.ids-tag__close {
  margin-left: 4px;
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: currentColor; opacity: 0.7; cursor: pointer; font-size: 11px;
}
.ids-tag__close:hover { opacity: 1; }

.ids-badge {
  background: var(--red-600); color: #fff;
  border: 2px solid #fff; border-radius: 12px;
  padding: 0 4px; font-size: 11px; line-height: 16px;
  font-weight: 600; min-width: 20px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ids-badge--dot { width: 12px; height: 12px; min-width: 12px; padding: 0; border-radius: 9999px; }

/* ---------- Alert ---------- */
.ids-alert {
  display: flex; align-items: stretch; gap: 4px;
  padding: 0 8px;
  background: var(--blue-200); color: var(--blue-800);
  font-size: 14px;
}
.ids-alert__icon { padding: 9px 4px; display: flex; align-items: flex-start; justify-content: center; }
.ids-alert__body { padding: 7px 0 7px 4px; flex: 1; align-self: center; }
.ids-alert__actions { display: flex; align-items: center; }
.ids-alert--success  { background: var(--green-200);  color: var(--green-800); }
.ids-alert--warning  { background: var(--yellow-200); color: var(--yellow-800); }
.ids-alert--caution  { background: var(--orange-200); color: var(--orange-800); }
.ids-alert--critical { background: var(--red-200);    color: var(--red-800); }
.ids-alert a { color: inherit; text-decoration: underline; }

/* ---------- Form ---------- */
.ids-form { display: flex; flex-direction: column; gap: 18px; }
.ids-field { display: flex; flex-direction: column; }
.ids-label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px; font-weight: 600;
  color: var(--fg-primary); line-height: 20px;
}
.ids-label--required::after { content: " *"; color: var(--red-600); }
.ids-input,
.ids-select,
.ids-textarea {
  display: block; width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--gray-600); border-radius: 8px;
  background: #fff; color: var(--fg-primary);
  font-family: var(--font-sans); font-size: 14px; line-height: 20px;
  outline: none;
  transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}
.ids-input::placeholder, .ids-textarea::placeholder { color: var(--gray-600); font-style: italic; }
.ids-input:hover, .ids-textarea:hover, .ids-select:hover { border-color: var(--blue-700); }
.ids-input:focus, .ids-textarea:focus, .ids-select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-600); }
.ids-input[disabled] { border-style: dashed; background: var(--gray-100); color: var(--gray-600); cursor: not-allowed; }
.ids-input--error { border-color: var(--red-600); }
.ids-input--error:focus { box-shadow: 0 0 0 1px var(--red-600); }
.ids-caption { padding: 4px 12px 0; font-size: 11px; color: var(--gray-600); }
.ids-caption--error { color: var(--red-600); }

/* Search bar with leading icon */
.ids-search {
  position: relative;
  display: flex; align-items: center;
  background: #fff;
  border: 1px solid var(--gray-600);
  border-radius: 8px;
  padding: 0 11px;
}
.ids-search:hover { border-color: var(--blue-700); }
.ids-search:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-600); }
.ids-search i { color: var(--gray-600); }
.ids-search input {
  flex: 1; padding: 9px 8px; border: none; outline: none;
  background: transparent; font: inherit; color: var(--fg-primary);
}

/* Checkbox */
.ids-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.ids-checkbox input { display: none; }
.ids-checkbox .box {
  width: 16px; height: 16px; border: 1px solid var(--gray-600);
  border-radius: 3px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px;
}
.ids-checkbox input:checked + .box { background: var(--blue-600); border-color: var(--blue-600); }

/* Toggle switch */
.ids-switch { width: 32px; height: 18px; background: var(--gray-300); border-radius: 9999px; position: relative; cursor: pointer; transition: background 200ms ease-in-out; }
.ids-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: left 200ms ease-in-out; }
.ids-switch.is-on { background: var(--blue-600); }
.ids-switch.is-on::after { left: 16px; }

/* ---------- Pagehead ---------- */
.ids-pagehead { display: flex; flex-direction: column; gap: 8px; padding: 0 0 16px; }
.ids-pagehead__breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--gray-800); }
.ids-pagehead__breadcrumbs a { color: var(--blue-600); text-decoration: none; cursor: pointer; }
.ids-pagehead__breadcrumbs a:hover { text-decoration: underline; color: var(--blue-700); }
.ids-pagehead__breadcrumbs .sep { color: var(--gray-600); }
.ids-pagehead__title { display: flex; align-items: center; gap: 12px; }
.ids-pagehead__title h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 600; }
.ids-pagehead__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ids-pagehead__subhead { font-size: 14px; color: var(--gray-600); }
.ids-pagehead__attrs { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- ids-table (mirrors libs/styles/src/components/table.css) ---------- */
.ids-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}
.ids-table td,
.ids-table th { padding: 10px 16px; }
.ids-table th {
  text-align: left;
  font-weight: 600;
  color: var(--fg-primary);
}
.ids-table thead th {
  border: 1px solid var(--gray-300);
  border-top: 0;
  border-right: 0;
}
.ids-table thead th:first-child { border-left: 0; }
.ids-table tbody td { border-bottom: 1px solid var(--gray-300); color: var(--fg-primary); vertical-align: middle; }
.ids-table tbody tr:last-child td { border-bottom: 0; }

/* Optional row hover — opt-in modifier */
.ids-table--hoverable > tbody > tr { transition: background 100ms ease-in-out; cursor: pointer; }
.ids-table--hoverable > tbody > tr:hover { background: var(--blue-100); }
.ids-table--hoverable > tbody > tr.ids-table-row--active:hover { background: var(--blue-200); }

/* Selected row */
.ids-table-row--active { background: var(--blue-200); }

/* nowrap utility */
.ids-table--nowrap td,
.ids-table--nowrap th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* sticky header utility */
.ids-table-header--sticky td,
.ids-table-header--sticky th { background: #fff; position: sticky; top: 0; z-index: 10; }

.ids-table .text-right { text-align: right; }

/* ---------- KPI card ---------- */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: 13px; color: var(--gray-600); }
.kpi__value { font-size: 36px; font-weight: 600; line-height: 1.1; color: var(--fg-primary); letter-spacing: -0.02em; }
.kpi__trend { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.kpi__trend.up { color: var(--green-700); }
.kpi__trend.down { color: var(--red-600); }

/* ---------- Status dot ---------- */
.ids-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ids-status .dot { width: 8px; height: 8px; border-radius: 9999px; background: var(--gray-500); }
.ids-status.ok    .dot { background: var(--green-500); box-shadow: 0 0 0 3px var(--green-100); }
.ids-status.warn  .dot { background: var(--yellow-500); box-shadow: 0 0 0 3px var(--yellow-100); }
.ids-status.crit  .dot { background: var(--red-500); box-shadow: 0 0 0 3px var(--red-100); }
.ids-status.muted .dot { background: var(--gray-400); box-shadow: 0 0 0 3px var(--gray-100); }

/* ---------- Tabs (pill) ---------- */
.ids-tabs { display: inline-flex; padding: 4px; background: var(--gray-100); border-radius: 9999px; gap: 2px; }
.ids-tabs__tab {
  padding: 6px 14px; border-radius: 9999px;
  font-size: 13px; font-weight: 600; color: var(--gray-700);
  cursor: pointer; transition: background 200ms ease-in-out, color 200ms ease-in-out;
}
.ids-tabs__tab:hover { color: var(--blue-700); }
.ids-tabs__tab.is-active { background: #fff; color: var(--gray-900); box-shadow: var(--shadow-raised); }

/* ---------- Conversation bubble (AI) ---------- */
.ids-bubble-row { display: flex; gap: 6px; margin-bottom: 8px; }
.ids-bubble-row.user { justify-content: flex-end; }
.ids-bubble {
  max-width: 78%; padding: 8px 12px;
  border-radius: 12px; font-size: 13px; line-height: 18px;
}
.ids-bubble.ai { background: var(--gray-100); color: var(--gray-800); font-style: italic; border-top-left-radius: 2px; }
.ids-bubble.user { background: #F1F4FF; color: var(--gray-900); border-top-right-radius: 2px; }
.ids-bubble-avatar {
  width: 24px; height: 24px; min-width: 24px;
  border-radius: 9999px;
  background: var(--green-500); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
}

/* ---------- Timeline ---------- */
.ids-timeline { position: relative; padding-left: 24px; }
.ids-timeline::before {
  content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--gray-200);
}
.ids-timeline__item { position: relative; padding-bottom: 18px; }
.ids-timeline__dot {
  position: absolute; left: -22px; top: 4px;
  width: 12px; height: 12px; border-radius: 9999px;
  background: #fff; border: 2px solid var(--blue-600);
}
.ids-timeline__dot.success { border-color: var(--green-600); background: var(--green-600); }
.ids-timeline__dot.critical { border-color: var(--red-600); background: var(--red-600); }
.ids-timeline__head { font-size: 13px; font-weight: 600; color: var(--fg-primary); }
.ids-timeline__meta { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.ids-timeline__body { font-size: 13px; color: var(--gray-700); margin-top: 6px; }

/* ---------- Grid helpers ---------- */
.grid { display: grid; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.col-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3 / span 3; }
.span-4 { grid-column: span 4 / span 4; }
.span-6 { grid-column: span 6 / span 6; }
.span-8 { grid-column: span 8 / span 8; }
.span-9 { grid-column: span 9 / span 9; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-1 { flex: 1; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--gray-600); }
.text-strong { font-weight: 600; color: var(--fg-primary); }
.text-danger { color: var(--red-600); }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex-grow { flex-grow: 1; }
.ml-auto { margin-left: auto; }
