/* Portal app pages — TOORCE light theme (white / red / black) */
body.t-app {
  background: var(--t-white);
  color: var(--t-ink);
}

body.t-app .t-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--t-border);
}

body.t-app .t-card {
  background: var(--t-white);
  border: 1px solid var(--t-border);
  box-shadow: var(--t-shadow);
}

body.t-app .t-table-wrap {
  border: 1px solid var(--t-border);
}

body.t-app .t-table th,
body.t-app .t-table td {
  color: var(--t-ink);
  border-bottom-color: var(--t-border);
}

body.t-app .t-table th {
  background: var(--t-gray-50);
  color: var(--t-gray-600);
}

body.t-app .t-section-title {
  color: var(--t-ink);
}

body.t-app .t-section-label {
  color: var(--t-red);
}

body.t-app .t-page-head h1 {
  color: var(--t-ink);
}

body.t-app .t-page-head p {
  color: var(--t-gray-600);
}

body.t-app .t-main {
  padding-top: 36px;
}

body.t-app .t-feature-card p {
  color: var(--t-gray-600);
}

body.t-app code {
  background: var(--t-red-soft);
  color: var(--t-red);
}

body.t-app .t-table select {
  background: var(--t-white);
  color: var(--t-ink);
  border: 1px solid var(--t-border);
}

body.t-app .t-btn-ghost {
  color: var(--t-gray-600);
  border: 1px solid var(--t-border);
  background: transparent;
}

body.t-app .t-btn-ghost:hover {
  color: var(--t-red);
  border-color: var(--t-red);
}

.t-btn-danger {
  border: 1px solid #a30f1a;
  background: #a30f1a;
  color: #fff;
}

.t-btn-danger:hover {
  border-color: #7f0b14;
  background: #7f0b14;
  color: #fff;
}

body.t-app .t-user-badge {
  color: var(--t-gray-600);
  border-color: var(--t-border);
}

body.t-app .t-company-panel {
  border: 1px solid var(--t-border);
  background: var(--t-gray-50);
}

body.t-app .t-company-panel p {
  color: var(--t-gray-600);
}

body.t-app .t-select {
  color: var(--t-ink);
  background: var(--t-white);
  border: 1px solid var(--t-border);
  width: 100%;
  padding: 13px 14px;
  font-family: inherit;
}

body.t-app .t-dialog {
  border: 1px solid var(--t-border);
  background: var(--t-white);
  color: var(--t-ink);
}

.t-portal-dialog {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.t-portal-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 20, 0.58);
  backdrop-filter: blur(3px);
}

.t-portal-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--t-border);
  border-radius: 14px;
  background: var(--t-white);
  box-shadow: 0 24px 70px rgba(15, 15, 20, 0.28);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.t-portal-dialog-panel.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.t-portal-dialog-accent {
  height: 5px;
  background: var(--t-red);
}

.t-portal-dialog-accent.is-danger {
  background: #a30f1a;
}

.t-portal-dialog-accent.is-success {
  background: #15803d;
}

.t-portal-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 14px;
}

.t-portal-dialog-header h2 {
  margin: 5px 0 0;
  color: var(--t-ink);
  font-size: 1.3rem;
  line-height: 1.25;
}

.t-portal-dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--t-border);
  border-radius: 50%;
  background: var(--t-gray-50);
  color: var(--t-gray-600);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.t-portal-dialog-body {
  padding: 0 26px 24px;
}

.t-portal-dialog-body > p {
  margin: 0 0 18px;
  color: var(--t-gray-600);
  line-height: 1.6;
}

.t-portal-dialog-body .t-textarea {
  min-height: 128px;
  resize: vertical;
}

.t-portal-dialog-error {
  min-height: 20px;
  margin-top: 7px;
  color: var(--t-red);
  font-size: 0.78rem;
  font-weight: 700;
}

.t-portal-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px;
  border-top: 1px solid var(--t-border);
  background: var(--t-gray-50);
}

@media (max-width: 560px) {
  .t-portal-dialog {
    align-items: end;
    padding: 12px;
  }

  .t-portal-dialog-header,
  .t-portal-dialog-body,
  .t-portal-dialog-actions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .t-portal-dialog-actions .t-btn {
    flex: 1;
  }
}

