@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* Tortola Express components. Plain CSS on the design-system tokens
   (tokens.css); hand-written from the HR portal's shadcn/Tailwind
   components so any site can use them. Every class starts with te-. */

.te-root {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.te-root *, .te-root *::before, .te-root *::after { box-sizing: border-box; }
.te-icon { width: var(--icon-sm); height: var(--icon-sm); flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.te-muted { color: var(--muted-foreground); }

/* Button: client/src/components/ui/button.tsx */
.te-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-height); padding: 8px 16px;
  border: 1px solid transparent; border-radius: var(--radius-lg);
  background: transparent; color: var(--foreground);
  font: 500 14px/20px var(--font-sans); white-space: nowrap; text-decoration: none;
  cursor: pointer; transition: background-color .15s, filter .15s, color .15s;
}
.te-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.te-btn:disabled, .te-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.te-btn .te-icon { width: var(--icon-sm); height: var(--icon-sm); }
.te-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); font-weight: 600; }
.te-btn--primary:hover { filter: brightness(.9); }
.te-btn--destructive { background: var(--destructive); border-color: var(--destructive); color: var(--destructive-foreground); font-weight: 600; box-shadow: var(--shadow-xs); }
.te-btn--destructive:hover { filter: brightness(.9); }
.te-btn--outline { border-color: var(--button-outline); box-shadow: var(--shadow-xs); }
.te-btn--outline:hover { background: var(--muted); }
.te-btn--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.te-btn--secondary:hover { filter: brightness(.95); }
.te-btn--ghost:hover { background: var(--muted); }
.te-btn--link { color: var(--primary); text-underline-offset: 4px; }
.te-btn--link:hover { text-decoration: underline; }
.te-btn--sm { min-height: var(--control-height-sm); padding: 0 12px; border-radius: var(--radius-md); font-size: 12px; }
.te-btn--lg { min-height: var(--control-height-lg); padding: 0 32px; border-radius: var(--radius-md); }
.te-btn--icon { width: var(--control-height); height: var(--control-height); min-height: 0; padding: 0; }
.te-btn--touch { width: 100%; min-height: var(--touch-height); font-size: 15px; }

/* Status pill: client/src/components/ui/badge.tsx + page status colours */
.te-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border: 1px solid var(--badge-outline); border-radius: var(--radius-full);
  background: var(--background); color: var(--foreground);
  font: 500 12px/16px var(--font-sans); white-space: nowrap;
}
.te-pill__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }
.te-pill--success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.te-pill--warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.te-pill--danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.te-pill--info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.te-pill--neutral { background: var(--secondary); border-color: var(--border); color: var(--secondary-foreground); }
.te-pill--solid { background: var(--primary); border-color: transparent; color: var(--primary-foreground); box-shadow: var(--shadow-xs); }
.te-pill--tiny { padding: 0 6px; font-size: 10px; font-weight: 400; line-height: 16px; }
.te-pill--struck { text-decoration: line-through; }

/* Card: client/src/components/ui/card.tsx */
.te-card { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow-xs); min-width: 0; }
.te-card__header { display: flex; flex-direction: column; gap: 6px; padding: var(--space-6); }
.te-card__header--row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.te-card__title { display: flex; align-items: center; gap: var(--space-2); margin: 0; font: 600 16px/1 var(--font-sans); letter-spacing: -0.025em; }
.te-card__title .te-icon { color: var(--muted-foreground); }
.te-card__desc { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.te-card__content { padding: 0 var(--space-6) var(--space-6); }
.te-card__footer { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-6) var(--space-6); }
.te-card--compact .te-card__header { padding: var(--space-4) var(--space-4) 4px; }
.te-card--compact .te-card__content { padding: 0 var(--space-4) var(--space-4); }

