/* ============================================================
   HISTORY  —  History ▸ Test Runs / Schedules / API / Manual
   ============================================================ */
.hist-header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-4);margin-bottom:var(--space-4)}
.hist-header__left{display:flex;flex-direction:column;gap:4px;min-width:0}
.hist-title{font-size:var(--text-3xl);font-weight:var(--weight-bold);color:var(--text-primary);letter-spacing:-.02em;line-height:1.2}
.hist-subtitle{font-size:var(--text-base);font-weight:var(--weight-regular);color:var(--text-secondary);line-height:1.4}
.hist-header__right{display:flex;align-items:center;gap:var(--space-2);flex-shrink:0}
.hist-daterange{display:inline-flex;align-items:center;gap:var(--space-2);height:40px;padding:0 var(--space-3);background:var(--surface);border:1px solid var(--border);border-radius:8px;
  font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--text-secondary);white-space:nowrap;cursor:pointer;transition:background var(--duration-fast) var(--ease),border-color var(--duration-fast) var(--ease)}
.hist-daterange:hover{background:var(--surface-2);border-color:var(--border-hi)}
.hist-daterange svg{width:16px;height:16px;stroke:var(--text-muted);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hist-filterbtn{display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 var(--space-4);background:var(--surface);border:1px solid var(--border);border-radius:8px;
  font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--text-secondary);cursor:pointer;white-space:nowrap;transition:background var(--duration-fast) var(--ease),border-color var(--duration-fast) var(--ease)}
.hist-filterbtn:hover{background:var(--surface-2);border-color:var(--border-hi)}
.hist-filterbtn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ── History date range picker ────────────────────────────────────────────── */
.hist-dr-wrap{position:relative;}
.hist-dr-label{font-size:var(--text-sm);color:var(--text-secondary);margin:0 var(--space-1);}
.hist-daterange .hist-dr-label{pointer-events:none;}
.hist-dr-pop{position:absolute;top:calc(100% + 8px);right:0;min-width:200px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);padding:var(--space-2);display:none;z-index:200;}
.hist-dr-pop--open{display:block;}
.hist-dr__item{display:block;width:100%;text-align:left;height:34px;padding:0 var(--space-3);border:none;background:transparent;border-radius:var(--radius-sm);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--text-secondary);cursor:pointer;white-space:nowrap;transition:background var(--duration-fast),color var(--duration-fast);}
.hist-dr__item:hover{background:var(--surface-2);color:var(--text-primary);}
.hist-dr__item--active{background:var(--brand);color:#FFFFFF;}
.hist-dr__custom{display:none;padding:var(--space-3) var(--space-2) var(--space-2);border-top:1px solid var(--border);margin-top:var(--space-2);flex-direction:column;gap:var(--space-2);}
.hist-dr__custom--show{display:flex;}
.hist-dr__field{display:flex;flex-direction:column;gap:4px;font-size:var(--text-xs);color:var(--text-secondary);}
.hist-dr__date{height:32px;padding:0 var(--space-2);background:var(--surface-0);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text-primary);font-size:var(--text-sm);cursor:pointer;}
.hist-dr__err{font-size:var(--text-xs);color:var(--error);min-height:16px;}
.hist-dr__actions{display:flex;justify-content:flex-end;gap:var(--space-2);margin-top:var(--space-1);}
.hist-dr__cancel{height:28px;padding:0 var(--space-3);border:1px solid var(--border);border-radius:var(--radius-sm);background:transparent;color:var(--text-secondary);font-size:var(--text-xs);cursor:pointer;}
.hist-dr__apply{height:28px;padding:0 var(--space-3);border:none;border-radius:var(--radius-sm);background:var(--info);color:#fff;font-size:var(--text-xs);cursor:pointer;font-weight:var(--weight-medium);}

.hist-tabs{display:flex;align-items:center;gap:var(--space-5);border-bottom:1px solid var(--border);margin-bottom:var(--space-5)}
.hist-tab{padding:0 0 var(--space-3);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--text-secondary);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;transition:color var(--duration-fast) var(--ease)}
.hist-tab:hover{color:var(--text-primary)}
.hist-tab--active{color:var(--brand);border-bottom-color:var(--brand);font-weight:var(--weight-semibold)}

.hist-summary{display:grid;grid-template-columns:repeat(5,1fr);gap:var(--space-4);margin-bottom:var(--space-4)}
.hist-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:var(--shadow-sm);padding:var(--space-4);display:flex;flex-direction:column;gap:var(--space-3);overflow:hidden;
  transition:box-shadow var(--duration-base) var(--ease),transform var(--duration-base) var(--ease)}
