/* Pattern bead counter desktop styles */

#app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.counter-header {
  gap: 20px;
}

.counter-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.counter-nav a,
.counter-nav span {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}

.counter-nav span {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--active-bg);
}

.counter-nav a:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.counter-main {
  overflow: hidden;
}

.counter-sidebar {
  width: 340px;
}

.panel-title-icon {
  flex-shrink: 0;
  color: var(--accent-primary);
}

.panel-count {
  color: var(--text-muted);
  font-size: 12px;
}

.visually-hidden-input {
  display: none;
}

.counter-upload {
  min-height: 190px;
}

.counter-upload.processing {
  pointer-events: none;
  opacity: 0.7;
}

.counter-upload-icon {
  display: block;
  margin: 0 auto 16px;
  color: var(--accent-primary);
  opacity: 0.75;
}

.file-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.file-panel .panel-content {
  min-height: 0;
}

.file-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
}

.file-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-valid .status-dot {
  background: var(--success);
}

.status-missing .status-dot,
.status-error .status-dot {
  background: var(--warning);
}

.file-item-controls {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.file-item-controls .el-input-number {
  width: 86px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.tool-btn:disabled,
.tool-btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  color: var(--text-muted);
  border-color: var(--border-color);
}

.counter-workspace {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  min-height: 82px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
}

.summary-card span {
  color: var(--text-secondary);
  font-size: 12px;
}

.summary-card strong {
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 185px;
  max-height: 240px;
}

.brand-summary-panel,
.color-strip-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.brand-summary-list,
.color-chip-wrap {
  min-height: 0;
  overflow-y: auto;
}

.brand-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.brand-summary-row:last-child {
  border-bottom: 0;
}

.brand-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.brand-code {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.brand-numbers {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.brand-numbers strong {
  font-size: 18px;
}

.brand-numbers span {
  color: var(--text-secondary);
  font-size: 12px;
}

.color-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}

.color-chip {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
}

.color-swatch {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1px solid rgba(128, 128, 128, 0.55);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.results-panel {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-header {
  gap: 12px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.result-content {
  min-height: 0;
  flex: 1;
  display: flex;
  padding-top: 8px;
  max-width: 100%;
  overflow: hidden;
}

.result-tabs {
  min-height: 0;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.result-tabs > .el-tabs__header {
  flex-shrink: 0;
}

.result-tabs > .el-tabs__content {
  min-height: 0;
  flex: 1;
}

.result-tabs .el-tab-pane {
  height: 100%;
}

.table-color {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.empty-state-small {
  padding: 14px 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .counter-sidebar {
    width: 310px;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

@media (max-width: 820px) {
  #app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .counter-header {
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .counter-nav {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .counter-main {
    flex-direction: column;
    overflow: visible;
    padding: 14px;
  }

  .counter-sidebar,
  .counter-workspace {
    width: 100%;
    max-height: none;
    overflow: visible;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-panel {
    min-height: 520px;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions .el-button {
    flex: 1;
  }

  .result-content {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .result-tabs {
    width: 760px;
    min-width: 760px;
  }
}

@media (max-width: 520px) {
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .logo-subtitle {
    display: none;
  }

  .file-item {
    grid-template-columns: 1fr;
  }

  .file-item-controls {
    align-items: center;
    justify-content: space-between;
  }
}
