/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e0e3e9;
  --text: #1d2129;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #b91c1c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.topbar nav { display: flex; gap: 1rem; }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--muted); font-size: 0.9rem; }

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

.container.narrow { max-width: 420px; }

h1 { font-size: 1.5rem; margin: 0 0 0.25rem; }
.subtitle { color: var(--muted); margin: 0 0 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.flash.notice { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.alert { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--surface);
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: #f3f4f6; }
.btn.link { background: none; border: none; color: var(--accent); padding: 0; }
.btn.small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn.danger { color: var(--danger); }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.dragging { border-color: var(--accent); background: #eff6ff; }
.dropzone strong { color: var(--text); display: block; font-size: 1.05rem; margin-bottom: 0.35rem; }

.file-list { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.file-list li {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 0.5rem;
}
.file-list .name {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}
.file-list .name input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
}
.file-list .meta { color: var(--muted); font-size: 0.85rem; }

.actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

table.templates {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.templates th,
table.templates td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.templates th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #fafbfc;
}
table.templates tr:last-child td { border-bottom: none; }
table.templates td.right { text-align: right; white-space: nowrap; }

.status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: capitalize;
}
.status.pending { background: #f3f4f6; color: #374151; }
.status.processing { background: #fef3c7; color: #92400e; }
.status.imported { background: #d1fae5; color: #065f46; }
.status.failed { background: #fee2e2; color: var(--danger); }
.status.cancelled { background: #e0e7ff; color: #3730a3; }

.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 0.75rem;
}
.log-header h2 { font-size: 1.1rem; margin: 0; }

.log {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.45;
  max-height: 520px;
}

dl.meta { display: grid; grid-template-columns: 160px 1fr; gap: 0.5rem 1rem; margin: 0; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }

.muted { color: var(--muted); }
