/* Everite admin/production shell — square, light shadow, brand red */
:root {
  --ui-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --ui-shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
  --ui-brand: #D10A10;
  --ui-font: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --ui-ink: #0f172a;
  --ui-body: #334155;
  --ui-muted: #64748b;
  --ui-faint: #94a3b8;
  --ui-size-caption: 0.6875rem; /* 11px — table headers, overlines */
  --ui-size-label: 0.75rem;     /* 12px — labels, serials, hints */
  --ui-size-small: 0.8125rem;   /* 13px — table body, nav */
  --ui-size-body: 0.875rem;     /* 14px — UI copy, buttons, fields */
  --ui-size-title: 1rem;        /* 16px — modal titles */
  --ui-size-page: 1.375rem;     /* 22px — page titles */
}

.ui-shell {
  background: #f8fafc;
  font-family: var(--ui-font);
  font-size: var(--ui-size-body);
  font-weight: 400;
  color: var(--ui-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.ui-shell main {
  width: 100%;
  max-width: none;
}
.ui-shell h1 {
  font-size: var(--ui-size-page) !important;
  font-weight: 700 !important;
  color: var(--ui-ink);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.ui-shell .modal-root h3,
.app-confirm-card h3 {
  font-size: var(--ui-size-title) !important;
  font-weight: 600 !important;
  color: var(--ui-ink);
  line-height: 1.35;
}
.ui-shell input,
.ui-shell select,
.ui-shell textarea,
.ui-shell button {
  font-family: inherit;
}
.ui-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.ui-shell select,
.ui-shell textarea {
  font-size: var(--ui-size-body);
  color: var(--ui-ink);
}

/* One scale for mixed Tailwind size/weight/color classes */
.ui-shell .text-\[10px\],
.ui-shell .text-\[11px\] {
  font-size: var(--ui-size-caption) !important;
  line-height: 1.35;
}
.ui-shell .text-xs { font-size: var(--ui-size-label) !important; line-height: 1.45; }
.ui-shell .text-sm { font-size: var(--ui-size-body) !important; line-height: 1.5; }
.ui-shell .text-base { font-size: var(--ui-size-title) !important; line-height: 1.4; }
.ui-shell .text-lg { font-size: var(--ui-size-title) !important; line-height: 1.35; }
.ui-shell .text-xl { font-size: 1.125rem !important; line-height: 1.3; }
.ui-shell .text-2xl { font-size: var(--ui-size-page) !important; line-height: 1.25; letter-spacing: -0.02em; }
.ui-shell .font-medium { font-weight: 500 !important; }
.ui-shell .font-semibold { font-weight: 600 !important; }
.ui-shell .font-bold,
.ui-shell .font-extrabold,
.ui-shell .font-black { font-weight: 600 !important; }
.ui-shell h1,
.ui-shell h1.font-bold,
.ui-shell .text-2xl.font-bold { font-weight: 700 !important; }
.ui-shell .text-gray-900,
.ui-shell .text-slate-900 { color: var(--ui-ink); }
.ui-shell .text-gray-800,
.ui-shell .text-slate-800 { color: #1e293b; }
.ui-shell .text-gray-700,
.ui-shell .text-slate-700 { color: var(--ui-body); }
.ui-shell .text-gray-600,
.ui-shell .text-slate-600 { color: #475569; }
.ui-shell .text-gray-500,
.ui-shell .text-slate-500 { color: var(--ui-muted); }
.ui-shell .text-gray-400,
.ui-shell .text-slate-400 { color: var(--ui-faint); }
.ui-shell label.block {
  font-size: var(--ui-size-label);
  font-weight: 500;
  color: #475569;
}

.ui-card,
.ui-table-wrap,
.ui-panel,
.ui-kpi,
.ui-filter-menu,
.ui-search-drop {
  background: #fff;
  border-radius: 0;
  box-shadow: var(--ui-shadow);
  border: 0;
}

.ui-btn,
.ui-btn-ghost,
.ui-filter-btn,
.ui-input,
.ui-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.ui-shell select,
.ui-shell textarea,
.ui-shell button:not(.ui-icon-btn) {
  border-radius: 0 !important;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ui-brand);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border: 0;
  cursor: pointer;
}
.ui-btn:hover { background: #b0080d; color: #fff; }

.ui-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  box-shadow: var(--ui-shadow);
}
.ui-btn-ghost:hover { background: #f8fafc; }

.ui-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  color: #0f172a;
  box-shadow: var(--ui-shadow);
  cursor: pointer;
}
.ui-filter-btn:hover,
.ui-filter-btn.is-open { background: #f8fafc; }
.ui-filter-btn .ui-filter-current { color: #64748b; font-weight: 400; }

.ui-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ui-toolbar-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
.ui-toolbar .ui-filter-menu { left: auto; right: 0; }
.ui-filter-wrap { position: relative; display: inline-block; }
.ui-filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 40;
  min-width: 17rem;
  max-width: 22rem;
  box-shadow: var(--ui-shadow-lg);
  border: 1px solid #e2e8f0;
}
.ui-filter-wrap.is-open .ui-filter-menu { display: block; }
.ui-filter-menu-head {
  font-weight: 600;
  font-size: var(--ui-size-body);
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
}
.ui-filter-section {
  font-size: var(--ui-size-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.7rem 0.9rem 0.25rem;
}
.ui-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.9rem;
  font-size: 0.875rem;
  color: #0f172a;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.ui-filter-option:hover { background: #f8fafc; }
.ui-filter-option.is-active {
  background: #fff5f5;
  color: var(--ui-brand);
  font-weight: 600;
}
.ui-filter-option .ui-check { width: 0.9rem; color: var(--ui-brand); visibility: hidden; flex-shrink: 0; }
.ui-filter-option.is-active .ui-check { visibility: visible; }
.ui-filter-fields { padding: 0.5rem 0.9rem 0.9rem; display: grid; gap: 0.65rem; }
.ui-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid #e2e8f0;
}

.ui-table-wrap { overflow: hidden; }
.ui-table-wrap table { width: 100%; font-size: var(--ui-size-small); border-collapse: collapse; }
.ui-table-wrap thead th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: var(--ui-size-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.ui-table-wrap thead th.text-right,
.ui-table-wrap td.text-right { text-align: right; }
.ui-table-wrap tbody td {
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: middle;
}
.ui-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}
.ui-table-wrap tbody tr:hover { background: #f8fafc; }
.ui-th-check, .ui-td-check { width: 2.5rem; padding-right: 0; }
.ui-row-check, .ui-row-check-all {
  appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.3rem;
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  vertical-align: middle;
}
.ui-row-check:checked,
.ui-row-check-all:checked,
.ui-row-check-all:indeterminate {
  background: var(--ui-brand, #D10A10);
  border-color: var(--ui-brand, #D10A10);
  box-shadow: 0 0 0 3px rgba(209, 10, 16, 0.18);
}
.ui-row-check:checked::after,
.ui-row-check-all:checked::after {
  content: "";
  width: 0.28rem;
  height: 0.5rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.ui-row-check-all:indeterminate::after {
  content: "";
  width: 0.55rem;
  height: 0;
  border-bottom: 2px solid #fff;
}
.ui-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.ui-bulk-bar[hidden] { display: none !important; }
.ui-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
.ui-bulk-count { font-size: 0.75rem; font-weight: 600; color: #64748b; }
.ui-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #334155;
  border-radius: 0.55rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}
.ui-bulk-btn:hover { background: #f8fafc; }
.ui-bulk-btn.is-danger { color: #be123c; }
.ui-bulk-btn svg { width: 1rem; height: 1rem; }
.ui-bulk-bar select {
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
}
#appConfirm[hidden] { display: none !important; }
.app-confirm-card {
  border-radius: 1.5rem;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}
.app-confirm-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto;
  border-radius: 9999px;
  background: #ffe4e6;
  color: #fb7185;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
.app-confirm-yes,
.app-confirm-no {
  display: block;
  width: 100%;
  border: 0;
  cursor: pointer;
  font-size: var(--ui-size-body);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem !important;
}
.app-confirm-yes {
  background: #fb7185;
  color: #fff;
}
.app-confirm-yes:hover { background: #f43f5e; color: #fff; }
.app-confirm-no {
  background: #f1f5f9;
  color: #0f172a;
}
.app-confirm-no:hover { background: #e2e8f0; }
.ui-mobile-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.ui-data-table .cell-activity {
  max-width: 26rem;
  white-space: normal;
  color: #334155;
  line-height: 1.4;
}

.ui-table-wrap table.ui-data-table { table-layout: auto; }
.ui-data-table .cell-nowrap { white-space: nowrap; }
.ui-data-table .cell-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-data-table .cell-muted { color: var(--ui-muted); font-size: var(--ui-size-caption); }
.ui-data-table .cell-truncate {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-data-table .cell-note {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
}
.ui-table-wrap .cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}
.ui-table-wrap .cell-stack .primary { color: var(--ui-ink); font-weight: 500; }
.ui-table-wrap .cell-stack .meta {
  font-size: var(--ui-size-caption);
  font-weight: 400;
  color: var(--ui-muted);
  line-height: 1.35;
  white-space: nowrap;
}
.ui-data-table .cell-stack .primary { color: #0f172a; font-weight: 500; }
.ui-data-table .cell-stack .secondary {
  font-size: var(--ui-size-caption);
  color: var(--ui-faint);
  font-family: ui-monospace, monospace;
  margin-top: 2px;
}
.ui-th-actions,
.ui-data-table td.ui-td-actions {
  width: 96px;
  min-width: 96px;
  text-align: right;
  white-space: nowrap;
}
.ui-data-table.has-wide-actions .ui-th-actions,
.ui-data-table.has-wide-actions td.ui-td-actions {
  width: 128px;
  min-width: 128px;
}
.ui-table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.ui-table-actions form { display: inline; margin: 0; }
.ui-table-wrap table.ui-data-table tbody tr { border-top: 1px solid #f1f5f9; }
.ui-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #64748b;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.ui-table-action:hover {
  color: var(--ui-brand);
  background: #fff5f5;
}
.ui-table-action.is-danger:hover {
  color: #be123c;
  background: #fff1f2;
}
.ui-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-size: var(--ui-size-label);
  font-weight: 500;
  line-height: 1.2;
  color: #64748b;
}
.ui-status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}
.ui-status.is-good { color: #047857; }
.ui-status.is-wait { color: #b45309; }
.ui-status.is-info { color: #1d4ed8; }
.ui-status.is-bad { color: #be123c; }
.ui-status.is-muted { color: #94a3b8; }
.cell-one { white-space: nowrap; }
.ui-table-wrap tbody tr.is-focused,
.ui-table-wrap tbody tr.is-focused:hover {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #d97706;
}
.ui-focus-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #d97706;
}
.ui-focus-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--ui-ink);
}
.ui-focus-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0;
}
.ui-focus-facts div { display: flex; gap: 0.35rem; align-items: baseline; }
.ui-focus-facts dt { font-size: var(--ui-size-caption); color: var(--ui-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.ui-focus-facts dd { margin: 0; font-size: var(--ui-size-small); color: var(--ui-body); }
.ui-badge-stage {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--ui-size-caption);
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
.ui-delta-pos { color: #059669; font-weight: 600; white-space: nowrap; }
.ui-delta-neg { color: #e11d48; font-weight: 600; white-space: nowrap; }

.ui-kpi {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  min-height: 6.5rem;
}
.ui-kpi .label {
  font-size: var(--ui-size-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.3;
}
.ui-kpi .value-block {
  margin-top: 0.45rem;
  flex: 1;
  min-width: 0;
}
.ui-kpi .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ui-ink);
  line-height: 1.15;
  word-break: break-word;
}
.ui-kpi .unit {
  font-size: var(--ui-size-label);
  font-weight: 600;
  color: var(--ui-ink);
  margin-top: 0.1rem;
  line-height: 1.2;
}
.ui-kpi .hint {
  font-size: var(--ui-size-caption);
  color: var(--ui-muted);
  margin-top: 0.45rem;
  min-height: 1rem;
}
.ui-kpi.is-dense .value { font-size: 1.05rem; }
.ui-kpi.is-dense { min-height: 6.25rem; }

/* List pagination */
.ui-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: #475569;
}
.ui-pager-size {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.ui-pager-select {
  appearance: none;
  width: auto !important;
  min-width: 3.25rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7l5 5 5-5' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.55rem center !important;
  border: 1px solid #e2e8f0 !important;
  padding: 0.35rem 1.6rem 0.35rem 0.65rem !important;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  box-shadow: var(--ui-shadow);
  cursor: pointer;
}
.ui-pager-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.ui-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--ui-shadow);
}
.ui-pager-btn:hover { background: #f8fafc; }
.ui-pager-btn.is-disabled {
  color: #cbd5e1;
  pointer-events: none;
  box-shadow: none;
}
.ui-pager-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
}
.ui-pager-page:hover { color: var(--ui-brand); }
.ui-pager-page.is-active {
  background: #fff5f5;
  color: var(--ui-brand);
  font-weight: 600;
}
.ui-pager-ellipsis {
  min-width: 1.5rem;
  text-align: center;
  color: #94a3b8;
}

.ui-sidebar {
  background: #fff;
  border-right: 1px solid #f1f5f9;
}
.ui-nav-group {
  font-size: var(--ui-size-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.85rem 0.85rem 0.3rem;
}
.ui-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.85rem;
  margin: 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  position: relative;
}
.ui-nav-link:hover { background: #f8fafc; color: #0f172a; }
.ui-nav-link.is-active {
  color: var(--ui-brand);
  background: #fff5f5;
  font-weight: 600;
}
.ui-nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 3px;
  background: var(--ui-brand);
}
.ui-nav-link svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.ui-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}
.ui-settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.1rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ui-settings-tab:hover { color: #0f172a; }
.ui-settings-tab.is-active {
  color: var(--ui-brand);
  font-weight: 600;
  border-bottom-color: var(--ui-brand);
}
.ui-settings-tab svg { width: 1rem; height: 1rem; }

.ui-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 0 0.7rem;
  height: 2.25rem;
  margin: 0.75rem 0.85rem 0.25rem;
}
.ui-search-topbar {
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.inv-analytics-panel {
  padding: 1.15rem 1.25rem;
}
.inv-bar-track {
  height: 8px;
  background: #f1f5f9;
  overflow: hidden;
}
.inv-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #D10A10, #f15b5b);
  min-width: 4px;
}
.inv-bar-track-muted { height: 6px; }
.inv-bar-fill-muted {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}
.inv-flow-arrow {
  text-align: center;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1;
  margin: -2px 0;
}
.inv-pack-table th,
.inv-pack-table td {
  vertical-align: middle;
}
.ui-search input {
  background: transparent;
  border: 0 !important;
  box-shadow: none !important;
  outline: none;
  font-size: 0.8125rem;
  width: 100%;
  padding: 0 !important;
}
.ui-search-kbd {
  font-size: var(--ui-size-caption);
  color: var(--ui-faint);
  border: 1px solid #e2e8f0;
  padding: 0.05rem 0.3rem;
  background: #fff;
}

.ui-topbar {
  background: #fff;
  box-shadow: var(--ui-shadow);
  border-bottom: 0;
}

.ui-mobile-card {
  background: #fff;
  box-shadow: var(--ui-shadow);
  padding: 1rem;
  font-size: var(--ui-size-small);
  color: var(--ui-body);
}
.ui-shell .ui-page-title,
.ui-page-title {
  font-size: var(--ui-size-page) !important;
  font-weight: 700 !important;
  color: var(--ui-ink);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.ui-shell .ui-page-sub,
.ui-page-sub {
  font-size: var(--ui-size-body) !important;
  font-weight: 400 !important;
  color: var(--ui-muted);
  margin-top: 0.15rem;
  line-height: 1.45;
}

.ui-pager a,
.ui-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
}
.ui-pager .is-current {
  background: var(--ui-brand);
  color: #fff;
}

.ui-shell .modal-root > div.bg-white {
  border-radius: 0 !important;
  box-shadow: var(--ui-shadow-lg);
}

.ui-shell tbody.divide-y > tr,
.ui-shell thead.border-b {
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
}
.ui-shell .bg-white.rounded-lg.border,
.ui-shell .bg-white.border.border-slate-200,
.ui-shell .bg-white.overflow-hidden.shadow-xs {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: var(--ui-shadow);
}
.ui-shell .sm\:hidden .border.border-slate-200,
.ui-shell a.block.bg-white.border {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: var(--ui-shadow);
}

/* Notifications dropdown */
.ui-notify-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ui-brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.ui-notify-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(22.5rem, calc(100vw - 1.25rem));
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  z-index: 60;
  border: 1px solid #e8edf3;
  overflow: hidden;
}
.ui-notify-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem 0.85rem;
}
.ui-notify-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.ui-notify-sub {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  color: #94a3b8;
}
.ui-notify-archive {
  color: #94a3b8;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.ui-notify-wave {
  height: 10px;
  margin: 0 0.5rem;
  background:
    radial-gradient(circle at 8px 0, transparent 6px, #eef2f7 6.5px) 0 0 / 16px 10px repeat-x;
  opacity: 0.95;
}
.ui-notify-list {
  position: relative;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.35rem 0 0.5rem;
}
.ui-notify-list::before {
  content: "";
  position: absolute;
  left: 2.05rem;
  top: 1.1rem;
  bottom: 1.1rem;
  width: 0;
  border-left: 1.5px dashed #e2e8f0;
  pointer-events: none;
}
.ui-notify-empty {
  padding: 1.75rem 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #94a3b8;
}
.ui-notify-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 1.15rem;
  text-decoration: none;
  color: inherit;
}
.ui-notify-item:hover { background: #f8fafc; }
.ui-notify-icon {
  position: relative;
  z-index: 1;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  flex-shrink: 0;
}
.ui-notify-icon svg {
  width: 1rem;
  height: 1rem;
}
.ui-notify-item.icon-bell .ui-notify-icon {
  border-color: #fdba74;
  color: #ea580c;
}
.ui-notify-item.icon-calendar .ui-notify-icon {
  border-color: #93c5fd;
  color: #2563eb;
}
.ui-notify-item.icon-check .ui-notify-icon {
  border-color: #86efac;
  color: #16a34a;
}
.ui-notify-item.icon-warning .ui-notify-icon {
  border-color: #fde047;
  color: #ca8a04;
}
.ui-notify-body {
  min-width: 0;
  padding-top: 0.1rem;
}
.ui-notify-item-title {
  display: block;
  font-size: var(--ui-size-body);
  font-weight: 600;
  color: var(--ui-ink);
  line-height: 1.25;
}
.ui-notify-item-text {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ui-notify-time {
  font-size: 0.6875rem;
  color: #94a3b8;
  white-space: nowrap;
  padding-top: 0.2rem;
}
.ui-alert-list {
  display: flex;
  flex-direction: column;
}
.ui-alert-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  text-decoration: none;
  border-top: 1px solid #f1f5f9;
  color: #0f172a;
}
.ui-alert-row:hover { background: #f8fafc; }
.ui-alert-count {
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
}
.ui-alert-row.severity-critical .ui-alert-count {
  color: #b91c1c;
  background: #fee2e2;
}
.ui-alert-row.severity-urgent .ui-alert-count {
  color: #b45309;
  background: #fef3c7;
}
.ui-alert-row.severity-warning .ui-alert-count {
  color: #334155;
  background: #e2e8f0;
}
.ui-alert-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #0f172a;
}
.ui-alert-chevron {
  color: #94a3b8;
  font-size: 0.8125rem;
}
.ui-alert-row:hover .ui-alert-chevron { color: var(--ui-brand); }

.ui-alert-banner {
  margin-bottom: 1rem;
  padding: 0.65rem 0.9rem;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  font-weight: 500;
}

.ui-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.ui-quick-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: fit-content;
  max-width: 100%;
}
.ui-quick-actions-inline .ui-quick-action {
  min-height: 0;
  min-width: 8.5rem;
  padding: 0.65rem 1rem;
  background: #fff;
  box-shadow: var(--ui-shadow);
}
.ui-quick-action {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  text-decoration: none;
  color: #0f172a;
  min-height: 3.75rem;
}
.ui-quick-action:hover { background: #fff5f5; color: var(--ui-brand); }
.ui-quick-action .qa-label { font-size: 0.8125rem; font-weight: 600; }
.ui-quick-action .qa-hint { font-size: 0.6875rem; color: #64748b; font-weight: 400; }

.ui-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ui-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
}
.ui-filter-chip:hover { background: #f8fafc; color: #0f172a; }
.ui-filter-chip.is-active {
  background: #fff5f5;
  border-color: #fecaca;
  color: var(--ui-brand);
  font-weight: 600;
}

.ui-person {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  max-width: 100%;
}
.ui-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  flex-shrink: 0;
}
.ui-avatar.tone-0 { background: #dcfce7; color: #15803d; }
.ui-avatar.tone-1 { background: #ede9fe; color: #6d28d9; }
.ui-avatar.tone-2 { background: #ffe4e6; color: #be123c; }
.ui-avatar.tone-3 { background: #e0f2fe; color: #0369a1; }
.ui-avatar.tone-4 { background: #ffedd5; color: #c2410c; }
.ui-avatar.tone-5 { background: #fef9c3; color: #a16207; }
.ui-person-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.ui-person-name {
  font-size: var(--ui-size-small);
  font-weight: 500;
  color: var(--ui-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-person-sub {
  font-size: var(--ui-size-caption);
  font-weight: 400;
  color: var(--ui-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-table-wrap tbody tr.is-clickable { cursor: pointer; }
.ui-table-wrap tbody tr.is-clickable:hover { background: #f8fafc; }
.ui-mobile-card.is-clickable { cursor: pointer; }
.ui-row-chevron { color: #cbd5e1; }

.ui-drawer[hidden] { display: none !important; }
.ui-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.ui-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ui-drawer.is-open .ui-drawer-backdrop { opacity: 1; }
.ui-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(26rem, 100%);
  background: #fff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}
.ui-drawer.is-open .ui-drawer-panel { transform: translateX(0); }
.ui-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.ui-drawer-head h3 {
  margin: 0;
  font-size: var(--ui-size-title);
  font-weight: 600;
  color: var(--ui-ink);
}
.ui-drawer-close {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}
.ui-drawer-close:hover { color: var(--ui-ink); }
.ui-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.25rem;
  display: grid;
  gap: 1rem;
}
.ui-drawer-facts {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}
.ui-drawer-facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.ui-drawer-facts dt {
  font-size: var(--ui-size-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ui-faint);
}
.ui-drawer-facts dd {
  margin: 0;
  font-size: var(--ui-size-small);
  color: var(--ui-body);
  text-align: right;
}
.ui-drawer-products {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}
.ui-drawer-products li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: var(--ui-size-small);
  color: var(--ui-body);
  padding: 0.45rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.ui-drawer-products li:last-child { border-bottom: 0; }
.ui-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.ui-drawer-actions .ui-btn,
.ui-drawer-actions .ui-btn-ghost {
  width: 100%;
  justify-content: center;
  text-decoration: none;
  order: 2;
}
.ui-drawer-closed-note {
  order: 0;
  margin: 0 0 0.25rem;
  font-size: var(--ui-size-label);
  color: var(--ui-muted);
  text-align: center;
}
.ui-drawer-actions .is-next { order: 1; }
.ui-drawer-actions #orderDrawerView { order: 3; }
.ui-drawer-actions .ui-btn:disabled,
.ui-drawer-actions .ui-btn-ghost:disabled,
.ui-drawer-actions [aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: auto;
  background: #f1f5f9;
  color: #94a3b8;
  box-shadow: none;
}
.ui-drawer-actions .ui-btn:disabled:hover,
.ui-drawer-actions .ui-btn-ghost:disabled:hover,
.ui-drawer-actions [aria-disabled="true"]:hover {
  background: #f1f5f9;
  color: #94a3b8;
}
