/* Eye3D components — every color, size and radius comes from tokens.css, so Light and Dark switch with data-theme. */
body { margin: 0; font-family: var(--font-roboto); background: var(--surface); color: var(--ink); }
.e3-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; padding: var(--space-4); }
.e3-row--top { align-items: flex-start; }
.e3-stack { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); }

/* Focus ring: 2px solid brand-blue, offset 2px */
.e3-btn:focus-visible, .e3-input:focus-visible, .e3-check__box:focus-visible, .e3-switch__track:focus-visible, .e3-tab:focus-visible, .e3-alert__close:focus-visible {
  outline: 2px solid var(--brand-blue); outline-offset: 2px;
}

/* Button */
.e3-btn { font-family: inherit; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; }
.e3-btn--sm { height: 32px; padding: 0 12px; border-radius: var(--radius-sm); }
.e3-btn--primary { background: var(--brand-blue); color: var(--on-brand); }
.e3-btn--primary:hover { background: var(--brand-blue-deep); }
.e3-btn--secondary { background: var(--surface); color: var(--brand-blue); border-color: var(--brand-blue); }
.e3-btn--secondary:hover { background: var(--surface-alt); }
.e3-btn--ghost { background: transparent; color: var(--brand-blue); }
.e3-btn--ghost:hover { background: var(--surface-alt); }
.e3-btn--danger { background: var(--danger); color: var(--on-brand); }
.e3-btn:disabled { background: var(--surface-alt); color: var(--ink-muted); border-color: var(--border); cursor: not-allowed; }

/* TextField */
.e3-field { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.e3-field__label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); }
.e3-input { font: inherit; font-size: 16px; line-height: 24px; height: 40px; box-sizing: border-box; padding: 0 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.e3-input::placeholder { color: var(--ink-muted); }
.e3-input:hover { border-color: var(--ink-muted); }
.e3-input:focus-visible { border-color: var(--brand-blue); }
.e3-field.is-error .e3-input { border-color: var(--danger); }
.e3-field__hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.e3-field__error { font-size: 14px; line-height: 20px; color: var(--danger); }
.e3-field.is-disabled .e3-input { background: var(--surface-alt); color: var(--ink-muted); border-color: var(--border); }

/* Checkbox */
.e3-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 16px; line-height: 24px; color: var(--ink); cursor: pointer; }
.e3-check__box { appearance: none; -webkit-appearance: none; margin: 0; width: 18px; height: 18px; position: relative; flex: none;
  border: 2px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.e3-check__box:checked { background: var(--brand-blue); border-color: var(--brand-blue); }
.e3-check__box:checked::after { content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px;
  border: solid var(--on-brand); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.e3-check.is-disabled { color: var(--ink-muted); cursor: not-allowed; }
.e3-check.is-disabled .e3-check__box { border-color: var(--border); background: var(--surface-alt); }

/* Switch */
.e3-switch { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 16px; line-height: 24px; color: var(--ink); }
.e3-switch__track { width: 44px; height: 24px; padding: 0; border-radius: 12px; position: relative; cursor: pointer;
  background: var(--surface-alt); border: 2px solid var(--border-strong); box-sizing: border-box; }
.e3-switch__thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--border-strong); transition: left .15s; }
.e3-switch__track[aria-checked="true"] { background: var(--brand-blue); border-color: var(--brand-blue); }
.e3-switch__track[aria-checked="true"] .e3-switch__thumb { left: 22px; background: var(--on-brand); }
.e3-switch.is-disabled { color: var(--ink-muted); }
.e3-switch__track:disabled { opacity: .5; cursor: not-allowed; }

/* Badge */
.e3-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-sm);
  font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; }
.e3-badge--neutral { background: var(--surface-alt); color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--border); }
.e3-badge--brand { background: var(--brand-panel); color: var(--on-panel); }
.e3-badge--info { background: var(--info-bg); color: var(--info); }
.e3-badge--success { background: var(--success-bg); color: var(--success); }
.e3-badge--warning { background: var(--warning-bg); color: var(--warning); }
.e3-badge--danger { background: var(--danger-bg); color: var(--danger); }