body.t-app .t-footer {
  background: var(--t-gray-50);
  border-top: 1px solid var(--t-border);
  color: var(--t-ink);
}

.t-page-head {
  margin-bottom: 32px;
}

.t-page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.t-page-head p {
  margin: 0;
  color: var(--t-gray-600);
  max-width: 640px;
}

.t-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.t-feature-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.t-feature-card p {
  flex: 1;
  color: var(--t-gray-500);
  margin: 0;
}

.t-partner-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.t-partner-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--t-border);
  background: var(--t-white);
  color: var(--t-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.t-partner-nav a:hover,
.t-partner-nav a.is-active {
  border-color: var(--t-red);
  color: var(--t-red);
  box-shadow: 0 8px 24px rgba(209, 17, 17, 0.08);
}

.t-auth-wrap {
  max-width: 460px;
  margin: 0 auto;
}

.t-auth-card {
  padding: 36px;
}

.t-user-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-gray-400);
  padding: 8px 12px;
  border: 1px solid var(--t-border-dark);
}

.t-installer-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
}

@media (max-width: 960px) {
  .t-installer-grid {
    grid-template-columns: 1fr;
  }
}

.t-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

code {
  font-family: var(--t-mono);
  font-size: 0.88em;
  background: var(--t-red-soft);
  color: var(--t-red);
  padding: 2px 6px;
}

.t-table select {
  padding: 8px 10px;
  background: var(--t-white);
  color: var(--t-ink);
  border: 1px solid var(--t-border);
  font-family: inherit;
  font-size: 0.85rem;
}

.t-table button {
  margin-left: 0;
  padding: 6px 12px;
  font-size: 0.65rem;
}

.t-table .t-catalog-group-row td {
  background: var(--t-gray-50);
  border-top: 2px solid var(--t-border);
  padding: 12px 16px;
}

.t-table .t-catalog-product-row td {
  background: #f7ecec;
  border-top: 3px solid var(--t-red);
  padding: 14px 16px;
}

.t-table .t-catalog-product-row strong {
  font-size: 1.05rem;
}

.t-table .t-catalog-group-row code {
  font-size: 0.9rem;
}

.t-catalog-group-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.t-catalog-group-bar > .t-catalog-group-toggle {
  flex: 1 1 auto;
  width: auto;
}

.t-catalog-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.t-catalog-group-toggle > span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.t-catalog-group-toggle .t-section-label {
  margin: 0;
}

.t-catalog-group-toggle > .t-catalog-group-meta {
  flex: 1 1 auto;
  gap: 8px 24px;
  justify-content: flex-end;
}

.t-catalog-group-meta > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.t-catalog-group-meta small {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-gray-400);
}

.t-catalog-group-meta strong {
  font-size: 0.9rem;
  white-space: nowrap;
}

.t-catalog-group-chevron {
  font-size: 1.2rem;
  color: var(--t-gray-600);
}

.t-catalog-table {
  table-layout: fixed;
  min-width: 980px;
}

.t-catalog-table th:nth-child(1),
.t-catalog-table td:nth-child(1) {
  width: 30%;
}

.t-catalog-table th:nth-child(2),
.t-catalog-table td:nth-child(2) {
  width: 14%;
}

.t-catalog-table th:nth-child(3),
.t-catalog-table td:nth-child(3) {
  width: 11%;
}

.t-catalog-table th:nth-child(4),
.t-catalog-table td:nth-child(4) {
  width: 16%;
}

.t-catalog-table th:nth-child(5),
.t-catalog-table td:nth-child(5) {
  width: 9%;
}

.t-catalog-table th:nth-child(6),
.t-catalog-table td:nth-child(6) {
  width: 20%;
}

.t-catalog-table td {
  vertical-align: top;
}

.t-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.t-cell-stack code {
  overflow-wrap: anywhere;
}

.t-cell-stack strong {
  font-weight: 600;
  line-height: 1.35;
}

.t-cell-capital {
  text-transform: capitalize;
}

.t-catalog-actions {
  min-width: 0;
  max-width: none;
}

.t-totals-box {
  border: 1px solid var(--t-border);
  background: var(--t-gray-50);
  padding: 14px 18px;
  display: grid;
  gap: 8px;
  max-width: 420px;
  margin-left: auto;
}

.t-totals-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.9rem;
}

