/* =====================================================================
   LPPM ISTN — Reusable Components
   ===================================================================== */

/* --------------------------------------------------------------- Buttons */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.btn:hover {
  text-decoration: none;
  filter: brightness(0.985);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.btn-primary {
  --btn-bg: var(--navy-900);
  --btn-fg: #ffffff;
  --btn-bd: var(--navy-900);
  box-shadow: 0 1px 2px rgba(10, 35, 64, 0.22);
}

.btn-primary:hover {
  --btn-bg: var(--navy-800);
  --btn-bd: var(--navy-800);
  filter: none;
}

.btn-secondary {
  --btn-bg: var(--royal-600);
  --btn-fg: #ffffff;
  --btn-bd: var(--royal-600);
}

.btn-secondary:hover {
  --btn-bg: var(--royal-700);
  --btn-bd: var(--royal-700);
  filter: none;
}

.btn-accent {
  --btn-bg: var(--gold-500);
  --btn-fg: var(--navy-950);
  --btn-bd: var(--gold-600);
  font-weight: 700;
}

.btn-accent:hover {
  --btn-bg: var(--gold-300);
  filter: none;
}

.btn-outline {
  --btn-bg: transparent;
  --btn-fg: var(--text-soft);
  --btn-bd: var(--border-strong);
}

.btn-outline:hover {
  --btn-bg: var(--surface-3);
  --btn-fg: var(--navy-900);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-soft);
  --btn-bd: transparent;
}

.btn-ghost:hover {
  --btn-bg: var(--surface-3);
  --btn-fg: var(--navy-900);
}

.btn-danger {
  --btn-bg: var(--danger);
  --btn-fg: #ffffff;
  --btn-bd: var(--danger);
}

.btn-danger:hover {
  --btn-bg: #92201a;
  --btn-bd: #92201a;
  filter: none;
}

.btn-danger-soft {
  --btn-bg: var(--danger-bg);
  --btn-fg: var(--danger);
  --btn-bd: var(--danger-border);
}

.btn-success-soft {
  --btn-bg: var(--success-bg);
  --btn-fg: var(--success);
  --btn-bd: var(--success-border);
}

.btn-sm {
  height: 28px;
  padding: 0 9px;
  font-size: 11.5px;
  gap: 5px;
}

.btn-sm svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.btn-xs {
  height: 24px;
  padding: 0 7px;
  font-size: 10.5px;
  border-radius: var(--radius-xs);
  gap: 4px;
}

.btn-lg {
  height: 40px;
  padding: 0 18px;
  font-size: var(--fs-md);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 30px;
  padding: 0;
  height: 30px;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.btn-group .btn {
  border: 0;
  border-radius: 0;
  height: 30px;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
}

.btn-group .btn:last-child {
  border-right: 0;
}

.btn-group .btn.is-active {
  background: var(--royal-50);
  color: var(--royal-700);
  font-weight: 700;
}

/* ----------------------------------------------------------------- Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.card-pad {
  padding: var(--sp-5);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 14px var(--sp-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.card-header h3,
.card-header h4 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--navy-900);
  margin: 0;
}

.card-header .sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 2px;
}

.card-body {
  padding: var(--sp-5);
}

.card-body-tight {
  padding: var(--sp-3) var(--sp-4);
}

.card-footer {
  padding: 12px var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.card.is-flush .card-body {
  padding: 0;
}

.card-hover {
  transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t-fast);
}

.card-hover:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ----------------------------------------------------------------- Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.55;
  border: 1px solid transparent;
  white-space: nowrap;
  max-width: 100%;
}

.badge .bdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 5px;
}

.badge-neutral { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-border); }
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge-gold { background: var(--gold-100); color: #74560a; border-color: #f0dfa4; }
.badge-navy { background: var(--navy-900); color: #ffffff; border-color: var(--navy-900); }
.badge-outline { background: transparent; color: var(--text-soft); border-color: var(--border-strong); }
.badge-soft { background: var(--surface-3); color: var(--text-soft); border-color: var(--border); }

.badge-sm {
  font-size: 9.5px;
  padding: 1px 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  line-height: 1;
  font-size: 13px;
}

.chip.is-active {
  background: var(--royal-50);
  border-color: var(--info-border);
  color: var(--royal-700);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------------------------------------------------------------- Alerts */
.alert {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-soft);
  align-items: flex-start;
}

.alert svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
}

.alert strong {
  color: var(--text);
}

