:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #18202b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.app-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.25;
}

h2 {
  font-size: 16px;
  line-height: 1.35;
}

.topbar p {
  margin-top: 8px;
  color: #5a6675;
  font-size: 14px;
}

button,
input {
  font: inherit;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: #176c5f;
  white-space: nowrap;
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #9ba6b3;
}

.secondary-button {
  color: #1f3348;
  background: white;
  border-color: #d7dde5;
}

.upload-grid,
.summary-grid,
.workspace-grid {
  display: grid;
  gap: 14px;
}

.upload-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
}

.upload-card,
.panel,
.metric-card {
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: white;
}

.upload-card {
  display: grid;
  gap: 10px;
  min-height: 116px;
  padding: 18px;
  cursor: pointer;
}

.upload-title {
  font-weight: 700;
}

.upload-status,
.hint {
  color: #647184;
  font-size: 13px;
}

.upload-card input {
  width: 100%;
}

.panel {
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card {
  padding: 14px 16px;
}

.metric-card span {
  display: block;
  color: #647184;
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.sheet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.sheet-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 8px 10px;
}

.sheet-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid #e8edf3;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f5f8;
  color: #415066;
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-cell,
.empty-state {
  color: #7a8696;
  text-align: center;
}

.issue-list {
  display: grid;
  gap: 10px;
}

.issue {
  border-left: 4px solid #c8d0da;
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px 12px;
  font-size: 13px;
}

.issue.warning {
  border-left-color: #d68b16;
  background: #fff8eb;
}

.issue.error {
  border-left-color: #c83e3e;
  background: #fff1f1;
}

.issue.success {
  border-left-color: #176c5f;
  background: #eef9f6;
}

@media (max-width: 900px) {
  .topbar,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .upload-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }
}