.t-totals-row > span:first-child {
  color: var(--t-gray-600);
}

.t-totals-row > strong {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.t-totals-row.t-totals-grand {
  border-top: 1px solid var(--t-border-dark);
  padding-top: 10px;
  font-size: 1.05rem;
}

.t-totals-note {
  font-size: 0.75rem;
  color: var(--t-gray-600);
}

@media (max-width: 640px) {
  .t-totals-box {
    max-width: none;
  }
}

.t-pricing-panel {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--t-border);
  background: var(--t-gray-50);
}

.t-pricing-panel.is-actionable {
  border-color: var(--t-red);
  background: #fff8f8;
  box-shadow: inset 3px 0 0 var(--t-red);
}

.t-pricing-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.t-pricing-panel > header .t-section-label {
  margin-bottom: 2px;
}

.t-pricing-panel > header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.t-pricing-hint {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--t-gray-600);
}

.t-pricing-panel .t-input:disabled,
.t-pricing-panel .t-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.t-row-needs-pricing > td {
  background: #fff8f8;
}

/* Read-only summary of a received BOQ, shown instead of the locked input form. */
.t-info-box {
  border: 1px solid var(--t-border);
  background: var(--t-gray-50);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.t-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.t-info-head h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.t-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 24px;
}

.t-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--t-border);
}

.t-info-label {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-gray-600);
}