/* Stat card: client/src/pages/dashboard.tsx */
.te-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.te-stat { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.te-stat__icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-lg); background: var(--accent); color: var(--accent-foreground); }
.te-stat__icon .te-icon { width: var(--icon-nav); height: var(--icon-nav); }
.te-stat__icon--warning { background: var(--warning-bg); color: var(--warning-text); }
.te-stat__body { min-width: 0; flex: 1; }
.te-stat__figure { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.te-stat__value { font: 600 20px/1.25 var(--font-sans); font-variant-numeric: tabular-nums; }
.te-stat__unit { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.te-stat__label { margin: 0; font-size: 12px; line-height: 1.375; color: var(--muted-foreground); }
.te-stat__note--good { color: var(--success-text); }
.te-stat__note--bad { color: var(--danger-text); font-weight: 500; }
.te-stat__note--attention { color: var(--warning-text); font-weight: 500; }
@media (max-width: 639px) {
  .te-stat-grid { gap: var(--space-2); }
  .te-stat { padding: var(--space-3); }
  .te-stat__icon { display: none; }
  .te-stat__label { font-size: 11px; }
}

/* Form fields: input.tsx, label.tsx, select.tsx, textarea.tsx, switch.tsx, form.tsx */
.te-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.te-label { font: 500 14px/1 var(--font-sans); color: var(--foreground); }
.te-field--error .te-label { color: var(--destructive); }
.te-input, .te-select, .te-textarea {
  display: flex; width: 100%; height: var(--control-height); padding: 4px 12px;
  border: 1px solid var(--input); border-radius: var(--radius-md);
  background: transparent; color: var(--foreground); box-shadow: var(--shadow-sm);
  font: 400 14px/20px var(--font-sans);
}
.te-input::placeholder, .te-textarea::placeholder { color: var(--muted-foreground); }
.te-input:focus-visible, .te-select:focus-visible, .te-textarea:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--ring); }
.te-input:disabled, .te-select:disabled, .te-textarea:disabled { opacity: .5; cursor: not-allowed; }
.te-select { align-items: center; justify-content: space-between; padding: 8px 12px; text-align: left; cursor: pointer; }
.te-select .te-icon { opacity: .5; }
.te-select--placeholder { color: var(--muted-foreground); }
.te-textarea { height: auto; min-height: 60px; padding: 8px 12px; resize: vertical; }
.te-helper { margin: 0; font-size: 12.8px; line-height: 1.4; color: var(--muted-foreground); }
.te-error { margin: 0; font-size: 12.8px; line-height: 1.4; font-weight: 500; color: var(--destructive); }
.te-required { color: var(--destructive); }
.te-switch { position: relative; display: inline-flex; align-items: center; width: 36px; height: 20px; flex-shrink: 0; padding: 0; border: 2px solid transparent; border-radius: var(--radius-full); background: var(--input); box-shadow: var(--shadow-sm); cursor: pointer; transition: background-color .15s; }
.te-switch::after { content: ""; display: block; width: 16px; height: 16px; border-radius: var(--radius-full); background: var(--background); box-shadow: var(--shadow-lg); transition: transform .15s; }
.te-switch[aria-checked="true"] { background: var(--primary); }
.te-switch[aria-checked="true"]::after { transform: translateX(16px); }
.te-switch:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.te-check { display: grid; place-content: center; width: 16px; height: 16px; flex-shrink: 0; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: transparent; color: var(--primary-foreground); }
.te-check[aria-checked="true"] { background: var(--primary); }
.te-check .te-icon { width: 14px; height: 14px; stroke-width: 3; }
.te-inline { display: flex; align-items: center; gap: var(--space-2); }
@media (max-width: 767px) { .te-input, .te-textarea { font-size: 16px; } }

/* Tabs: client/src/components/ui/tabs.tsx */
.te-tabs { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0; min-height: var(--control-height); padding: var(--space-1); border-radius: var(--radius-lg); background: var(--muted); color: var(--muted-foreground); }
.te-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 12px; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; font: 500 14px/20px var(--font-sans); white-space: nowrap; cursor: pointer; transition: all .15s; }
.te-tab[aria-selected="true"] { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm); }
.te-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.te-tab .te-icon { width: var(--icon-sm); height: var(--icon-sm); }
@media (max-width: 639px) {
  .te-tabs { display: flex; }
  .te-tab { flex: 1 1 auto; padding: 4px 8px; white-space: normal; }
  .te-tab .te-icon { display: none; }
}