.hist-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px)}
.hist-card__top{display:flex;align-items:center;gap:var(--space-2)}
.hist-card__icon{width:32px;height:32px;min-width:32px;border-radius:var(--radius-md);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.hist-card__icon svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.hist-card__icon--blue{background:var(--info-bg);color:var(--info)}
.hist-card__icon--green{background:var(--success-bg);color:var(--success)}
.hist-card__icon--red{background:var(--error-bg);color:var(--error)}
.hist-card__icon--gray{background:var(--surface-2);color:var(--text-secondary)}
.hist-card__icon--orange{background:var(--warning-bg);color:var(--warning)}
.hist-card__title{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--text-secondary);line-height:1;flex:1;min-width:0}
.hist-card__pill{display:inline-flex;align-items:center;height:20px;padding:0 var(--space-2);border-radius:var(--radius-full);font-size:var(--text-xs);font-weight:var(--weight-semibold);white-space:nowrap}
.hist-card__pill--green{background:var(--success-bg);color:var(--success)}
.hist-card__pill--red{background:var(--error-bg);color:var(--error)}
.hist-card__pill--gray{background:var(--surface-2);color:var(--text-muted)}
.hist-card__pill--orange{background:var(--warning-bg);color:var(--warning)}
.hist-card__body{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--space-2);margin-top:auto}
.hist-card__left{display:flex;flex-direction:column;gap:var(--space-2);min-width:0}
.hist-card__value{font-size:var(--text-3xl);font-weight:var(--weight-bold);color:var(--text-primary);letter-spacing:-.03em;line-height:1}
.hist-card__spark{flex-shrink:0;align-self:flex-end}
.hist-card__spark svg{display:block}
.hist-card__trend{display:flex;align-items:center;gap:4px;font-size:var(--text-xs);font-weight:var(--weight-medium);line-height:1.2}
.hist-card__trend--up{color:var(--success)}
.hist-card__trend--down{color:var(--error)}
.hist-card__trend-lbl{color:var(--text-muted);font-weight:var(--weight-regular)}

.hist-filterrow{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;margin-bottom:var(--space-4)}
.hist-search{position:relative;flex:1;min-width:220px}
.hist-search__icon{position:absolute;left:var(--space-3);top:50%;transform:translateY(-50%);display:flex;color:var(--text-muted);pointer-events:none}
.hist-search__icon svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hist-search__input{width:100%;height:36px;padding:0 var(--space-3) 0 var(--space-8);background:var(--surface);border:1px solid var(--border);border-radius:8px;font-size:var(--text-sm);color:var(--text-primary);transition:border-color var(--duration-fast) var(--ease),box-shadow var(--duration-fast) var(--ease)}
.hist-search__input::placeholder{color:var(--text-muted)}
.hist-search__input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-muted)}
.hist-dd{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 var(--space-3);background:var(--surface);border:1px solid var(--border);border-radius:8px;
  font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--text-secondary);cursor:pointer;white-space:nowrap;transition:background var(--duration-fast) var(--ease),border-color var(--duration-fast) var(--ease)}
.hist-dd:hover{background:var(--surface-2);border-color:var(--border-hi)}
.hist-dd svg{width:12px;height:12px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;color:var(--text-muted)}
.hist-clear{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--brand);cursor:pointer;white-space:nowrap}
.hist-clear:hover{opacity:.75}
.hist-export{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 var(--space-4);background:var(--brand);color:var(--text-inverse);border-radius:8px;
  font-size:var(--text-sm);font-weight:var(--weight-semibold);white-space:nowrap;cursor:pointer;margin-left:auto;transition:background var(--duration-fast) var(--ease)}
.hist-export:hover{background:var(--brand-alt)}
.hist-export svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Root wrapper — fills the page-content scroll container */
.hist-root{display:flex;flex-direction:column;min-height:100%}

.hist-main{display:grid;grid-template-columns:1fr 320px;gap:var(--space-5);align-items:stretch;flex:1;min-height:340px}
.hist-tablewrap{min-width:0;display:flex;flex-direction:column}