.alert-info { background: var(--info-bg); border-color: var(--info-border); color: #1c3f7d; }
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: #0d5d43; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: #7c4708; }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-border); color: #7f1a15; }
.alert-neutral { background: var(--surface-3); border-color: var(--border); }

.alert-title {
  font-weight: 700;
  margin-bottom: 2px;
  color: inherit;
}

/* ----------------------------------------------------------------- Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field.is-span-2 {
  grid-column: span 2;
}

.field.is-span-3 {
  grid-column: span 3;
}

.field.is-span-4 {
  grid-column: span 4;
}

.field label,
.field-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

.field .req {
  color: var(--danger);
  margin-left: 2px;
}

.field .hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.field .err {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
  display: none;
}

.field.has-error .err {
  display: block;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
  background: #fffafa;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b8c4d4;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--royal-500);
  box-shadow: 0 0 0 3px var(--royal-100);
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, #7b8798 50%),
    linear-gradient(135deg, #7b8798 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select-sm,
.input-sm {
  min-height: 30px;
  font-size: var(--fs-sm);
  padding: 4px 8px;
}

.select-sm {
  padding-right: 26px;
  background-position: calc(100% - 13px) 13px, calc(100% - 8px) 13px;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .addon {
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-3);
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-soft);
  line-height: 1.45;
  cursor: pointer;
}

.check input[type="checkbox"],
.check input[type="radio"] {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 1px 0 0;
  accent-color: var(--royal-600);
  cursor: pointer;
}

.radio-cards {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.radio-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
  background: var(--surface);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.radio-card:hover {
  border-color: var(--royal-500);
}

.radio-card input {
  margin-top: 2px;
  accent-color: var(--royal-600);
}

.radio-card .rc-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.radio-card .rc-sub {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.35;
}

.radio-card:has(input:checked) {
  border-color: var(--royal-600);
  background: var(--royal-50);
  box-shadow: 0 0 0 2px var(--royal-100);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: var(--sp-4);
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.form-actions.is-split {
  justify-content: space-between;
}

/* -------------------------------------------------------------- Filter bar */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--sp-4);
}

.filter-bar .f-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 132px;
}

.filter-bar .f-item.is-grow {
  flex: 1 1 220px;
  min-width: 180px;
}

.filter-bar .f-item > span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-bar .f-item .input,
.filter-bar .f-item .select {
  min-height: 32px;
  font-size: var(--fs-sm);
}

.filter-bar .f-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}

.search-input {
  position: relative;
  flex: 1 1 240px;
  min-width: 190px;
}

.search-input input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  background: var(--surface);
}

.search-input input:focus {
  outline: none;
  border-color: var(--royal-500);
  box-shadow: 0 0 0 3px var(--royal-100);
}

.search-input svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

/* ------------------------------------------------------------------ Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
  min-width: 680px;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.table thead th.is-sortable {
  cursor: pointer;
  user-select: none;
}

.table thead th.is-sortable:hover {
  color: var(--navy-900);
  background: var(--surface-3);
}

.table thead th .sort-ind {
  display: inline-flex;
  flex-direction: column;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 0.5;
  font-size: 8px;
  color: var(--muted-2);
}

.table thead th.is-sorted .sort-ind {
  color: var(--royal-600);
}

.table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
  color: var(--text-soft);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: #f9fbfe;
}

.table tbody tr.is-clickable {
  cursor: pointer;
}

.table tbody tr.is-clickable:hover td {
  background: var(--royal-50);
}

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

.table td.center,
.table th.center {
  text-align: center;
}

.table .t-title {
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.table .t-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.table .t-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.table .t-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.table-compact tbody td {
  padding: 7px 10px;
}

.table-compact thead th {
  padding: 7px 10px;
}

.table-striped tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.table tfoot td {
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text);
  font-size: var(--fs-sm);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.pagination .pages {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pagination .page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.pagination .page-btn:hover:not([disabled]) {
  border-color: var(--royal-500);
  color: var(--royal-700);
  background: var(--royal-50);
}

.pagination .page-btn.is-active {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #ffffff;
}

.pagination .page-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Empty state */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  gap: 8px;
  color: var(--muted);
}

.empty .e-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted-2);
  margin-bottom: 4px;
}

.empty .e-ico svg {
  width: 22px;
  height: 22px;
}

.empty .e-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-soft);
}

.empty .e-sub {
  font-size: var(--fs-sm);
  max-width: 44ch;
  line-height: 1.5;
}

/* ------------------------------------------------------------------- Tabs */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  padding: 9px 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.tab:hover {
  color: var(--navy-900);
}

.tab.is-active {
  color: var(--navy-900);
  border-bottom-color: var(--gold-500);
  font-weight: 700;
}

.tab .tcount {
  margin-left: 5px;
  font-size: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0 5px;
  border-radius: 8px;
}

.tab.is-active .tcount {
  background: var(--gold-100);
  border-color: #f0dfa4;
  color: var(--gold-700);
}