.t-info-value {
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.t-table th.t-num,
.t-table td.t-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.t-nowrap {
  white-space: nowrap;
}

.t-boq-accordion {
  padding: 0;
  overflow: hidden;
  margin-bottom: 12px;
}

.t-boq-accordion > summary {
  list-style: none;
}

.t-boq-accordion > summary::-webkit-details-marker {
  display: none;
}

.t-boq-summary {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(180px, 1.2fr) minmax(170px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
}

.t-boq-summary:hover {
  background: var(--t-gray-50);
}

.t-boq-summary > span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.t-boq-summary > span:first-child,
.t-boq-summary > span:nth-child(3) {
  flex-direction: column;
  align-items: flex-start;
}

.t-boq-summary small {
  display: block;
  color: var(--t-gray-600);
}

.t-boq-summary-chevron {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.t-boq-accordion[open] .t-boq-summary-chevron {
  transform: rotate(180deg);
}

.t-boq-detail {
  border-top: 1px solid var(--t-border);
  padding: 20px;
}

.t-boq-product-group {
  border: 1px solid var(--t-border);
  margin-bottom: 24px;
  background: var(--t-white);
}

.t-boq-product-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #f7ecec;
  border-top: 3px solid var(--t-red);
  border-bottom: 1px solid var(--t-border);
}

.t-boq-product-group > header .t-section-label {
  margin-bottom: 3px;
}

.t-boq-product-group > header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.t-boq-deployment-group {
  border-bottom: 1px solid var(--t-border);
}

.t-boq-deployment-group:last-child {
  border-bottom: 0;
}

.t-boq-deployment-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  list-style: none;
  cursor: pointer;
  background: var(--t-gray-50);
}

.t-boq-deployment-group > summary::-webkit-details-marker {
  display: none;
}

.t-boq-deployment-group > summary span:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.t-boq-deployment-group > summary small {
  color: var(--t-gray-600);
}

.t-boq-deployment-group[open] > summary > span:last-child {
  transform: rotate(180deg);
}

.t-boq-deployment-list {
  padding: 12px;
}

.t-boq-deployment-list .t-boq-accordion:last-child {
  margin-bottom: 0;
}

.t-table .t-boq-product-table-row td {
  padding: 13px 16px;
  background: #f7ecec;
  border-top: 3px solid var(--t-red);
}

.t-boq-product-table-content,
.t-boq-product-table-content > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.t-boq-product-table-content > span:first-child {
  justify-content: flex-start;
}

.t-boq-product-table-row small {
  color: var(--t-red);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.t-table .t-boq-deployment-table-row td,
.t-table .t-boq-line-group td {
  padding: 9px 16px;
  background: var(--t-gray-50);
  color: var(--t-gray-600);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Platform groups inside one BOQ (firewall group, Anti-Bot & WAF group, …). */
.t-table .t-boq-line-group-row td {
  padding: 11px 16px;
  background: var(--t-gray-50);
  border-top: 2px solid var(--t-border-dark);
}

.t-table .t-boq-line-group-row.is-active td {
  background: #f7ecec;
  border-top-color: var(--t-red);
}

.t-boq-line-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.t-boq-line-group-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.t-table .t-boq-line-group-subtotal td {
  background: var(--t-gray-50);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.t-table .t-boq-line-group-subtotal td:first-child {
  text-align: right;
}

.t-totals-row.t-totals-sub {
  font-size: 0.82rem;
  color: var(--t-gray-600);
  padding-left: 10px;
  border-left: 2px solid var(--t-border);
}

@media (max-width: 800px) {
  .t-boq-summary {
    grid-template-columns: 1fr auto;
  }

  .t-boq-deployment-group > summary span:first-child {
    flex-direction: column;
    gap: 2px;
  }
}

/* Action clusters outside tables (cards, panels) lay out as a wrapping flex row. */
div.t-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
}

/*
 * Inside a table the cell must stay a real table-cell, otherwise the browser wraps it in
 * an anonymous cell and the buttons spill past the table edge. Buttons flow inline and
 * wrap within the column instead.
 */
td.t-table-actions {
  vertical-align: top;
  white-space: normal;
  min-width: 150px;
  max-width: 300px;
}

.t-table-actions .t-btn {
  margin: 0;
  max-width: none;
  white-space: nowrap;
  line-height: 1.25;
  height: auto;
  min-height: 0;
  padding: 7px 11px;
  text-align: center;
}

td.t-table-actions .t-btn,
td.t-table-actions .t-req-note {
  display: inline-flex;
  vertical-align: top;
  margin: 0 4px 5px 0;
}

/* Destructive action stands apart from the safe ones and only fills its own line. */
.t-table-actions .t-btn-delete {
  border: 1px solid #a30f1a;
  background: transparent;
  color: #a30f1a;
}

.t-table-actions .t-btn-delete:hover {
  background: #a30f1a;
  color: #fff;
}

td.t-table-actions .t-btn-delete {
  display: flex;
  width: 100%;
  margin: 3px 0 0;
}

/* Keep the actions column reachable while the rest of a wide table scrolls sideways. */
.t-table-sticky-actions td.t-table-actions,
.t-table-sticky-actions th.t-actions-col {
  position: sticky;
  right: 0;
  z-index: 1;
  border-left: 1px solid var(--t-border);
  background: var(--t-white);
}

.t-table-sticky-actions th.t-actions-col {
  z-index: 2;
  background: var(--t-gray-50);
}

body.t-dark .t-table-sticky-actions td.t-table-actions {
  background: var(--t-ink);
  border-left-color: var(--t-border-dark);
}

body.t-dark .t-table-sticky-actions th.t-actions-col {
  background: #0a0a0a;
  border-left-color: var(--t-border-dark);
}

/* Page-level topic tabs: one focused workspace instead of stacked unrelated cards. */
.t-page-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--t-border);
  background: var(--t-gray-50);
}

.t-page-tab {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--t-gray-600);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.t-page-tab:hover {
  background: var(--t-white);
  color: var(--t-ink);
}

.t-page-tab.is-active {
  border-bottom-color: var(--t-red);
  background: var(--t-white);
  color: var(--t-ink);
}

.t-tab-panel > .t-card:last-child {
  margin-bottom: 0 !important;
}

.t-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.t-panel-head .t-section-title {
  margin: 0;
}

.t-create-action {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 14px;
}

.t-create-action-inline {
  display: inline-flex;
  margin: 0;
}

body.t-modal-open {
  overflow: hidden;
}

.t-form-modal .t-modal-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: 90vh;
  overflow: auto;
}

.t-form-modal-wide .t-modal-dialog {
  width: min(1080px, calc(100% - 32px));
}

.t-form-modal-companion {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--t-border);
}

.t-form-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.t-form-modal-head h2 {
  margin: 2px 0 0;
  font-size: 1.2rem;
}

.t-catalog-search {
  width: min(420px, 100%);
  margin-bottom: 14px;
}

.t-catalog-search .t-label {
  display: block;
  margin-bottom: 5px;
}

.t-catalog-search .t-req-note {
  display: block;
  margin-top: 5px;
}