.hist-table{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:var(--shadow-sm);overflow:hidden;display:flex;flex-direction:column;flex:1}
.hist-thead,.hist-row{display:grid;grid-template-columns:1.5fr 2fr .8fr .9fr .9fr 1.2fr .8fr 1fr 44px;align-items:center;gap:var(--space-3);padding:0 var(--space-4)}
.hist-thead{height:42px;border-bottom:1px solid var(--border);background:var(--surface-2)}
.hist-th{font-size:var(--text-xs);font-weight:var(--weight-semibold);color:var(--text-muted);text-transform:uppercase;letter-spacing:.03em;white-space:nowrap}
.hist-th--right,.hist-cell--right{justify-self:end;text-align:right}
.hist-row{min-height:56px;border-bottom:1px solid var(--border);cursor:pointer;border-left:3px solid transparent;transition:background var(--duration-fast) var(--ease)}
.hist-row:last-child{border-bottom:none}
.hist-row:hover{background:var(--surface-2)}
.hist-row--selected{background:var(--info-bg);border-left-color:var(--info)}
.hist-cell{min-width:0;font-size:var(--text-sm);color:var(--text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hist-runid{display:flex;flex-direction:column;gap:2px;min-width:0}
.hist-runid__id{font-family:var(--font-mono);font-size:var(--text-xs);font-weight:var(--weight-semibold);color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hist-runid__link{font-size:var(--text-xs);color:var(--info);font-weight:var(--weight-medium)}
.hist-pt{display:flex;flex-direction:column;gap:2px;min-width:0}
.hist-pt__name{font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hist-pt__sub{font-size:var(--text-xs);color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hist-env{display:inline-flex;align-items:center;height:22px;padding:0 var(--space-2);border-radius:var(--radius-sm);font-size:var(--text-xs);font-weight:var(--weight-medium);background:var(--surface-2);color:var(--text-secondary)}
.hist-badge{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 var(--space-2);border-radius:var(--radius-full);font-size:var(--text-xs);font-weight:var(--weight-semibold);white-space:nowrap}
.hist-badge::before{content:'';width:6px;height:6px;border-radius:var(--radius-full);background:currentColor;display:block}
.hist-badge--passed{background:var(--success-bg);color:var(--success)}
.hist-badge--failed{background:var(--error-bg);color:var(--error)}
.hist-badge--skipped{background:var(--surface-2);color:var(--text-muted)}
.hist-badge--running{background:var(--warning-bg);color:var(--warning)}
.hist-trigger{display:flex;align-items:center;gap:6px;color:var(--text-secondary);font-size:var(--text-sm)}
.hist-trigger svg{width:13px;height:13px;stroke:var(--text-muted);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.hist-by{display:flex;align-items:center;gap:6px;min-width:0}
.hist-avatar{width:24px;height:24px;min-width:24px;border-radius:var(--radius-full);display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:var(--weight-bold);color:#fff;text-transform:uppercase;background:var(--avatar-bg)}
.hist-by__name{font-size:var(--text-sm);color:var(--text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hist-rowaction{justify-self:end}
.hist-iconbtn{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:var(--radius-sm);color:var(--text-muted);cursor:pointer;transition:background var(--duration-fast) var(--ease),color var(--duration-fast) var(--ease)}
.hist-iconbtn:hover{background:var(--surface-3);color:var(--text-primary)}
.hist-iconbtn svg{width:16px;height:16px;fill:currentColor;stroke:none}

.hist-foot{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-top:var(--space-4)}
.hist-foot__info{font-size:var(--text-sm);color:var(--text-secondary)}
.hist-pages{display:flex;align-items:center;gap:var(--space-2)}
.hist-pagebtn{min-width:32px;height:32px;padding:0 var(--space-2);display:inline-flex;align-items:center;justify-content:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);
  font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--text-secondary);cursor:pointer;transition:background var(--duration-fast) var(--ease),border-color var(--duration-fast) var(--ease),color var(--duration-fast) var(--ease)}
.hist-pagebtn:hover:not(:disabled){background:var(--surface-2);border-color:var(--border-hi);color:var(--text-primary)}
.hist-pagebtn--active{background:var(--info);border-color:var(--info);color:#fff}
.hist-pagebtn:disabled{opacity:.45;cursor:not-allowed}
.hist-pagebtn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hist-pages__dots{padding:0 4px;color:var(--text-muted);font-size:var(--text-sm)}

/* Table body (rows area — fills remaining table height) */
.hist-tbody{flex:1;min-height:0;display:flex;flex-direction:column}
.hist-tbody .hist-empty{flex:1;min-height:200px;padding:var(--space-8) var(--space-4)}
.hist-tbody .hist-empty--main{flex:1;min-height:200px;padding:var(--space-8) var(--space-4)}

/* Right detail panel */
.hist-detail{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:var(--shadow-sm);padding:var(--space-4);display:flex;flex-direction:column;gap:var(--space-3);overflow-y:auto;max-height:calc(100vh - 160px)}
.hist-detail__hd{display:flex;align-items:center;gap:var(--space-2)}
.hist-detail__id{font-family:var(--font-mono);font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--text-primary)}
.hist-detail__close{width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:var(--radius-sm);color:var(--text-muted);cursor:pointer;margin-left:auto}
.hist-detail__close:hover{background:var(--surface-2);color:var(--text-primary)}
.hist-detail__close svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hist-detail__title{font-size:var(--text-md);font-weight:var(--weight-semibold);color:var(--text-primary);line-height:1.3}
.hist-detail__sub{font-size:var(--text-sm);color:var(--text-muted);line-height:1.3;margin-top:-8px}
.hist-fields{display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-3) 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.hist-field{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3)}
.hist-field__label{font-size:var(--text-sm);color:var(--text-muted)}
.hist-field__value{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--text-primary);text-align:right;white-space:nowrap}
.hist-donut{display:flex;align-items:center;justify-content:center;padding:0}
.hist-donut__center-pct{font-size:var(--text-xl);font-weight:var(--weight-bold);fill:var(--text-primary)}
.hist-donut__center-sub{font-size:9px;fill:var(--text-muted)}
.hist-legend{display:flex;flex-direction:column;gap:6px}
.hist-legend__item{display:flex;align-items:center;gap:var(--space-2);font-size:var(--text-sm);color:var(--text-secondary)}
.hist-legend__dot{width:8px;height:8px;border-radius:var(--radius-full);flex-shrink:0}
.hist-legend__label{flex:1}
.hist-legend__val{font-weight:var(--weight-semibold);color:var(--text-primary)}
.hist-detail__actions{display:flex;flex-direction:column;gap:var(--space-2)}
.hist-detail__actionrow{display:flex;align-items:center;gap:var(--space-2)}
.hist-detail__actionrow .hist-btn{flex:1}
.hist-detail__moreicon{width:38px;height:38px;min-width:38px;display:flex;align-items:center;justify-content:center;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text-secondary);cursor:pointer;flex-shrink:0;transition:background var(--duration-fast) var(--ease),color var(--duration-fast) var(--ease)}
.hist-detail__moreicon:hover{background:var(--surface-2);color:var(--text-primary)}
.hist-detail__moreicon svg{width:18px;height:18px;fill:currentColor;stroke:none}
.hist-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;border-radius:8px;font-size:var(--text-base);font-weight:var(--weight-semibold);cursor:pointer;border:1px solid transparent;width:100%;
  transition:background var(--duration-fast) var(--ease),border-color var(--duration-fast) var(--ease),color var(--duration-fast) var(--ease)}
.hist-btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hist-btn--primary{background:var(--info);color:#fff;border-color:var(--info)}
.hist-btn--primary:hover{filter:brightness(.95)}
.hist-btn--ghost{background:var(--surface);color:var(--text-secondary);border-color:var(--border)}
.hist-btn--ghost:hover{background:var(--surface-2);color:var(--text-primary);border-color:var(--border-hi)}
.hist-detail__more{display:inline-flex;align-items:center;justify-content:center;height:38px;width:100%;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text-secondary);cursor:pointer}
.hist-detail__more:hover{background:var(--surface-2);color:var(--text-primary)}
.hist-detail__more svg{width:18px;height:18px;fill:currentColor;stroke:none}

/* ── Tab-specific grid columns ─────────────────────────────────────────── */
/* Test Runs uses the default .hist-thead/.hist-row columns (9 cols) */
.hist-table--schedules .hist-thead,
.hist-table--schedules .hist-row{grid-template-columns:1.8fr 1.8fr 1.2fr 1fr 1.2fr .9fr 1fr 96px}
.hist-table--api-executions .hist-thead,
.hist-table--api-executions .hist-row{grid-template-columns:1.3fr 1fr 1.4fr 1.4fr .7fr .9fr 1.1fr .7fr 44px}
.hist-table--manual-tests .hist-thead,
.hist-table--manual-tests .hist-row{grid-template-columns:1.3fr 1.4fr .7fr 1fr .9fr 1fr 1.2fr .7fr 44px}
.hist-table--trash .hist-thead,
.hist-table--trash .hist-row{grid-template-columns:2fr .9fr 1fr 1.2fr 1fr 96px}
.hist-badge--trash{background:var(--surface-2);color:var(--text-secondary);border:1px solid var(--border)}
.hist-dd--select{appearance:auto;background:var(--surface);border:1px solid var(--border);color:var(--text-primary);
  height:36px;border-radius:8px;padding:0 var(--space-3);font-size:var(--text-sm);cursor:pointer}
.hist-export--danger{border-color:var(--error)}
.hist-export--danger:hover{background:var(--error);color:#fff}
/* per-row ⋯ menu (rendered on <body>) */
.hist-rowmenu{position:fixed;min-width:160px;background:var(--surface-0,var(--surface));border:1px solid var(--border);
  border-radius:10px;box-shadow:var(--shadow-lg);padding:6px;z-index:1300;display:flex;flex-direction:column;gap:2px}
.hist-rowmenu__item{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;border:none;background:none;cursor:pointer;
  border-radius:7px;font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--text-primary);text-align:left}
.hist-rowmenu__item:hover{background:var(--surface-2)}
.hist-rowmenu__item--danger{color:var(--error)}
.hist-rowmenu__item--danger:hover{background:var(--error-bg,rgba(255,61,107,.12))}

/* ── Summary card count variants ──────────────────────────────────────── */
.hist-summary--4{grid-template-columns:repeat(4,1fr)}
.hist-summary--5{grid-template-columns:repeat(5,1fr)}

/* ── Full-width main (no detail panel) ────────────────────────────────── */
.hist-main--full{grid-template-columns:1fr}

/* ── Filter row right side ────────────────────────────────────────────── */
.hist-filterrow__right{display:flex;align-items:center;gap:var(--space-2);margin-left:auto}
.hist-filterrow__right .hist-export{margin-left:0}

/* ── New Schedule / Add Manual button ─────────────────────────────────── */
.hist-newbtn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 var(--space-4);
  background:var(--brand);color:var(--text-inverse);border-radius:8px;border:none;
  font-size:var(--text-sm);font-weight:var(--weight-semibold);white-space:nowrap;cursor:pointer;
  transition:background var(--duration-fast) var(--ease)}
.hist-newbtn:hover{background:var(--brand-alt)}
.hist-newbtn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ── Row actions: multi-button variant (schedules) ────────────────────── */
.hist-rowaction--multi{display:flex;align-items:center;gap:2px;justify-self:end}
.hist-iconbtn--sm{width:24px;height:24px}
.hist-iconbtn--sm svg{width:13px;height:13px}

/* ── Additional badge colors ──────────────────────────────────────────── */
.hist-badge--active{background:var(--success-bg);color:var(--success)}
.hist-badge--paused{background:var(--surface-2);color:var(--text-muted)}
.hist-badge--success{background:var(--success-bg);color:var(--success)}
.hist-badge--rate-limited{background:var(--warning-bg);color:var(--warning)}
.hist-badge--needs-review{background:var(--warning-bg);color:var(--warning)}
.hist-badge--blocked{background:var(--error-bg);color:var(--error)}

/* ── API table cells ──────────────────────────────────────────────────── */
.hist-endpoint{font-family:var(--font-mono);font-size:11px;color:var(--text-secondary);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}
.hist-response{font-family:var(--font-mono);font-size:var(--text-xs);font-weight:var(--weight-semibold)}
.hist-response--ok{color:var(--success)}
.hist-response--err{color:var(--error)}
.hist-response--warn{color:var(--warning)}

/* ── Empty state ──────────────────────────────────────────────────────── */
.hist-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:var(--space-3);padding:var(--space-12) var(--space-4);color:var(--text-muted)}
.hist-empty svg{stroke:var(--text-muted);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;opacity:.5}
.hist-empty p{font-size:var(--text-base);color:var(--text-muted)}
.hist-empty--main{gap:var(--space-2)}
.hist-empty__title{font-size:var(--text-md);font-weight:var(--font-medium);color:var(--text-secondary);margin:0}
.hist-empty__desc{font-size:var(--text-sm);color:var(--text-muted);margin:0}

/* ── Toast ────────────────────────────────────────────────────────────── */
.hist-toast{position:fixed;bottom:var(--space-6);left:50%;transform:translateX(-50%) translateY(12px);
  background:var(--surface-2);color:var(--text-primary);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:var(--space-3) var(--space-5);
  font-size:var(--text-sm);font-weight:var(--weight-medium);
  opacity:0;z-index:9999;pointer-events:none;
  transition:opacity var(--duration-base) var(--ease),transform var(--duration-base) var(--ease);
  box-shadow:var(--shadow-md);white-space:nowrap}
.hist-toast--show{opacity:1;transform:translateX(-50%) translateY(0)}
.hist-toast--success{background:var(--brand);color:var(--text-inverse);border-color:var(--brand)}

/* ── Modal overlay + modal ────────────────────────────────────────────── */
.hist-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:1000;
  display:flex;align-items:center;justify-content:center;padding:var(--space-4)}