/* Alert */
.e3-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px var(--space-4); border-radius: var(--radius-md); border: 1px solid; color: var(--ink); }
.e3-alert__icon { flex: none; margin-top: 2px; }
.e3-alert__body { flex: 1; }
.e3-alert__title { font-size: 16px; line-height: 24px; font-weight: 500; }
.e3-alert__text { font-size: 14px; line-height: 20px; }
.e3-alert__close { background: none; border: 0; color: var(--ink-muted); font-size: 20px; line-height: 24px; cursor: pointer; padding: 0 4px; border-radius: var(--radius-sm); }
.e3-alert--info { background: var(--info-bg); border-color: var(--info); } .e3-alert--info .e3-alert__icon, .e3-alert--info .e3-alert__title { color: var(--info); }
.e3-alert--success { background: var(--success-bg); border-color: var(--success); } .e3-alert--success .e3-alert__icon, .e3-alert--success .e3-alert__title { color: var(--success); }
.e3-alert--warning { background: var(--warning-bg); border-color: var(--warning); } .e3-alert--warning .e3-alert__icon, .e3-alert--warning .e3-alert__title { color: var(--warning); }
.e3-alert--danger { background: var(--danger-bg); border-color: var(--danger); } .e3-alert--danger .e3-alert__icon, .e3-alert--danger .e3-alert__title { color: var(--danger); }

/* Tabs */
.e3-tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--border); }
.e3-tab { font: inherit; font-size: 14px; line-height: 20px; font-weight: 500; background: none; border: 0; cursor: pointer;
  padding: 10px 12px; margin-bottom: -1px; color: var(--ink-muted); border-bottom: 2px solid transparent; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.e3-tab:hover { color: var(--ink); background: var(--surface-alt); }
.e3-tab.is-active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }
.e3-tab:disabled { opacity: .5; cursor: not-allowed; }

/* Card */
.e3-card { padding: var(--space-6); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); color: var(--ink); max-width: 360px; box-sizing: border-box; }
.e3-card--muted { background: var(--surface-alt); }
.e3-card--brand { background: var(--brand-panel); border-color: var(--brand-panel); color: var(--on-panel); }
.e3-card__eyebrow { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ink-muted); margin-bottom: var(--space-2); }
.e3-card--brand .e3-card__eyebrow { color: var(--brand-silver); }
.e3-card__title { margin: 0 0 var(--space-2); font-size: 18px; line-height: 26px; font-weight: 500; }
.e3-card__body { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.e3-card--brand .e3-card__body { color: var(--on-panel); }
.e3-card__footer { margin-top: var(--space-4); display: flex; gap: var(--space-2); }

/* Table — static markup and DataTables 2.x/3.x (load only DataTables' JS, not its stylesheet) */
.e3-table-wrap { font-family: var(--font-roboto); font-size: 14px; line-height: 20px; color: var(--ink); }
.e3-table-scroll, .e3-table-wrap .dt-layout-table > .dt-layout-cell { overflow-x: auto; }
.e3-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 14px; line-height: 20px; }
.e3-table caption { caption-side: top; text-align: left; font-size: 18px; line-height: 26px; font-weight: 500; padding-bottom: var(--space-2); }
.e3-table thead th { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; text-align: left;
  color: var(--ink-muted); background: var(--surface-alt); padding: 12px var(--space-4); border-bottom: 1px solid var(--border); white-space: nowrap; }