/* Marks the row that was just saved so the admin can spot it in the reloaded list. */
.t-catalog-row-flash > td {
  animation: t-catalog-row-flash 2.2s ease-out;
}

@keyframes t-catalog-row-flash {
  0%,
  55% {
    background: rgba(0, 122, 204, 0.16);
  }
  100% {
    background: transparent;
  }
}

.t-license-search {
  width: min(360px, 100%);
}

.t-license-search .t-label {
  display: block;
  margin-bottom: 5px;
}

.t-license-groups {
  display: grid;
  gap: 18px;
}

.t-license-group {
  overflow: hidden;
  border: 1px solid var(--t-border);
  background: var(--t-white);
}

.t-license-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--t-border);
  border-left: 4px solid var(--t-red);
  background: var(--t-gray-50);
}

summary.t-license-group-head {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

summary.t-license-group-head::-webkit-details-marker {
  display: none;
}

summary.t-license-group-head::after {
  content: "▾";
  flex: 0 0 auto;
  color: var(--t-gray-600);
  font-size: 0.95rem;
  transition: transform 0.16s ease;
}

.t-license-group:not([open]) > summary.t-license-group-head {
  border-bottom-color: transparent;
}

.t-license-group:not([open]) > summary.t-license-group-head::after {
  transform: rotate(-90deg);
}

.t-license-group-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.t-license-group-head p {
  margin: 3px 0 0;
  color: var(--t-gray-600);
  font-size: 0.78rem;
}

.t-license-group-count {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--t-ink);
  color: var(--t-white);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.t-license-group.is-expired .t-license-group-head {
  border-left-color: #9a6700;
  background: #fff9e8;
}

.t-license-empty {
  padding: 18px 16px;
  color: var(--t-gray-600);
  font-size: 0.85rem;
}

.t-license-no-results {
  padding: 26px 18px;
  border: 1px dashed var(--t-border);
  color: var(--t-gray-600);
  text-align: center;
}

.t-secret-value {
  font-family: var(--t-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .t-page-tab {
    padding: 9px 12px;
  }

  .t-form-modal .t-modal-dialog {
    width: calc(100% - 20px);
  }
}

.t-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.t-modal.hidden {
  display: none !important;
}

.t-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 20, 0.45);
}

.t-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
}

.t-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.t-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--t-border);
  background: var(--t-gray-50);
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
}

.t-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--t-red);
}

.t-expiry-box {
  padding: 12px 14px;
  border: 1px solid var(--t-border);
  background: var(--t-gray-50);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

.t-license-json {
  margin: 0;
  padding: 14px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--t-border);
  background: #0f1115;
  color: #e8eaed;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.t-btn-sm {
  padding: 6px 10px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.t-company-panel {
  border: 1px solid var(--t-border);
  margin-bottom: 20px;
  padding: 20px;
  background: var(--t-gray-50);
}

.t-company-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.t-company-panel h3 {
  margin: 6px 0;
  font-size: 1.15rem;
  color: var(--t-ink);
}

.t-company-panel p {
  margin: 4px 0;
  color: var(--t-gray-600);
  font-size: 0.9rem;
}

.t-company-code {
  font-family: var(--t-mono);
  color: var(--t-red);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.t-company-admin-line {
  margin-top: 8px !important;
}

.t-status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.t-status-pill.active {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.t-status-pill.inactive {
  color: var(--t-red);
  background: var(--t-red-soft);
}

.t-status-pill.pending {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
}

.t-status-pill.approved {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.t-status-pill.rejected {
  color: var(--t-red);
  background: var(--t-red-soft);
}

.t-status-pill.neutral {
  color: var(--t-gray-600);
  background: var(--t-gray-100, rgba(0, 0, 0, 0.06));
}

.t-status-pill.revoked,
.t-status-pill.revoke-pending {
  color: #6b21a8;
  background: rgba(147, 51, 234, 0.12);
}

.t-req-note {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--t-gray-600);
}

.t-dialog {
  border: 1px solid var(--t-border);
  border-radius: 12px;
  background: var(--t-white);
  color: var(--t-ink);
  padding: 24px;
  max-width: 560px;
  width: calc(100% - 32px);
}

.t-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.t-dialog h3 {
  margin: 0 0 20px;
  color: var(--t-ink);
}

.t-guide {
  line-height: 1.75;
  color: var(--t-gray-600);
}

.t-guide h2 {
  margin: 32px 0 12px;
  font-size: 1.15rem;
  color: var(--t-ink);
}

.t-guide h2:first-child {
  margin-top: 0;
}

.t-guide h3 {
  margin: 20px 0 8px;
  font-size: 1rem;
  color: var(--t-ink);
}

.t-guide p {
  margin: 0 0 12px;
}

.t-guide ul,
.t-guide ol {
  margin: 0 0 16px;
  padding-left: 1.35rem;
}

.t-guide li {
  margin-bottom: 6px;
}

.t-guide a {
  color: var(--t-red);
  font-weight: 600;
}

.t-guide code,
.t-guide .t-guide-path {
  font-family: var(--t-mono);
  font-size: 0.85em;
  background: var(--t-gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--t-ink);
}

.t-guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 0.9rem;
}

.t-guide-table th,
.t-guide-table td {
  border: 1px solid var(--t-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.t-guide-table th {
  background: var(--t-gray-50);
  color: var(--t-ink);
  font-weight: 700;
}

.t-guide-callout {
  border-left: 3px solid var(--t-red);
  background: var(--t-red-soft);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
}

.t-guide-toc {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
}

.t-guide-toc a {
  text-decoration: none;
}

.t-guide-toc a:hover {
  text-decoration: underline;
}

.t-guide-table-wrap {
  overflow-x: auto;
  margin: 12px 0 20px;
}

.t-guide-table-wrap .t-guide-table {
  margin: 0;
  min-width: 720px;
}

.t-download-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--t-gray-100);
  border: 1px solid var(--t-border);
  overflow: hidden;
}

.t-download-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--t-red), #ff6b6b);
  transition: width 0.15s ease;
}