.tab-panel {
  padding-top: var(--sp-5);
}

.tab-panel[hidden] {
  display: none;
}

/* Pill tabs */
.pill-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pill-tab {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
}

.pill-tab.is-active {
  background: var(--surface);
  color: var(--navy-900);
  box-shadow: var(--shadow-xs);
}

/* ------------------------------------------------------------------ Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px 24px;
  overflow-y: auto;
  animation: fadeIn var(--t-fast) var(--ease);
}

.modal {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalIn var(--t) var(--ease);
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.modal.is-lg { max-width: 860px; }
.modal.is-xl { max-width: 1080px; }
.modal.is-sm { max-width: 460px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--navy-900);
  margin: 0;
}

.modal-head .m-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 2px;
}

.modal-body {
  padding: 18px 20px;
}

.modal-body.is-tight {
  padding: 0;
}

.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  flex: 0 0 30px;
}

.modal-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ------------------------------------------------------------------ Toast */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(400px, calc(100vw - 36px));
}

.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  background: var(--navy-900);
  color: #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-sm);
  line-height: 1.45;
  animation: toastIn var(--t) var(--ease);
  border-left: 3px solid var(--gold-500);
}

.toast.is-success { border-left-color: #34d399; }
.toast.is-danger { border-left-color: #f87171; }
.toast.is-warning { border-left-color: #fbbf24; }
.toast.is-info { border-left-color: #60a5fa; }

.toast .t-ico {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  color: var(--gold-300);
}

.toast.is-success .t-ico { color: #6ee7b7; }
.toast.is-danger .t-ico { color: #fca5a5; }
.toast.is-warning .t-ico { color: #fcd34d; }
.toast.is-info .t-ico { color: #93c5fd; }

.toast .t-body {
  flex: 1 1 auto;
  min-width: 0;
}

.toast .t-title {
  font-weight: 700;
}

.toast .t-msg {
  color: #d7e3f2;
  font-size: 11.5px;
}

.toast .t-close {
  border: 0;
  background: transparent;
  color: #9db2cc;
  padding: 0;
  line-height: 1;
}

.toast .t-close:hover {
  color: #ffffff;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

/* -------------------------------------------------------------- Misc bits */
.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--royal-100);
  color: var(--royal-700);
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  font-size: 12px;
  border: 1px solid rgba(30, 79, 191, 0.12);
}

.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 46px; height: 46px; font-size: 15px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }
.avatar-gold { background: var(--gold-100); color: var(--gold-700); border-color: #f0dfa4; }
.avatar-navy { background: var(--navy-900); color: #ffffff; border-color: var(--navy-900); }
.avatar-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -7px;
  border: 2px solid var(--surface);
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-cell .uc-main {
  min-width: 0;
}

.user-cell .uc-name {
  font-weight: 600;
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-cell .uc-sub {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kv {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr;
  gap: 7px 14px;
  font-size: var(--fs-sm);
}

.kv dt {
  color: var(--muted);
  font-weight: 600;
}

.kv dd {
  color: var(--text);
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.stat-inline {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stat-inline .v {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

.stat-inline .l {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.list-plain li {
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: var(--fs-sm);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: space-between;
}

.list-plain li:last-child {
  border-bottom: 0;
}

.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.tl-item {
  position: relative;
  padding: 0 0 15px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
}

.tl-item.is-done::before {
  background: var(--success);
  border-color: var(--success);
}

.tl-item.is-active::before {
  background: var(--gold-500);
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px var(--gold-100);
}

.tl-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.tl-meta {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.tl-desc {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 3px;
  line-height: 1.45;
}

.tooltip-wrap {
  position: relative;
}

.tooltip-wrap[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-950);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 7px;
  border-radius: 5px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 11px;
  color: var(--muted);
}

.legend .lg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend .sw {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--muted);
  flex: 0 0 9px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title h3 {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--navy-900);
}

.section-title .st-sub {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}

.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.split-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-5);
  align-items: start;
}

.split-main.is-wide-side {
  grid-template-columns: minmax(0, 1fr) 400px;
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.stack-lg > * + * {
  margin-top: var(--sp-5);
}

.hr-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: var(--sp-4) 0;
}

.hr-text::before,
.hr-text::after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1 1 auto;
}

/* Prototype / stage markers */
.stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-3);
  border: 1px dashed var(--border-strong);
  color: var(--muted);
}

.stage-tag.is-next {
  background: #f6f0ff;
  border-color: #ddd0f7;
  color: #6b3fa0;
}

.demo-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--gold-50);
  border: 1px dashed #e8d79b;
  color: #6b5206;
  font-size: 11.5px;
  line-height: 1.45;
}

.demo-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
}