.hist-modal{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius-xl);
  box-shadow:var(--shadow-lg);width:100%;max-width:520px;display:flex;flex-direction:column;max-height:90vh}
.hist-modal--sm{max-width:420px}
.hist-modal__hd{display:flex;align-items:center;justify-content:space-between;padding:var(--space-5);border-bottom:1px solid var(--border)}
.hist-modal__title{font-size:var(--text-lg);font-weight:var(--weight-semibold);color:var(--text-primary)}
.hist-modal__close{width:28px;height:28px;display:flex;align-items:center;justify-content:center;
  border-radius:var(--radius-sm);color:var(--text-muted);cursor:pointer;flex-shrink:0}
.hist-modal__close:hover{background:var(--surface-2);color:var(--text-primary)}
.hist-modal__close svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hist-modal__body{padding:var(--space-5);overflow-y:auto;display:flex;flex-direction:column;gap:var(--space-4)}
.hist-modal__foot{padding:var(--space-4) var(--space-5);border-top:1px solid var(--border);
  display:flex;align-items:center;justify-content:flex-end;gap:var(--space-3);flex-shrink:0}

/* ── Form controls in modals ──────────────────────────────────────────── */
.hist-form-row{display:flex;flex-direction:column;gap:var(--space-2)}
.hist-form-row--check{flex-direction:row;align-items:center;gap:var(--space-2)}
.hist-label{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--text-secondary)}
.hist-input{height:36px;padding:0 var(--space-3);background:var(--surface);border:1px solid var(--border);
  border-radius:8px;font-size:var(--text-sm);color:var(--text-primary);width:100%;
  transition:border-color var(--duration-fast) var(--ease),box-shadow var(--duration-fast) var(--ease)}
