/* ========================================================================== */
/*  ROOT VARIABLES (BRAND & THEME)                                            */
/* ========================================================================== */

:root {
  /* Brand colors */
  --brand: #0b5fa5;
  --brand-600: #094b82;

  /* Text colors */
  --ink: #1a1f36;
  --muted: #6b7280;

  /* Backgrounds */
  --bg: #f7f9fc;
  --card: #ffffff;

  /* Status colors */
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;

  --radius: 10px;
}

/* ========================================================================== */
/*  GLOBAL RESET & BASE                                                       */
/* ========================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* ========================================================================== */
/*  TOP BAR                                                                   */
/* ========================================================================== */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 20px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 68px;
  width: auto;
}

.brandname {
  font-weight: 700;
  color: var(--brand);
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ========================================================================== */
/*  PAGE CONTAINERS                                                           */
/* ========================================================================== */

.page .container {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 16px;
}

.admin-page .container {
  max-width: 1200px;
}

/* Lock the login page card width regardless of other page rules */
body.login-page .login-card {
  max-width: 420px !important;
  margin: 40px auto !important;
}

#loginError {
	color:red;
}

/* ========================================================================== */
/*  CARD                                                                      */
/* ========================================================================== */

.card {
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
}

h1,
h2,
h3 {
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.note {
  background: #f8fafc;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 10px;
}

.badge {
  display: inline-block;
  background: #eef6ff;
  color: #084c8f;
  border: 1px solid #d3e5ff;
  border-radius: 999px;
  padding: 4px 10px;
}

/* ========================================================================== */
/*  BUTTONS                                                                   */
/* ========================================================================== */

.btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s,
    transform 0.02s;
}

.btn:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.btn.subtle {
  background: #fff;
}

.btn.subtle:hover {
  background: #f8fafc;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========================================================================== */
/*  FORM ELEMENTS                                                             */
/* ========================================================================== */

label {
  display: block;
  margin: 10px 0;
}

/* Base input used across dashboard & admin */
.input,
input[type='text'],
input[type='password'],
input[type='number'],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

/* Half‑width inputs for compact numeric fields */
.input.sm {
  width: 50%;
  min-width: 180px;
}

/* Units after inputs (mins / hours / MB) */
.unit {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ========================================================================== */
/*  ADMIN GRID UTILITIES                                                      */
/* ========================================================================== */

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ========================================================================== */
/*  DASHBOARD: FILES, DROPZONE, JOB LIST                                     */
/* ========================================================================== */

.dropzone {
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  background: #f8fafc;
  margin-bottom: 16px;
}

.dropzone.hover {
  background: #eef2ff;
}

.filelist .fileitem {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding: 8px 2px;
}

/* Job listing rows (dashboard) */
.jobslist .jobrow {
  display: grid;
  grid-template-columns: 260px 280px 160px 50px 120px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

.job-created,
.job-id,
.job-status,
.job-progress {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-status.failed {
  color: #b91c1c;
  font-weight: 600;
}

.view-job-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.view-job-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ========================================================================== */
/*  JOB PAGE BANNERS                                                          */
/* ========================================================================== */

.errors {
  margin: 8px 0 0 18px;
}

.downloadrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}

.outputs-expired-banner {
  background: #f1f5f9;
  border: 1px solid #d5dce3;
  color: #475569;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 500;
}

.job-error-banner {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 12px 16px;
  margin-top: 12px;
  border-radius: 8px;
  font-weight: 600;
}

/* ========================================================================== */
/*  ROLE BADGE                                                                */
/* ========================================================================== */

.role-badge {
  background: #f7d37c;
  color: #543c00;
  padding: 2px 6px;
  font-size: 9px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}

/* ========================================================================== */
/*  FOOTER                                                                    */
/* ========================================================================== */

.footer {
  padding: 16px;
  text-align: center;
  color: var(--muted);
}