.operations-filter[hidden],
.record-form .field[hidden] {
  display: none;
}
.operations-filter,
.calendar-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 16px 18px;
  background: #f8f9fc;
}
.operations-filter input,
.operations-filter select,
.calendar-tools input,
.calendar-tools select {
  min-height: 40px;
}
.operations-filter .button,
.calendar-tools .button {
  min-height: 39px;
}
.operations-filter button[type="submit"] { background:var(--blue); border-color:var(--blue); color:white; padding-inline:18px; }
.operations-filter button[type="submit"]:hover:not(:disabled) { background:var(--blue-hover); border-color:var(--blue-hover); }
.operations-filter button[type="reset"] { color:#596a83; }
.schedule-staff-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.schedule-staff-picker [draggable="true"] {
  cursor: grab;
}
.schedule-project-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 155px;
  margin-bottom: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #f8fafd;
  font-size: 12px;
}
.schedule-project-slot.drag-over {
  background: #edf3fb;
  border-color: var(--blue);
  outline: 1px solid var(--blue);
}
.schedule-project-empty {
  padding: 12px;
  border-top: 1px solid var(--line);
}
.operations-thumb {
  display: block;
  width: 64px;
  height: 48px;
  object-fit: contain;
  background: #f8fafc;
}
.quote-history { min-width:0; }
.quote-history table { min-width:780px; }
.quote-history td { max-width:300px; overflow-wrap:anywhere; }
.quote-history td small { display:block; }
.quote-history h3 { margin:16px 0 10px; }
.quote-history code { overflow-wrap:anywhere; }
.quote-history .detail-actions { margin-block:14px; flex-wrap:wrap; }
.quote-history [data-history-result] > p { margin-block:14px; }
.history-amounts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-block:1px solid var(--line); background:#f8f9fc; padding:12px; gap:12px; }
.history-amounts dt { font-size:12px; color:var(--muted); }
.history-amounts dd { margin:8px 0 0; font-weight:650; font-variant-numeric:tabular-nums; }
@media(max-width:760px) { .history-amounts { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.operations-section {
  margin: 0;
  padding: 18px;
}
.operations-section + .operations-section {
  border-top: 1px solid var(--line);
}
.operations-section h3 {
  margin-bottom: 10px;
}
.operations-filter {
  border-bottom: 1px solid var(--line);
}
.operations-filter input[type="search"] {
  flex:1 1 280px;
  max-width:600px;
  min-width:220px;
  padding-left:38px;
  background:white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath fill='none' stroke='%237185a4' stroke-width='1.6' d='M8 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12ZM12 12l4 4'/%3E%3C/svg%3E") no-repeat 12px center;
}
.operations-filter select { flex:0 1 150px; }
.shell .panel > .table-scroll { border-radius:0; }
.shell .panel table td .button { box-shadow:none; }
.shell .panel table th { font-size:12px; color:#596a83; }
.shell .panel table td { font-size:13px; }
.shell .panel table .detail-actions { gap:5px; }
.operations-schedule {
  display: grid;
  grid-template-columns: 150px repeat(7, minmax(132px, 1fr));
  min-width: 1080px;
  gap: 1px;
  background: #dbe4ef;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.operations-schedule .schedule-cell {
  min-height: 108px;
}
.operations-schedule .header {
  min-height: 38px;
}
.operations-schedule .schedule-task {
  cursor: pointer;
}
.operations-section table thead th { background:#f8fafc; }
.operations-section .table-scroll { border:1px solid var(--line); border-radius:8px; }
.operations-section .table-scroll table { min-width:720px; }
.operations-filter + div td small {
  display: block;
  font-size: 11px;
  line-height: 1.5;
}
.stock-query {
  align-items: flex-end;
}
.stock-query .field {
  min-width: 170px;
}
.dialog-body > .detail-actions {
  position: sticky;
  top: -20px;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  z-index: 2;
}
.detail-section .check-label {
  margin: 8px 0;
}
.detail-section h3:not(:first-child) {
  margin-top: 14px;
}
.operations-filter button {
  flex: none;
}
.operations-filter select {
  max-width: 220px;
}
.operations-page,
.operations-data,
#finance-content,
#schedule-projects,
#schedule-calendar,
#schedule-list,
#stock-reservations {
  min-width: 0;
  max-width: 100%;
}
.operations-tabs {
  margin: 0;
  padding-inline: 6px;
  border-bottom: 1px solid var(--line);
  background: white;
  scrollbar-width: thin;
}
.operations-tabs button {
  min-height: 48px;
  border-radius: 10px 10px 0 0;
  transition: color var(--feedback) var(--ease-out), background-color var(--feedback) var(--ease-out), box-shadow var(--feedback) var(--ease-out), transform var(--feedback) var(--ease-out);
}
.operations-tabs button:hover:not(:disabled) { background: var(--blue-soft); color: var(--blue); }
.operations-tabs button:active:not(:disabled) { background: #dfe7f6; transform: scale(.97); }
.operations-tabs button.working { opacity: .65; cursor: progress; }
.operations-page .operations-filter { margin: 0; }
.operations-page .operations-filter input[type="search"] { max-width: none; min-width: 0; flex: 1 1 300px; }
.operations-page .operations-filter select { min-width: 0; flex: 0 1 165px; }
.operations-results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.operations-results-bar strong { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.operations-record-title { display: flex; flex-direction: column; min-width: 150px; gap: 3px; }
.operations-record-title strong { color: var(--ink); font-weight: 650; }
.operations-record-title > span { color: var(--muted); font-size: 12px; }
.operations-row-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 165px; }
.operations-next-action { color: var(--muted); font-size: 12px; white-space: nowrap; }
.orders-workspace table { min-width: 1050px; }
.orders-workspace td:nth-child(5),
.orders-workspace td:nth-child(6),
.orders-workspace td:nth-child(7),
.finance-workspace td { font-variant-numeric: tabular-nums; }
.orders-workspace td:nth-child(5) { color: var(--ink); font-weight: 650; }
.orders-workspace [data-order], .finance-workspace [data-order] { color: var(--blue); border-color: #c6d3e7; }
.finance-accounts table { min-width: 1320px; }
.finance-ledger table { min-width: 1040px; }
.finance-records table, .finance-payroll table { min-width: 860px; }
.finance-accounts td:nth-child(4), .finance-ledger td:nth-child(3) { color: var(--ink); font-weight: 650; white-space: nowrap; }
.finance-workspace td:not(:first-child) { min-width: 80px; }
.finance-ledger td:nth-child(4), .finance-records td:nth-child(4) { min-width: 240px; max-width: 340px; overflow-wrap: anywhere; }
.stock-query { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)) minmax(140px, .7fr) minmax(170px, 1fr) auto; }
.stock-query .field { min-width: 0; }
.stock-query input, .stock-query select { width: 100%; min-width: 0; max-width: 100%; }
.operations-stock-context { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 14px; padding: 0 18px 14px; font-size: 12px; }
.operations-stock-context > span:first-child { color: var(--ink); font-weight: 650; }
.operations-stock-context .file-note { margin: 0; }
.operations-stock-context > span:last-child { flex-basis: 100%; }
.stock-workspace table { min-width: 760px; }
.stock-workspace td:nth-child(4) { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
#stock-reservations table { min-width: 880px; }
.schedule-calendar-controls { gap: 12px; }
.schedule-view-switch, .schedule-date-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.schedule-date-controls .check-label { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 12px; }
.schedule-date-controls input { width: 146px; }
#schedule-range { margin-left: auto; }
.schedule-filter input[type="search"] { flex-basis: 280px; }
.operations-section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 17px 18px 9px; }
.operations-section-heading h3 { margin: 0; font-size: 14px; }
.operations-section-heading span { font-size: 12px; color: var(--muted); }
.schedule-desktop table { min-width: 1040px; table-layout: auto; }
.schedule-desktop th:first-child, .schedule-desktop td:first-child { position: sticky; left: 0; min-width: 160px; max-width: 190px; background: white; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.schedule-desktop th:first-child { background: #f2f4f8; z-index: 2; }
.schedule-desktop th:not(:first-child), .schedule-desktop td:not(:first-child) { min-width: 170px; }
.schedule-desktop .schedule-cell { padding: 3px 0; min-height: 108px; }
.schedule-task { border-radius: var(--radius-control); padding: 9px; transition: background-color var(--feedback) var(--ease-out), border-color var(--feedback) var(--ease-out), transform var(--feedback) var(--ease-out); }
.schedule-task:hover:not(:disabled) { background: #dfe9f7; border-color: #9eb7dc; }
.schedule-task:active:not(:disabled), .schedule-day-task:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.schedule-mobile { display: none; }
.schedule-mobile-hint { display: none; }
.schedule-day { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.schedule-day h3 { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 10px; font-size: 14px; }
.schedule-day h3 > span { color: var(--muted); font-size: 12px; font-weight: 400; }
.schedule-day-demand { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.schedule-day-demand > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; }
.schedule-day-demand strong { color: var(--ink); }
.schedule-day-demand .button { flex-shrink: 0; min-height: 44px; }
.schedule-day-task { display: flex; flex-direction: column; width: 100%; min-width: 0; text-align: left; gap: 5px; padding: 12px 0; background: white; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 13px; line-height: 1.6; transition: background-color var(--feedback) var(--ease-out), transform var(--feedback) var(--ease-out); }
.schedule-day-task > span { overflow-wrap: anywhere; }
.schedule-day-task > span:first-child { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.schedule-day-task:hover:not(:disabled) { background: #f4f7fc; }
.schedule-day-task > .muted { font-size: 12px; }
#schedule-list table { min-width: 920px; }
.order-detail-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 18px; }
.order-detail-summary > div { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 160px; }
.order-detail-summary > div > strong { font-size: 17px; }
.order-detail-summary > div > span { color: var(--muted); font-size: 12px; }
.order-detail-summary dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; flex-basis: 100%; margin: 0; padding: 14px 0; border-block: 1px solid var(--line); }
.order-detail-summary dt { color: var(--muted); font-size: 12px; }
.order-detail-summary dd { color: var(--ink); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; margin: 6px 0 0; }
.dialog-body > .order-command-bar { position: static; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 18px; padding: 0 0 16px; }
.order-action-group { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.order-action-group > span { color: var(--muted); font-size: 12px; }
.order-action-group > div { display: flex; flex-wrap: wrap; gap: 6px; }
.order-action-group > div:empty { display: none; }
@media (max-width: 1180px) {
  .stock-query { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-query > .button { justify-self: start; }
  #schedule-range { flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 768px) {
  .schedule-desktop { display: none; }
  .schedule-mobile { display: block; }
  .schedule-desktop-hint { display: none; }
  .schedule-mobile-hint { display: inline; }
  .stock-workspace .stock-query { grid-template-columns: minmax(0, 1fr); }
  .stock-workspace .stock-query > .field,
  .stock-workspace .stock-query > .button { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .stock-workspace .stock-query > .button { min-height: 44px; }
  .schedule-calendar-controls { align-items: stretch; }
  .schedule-date-controls { flex: 1 1 100%; }
  .operations-page .operations-filter select { flex: 1 1 145px; }
}
@media (max-width: 640px) {
  .operations-tabs { padding-inline: 0; }
  .operations-tabs button { min-height: 44px; padding-inline: 12px; }
  .operations-page .operations-filter input[type="search"] { flex-basis: 100%; }
  .operations-page .operations-filter .button { flex: 1 1 calc(50% - 6px); white-space: normal; min-height: 44px; }
  .operations-results-bar { padding: 12px; }
  .operations-results-bar > .muted { flex-basis: 100%; }
  .stock-query { grid-template-columns: minmax(0,1fr); padding: 12px; }
  .stock-query .field { width: 100%; }
  .stock-query > .button { width: 100%; min-height: 44px; }
  .operations-stock-context { padding-inline: 12px; }
  .schedule-calendar-controls { padding: 12px; }
  .schedule-view-switch { width: 100%; }
  .schedule-view-switch .button { flex: 1; min-height: 44px; }
  .schedule-date-controls { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .schedule-date-controls .check-label { grid-column: 1 / -1; order: -1; justify-content: space-between; min-width: 0; flex-wrap: wrap; }
  .schedule-date-controls .button { min-width: 0; min-height: 44px; padding-inline: 7px; }
  .schedule-day { padding: 14px 12px; }
  .dialog-body > .order-command-bar { grid-template-columns: minmax(0,1fr); }
  .order-action-group .button { flex: 1 1 calc(50% - 6px); min-height: 44px; white-space: normal; }
  .order-detail-summary dl { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .order-detail-summary dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .order-detail-summary dd { margin: 0; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .operations-tabs button, .schedule-task, .schedule-day-task { transition-property: background-color, color, border-color, box-shadow !important; transform: none !important; }
}
.stock-error {
  margin: 0 14px 12px;
}
.operations-section details summary,
td details summary {
  color: var(--blue);
  cursor: pointer;
}
.dialog .detail-section th {
  position: sticky;
  top: 0;
}
.dialog table {
  font-variant-numeric: tabular-nums;
}
.dialog .detail-actions + .detail-section {
  margin-top: 10px;
}
.record-form .inline-notice {
  margin-top: 16px;
  border: 1px solid #efdfc0;
}
.record-form > .table-scroll {
  margin-top: 14px;
}
.detail-grid > div {
  overflow-wrap: anywhere;
}
.dialog-body .detail-section:first-child {
  margin-top: 0;
}
input[type="checkbox"] {
  flex: none;
}
@media (max-width: 640px) {
  .operations-filter {
    align-items: stretch;
  }
  .operations-filter select {
    max-width: none;
    flex: 1;
  }
  .operations-filter input[type="search"] {
    width: 100%;
    max-width: none;
    flex:1 1 100%;
    min-width:0;
  }
  .operations-filter { padding:12px; }
  .operations-filter .button { flex:1; }
  .stock-query .field {
    min-width: 0;
    width: 100%;
  }
  .stock-query .button {
    width: 100%;
  }
  .dialog-body > .detail-actions {
    top: -15px;
  }
  .operations-section {
    padding: 12px;
  }
  .operations-schedule {
    grid-template-columns: 112px repeat(7, minmax(128px, 1fr));
    min-width: 1020px;
  }
  .dialog .detail-actions .button {
    flex: 1;
  }
  .detail-actions {
    gap: 6px;
  }
}
.asset-scan-form {
  align-items: flex-end;
}
.asset-scan-form .field:first-child {
  min-width: 180px;
}
.asset-scan-form .field:nth-child(2) {
  flex: 1;
  min-width: 240px;
}
.asset-scan-form input {
  font-variant-numeric: tabular-nums;
}
.operations-scan-note {
  padding: 0 14px;
}
.scan-result:empty {
  display: none;
}
.scan-result .form-error {
  margin-top: 0;
}
.scan-result .detail-actions {
  margin-top: 10px;
}
@media (max-width: 640px) {
  .asset-scan-form .field:first-child,
  .asset-scan-form .field:nth-child(2) {
    min-width: 0;
    width: 100%;
    flex: auto;
  }
  .asset-scan-form .button {
    width: 100%;
  }
}