.t-guide-table td code {
  white-space: nowrap;
}

/* Tag multi-select (search, pick, chip) — see assets/js/tag-multiselect.js */
.t-ms {
  position: relative;
}

.t-ms-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 8px 10px;
  background: var(--t-white);
  border: 1px solid var(--t-gray-200);
  border-radius: var(--t-radius);
  cursor: text;
  transition: border-color 0.15s;
}

body.t-dark .t-ms-control {
  background: #0a0a0a;
  border-color: var(--t-border-dark);
}

.t-ms.is-open .t-ms-control,
.t-ms-control:focus-within {
  border-color: var(--t-red);
}

.t-ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 6px 5px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--t-ink);
  background: var(--t-gray-100);
  border: 1px solid var(--t-border);
  border-radius: 999px;
}

body.t-dark .t-ms-chip {
  color: var(--t-white);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--t-border-dark);
}

.t-ms-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-ms-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--t-gray-500);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.t-ms-chip-remove:hover {
  color: var(--t-white);
  background: var(--t-red);
}

.t-ms-search {
  flex: 1 1 120px;
  min-width: 120px;
  padding: 6px 2px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--t-ink);
  background: transparent;
  border: none;
}

body.t-dark .t-ms-search {
  color: var(--t-white);
}

.t-ms-search:focus {
  outline: none;
}

.t-ms-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  color: var(--t-gray-500);
  background: transparent;
  border: none;
  cursor: pointer;
}

.t-ms-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--t-white);
  border: 1px solid var(--t-gray-200);
  border-radius: var(--t-radius);
  box-shadow: var(--t-shadow);
}

body.t-dark .t-ms-menu {
  background: #111111;
  border-color: var(--t-border-dark);
}

.t-ms-menu[hidden] {
  display: none;
}

.t-ms-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--t-ink);
  cursor: pointer;
}

body.t-dark .t-ms-option {
  color: var(--t-white);
}

.t-ms-option.is-active {
  background: var(--t-red-soft);
}

.t-ms-option.is-selected {
  font-weight: 600;
}

.t-ms-option.is-selected::after {
  content: "✓";
  color: var(--t-red);
  font-weight: 700;
}

.t-ms-empty {
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--t-gray-500);
}

.t-ms-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--t-gray-500);
}

.t-ms-action {
  padding: 0;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--t-red);
  background: none;
  border: none;
  cursor: pointer;
}

.t-ms-action:disabled {
  color: var(--t-gray-400);
  cursor: default;
}
