/* Shared interaction polish. Keep business-specific layouts in styles.css. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #2a837b;
  outline-offset: 3px;
}
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
input, select, textarea { min-width: 0; }
button:disabled { transform: none; }
.toast { max-width: min(480px, calc(100vw - 24px)); overflow-wrap: anywhere; line-height: 1.5; }

@media (min-width: 861px) {
  .sidebar .mobile-only, .topbar .mobile-only { display: none !important; }
  .table-wrap { scrollbar-width: thin; scrollbar-color: #bac8c6 #f4f7f6; }
}

/* Dashboard: real workflow counts, clear destinations, and compact scan paths. */
.dashboard-shell { display: grid; gap: 18px; min-width: 0; }
.dashboard-shell svg { width: 19px; height: 19px; }
.dashboard-welcome { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 0 1px 2px; }
.dashboard-welcome p { margin: 0; color: #52636b; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.dashboard-welcome strong { color: var(--text); font-weight: 650; }
.dashboard-welcome time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.dashboard-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.dashboard-metric {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 132px;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
}
.dashboard-metric-label { display: flex; align-items: center; gap: 8px; min-width: 0; color: #4b5f63; font-size: 13px; line-height: 1.4; }
.dashboard-metric-label > svg:first-child { color: var(--primary); }
.dashboard-metric-label > span { min-width: 0; overflow-wrap: anywhere; }
.dashboard-metric-arrow { margin-left: auto; width: 14px !important; height: 14px !important; color: #7c8e91; }
.dashboard-metric-value { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.dashboard-metric-value strong { min-width: 0; font-size: clamp(24px, 2.3vw, 32px); font-weight: 700; line-height: 1.1; letter-spacing: -.7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dashboard-metric-value > span { color: var(--muted); font-size: 12px; }
.dashboard-metric-hint { color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.dashboard-metric.attention { border-top-color: #c5a56c; }
.dashboard-metric.attention .dashboard-metric-value strong { color: #976319; }
button.dashboard-metric:hover { background: var(--panel); }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); align-items: start; gap: 18px; min-width: 0; }
.dashboard-primary { display: grid; gap: 18px; min-width: 0; }
.dashboard-panel { min-width: 0; padding: 19px 20px; border-radius: 9px; }
.dashboard-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; min-width: 0; min-height: 28px; margin-bottom: 15px; }
.dashboard-panel-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 15px; font-weight: 650; line-height: 1.5; }
.dashboard-panel-head > span { color: var(--muted); font-size: 11px; }
.dashboard-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; min-height: 22px; padding: 1px 6px; border-radius: 6px; background: #eaf4f2; color: #146b62; font-size: 11px; font-variant-numeric: tabular-nums; }
button.dashboard-text-link { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 3px; min-height: 32px; padding: 4px 0 4px 5px; border: 0; background: transparent; color: #0d7369; font-size: 12px; font-weight: 500; }
.dashboard-text-link svg { width: 15px; height: 15px; }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dashboard-shortcuts button { display: grid; justify-items: center; align-content: center; gap: 9px; min-width: 0; min-height: 84px; padding: 12px 5px; border: 1px solid #e7eeec; border-radius: 7px; background: #f7faf9; color: #294d49; }
.dashboard-shortcuts button > svg { width: 21px; height: 21px; color: var(--primary); }
.dashboard-shortcuts button > span { font-size: 12px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.dashboard-distribution-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 12px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.dashboard-distribution-summary strong { padding-inline: 4px; color: var(--text); font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dashboard-distribution-summary b { color: #59666b; font-weight: 600; font-variant-numeric: tabular-nums; }
.dashboard-distribution { display: flex; width: 100%; height: 10px; margin-bottom: 22px; overflow: hidden; border-radius: 3px; background: #edf2f1; }
.dashboard-distribution > span { height: 100%; min-width: 1px; }
.dashboard-distribution > span + span { border-left: 2px solid #fff; }
.dashboard-distribution-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.dashboard-distribution-list > li { display: grid; gap: 7px; min-width: 0; }
.dashboard-distribution-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #53636a; font-size: 12px; }
.dashboard-distribution-label > span:first-child { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.dashboard-distribution-label > span:last-child { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dashboard-distribution-label b { color: var(--text); font-weight: 600; }
.dashboard-distribution-label small { display: inline-block; min-width: 45px; margin-left: 8px; color: var(--muted); font-size: 11px; text-align: right; }
.dashboard-status-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 2px; }
.dashboard-progress { height: 5px; overflow: hidden; border-radius: 3px; background: #edf2f1; }
.dashboard-progress > span { display: block; height: 100%; border-radius: inherit; }
.dashboard-distribution > .approved, .dashboard-status-dot.approved, .dashboard-progress.approved > span { background: #34897b; }
.dashboard-distribution > .pending, .dashboard-status-dot.pending, .dashboard-progress.pending > span { background: #c79842; }
.dashboard-distribution > .rejected, .dashboard-status-dot.rejected, .dashboard-progress.rejected > span { background: #bc7269; }
.dashboard-distribution > .cancelled, .dashboard-status-dot.cancelled, .dashboard-progress.cancelled > span { background: #8c9b9f; }
.dashboard-distribution > .other, .dashboard-status-dot.other, .dashboard-progress.other > span { background: #738c9e; }
.dashboard-empty { display: flex; align-items: center; gap: 13px; min-height: 89px; padding: 14px 0 12px; }
.dashboard-empty > svg { flex: 0 0 auto; width: 30px; height: 30px; color: #7e9e98; stroke-width: 1.5; }
.dashboard-empty > div { min-width: 0; }
.dashboard-empty strong { color: #53666b; font-size: 13px; font-weight: 550; }
.dashboard-empty p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.dashboard-notification-list { display: grid; gap: 10px; }
.dashboard-notification-list .notification-item { padding: 12px; border-color: #e0e9e6; border-radius: 6px; overflow-wrap: anywhere; }
.dashboard-notification-list .notification-item.unread { border-left: 3px solid #70a69b; background: #fbfdfc; }
.dashboard-notification-list .notification-item b { color: #334d4a; font-size: 13px; line-height: 1.5; }
.dashboard-notification-list .notification-item p { line-height: 1.7; }
.dashboard-notification-list .notification-item button { max-width: 100%; font-size: 12px; }
.dashboard-list-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

@media (hover: hover) and (pointer: fine) {
  button.dashboard-metric:hover { border-color: #94b8b0; background: #fbfdfc; box-shadow: 0 3px 10px rgba(29, 71, 60, .05); }
  .dashboard-shortcuts button:hover { border-color: #9cbfb6; background: #edf6f3; }
  button.dashboard-text-link:hover { color: #084f49; text-decoration: underline; text-underline-offset: 3px; }
}

@media (min-width: 861px) and (max-width: 1179px) {
  .dashboard-columns { grid-template-columns: minmax(0, 1fr) minmax(260px, .95fr); gap: 14px; }
  .dashboard-primary { gap: 14px; }
  .dashboard-metric { padding: 15px 12px; }
  .dashboard-metric-label { gap: 5px; font-size: 12px; }
  .dashboard-metric-arrow { display: none; }
  .dashboard-panel { padding: 16px; }
  .dashboard-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-shortcuts button { grid-template-columns: 22px minmax(0, 1fr); justify-items: start; align-items: center; gap: 8px; min-height: 60px; padding: 10px; }
  .dashboard-shortcuts button > span { text-align: left; }
  .dashboard-panel-head > span { display: none; }
}

@media (max-width: 860px) {
  .dashboard-shell, .dashboard-primary { gap: 14px; }
  .dashboard-welcome { flex-wrap: wrap; gap: 2px 10px; }
  .dashboard-welcome p { font-size: 14px; }
  .dashboard-welcome time { font-size: 11px; }
  .dashboard-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dashboard-metric { gap: 9px; min-height: 120px; padding: 14px; border-radius: 8px; }
  .dashboard-metric-label { font-size: 12px; }
  .dashboard-metric-label > svg:first-child { width: 17px; height: 17px; }
  .dashboard-metric-value strong { font-size: 28px; }
  .dashboard-metric-hint { font-size: 11px; }
  .dashboard-columns { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dashboard-primary { display: contents; }
  .dashboard-notifications { grid-row: 2; }
  .dashboard-applications { grid-row: 3; }
  .dashboard-panel { padding: 16px; }
  .dashboard-panel-head { min-height: 32px; margin-bottom: 12px; }
  .dashboard-panel-head > span { font-size: 11px; }
  button.dashboard-text-link { min-height: 40px; }
  .dashboard-shortcuts { gap: 8px; }
  .dashboard-shortcuts button { min-height: 78px; padding: 10px 3px; gap: 8px; }
  .dashboard-empty { min-height: 82px; padding: 8px 0; }
  .dashboard-notification-list .notification-item button { min-height: 42px; }
  .toolbar.has-filters > * { min-width: 0; }
  .toolbar.has-filters label > input, .toolbar.has-filters label > select { max-width: 100%; }
  .mobile-table td > input, .mobile-table td > select, .mobile-table td > textarea { max-width: 100%; }
}

@media (min-width: 680px) and (max-width: 860px) {
  .dashboard-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-metric { padding-inline: 12px; }
  .dashboard-metric-arrow { display: none; }
}

@media (max-width: 359px) {
  .dashboard-welcome { display: grid; gap: 3px; }
  .dashboard-metric-grid { gap: 8px; }
  .dashboard-metric { min-height: 118px; padding: 12px 10px; }
  .dashboard-metric-label { gap: 5px; }
  .dashboard-metric-arrow { display: none; }
  .dashboard-metric-value strong { font-size: 26px; }
  .dashboard-panel { padding: 13px; }
  .dashboard-panel-head > span { display: none; }
  .dashboard-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-shortcuts button { grid-template-columns: 20px minmax(0, 1fr); justify-items: start; align-items: center; min-height: 56px; padding: 9px; gap: 8px; }
  .dashboard-shortcuts button > svg { width: 19px; height: 19px; }
  .dashboard-shortcuts button > span { text-align: left; }
}
