:root {
  --brand: #159a91;
  --brand-hover: #0e7d76;
  --brand-soft: #e6f6f4;
  --ink: #12161d;
  --muted: #5b6472;
  --line: #e6eaef;
  --bg: #f3f6f8;
  --shadow: 0 10px 30px rgba(18, 22, 29, 0.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.top strong { margin-right: auto; }
.top button {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
}
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}
.flash {
  background: var(--brand-soft);
  color: #0e7d76;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 0 0 18px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin: 18px 0 0;
  box-shadow: var(--shadow);
}
.narrow { max-width: 420px; }
.table-wrap { overflow: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.actions { display: flex; gap: 8px; }
.actions form { margin: 0; }
.actions button {
  background: #12161d;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}

.upload-page { display: grid; gap: 18px; }
.upload-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.upload-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.upload-back:hover { color: var(--ink); }
.upload-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.03em;
}
.upload-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 42rem;
}
.upload-info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: min(280px, 100%);
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: #0e7d76;
  font-size: 13px;
  line-height: 1.45;
}
.upload-info-icon {
  display: inline-flex;
  color: var(--brand);
  margin-top: 1px;
}
.upload-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.upload-kpi {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.upload-kpi-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
}
.upload-kpi-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.upload-kpi strong {
  display: block;
  margin-top: 2px;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.upload-kpi small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.upload-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.upload-field { margin-bottom: 18px; }
.upload-field label,
.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.upload-field-icon { color: var(--brand); display: inline-flex; }
.upload-field input,
.upload-field select,
.upload-field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.upload-field input:focus,
.upload-field select:focus,
.upload-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 154, 145, 0.14);
}
.upload-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.upload-notes-wrap { position: relative; }
.upload-notes-wrap textarea {
  min-height: 132px;
  resize: vertical;
  padding-bottom: 28px;
}
.upload-notes-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.upload-drop {
  position: relative;
  border: 1.5px dashed #c9d3dc;
  border-radius: 18px;
  background: #f8fbfc;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.upload-drop.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(21, 154, 145, 0.2);
}
.upload-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.upload-drop-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 18px;
}
.upload-drop-cloud { color: var(--brand); flex-shrink: 0; }
.upload-drop-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.upload-drop-copy strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}
.upload-drop-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.upload-browse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--brand);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.upload-browse:hover {
  background: var(--brand-soft);
}
.upload-drop-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
}
.upload-file-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.upload-file-badge {
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.upload-file-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(420px, 55vw);
}
.upload-file-meta span {
  color: var(--muted);
  font-size: 12px;
}
.upload-file-replace {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.upload-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 18px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(21, 154, 145, 0.06);
}
.upload-option {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid transparent;
  cursor: pointer;
}
.upload-option:hover { border-color: rgba(21, 154, 145, 0.25); }
.upload-option-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}
.upload-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.upload-option-copy strong { font-size: 14px; }
.upload-option-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.upload-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.upload-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(21, 154, 145, 0.28);
}
.upload-submit:hover { background: var(--brand-hover); }
.upload-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}
.upload-progress {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
}
.upload-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(21, 154, 145, 0.12);
  overflow: hidden;
}
.upload-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #0f766e);
  transition: width 0.2s ease;
}
.upload-progress-text {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #5b6b73);
}
.upload-card.is-uploading .upload-drop,
.upload-card.is-uploading .upload-option,
.upload-card.is-uploading .upload-field input,
.upload-card.is-uploading .upload-field select,
.upload-card.is-uploading .upload-field textarea {
  pointer-events: none;
  opacity: 0.72;
}

@media (max-width: 900px) {
  .upload-hero { flex-direction: column; }
  .upload-info { width: 100%; }
}
@media (max-width: 720px) {
  .upload-kpis,
  .upload-grid,
  .upload-options { grid-template-columns: 1fr; }
  .upload-drop-empty {
    flex-direction: column;
    text-align: center;
  }
  .upload-drop-copy { justify-items: center; }
  .upload-drop-file { flex-direction: column; align-items: flex-start; }
  .actions { flex-direction: column; }
}