.e3-table thead tr:first-child th:first-child { border-top-left-radius: calc(var(--radius-md) - 1px); }
.e3-table thead tr:first-child th:last-child { border-top-right-radius: calc(var(--radius-md) - 1px); }
.e3-table tbody td { padding: 12px var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.e3-table tbody tr:last-child td { border-bottom: 0; }
.e3-table tfoot th, .e3-table tfoot td { padding: 12px var(--space-4); border-top: 1px solid var(--border); font-weight: 500; text-align: left; }
.e3-table--compact thead th, .e3-table--compact tbody td, .e3-table--compact tfoot th, .e3-table--compact tfoot td { padding: 8px 12px; }
.e3-table tbody tr:hover td { background: var(--surface-alt); }
.e3-table--striped tbody tr:nth-child(even) td { background: var(--surface-alt); }
.e3-table--striped tbody tr:hover td { background: var(--info-bg); }
.e3-table tbody tr.selected td { background: var(--info-bg); }
.e3-table .e3-num, .e3-table .dt-type-numeric, .e3-table .dt-type-date { text-align: right; font-variant-numeric: tabular-nums; }
.e3-table .e3-center, .e3-table .dt-center { text-align: center; }
.e3-table td a { color: var(--brand-blue); }
.e3-table td.dt-empty { text-align: center; color: var(--ink-muted); padding: var(--space-8) var(--space-4); }

/* Sorting (DataTables header markup) */
.e3-table thead th.dt-orderable-asc, .e3-table thead th.dt-orderable-desc { cursor: pointer; user-select: none; }
.e3-table thead th.dt-orderable-asc:hover, .e3-table thead th.dt-orderable-desc:hover { color: var(--ink); }
.e3-table thead th.dt-ordering-asc, .e3-table thead th.dt-ordering-desc { color: var(--brand-blue); }
.e3-table thead th:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: -2px; }
.e3-table .dt-column-header { display: flex; align-items: center; gap: 6px; justify-content: flex-start; }
.e3-table th.e3-num .dt-column-header, .e3-table th.dt-type-numeric .dt-column-header, .e3-table th.dt-type-date .dt-column-header { flex-direction: row-reverse; }
.e3-table .dt-column-title { flex: 0 1 auto; }
.e3-table .dt-column-order { position: relative; flex: none; width: 8px; height: 14px; }
.e3-table thead th:not(.dt-orderable-asc):not(.dt-orderable-desc) .dt-column-order { display: none; }
.e3-table thead th.dt-orderable-asc .dt-column-order::before,
.e3-table thead th.dt-orderable-desc .dt-column-order::after { content: ""; position: absolute; left: 0; opacity: .35;
  border-left: 4px solid transparent; border-right: 4px solid transparent; }
.e3-table thead th.dt-orderable-asc .dt-column-order::before { top: 1px; border-bottom: 5px solid currentColor; }
.e3-table thead th.dt-orderable-desc .dt-column-order::after { bottom: 1px; border-top: 5px solid currentColor; }
.e3-table thead th.dt-ordering-asc .dt-column-order::before, .e3-table thead th.dt-ordering-desc .dt-column-order::after { opacity: 1; }

/* DataTables controls: length, search, info, paging, processing */
.e3-table-wrap .dt-container { position: relative; }
.e3-table-wrap .dt-layout-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-4); margin: var(--space-4) 0; }
.e3-table-wrap .dt-layout-row:first-child { margin-top: 0; }
.e3-table-wrap .dt-layout-row:last-child { margin-bottom: 0; }
.e3-table-wrap .dt-layout-cell { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.e3-table-wrap .dt-layout-cell:empty { display: none; }
.e3-table-wrap .dt-layout-start { margin-right: auto; }
.e3-table-wrap .dt-layout-end { margin-left: auto; }
.e3-table-wrap .dt-layout-full { display: block; flex: 1 1 100%; }
.e3-table-wrap .dt-length, .e3-table-wrap .dt-search { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-muted); }
.e3-table-wrap .dt-input { font: inherit; font-size: 14px; height: 36px; box-sizing: border-box; padding: 0 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.e3-table-wrap select.dt-input { padding: 0 8px; }
.e3-table-wrap .dt-search input.dt-input { width: 220px; max-width: 100%; }
.e3-table-wrap .dt-input:hover { border-color: var(--ink-muted); }
.e3-table-wrap .dt-input:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; border-color: var(--brand-blue); }
.e3-table-wrap .dt-info { color: var(--ink-muted); }
.e3-table-wrap .dt-paging nav, .e3-table-wrap .dt-paging { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.e3-table-wrap .dt-paging-button { font: inherit; font-size: 14px; min-width: 36px; height: 36px; padding: 0 10px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; }
.e3-table-wrap .dt-paging-button:hover { background: var(--surface-alt); }
.e3-table-wrap .dt-paging-button.current, .e3-table-wrap .dt-paging-button.current:hover { background: var(--brand-blue); color: var(--on-brand); font-weight: 500; }
.e3-table-wrap .dt-paging-button.disabled, .e3-table-wrap .dt-paging-button.disabled:hover { background: transparent; color: var(--ink-muted); opacity: .5; cursor: default; }
.e3-table-wrap .dt-paging-button:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.e3-table-wrap .dt-paging .ellipsis { padding: 0 4px; color: var(--ink-muted); }
.e3-table-wrap .dt-processing { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  background: var(--surface); color: var(--ink-muted); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px var(--space-4); }
.e3-table-wrap .dt-processing > div:last-child { display: none; }
