:root {
  --radius: 8px;
  --accent-dark: #c92e47;
  --bg-card: var(--box);
  --border: var(--box-border);
  --dropzone-bg: var(--input-bg);
  --table-head-bg: var(--box-border);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  min-height: 100vh;
}

/* ---------- Layout ---------- */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 600;
}

/* ---------- Form elements ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

select, input[type="password"] {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: 0.9; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-danger { background: var(--accent-dark); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-block { width: 100%; margin-top: 8px; }
.btn-small { padding: 4px 10px; font-size: 13px; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--dropzone-bg);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.dragover {
  border-color: var(--accent);
}
.dropzone-icon { font-size: 28px; margin-bottom: 8px; }
.dropzone-text { color: var(--text-muted); font-size: 14px; }

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--dropzone-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

/* ---------- Upload status ---------- */
.upload-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.upload-status.success { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.upload-status.error { background: rgba(233, 69, 96, 0.1); color: var(--accent-dark); }
.upload-status.pending { background: rgba(234, 179, 8, 0.12); color: #b45309; }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: rgba(233, 69, 96, 0.1); color: var(--accent-dark); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
tbody td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.muted { color: var(--text-muted); }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.badge-error { background: rgba(233, 69, 96, 0.15); color: var(--accent-dark); }
.badge-warning { background: rgba(234, 179, 8, 0.18); color: #b45309; }

/* ---------- Modal ---------- */
.modal-overlay[hidden] { display: none; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.modal h3 { margin-top: 0; }
.warnings-list { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.warnings-list ul { margin: 0; padding-left: 18px; }
.warnings-list li { margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