/* Table: client/src/components/ui/table.tsx */
.te-table-wrap { position: relative; width: 100%; overflow-x: auto; }
.te-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; caption-side: bottom; }
.te-table thead th { background: color-mix(in srgb, var(--muted) 60%, var(--card)); }
.te-table tr { border-bottom: 1px solid var(--border); transition: background-color .15s; }
.te-table tbody tr:last-child { border-bottom: 0; }
.te-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.te-table th { height: 40px; padding: 0 8px; text-align: left; vertical-align: middle; font-size: 13px; font-weight: 600; color: var(--foreground); white-space: nowrap; }
.te-table td { padding: 8px; vertical-align: middle; }
.te-table .te-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.te-table .te-nowrap { white-space: nowrap; }
.te-table caption { margin-top: var(--space-4); font-size: 14px; color: var(--muted-foreground); }
.te-person { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.te-person__name { font-weight: 500; }
.te-person__meta { display: block; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }

/* Data views: client/src/pages/team.tsx. Sortable, filterable tables from
   1024px; record cards below. Same data, same saved view. */
.te-dataview { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; container-type: inline-size; }
.te-dataview__table { display: none; }
.te-dataview__cards { display: flex; flex-direction: column; gap: var(--space-3); }
@media (min-width: 1024px) {
  .te-dataview__table { display: block; }
  .te-dataview__cards { display: none; }
}
.te-dataview--table .te-dataview__table { display: block; }
.te-dataview--table .te-dataview__cards { display: none; }
.te-dataview--cards .te-dataview__table { display: none; }
.te-dataview--cards .te-dataview__cards { display: flex; }

.te-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.te-toolbar__end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-left: auto; }
.te-search { position: relative; flex: 1 1 220px; max-width: 320px; }
.te-search > .te-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.te-search .te-input { padding-left: 34px; }
.te-view-state { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.te-view-state .te-icon { width: 14px; height: 14px; color: var(--success-text); }
.te-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.te-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 3px 1px 10px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--accent); color: var(--accent-foreground); font: 500 12px/20px var(--font-sans); white-space: nowrap; }
.te-chip__x { display: inline-flex; padding: 2px; border: 0; border-radius: var(--radius-full); background: none; color: inherit; cursor: pointer; }
.te-chip__x .te-icon { width: 12px; height: 12px; }
.te-chip__x:hover { background: color-mix(in srgb, var(--accent-foreground) 12%, transparent); }
.te-chip__x:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Header cells: a sort button and a filter button side by side */
.te-table--views th { position: relative; }
.te-th { display: flex; align-items: center; gap: var(--space-2); }
.te-table .te-num .te-th { justify-content: flex-end; }
.te-sort { display: inline-flex; align-items: center; gap: 4px; margin: 0 -4px; padding: 2px 4px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; transition: background-color .15s; }
.te-sort:hover { background: var(--muted); }
.te-sort .te-icon { width: var(--icon-sm); height: var(--icon-sm); opacity: .5; }
[aria-sort="ascending"] .te-sort .te-icon, [aria-sort="descending"] .te-sort .te-icon { opacity: 1; }
.te-th-filter { display: inline-flex; align-items: center; justify-content: center; padding: 4px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted-foreground); cursor: pointer; transition: background-color .15s, color .15s; }
.te-th-filter .te-icon { width: 14px; height: 14px; }
.te-th-filter:hover { background: var(--muted); color: var(--foreground); }
.te-th-filter.is-active { background: var(--accent); color: var(--primary); }
.te-sort:focus-visible, .te-th-filter:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Menus and popovers: dropdown-menu.tsx, popover.tsx */
.te-popover-anchor { position: relative; }
.te-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; gap: 2px; min-width: 192px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-lg); font: 400 14px/20px var(--font-sans); text-align: left; white-space: normal; }
.te-menu--end { left: auto; right: 0; }
.te-menu--filter { width: 224px; padding: var(--space-3); gap: var(--space-3); }
.te-menu__title { font-size: 14px; font-weight: 500; }
.te-menu__label { padding: 6px 8px; font-size: 14px; font-weight: 600; }
.te-menu__row { display: flex; gap: var(--space-2); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.te-menu__row .te-btn { min-height: 28px; padding: 0 8px; font-size: 12px; }
.te-menu__options { display: flex; flex-direction: column; gap: 2px; max-height: 192px; overflow-y: auto; }
.te-menu__item { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.te-menu--filter .te-menu__item { padding: 6px; }
.te-menu__item:hover, .te-menu__item:focus-visible { outline: none; background: var(--accent); color: var(--accent-foreground); }
.te-menu__item[aria-disabled="true"] { opacity: .5; cursor: default; }
.te-menu__item[aria-disabled="true"]:hover { background: none; color: inherit; }
.te-menu__count { margin-left: auto; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.te-menu__sep { height: 1px; margin: 4px -4px; background: var(--muted); }
.te-menu__foot { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 4px; }
.te-menu .te-input { height: 32px; }
.te-check[aria-checked="false"] .te-icon { visibility: hidden; }

/* Table chrome */
.te-table-wrap--scroll { max-height: min(70vh, 720px); overflow: auto; }
.te-table--sticky thead th { position: sticky; top: 0; z-index: 2; }
.te-table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.te-table-empty td { padding: 32px 8px; text-align: center; color: var(--muted-foreground); }
.te-row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.te-record-name { display: flex; align-items: center; gap: var(--space-3); min-width: 0; font-weight: 500; white-space: nowrap; }
.te-record-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-foreground); }
.te-record-icon .te-icon { width: var(--icon-sm); height: var(--icon-sm); }
.te-card > .te-dataview__table, .te-card > .te-table-wrap { border-radius: inherit; }
.te-card .te-table thead tr:first-child th:first-child { border-top-left-radius: calc(var(--radius-xl) - 1px); }
.te-card .te-table thead tr:first-child th:last-child { border-top-right-radius: calc(var(--radius-xl) - 1px); }

/* Record cards: the same records below 1024px */
.te-record-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
@container (min-width: 640px) { .te-record-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.te-record { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.te-record__head { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; }
.te-record__head .te-record-icon { width: 36px; height: 36px; border-radius: var(--radius-lg); }
.te-record__who { min-width: 0; flex: 1; }
.te-record__title { margin: 0; font: 600 15px/1.35 var(--font-sans); overflow-wrap: anywhere; }
.te-record__meta { margin: 2px 0 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.te-record__head .te-pill { flex-shrink: 0; }
.te-record__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); margin: 0; }
.te-record__fields dt { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.te-record__fields dd { margin: 2px 0 0; font-size: 14px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.te-record__fields .te-record__key { font: 600 20px/1.25 var(--font-sans); }
.te-record__actions { display: flex; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.te-record__actions .te-btn:first-child { flex: 1; }
.te-sheet { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); border: 1px solid var(--border); border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--background); box-shadow: var(--shadow-lg); }
.te-sheet__grip { width: 40px; height: 4px; margin: 0 auto; border-radius: var(--radius-full); background: var(--border); }

/* Alert, note and banner: client/src/pages/login.tsx, client/src/components/layout.tsx */
.te-alert { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 14px; line-height: 20px; }
.te-alert .te-icon { width: 20px; height: 20px; }
.te-alert__title { margin: 0; font-weight: 600; }
.te-alert__text { margin: 0; }
.te-alert--danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.te-alert--warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.te-alert--info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.te-alert--success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.te-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--warning-border); background: var(--warning-bg); color: var(--warning-text); font-size: 14px; font-weight: 500; }
.te-banner__lead { display: flex; align-items: center; gap: var(--space-2); }

/* Dialog: client/src/components/ui/dialog.tsx */
.te-overlay { display: flex; align-items: center; justify-content: center; padding: var(--space-4); background: var(--overlay); }
.te-dialog { position: relative; display: grid; gap: var(--space-4); width: 100%; max-width: var(--content-dialog); padding: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background); color: var(--foreground); box-shadow: var(--shadow-lg); }
.te-dialog__header { display: flex; flex-direction: column; gap: 6px; padding-right: var(--space-6); }
.te-dialog__title { margin: 0; font: 600 18px/1 var(--font-sans); letter-spacing: -0.025em; }
.te-dialog__desc { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.te-dialog__footer { display: flex; flex-direction: column-reverse; gap: var(--space-2); }
.te-dialog__close { position: absolute; top: var(--space-4); right: var(--space-4); display: flex; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; opacity: .7; cursor: pointer; }
.te-dialog__close:hover { opacity: 1; }
.te-dialog__close:focus-visible { outline: none; opacity: 1; box-shadow: var(--focus-ring); }
.te-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (min-width: 640px) {
  .te-dialog__footer { flex-direction: row; justify-content: flex-end; }
  .te-dialog__title { font-size: 20px; }
}
@media (max-width: 479px) { .te-grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Avatar: client/src/components/ui/avatar.tsx */
.te-avatar { display: inline-flex; align-items: center; justify-content: center; width: var(--control-height-lg); height: var(--control-height-lg); flex-shrink: 0; overflow: hidden; border-radius: var(--radius-full); background: var(--accent); color: var(--accent-foreground); font: 600 14px/1 var(--font-sans); }
.te-avatar--ring { border: 2px solid var(--sidebar-border); }
.te-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.te-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Sidebar: client/src/components/layout.tsx */
.te-sidebar { display: flex; flex-direction: column; width: var(--sidebar-width); height: 100%; border-right: 1px solid var(--sidebar-border); background: var(--sidebar); color: var(--sidebar-foreground); }
.te-sidebar__brand { display: block; padding: var(--space-5) var(--space-5) var(--space-4); text-decoration: none; }
.te-sidebar__logo { display: block; width: 168px; height: auto; }
.te-sidebar__product { margin: 6px 0 0; padding-left: 2px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted-foreground); }
.te-sidebar__nav { display: flex; flex: 1; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); overflow-y: auto; }
.te-nav-item { display: flex; align-items: center; gap: var(--space-3); padding: 10px 12px; border-radius: var(--radius-lg); color: var(--sidebar-foreground); font: 500 15px/1.5 var(--font-sans); text-decoration: none; transition: background-color .15s, color .15s; }
.te-nav-item .te-icon { width: var(--icon-nav); height: var(--icon-nav); }
.te-nav-item:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.te-nav-item[aria-current="page"] { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
.te-nav-item:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--sidebar-ring); }
.te-sidebar__rule { height: 1px; margin: var(--space-2) 0; background: var(--sidebar-border); }
.te-sidebar__foot { padding: var(--space-3); }
.te-sidebar__user { display: flex; align-items: center; gap: var(--space-3); padding-left: 4px; }
.te-sidebar__who { min-width: 0; flex: 1; }
.te-sidebar__name { margin: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-sidebar__email { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-sidebar--collapsed { width: var(--sidebar-width-collapsed); }
.te-sidebar--collapsed .te-sidebar__brand { display: flex; justify-content: center; padding: var(--space-5) var(--space-2); }
.te-sidebar--collapsed .te-sidebar__nav { padding: var(--space-2); }
.te-sidebar--collapsed .te-nav-item { justify-content: center; padding: var(--space-3); }
.te-sidebar--collapsed .te-nav-item .te-icon { width: 20px; height: 20px; }

/* Top bar: client/src/components/layout.tsx */
.te-topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: var(--space-3); height: var(--topbar-height); padding: 0 var(--space-4); border-bottom: 1px solid var(--border); background: var(--background); }
.te-topbar__btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-md); background: none; color: var(--muted-foreground); cursor: pointer; }
.te-topbar__btn:hover { background: var(--muted); color: var(--foreground); }
.te-topbar__btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.te-topbar__btn .te-icon { width: var(--icon-nav); height: var(--icon-nav); }
.te-topbar__rule { width: 1px; height: 20px; flex-shrink: 0; background: var(--border); }
.te-topbar__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.te-topbar__end { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.te-topbar__logo { display: block; height: 24px; width: auto; }
.te-topbar--phone { gap: var(--space-2); padding: 0 var(--space-2); }

/* Page header */
.te-page-head { display: flex; flex-direction: column; gap: 2px; }
.te-page-title { margin: 0; font: 600 20px/28px var(--font-sans); letter-spacing: -0.025em; text-wrap: balance; }
.te-page-sub { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
@media (min-width: 640px) { .te-page-title { font-size: 24px; line-height: 32px; } }

/* Sign-in page and brand panel: client/src/pages/login.tsx */
.te-signin { display: flex; flex-direction: column; min-height: 100%; background: var(--sidebar); }
.te-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-8); padding: var(--space-8) var(--space-6); overflow: hidden; background: var(--brand-panel); color: var(--on-brand); }
.te-brand-panel__logo { position: relative; width: 192px; height: auto; }
.te-brand-panel__chevrons { display: none; align-items: center; }
.te-brand-panel__chevrons img { height: 208px; width: auto; }
.te-brand-panel__chevrons img + img { margin-left: -56px; }
.te-brand-panel__chevrons img:nth-child(1) { opacity: .35; }
.te-brand-panel__chevrons img:nth-child(2) { opacity: .6; }
.te-brand-panel__copy { position: relative; display: flex; flex-direction: column; gap: var(--space-2); max-width: 448px; }
.te-brand-panel__headline { margin: 0; font: 600 24px/1.25 var(--font-sans); text-wrap: balance; }
.te-brand-panel__tagline { margin: 0; font-size: 14px; line-height: 20px; color: var(--on-brand-muted); }
.te-signin__main { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-6); padding: 40px var(--space-4); }
.te-signin__card { display: flex; flex-direction: column; gap: var(--space-5); width: 100%; max-width: var(--content-signin); padding: var(--space-6); }
.te-signin__title { margin: 0; font: 600 24px/32px var(--font-sans); }
.te-signin__lede { margin: 6px 0 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.te-signin__foot { display: flex; align-items: center; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.te-signin__foot .te-icon { width: 14px; height: 14px; }
.te-signin__legal { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); text-align: center; }
@media (min-width: 640px) { .te-signin__card { padding: var(--space-8); } }
@media (min-width: 768px) {
  .te-signin { flex-direction: row; }
  .te-brand-panel { flex: 1; gap: var(--space-12); padding: var(--space-12) 56px; }
  .te-brand-panel__logo { width: 240px; }
  .te-brand-panel__chevrons { display: flex; }
  .te-brand-panel__headline { font-size: 30px; }
  .te-signin__main { padding: 40px var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
  .te-btn, .te-tab, .te-switch, .te-switch::after, .te-nav-item, .te-table tr, .te-sort, .te-th-filter { transition: none; }
}