.hist-input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-muted)}
.hist-input::placeholder{color:var(--text-muted)}
.hist-select{appearance:none;cursor:pointer;padding-right:var(--space-6);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236080a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right var(--space-3) center}
.hist-textarea{height:80px;padding:var(--space-2) var(--space-3);resize:vertical;line-height:1.5}
.hist-btn--auto{width:auto;padding:0 var(--space-5)}

/* ── Detail panel extras ──────────────────────────────────────────────── */
.hist-detail__section-hd{font-size:var(--text-xs);font-weight:var(--weight-semibold);
  color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;
  padding-top:var(--space-3);border-top:1px solid var(--border);margin-top:var(--space-1)}
.hist-detail__notes{font-size:var(--text-sm);color:var(--text-secondary);line-height:1.6;
  padding:var(--space-2) 0}
.hist-detail__evidence-box{display:flex;align-items:center;gap:var(--space-2);
  background:var(--surface-0);border:1px dashed var(--border);border-radius:var(--radius-sm);
  padding:var(--space-3) var(--space-4);font-size:var(--text-sm);color:var(--text-muted)}
.hist-detail__evidence-box svg{width:20px;height:20px;stroke:var(--text-muted);fill:none;stroke-width:1.8;flex-shrink:0}
.hist-code-block{background:var(--surface-0);border:1px solid var(--border);border-radius:var(--radius-sm);
  padding:var(--space-3);font-family:var(--font-mono);font-size:var(--text-xs);
  color:var(--text-secondary);white-space:pre-wrap;word-break:break-all;line-height:1.5}

@media(max-width:1080px){.hist-main{grid-template-columns:1fr}.hist-detail{max-width:420px}}
@media(max-width:1200px){.hist-summary{grid-template-columns:repeat(3,1fr)}.hist-summary--4{grid-template-columns:repeat(2,1fr)}.hist-thead{display:none}
  .hist-row{grid-template-columns:1fr 1fr;row-gap:var(--space-2);padding:var(--space-3) var(--space-4)}}
@media(max-width:768px){.hist-summary{grid-template-columns:repeat(2,1fr)}.hist-summary--4{grid-template-columns:repeat(2,1fr)}}
