/* ==========================================================================
   V3.5 Dual-Mode File Slot, Preflight Diagnostics & 7-Day Data Shelf Drawer
   ========================================================================== */

/* ---------- Dual-Mode File Slot Enhancement ---------- */
.ws-slot-wrap {
  margin-top: 6px;
  border: 1px solid var(--app-line, #e2e8f0);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.ws-slot-wrap.is-dragover {
  border: 1.5px dashed var(--app-teal, #087d83);
  background: var(--app-teal-soft, #eef8f8);
}

.ws-slot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.ws-slot-tabs {
  display: inline-flex;
  padding: 2px;
  border-radius: 7px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.ws-slot-tab {
  padding: 4px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  font: 600 12px/1.3 var(--app-font, sans-serif);
  cursor: pointer;
}

.ws-slot-tab.is-active {
  background: #ffffff;
  color: var(--app-teal, #087d83);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.ws-slot-autosave {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--app-muted, #5e7088);
  cursor: pointer;
  margin: 0 !important;
  font-weight: 500 !important;
}

.ws-slot-autosave input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 15px;
  accent-color: var(--app-teal, #087d83);
  cursor: pointer;
}

.ws-slot-selected-chip[hidden],
.ws-slot-inline-picker[hidden],
.ws-slot-preflight[hidden] {
  display: none !important;
}

.ws-picker-filter-note {
  font-size: 11.5px;
  color: #64748b;
  padding: 3px 6px 5px;
  border-bottom: 1px dashed #e2e8f0;
  margin-bottom: 2px;
}

.ws-slot-selected-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  margin-top: 6px;
  border-radius: 8px;
  background: var(--app-teal-soft, #eef8f8);
  border: 1px solid var(--app-teal-border, #9fd5d8);
  font-size: 12.5px;
  color: #0f3f43;
}

.ws-slot-selected-chip strong {
  font-weight: 600;
  word-break: break-all;
}

.ws-slot-selected-actions {
  display: inline-flex;
  gap: 6px;
  flex: none;
}

.ws-slot-preflight {
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.ws-slot-preflight.is-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.ws-slot-preflight.is-warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.ws-slot-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.ws-slot-warn-list {
  margin: 5px 0 0;
  padding-left: 16px;
}

.ws-slot-inline-picker {
  margin-top: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  gap: 4px;
}

.ws-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  font: 12.5px/1.35 var(--app-font, sans-serif);
}

.ws-picker-row:hover {
  border-color: var(--app-teal, #087d83);
  background: var(--app-teal-soft, #eef8f8);
}

.ws-picker-row small {
  color: var(--app-muted, #5e7088);
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- Multi-Slot Smart Auto-Match Banner ---------- */
.ws-automatch-banner {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--app-teal-border, #9fd5d8);
  background: linear-gradient(90deg, #eef8f8 0%, #f8fafc 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--app-ink, #172638);
}

.ws-automatch-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ws-automatch-pair {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 12px;
}

/* ---------- Global 7-Day Shelf Slide-over Drawer ---------- */
.ws-shelf-drawer[hidden] {
  display: none !important;
}

.ws-shelf-drawer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  font-family: var(--app-font, sans-serif);
}

.ws-shelf-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 27, 50, 0.42);
}

.ws-shelf-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  background: #ffffff;
  box-shadow: var(--app-shadow-3);
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.ws-shelf-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--app-line, #e2e8f0);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ws-shelf-head h2 {
  margin: 0;
  font-size: 17px;
  color: var(--app-ink, #172638);
}

.ws-shelf-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--app-muted, #5e7088);
}

.ws-shelf-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-quota-bar {
  padding: 10px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--app-line, #e2e8f0);
}

.ws-quota-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--app-muted, #5e7088);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.ws-retention-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
}

.ws-quota-track {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.ws-quota-fill {
  height: 100%;
  background: var(--app-teal, #087d83);
  transition: width 200ms ease;
}

.ws-shelf-toolbar {
  padding: 10px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--app-line, #e2e8f0);
}

.ws-input,
.ws-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: 13px var(--app-font, sans-serif);
  background: #ffffff;
  color: var(--app-ink, #172638);
}

.ws-input {
  flex: 1 1 165px;
  min-width: 140px;
}

.ws-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--app-ink, #172638);
  font: 600 12.5px/1 var(--app-font, sans-serif);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.ws-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ws-btn-primary {
  background: var(--app-teal, #087d83);
  border-color: var(--app-teal, #087d83);
  color: #ffffff !important;
}

.ws-btn-primary:hover:not(:disabled) {
  background: var(--app-teal-strong, #066a70);
}

.ws-btn-ghost {
  background: #f8fafc;
}

.ws-btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 11.5px;
}

.ws-btn-icon {
  width: 34px;
  padding: 0;
}

.ws-shelf-status {
  margin: 8px 18px 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: var(--app-teal-soft, #eef8f8);
  color: #0f3f43;
}

.ws-shelf-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.ws-file-card {
  border: 1px solid var(--app-line, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
  display: grid;
  gap: 6px;
  transition: border-color 140ms ease;
}

.ws-file-card:hover,
.ws-file-card.is-checked {
  border-color: var(--app-teal, #087d83);
}

.ws-file-card.is-checked {
  background: #f5fbfb;
}

.ws-file-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-file-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--app-ink, #172638);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-exp-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

.ws-exp-tag.is-urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.ws-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--app-muted, #5e7088);
  padding-left: 24px;
}

.ws-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 24px;
}

.ws-preview-pane {
  border-top: 1px solid var(--app-line, #e2e8f0);
  background: #f8fafc;
  max-height: 44%;
  display: flex;
  flex-direction: column;
}

.ws-preview-head {
  padding: 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
}

.ws-preview-body {
  padding: 10px 18px;
  overflow: auto;
  font-size: 12px;
}

.ws-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  background: #ffffff;
}

.ws-mini-table th,
.ws-mini-table td {
  border: 1px solid #e2e8f0;
  padding: 4px 7px;
  text-align: left;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-mini-table th {
  background: #f1f5f9;
  font-weight: 600;
}

.ws-shelf-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--app-line, #e2e8f0);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ws-selected-summary {
  font-size: 12px;
  color: var(--app-muted, #5e7088);
}

.ws-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--app-muted, #5e7088);
  font-size: 13px;
}

/* ---------- Batch Multi-Analysis Dialog ---------- */
.ws-batch-dialog {
  width: min(740px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--app-line, #e2e8f0);
  border-radius: 14px;
  box-shadow: var(--app-shadow-3);
  font-family: var(--app-font, sans-serif);
}

.ws-batch-dialog::backdrop {
  background: rgba(7, 27, 50, 0.5);
}

.ws-batch-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-line, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ws-batch-head h2 {
  margin: 0;
  font-size: 18px;
}

.ws-batch-body {
  padding: 16px 20px;
  max-height: 62vh;
  overflow-y: auto;
  display: grid;
  gap: 12px;
}

.ws-batch-item {
  border: 1px solid var(--app-line, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
  display: grid;
  gap: 8px;
}

.ws-batch-item.is-selected {
  border-color: var(--app-teal, #087d83);
  background: #f7fcfc;
}

.ws-batch-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ws-batch-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.ws-batch-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--app-line, #e2e8f0);
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
