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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid #1e2235;
  background: #13161f;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #60a5fa;
  letter-spacing: -0.02em;
}

.topbar-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s;
}
.topbar-back:hover { color: #94a3b8; }

.page { padding: 2rem; max-width: 1100px; margin: 0 auto; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.page-title { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; }

/* ── Cards ── */
.card {
  background: #1a1d27;
  border: 1px solid #2d3148;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  background: #1a1d27;
  border: 1px solid #2d3148;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.project-card:hover { border-color: #3b82f6; background: #1e2235; }

.project-card-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
}

.project-card-path {
  font-family: 'Consolas', monospace;
  font-size: 0.75rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.72rem;
  color: #64748b;
}

.project-card-delete {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: none;
  border: none;
  color: #374151;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.project-card-delete:hover { color: #ef4444; background: #1f1010; }

/* ── Job List ── */
.job-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #1a1d27;
  border: 1px solid #2d3148;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.job-item:hover { border-color: #3b4260; }

.job-info { flex: 1; min-width: 0; }
.job-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.job-path {
  font-family: 'Consolas', monospace;
  font-size: 0.75rem;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-meta { font-size: 0.72rem; color: #64748b; margin-top: 0.3rem; }
.job-meta span { color: #22c55e; }

.job-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ── Buttons ── */
button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }

.btn-ghost {
  background: #1e293b;
  border: 1px solid #2d3148;
  color: #94a3b8;
}
.btn-ghost:hover { background: #273447; color: #e2e8f0; }

.btn-danger { background: #7f1d1d; color: #fca5a5; }
.btn-danger:hover { background: #991b1b; }

.btn-success { background: #065f46; color: #d1fae5; }
.btn-success:hover { background: #047857; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }

button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Form ── */
.form-group { margin-bottom: 1rem; }

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="datetime-local"] {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: #0f1117;
  border: 1px solid #2d3148;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
input:focus { border-color: #60a5fa; }
input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }

.input-group { display: flex; gap: 0.5rem; }
.input-group input { flex: 1; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Table ── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }

thead th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #2d3148;
}

tbody tr { border-bottom: 1px solid #1a1d27; transition: background 0.12s; }
tbody tr:hover { background: #1e2235; }
tbody tr.selected { background: #172040; }

td { padding: 0.5rem 0.8rem; vertical-align: middle; }

.td-check { width: 36px; }
.td-path { font-family: 'Consolas', monospace; color: #a5b4fc; word-break: break-all; }
.td-date { color: #94a3b8; white-space: nowrap; }
.td-size { color: #64748b; text-align: right; white-space: nowrap; }

input[type="checkbox"] { width: 15px; height: 15px; accent-color: #3b82f6; cursor: pointer; }

/* ── Status ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-blue { background: #1e3a6e; color: #60a5fa; }
.badge-green { background: #064e3b; color: #34d399; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stats { font-size: 0.84rem; color: #64748b; }
.stats strong { color: #60a5fa; }

.sel-bar { display: flex; align-items: center; gap: 0.75rem; font-size: 0.82rem; color: #64748b; }
.sel-bar strong { color: #f59e0b; }

/* ── Alert ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.84rem;
  margin-bottom: 1rem;
}
.alert-error { background: #2d1515; border: 1px solid #7f1d1d; color: #fca5a5; }
.alert-success { background: #052e16; border: 1px solid #065f46; color: #86efac; }

.empty { text-align: center; padding: 3rem; color: #374151; font-size: 0.9rem; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: #1a1d27;
  border: 1px solid #2d3148;
  border-radius: 14px;
  padding: 1.75rem;
  width: 460px;
  max-width: 95vw;
}
.modal-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: #065f46;
  color: #d1fae5;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.84rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 200;
}
.toast.show { opacity: 1; }
