*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #15803d;
  --error: #dc2626;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

/* Header */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-bottom: 2rem;
}
header h1 { font-size: 1.375rem; font-weight: 700; }
header .subtitle { color: var(--muted); font-size: 0.875rem; margin-top: 2px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; }

/* Form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.8125rem; font-weight: 500; margin-bottom: .375rem; }

input[type="text"] {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  outline: none;
  transition: border-color .15s;
  background: var(--card);
  color: var(--text);
}
input[type="text"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: border-color .15s, background .15s;
  cursor: default;
}
.drop-zone.dragging { border-color: var(--primary); background: #eff6ff; }
.drop-icon { font-size: 1.75rem; color: var(--muted); margin-bottom: .625rem; }
.drop-zone p { color: var(--muted); font-size: 0.875rem; }
.hint { font-size: 0.75rem !important; margin-top: .25rem; }
.link-btn {
  background: none; border: none; color: var(--primary);
  cursor: pointer; font-size: 0.875rem; text-decoration: underline; padding: 0;
}
.file-info {
  display: inline-flex; gap: .625rem; align-items: center;
  margin-top: .75rem; padding: .375rem .75rem;
  background: #eff6ff; border-radius: 4px; font-size: 0.875rem;
}

/* Progress */
.progress-container { margin-bottom: 1rem; }
.progress-bg { background: var(--border); border-radius: 99px; height: 1.375rem; overflow: hidden; }
.progress-bar {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .25s ease; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 0.6875rem; font-weight: 600;
  min-width: 2.5rem;
}

/* Status */
.status-msg {
  font-size: 0.875rem; padding: .5rem .75rem;
  border-radius: 4px; margin-bottom: 1rem;
}
.status-msg.info    { background: #eff6ff; color: var(--primary); }
.status-msg.success { background: #f0fdf4; color: var(--success); }
.status-msg.error   { background: #fef2f2; color: var(--error); }

/* Buttons */
.btn-primary {
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius); padding: .625rem 1.25rem;
  font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem 1rem;
  font-size: 0.875rem; cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

.btn-copy {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: .2rem .5rem; font-size: 0.75rem; cursor: pointer; color: var(--text);
  transition: background .15s;
}
.btn-copy:hover { background: var(--bg); }

/* Filter row */
.filter-row { display: flex; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filter-row input { flex: 1; min-width: 120px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  text-align: left; padding: .5rem .75rem;
  background: var(--bg); border-bottom: 1px solid var(--border);
  font-weight: 600; color: var(--muted); font-size: 0.6875rem;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
td { padding: .625rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

.url-cell {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: monospace; font-size: 0.75rem; color: var(--muted);
}

.empty { text-align: center; color: var(--muted); padding: 2rem !important; }
.list-error { text-align: center; color: var(--error); padding: 2rem !important; }
.muted { color: var(--muted); }

/* Pagination */
.pagination {
  display: flex; align-items: center; gap: 1rem;
  margin-top: 1rem; justify-content: center; font-size: 0.875rem;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}
