/* Shared presentation for the four DEV work pages selected by base.html. */
.xinpu-theme {
  --bg: #f8fafc;
  --panel: #fff;
  --line: #e2e8f0;
  --text: #334155;
  --muted: #64748b;
  --accent: #1e3a8a;
  --accent-dark: #1d4ed8;
  --review-ink: #0f172a;
  --review-muted: var(--muted);
  --review-border: var(--line);
  --review-accent: var(--accent);
  --review-tint: #eff6ff;
  --theme-field: #cbd5e1;
  --theme-slate: #1e293b;
  --theme-focus: 0 0 0 3px rgba(30,58,138,.15);
  --theme-shadow: 0 1px 3px rgba(0,0,0,.05);
  --theme-control: 38px;
  --theme-radius: 6px;
  --theme-pill: 9999px;
  --theme-complete: #dcfce7;
  --theme-complete-text: #166534;
  --theme-review: #fef3c7;
  --theme-review-text: #92400e;
  --theme-warning: #fee2e2;
  --theme-warning-text: #991b1b;
}
.xinpu-theme .topbar {
  min-height: 64px;
  gap: .5rem 1rem;
  padding: .5rem clamp(.85rem,2vw,1.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: nowrap;
}
.xinpu-theme .topbar .brand { color: var(--review-ink); font-size: 1.05rem; white-space: nowrap; }
.xinpu-theme #xinpu-clock { color: var(--muted); font-size: .8125rem; }
.xinpu-theme .topbar .nav { gap: .25rem .4rem; flex-wrap: wrap; justify-content: end; }
.xinpu-theme .topbar .nav > a,
.xinpu-theme .topbar .xinpu-table-menu > summary {
  padding: .4rem .55rem;
  border-radius: var(--theme-radius);
  color: var(--text);
  font-size: .9rem;
  white-space: nowrap;
}
.xinpu-theme .topbar .nav > a:hover,
.xinpu-theme .topbar .xinpu-table-menu > summary:hover { background: var(--review-tint); color: var(--accent-dark); }
.xinpu-theme .topbar .nav > a[aria-current="page"],
.xinpu-theme .topbar .xinpu-table-menu:has(a[aria-current="page"]) > summary {
  color: var(--accent);
  background: var(--review-tint);
  box-shadow: inset 0 -2px var(--accent);
  font-weight: 700;
}
.xinpu-theme .topbar .user { padding-inline: .35rem; font-size: .875rem; white-space: nowrap; }
.xinpu-theme > p.page[role="note"] { margin: 0; padding: .65rem clamp(.85rem,2vw,1.5rem) .25rem; font-size: .8rem; color: var(--muted); }
.xinpu-theme main.page { padding: .75rem clamp(.85rem,2vw,1.5rem) 2rem; }
.xinpu-theme :is(#domain-root,#work-overview,#entry-root,.domain-crew-daily) h1 {
  margin: 0 0 .35rem;
  color: var(--review-ink);
  font-size: clamp(1.5rem,2.6vw,1.875rem);
  line-height: 1.25;
}
.xinpu-theme :is(.domain-identity,.work-overview-heading) h1 + p,
.xinpu-theme :is(#entry-root,.domain-crew-daily) > h1 + p {
  margin: 0 0 .55rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: .9rem;
}
.xinpu-theme :is(#entry-root,.domain-crew-daily) > :is(p,h2) { margin-block: .55rem; }
.xinpu-theme :is(#work-overview,#entry-root,.domain-crew-daily) :is(h2,legend) { color: var(--review-ink); }
.xinpu-theme main a:not(.work-card,.sheet-action-link,[role="tab"],[aria-current="page"]) { color: var(--accent); }
.xinpu-theme main a:not(.work-card,.sheet-action-link,[role="tab"],[aria-current="page"]):hover { color: var(--accent-dark); }
.xinpu-theme :is(.work-day,#xinpu-clock,input[type="date"],input[type="time"]) { font-variant-numeric: tabular-nums; }
.xinpu-theme :is(#domain-root,#work-overview,#entry-root,.domain-crew-daily) :is(input:not([type]),input:is([type="text"],[type="number"],[type="search"],[type="date"],[type="time"],[type="datetime-local"]),select):not(dialog *, .domain-scroll *) {
  min-width: 0;
  max-width: 100%;
  min-height: var(--theme-control);
  height: var(--theme-control);
  padding: 0 12px;
  border: 1px solid var(--theme-field);
  border-radius: var(--theme-radius);
  background: var(--panel);
  color: var(--text);
}
.xinpu-theme :is(#domain-root,#work-overview,#entry-root,.domain-crew-daily) :is(input:not([type]),input:is([type="text"],[type="number"],[type="search"],[type="date"],[type="time"],[type="datetime-local"]),select):not(dialog *, .domain-scroll *):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--theme-focus);
}
.xinpu-theme #entry-fields textarea {
  font: inherit;
  padding: .65rem .75rem;
  border: 1px solid var(--theme-field);
  border-radius: var(--theme-radius);
  color: var(--text);
}
.xinpu-theme #entry-fields textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--theme-focus); }
.xinpu-theme .sheet-action-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}
.xinpu-theme :is(.topbar,#entry-root,#vendor-daily-root,.domain-crew-daily,.domain-heading) button:not(dialog *,[data-recent-sort],[data-floor-toggle]),
.xinpu-theme .sheet-action-link {
  min-height: var(--theme-control);
  padding: .375rem .75rem;
  border: 1px solid var(--theme-field);
  border-radius: var(--theme-radius);
  background: var(--panel);
  color: var(--accent);
  font-weight: 650;
}
.xinpu-theme :is(.topbar,#entry-root,#vendor-daily-root,.domain-crew-daily,.domain-heading) button:not(dialog *,[data-recent-sort],[data-floor-toggle]):enabled:hover,
.xinpu-theme .sheet-action-link:hover {
  border-color: var(--accent);
  background: var(--review-tint);
  color: var(--accent-dark);
}
.xinpu-theme button:is(.topbar button[type="submit"],.crew-daily-query button,#entry-preview,#entry-commit,#entry-find button,#workflow-schedule,.domain-add-unit button,#entry-root [aria-pressed="true"],#workflow-review-save):enabled,
.xinpu-theme .sheet-action-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--panel);
}
.xinpu-theme button:is(.topbar button[type="submit"],.crew-daily-query button,#entry-preview,#entry-commit,#entry-find button,#workflow-schedule,.domain-add-unit button,#entry-root [aria-pressed="true"],#workflow-review-save):enabled:hover,
.xinpu-theme .sheet-action-primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: var(--panel);
}
.xinpu-theme :is(.topbar,#entry-root,#vendor-daily-root,.domain-crew-daily,.domain-heading) button:disabled:not(dialog *,[data-recent-sort]),
.xinpu-theme :is(#domain-root,#work-overview,#entry-root,.domain-crew-daily) :is(input:not([type]),input:is([type="text"],[type="number"],[type="search"],[type="date"],[type="time"],[type="datetime-local"]),select):not(dialog *, .domain-scroll *):disabled,
.xinpu-theme #entry-fields textarea:disabled {
  background: #f1f5f9;
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}
.xinpu-theme :is(.domain-grid-frame,.domain-whole-summary,#work-overview-detail article,.work-card,.work-day,
                 #entry-fields,#schedule-fields,#entry-workflow,.crew-daily-query,.crew-daily-totals,.crew-daily-scroll) {
  border: 1px solid var(--line);
  border-radius: var(--surface-radius);
  background: var(--panel);
  box-shadow: var(--theme-shadow);
}
.xinpu-theme .work-day { padding: .45rem .7rem; font-size: .875rem; }
.xinpu-theme #work-overview .work-counts [data-work-tab] {
  min-height: var(--theme-control);
  padding: .3rem .65rem;
  border-radius: var(--theme-pill);
}
.xinpu-theme #work-overview .work-counts > a:is([data-work-tab="requirement"],[data-work-tab="approval"],[data-work-tab="followups"]),
.xinpu-theme .work-state:is([data-work-state="requirement"],[data-work-state="approval"]) strong {
  background: var(--theme-review);
  color: var(--theme-review-text);
}
.xinpu-theme #work-overview .work-counts :is([data-work-tab="cancelled"],[data-work-tab="missing"]),
.xinpu-theme .work-state:is([data-work-state="cancelled"],[data-work-state="unknown"]) strong {
  background: var(--theme-warning);
  color: var(--theme-warning-text);
}
.xinpu-theme #work-overview .work-counts [data-work-tab="scheduled"],
.xinpu-theme .work-state[data-work-state="scheduled"] strong {
  background: var(--theme-complete);
  color: var(--theme-complete-text);
}
.xinpu-theme .work-state strong { display: inline-block; border-radius: var(--theme-pill); padding: .12rem .5rem; }
.xinpu-theme .work-card[aria-current="true"] { border-color: var(--accent); background: var(--review-tint); }
.xinpu-theme #work-overview-detail dt { color: var(--muted); font-weight: 650; }
.xinpu-theme #entry-fields { padding: .85rem 1rem 1rem; grid-template-columns: repeat(3,minmax(0,1fr)); }
.xinpu-theme #entry-fields > .xinpu-floor-range { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 0; }
.xinpu-theme #entry-fields > .xinpu-floor-range small { grid-column: 1 / -1; color: var(--muted); }
.xinpu-theme #entry-fields :is(label,select,input) { min-width: 0; }
.xinpu-theme #entry-fields [data-entry-panel]:not([hidden]),
.xinpu-theme #schedule-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
.xinpu-theme #entry-workflow { margin-block: .9rem; padding: .85rem 1rem; }
.xinpu-theme #entry-workflow > h2 { margin: 0 0 .55rem; }
.xinpu-theme #entry-workflow > #schedule-fields { margin-block: .55rem; }
.xinpu-theme #entry-workflow > p, .xinpu-theme #entry-state p { margin-block: .35rem; }
.xinpu-theme #entry-status { color: var(--muted); }
.xinpu-theme .crew-daily-query, .xinpu-theme .crew-daily-totals { padding: .75rem 1rem; }
.xinpu-theme .crew-daily-totals dt { color: var(--muted); }
.xinpu-theme .crew-daily-table :is(th,td) { padding: 10px 14px; border-color: var(--line); }
.xinpu-theme .crew-daily-table th { background: var(--theme-slate); color: var(--panel); }
.xinpu-theme .crew-daily-table tbody tr:hover { background: #f1f5f9; }
.xinpu-theme .crew-daily-table td:is([data-label="廠商"],[data-label="工項"],[data-label="工作內容"]) { text-align: left; }
.xinpu-theme .crew-daily-table td:is([data-label="排序"],[data-label$="人數"]) { font-variant-numeric: tabular-nums; }
.xinpu-theme :is(#domain-root,#vendor-sheet-grid) #domain-table > thead > tr > th:not([data-grid-identity],[data-grid-active]) {
  background: var(--theme-slate);
  color: var(--panel);
}
.xinpu-theme #domain-root #domain-table .domain-cell,
.xinpu-theme #domain-root #domain-table > thead > tr > th { border-color: var(--line); }
.xinpu-theme #domain-root .progress-cell-link[data-negative] > :first-child { color: var(--theme-warning-text); }
.xinpu-theme #domain-root #domain-table tr:hover .domain-cell:not([data-grid-active]) { background: #f1f5f9; }
.xinpu-theme #domain-root .domain-whole-summary { padding: .75rem; }
@media (max-width: 760px) {
  .xinpu-theme .topbar .nav { justify-content: start; min-inline-size: 0; }
  .xinpu-theme .topbar .user { min-inline-size: 0; max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; }
  .xinpu-theme .topbar .nav > a { padding: .3rem .35rem; font-size: .85rem; }
  .xinpu-theme #entry-fields,
  .xinpu-theme #entry-fields > .xinpu-floor-range,
  .xinpu-theme #entry-fields [data-entry-panel]:not([hidden]),
  .xinpu-theme #schedule-fields { grid-template-columns: minmax(0,1fr); }
  .xinpu-theme .crew-daily-table tbody tr { background: var(--panel); }
  .xinpu-theme .crew-daily-table td { padding: .35rem .5rem; }
}

.xinpu-theme .vendor-authorized-grid td { text-align: center; font-variant-numeric: tabular-nums; }
.xinpu-theme .vendor-authorized-grid .vendor-grid-warning { color: var(--theme-warning-text); }
#vendor-sheet-grid .domain-table-scale { margin-block: .5rem; justify-content: flex-end; }
.xinpu-theme #vendor-daily-root fieldset {
  border: 1px solid var(--line);
  border-radius: var(--theme-radius);
  background: var(--panel);
  box-shadow: var(--theme-shadow);
}
.xinpu-theme #vendor-daily-root :is(input:not([type]), input:is([type="number"],[type="datetime-local"]),select,textarea) {
  border: 1px solid var(--theme-field);
  border-radius: var(--theme-radius);
  padding: .4rem .7rem;
  color: var(--text);
  background: var(--panel);
}
.xinpu-theme #vendor-daily-root :is(input,select,textarea):focus-visible { box-shadow: var(--theme-focus); }
.xinpu-theme #vendor-daily-root :is(#vd-preview,#vd-save):enabled { background: var(--accent); color: var(--panel); }
