/* Job Monitoring Tool - SLT internal
   Colours are defined once here; change --brand / --brand-accent to restyle the whole app. */
:root {
  --brand: #0b4ea2; /* corporate blue */
  --brand-dark: #073676;
  --brand-light: #e8f0fb;
  --brand-accent: #1aa260; /* corporate green */

  --bg: #f3f5f9;
  --panel: #ffffff;
  --text: #16203a;
  --muted: #5f6b85;
  --border: #e2e7f0;
  --border-strong: #cfd6e3;
  --accent: var(--brand);
  --accent-hover: var(--brand-dark);

  --queued: #64748b;
  --running: #1d6fdc;
  --succeeded: #16a34a;
  --failed: #dc2626;
  --cancelled: #d97706;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 64, 0.06);
  --shadow: 0 1px 2px rgba(16, 32, 64, 0.05), 0 4px 16px rgba(16, 32, 64, 0.06);
  --shadow-lg: 0 12px 40px rgba(7, 30, 70, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(100deg, var(--brand-dark) 0%, var(--brand) 55%, #1466c8 100%);
  color: #fff;
  border-bottom: 3px solid var(--brand-accent);
  box-shadow: 0 2px 12px rgba(7, 30, 70, 0.2);
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

/* Small logo mark next to the app name */
.brand a::before {
  content: "JMT";
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  background: #fff;
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 -3px 0 var(--brand-accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-right: auto;
}

.nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav a.active {
  color: var(--brand-dark);
  background: #fff;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.user {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.btn-ghost {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  transition: background 0.15s;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.topbar a.btn-ghost {
  text-decoration: none;
}

.connection {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.connection::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
}

.connection.online::before {
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  grid-template-areas:
    "stats stats"
    "jobs detail"
    "api detail";
  gap: 1.25rem;
  align-items: start;
}

.stats { grid-area: stats; }
.jobs-panel { grid-area: jobs; }
.detail-panel { grid-area: detail; position: sticky; top: 5rem; }
.api-panel { grid-area: api; }

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "stats" "jobs" "detail" "api";
  }
  .detail-panel { position: static; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.4rem 0 0.6rem;
}

.empty {
  color: var(--muted);
  text-align: center;
  margin: 2rem 0;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  box-shadow: var(--shadow);
}

/* Coloured strip along the top of each tile */
.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--stat-color, var(--brand));
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--stat-color, var(--brand));
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-running { --stat-color: var(--running); }
.stat-queued { --stat-color: var(--queued); }
.stat-succeeded { --stat-color: var(--succeeded); }
.stat-failed { --stat-color: var(--failed); }

/* ---------- Forms & buttons ---------- */
.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

input,
select,
textarea {
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b5bfd0;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 78, 162, 0.15);
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  white-space: nowrap;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(11, 78, 162, 0.25);
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}

.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 3px 10px rgba(11, 78, 162, 0.3);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
  box-shadow: none;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-block {
  width: 100%;
}

.btn-small {
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.btn-small:hover { background: var(--bg); }
.btn-cancel { color: var(--cancelled); }
.btn-retry { color: var(--brand); }
.btn-delete { color: var(--failed); }
.btn-cancel:hover { border-color: var(--cancelled); background: #fffbeb; }
.btn-retry:hover { border-color: var(--brand); background: var(--brand-light); }
.btn-delete:hover { border-color: var(--failed); background: #fef2f2; }

.btn-icon {
  margin-left: auto;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
}

.btn-icon:hover {
  background: var(--bg);
  color: var(--text);
}

/* ---------- Dashboard filters ---------- */
.date-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.date-filter label {
  font-weight: 600;
  color: var(--muted);
}

.date-filter select,
.date-filter input {
  padding: 0.3rem 0.55rem;
  font-size: 0.88rem;
}

.custom-range {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.range-summary {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.filters button {
  padding: 0.32rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  transition: all 0.15s;
}

.filters button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.filters button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

th {
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.6rem;
  background: #f7f9fc;
  border-bottom: 1px solid var(--border);
}

th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }

td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

tbody tr:hover {
  background: #f7f9fd;
}

tbody tr.selected {
  background: var(--brand-light);
  box-shadow: inset 3px 0 0 var(--brand);
}

.job-name {
  font-weight: 600;
  white-space: normal;
}

.job-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.actions {
  text-align: right;
}

.actions button + button {
  margin-left: 0.3rem;
}

/* ---------- Badges & progress ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--badge-color);
  background: color-mix(in srgb, var(--badge-color) 12%, white);
  border: 1px solid color-mix(in srgb, var(--badge-color) 25%, white);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-queued { --badge-color: var(--queued); }
.badge-running { --badge-color: var(--running); }
.badge-succeeded { --badge-color: var(--succeeded); }
.badge-failed { --badge-color: var(--failed); }
.badge-cancelled { --badge-color: var(--cancelled); }
.badge-pending { --badge-color: var(--cancelled); }
.badge-accepted { --badge-color: var(--succeeded); }
.badge-rejected { --badge-color: var(--failed); }

.badge-running::before {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.3; }
}

.progress {
  display: inline-block;
  vertical-align: middle;
  width: 110px;
  height: 7px;
  background: #e8ecf3;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.fill-queued { background: var(--queued); }
.fill-running { background: linear-gradient(90deg, var(--brand), var(--running)); }
.fill-succeeded { background: var(--succeeded); }
.fill-failed { background: var(--failed); }
.fill-cancelled { background: var(--cancelled); }

.progress-label {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Detail panel ---------- */
.detail-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.detail-header h2 {
  word-break: break-word;
}

.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1rem;
  margin: 1rem 0 0;
  font-size: 0.86rem;
}

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

.meta dd {
  margin: 0;
  font-weight: 500;
  word-break: break-word;
  white-space: pre-wrap;
}

.status-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding: 0.9rem;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.status-form h3 {
  margin: 0;
}

.status-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 0.6rem;
}

.status-form select,
.status-form input,
.status-form textarea {
  padding: 0.42rem 0.55rem;
  font-weight: 400;
}

.status-form .btn-primary {
  align-self: flex-start;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.logs {
  background: #0f1a2e;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  max-height: 420px;
  overflow-y: auto;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 0.77rem;
  line-height: 1.6;
}

.log {
  white-space: pre-wrap;
  word-break: break-word;
}

.log-time { color: #8b9ab3; }
.log-info .log-level { color: #60a5fa; }
.log-warn .log-level { color: #fbbf24; }
.log-error .log-level { color: #f87171; }
.log-error .log-msg { color: #fecaca; }

/* ---------- API help ---------- */
.api-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
}

.api-panel pre {
  background: #0f1a2e;
  color: #e2e8f0;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.78rem;
}

code {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.85em;
}

.hint {
  font-size: 0.86rem;
  color: var(--muted);
}

/* ---------- Generic form fields (login) ---------- */
.form h2 {
  margin-bottom: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  padding: 0;
  border: none;
}

.field > label,
.field > legend {
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0;
}

.field > legend {
  margin-bottom: 0.35rem;
}

.field input {
  padding: 0.65rem 0.8rem;
}

.form-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--failed);
  color: #b91c1c;
  font-size: 0.88rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

/* ---------- Page with a form card (New job, Users, Requests...) ---------- */
.page-card {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

.welcome {
  margin: 0 0 0.8rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
}

.welcome span {
  color: var(--brand);
}

.job-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-row {
  display: grid;
  grid-template-columns: minmax(200px, 28%) minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}

.card-label {
  display: flex;
  align-items: center;
  padding: 0.55rem 1rem;
  background: #f7f9fc;
  border-right: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #3b4763;
}

.card-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.45rem 0.8rem;
  min-height: 2.6rem;
  min-width: 0;
}

.card-value input,
.card-value select,
.card-value textarea {
  padding: 0.4rem 0.6rem;
  max-width: 100%;
}

.card-value select:disabled {
  background: var(--bg);
  color: var(--muted);
}

.on-hold .card-label {
  color: #b45309;
  background: #fffbeb;
}

.req {
  color: var(--failed);
  margin-left: 0.2rem;
}

.readonly-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand);
}

.hint-inline {
  color: var(--muted);
  font-size: 0.78rem;
}

.mono {
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
}

.w-xs { width: 150px; }
.w-sm { width: 230px; }
.w-md { width: 320px; }
.w-lg { width: 480px; }
.w-xl { width: 900px; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  background: #f7f9fc;
}

.card-actions .form-error {
  flex-basis: 100%;
  margin: 0 0 0.25rem;
}

@media (max-width: 700px) {
  .card-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .card-label {
    border-right: none;
    padding-bottom: 0.3rem;
  }
  .card-value input,
  .card-value select,
  .card-value textarea {
    width: 100%;
  }
  .topbar {
    position: static;
  }
}

/* ---------- Users page ---------- */
.section-title {
  margin: 1.75rem 0 0.4rem;
  font-size: 1.3rem;
}

.section-title:first-child {
  margin-top: 0.25rem;
}

.page-card .hint {
  margin: 0 0 0.9rem;
}

.users-table tbody tr,
.perf-table tbody tr,
.requests-table tbody tr {
  cursor: default;
}

.role-select {
  padding: 0.25rem 0.45rem;
  font-size: 0.85rem;
}

.you-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand);
}

.missing-tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #fef2f2;
  color: var(--failed);
}

/* ---------- Best performers page ---------- */
.perf-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0 0.4rem;
}

.perf-controls .section-title {
  margin: 0;
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.month-picker input {
  padding: 0.35rem 0.55rem;
}

.month-picker .btn-small {
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.3rem 0.65rem;
}

/* Highlight card: best performer / request sent */
.winner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.1rem;
  padding: 1.3rem 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--brand-dark), var(--brand) 60%, #1572d6);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.winner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 28px solid rgba(26, 162, 96, 0.35);
}

.winner-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.winner-name {
  font-size: 1.6rem;
  font-weight: 700;
}

.winner-points {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.2rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-accent);
  font-weight: 600;
  font-size: 0.85rem;
}

.winner-points:empty {
  display: none;
}

.winner .hint {
  color: rgba(255, 255, 255, 0.85);
}

.winner p {
  position: relative;
  z-index: 1;
  margin: 0.6rem 0 0;
}

.perf-table tbody tr.top {
  background: #effaf3;
  font-weight: 600;
}

.perf-table tbody tr.top td:first-child::before {
  content: "★ ";
  color: #e3a008;
}

.perf-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Job requests ---------- */
.nav-badge {
  display: inline-block;
  min-width: 1.25rem;
  margin-left: 0.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--brand-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25rem;
}

.requests-table td {
  vertical-align: top;
}

.request-desc {
  min-width: 240px;
  white-space: normal;
}

.request-desc .job-name {
  font-weight: 400;
  white-space: pre-wrap;
}

.requests-table .actions a {
  display: inline-block;
  text-decoration: none;
}

.requests-table .actions > * + * {
  margin-left: 0.3rem;
}

.request-banner {
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  border: 1px solid #c3d6f2;
  border-left: 4px solid var(--brand);
  color: var(--brand-dark);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Attachments ---------- */
.file-field {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

/* The real file input is hidden; its label is the button people click */
.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border: 1px dashed var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.file-button::before {
  content: "+";
  font-size: 1.05rem;
  line-height: 1;
}

.file-button:hover {
  background: #dce8f8;
}

.file-button:focus-within {
  box-shadow: 0 0 0 3px rgba(11, 78, 162, 0.2);
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.25rem 0.35rem 0.25rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 0.83rem;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.file-size {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.file-remove {
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  line-height: 1;
}

.file-remove:hover {
  background: #fee2e2;
  color: var(--failed);
}

.attachment-list {
  margin: 0.3rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.attachment-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  white-space: normal;
}

.attachment-list li + li {
  border-top: 1px dashed var(--border);
}

.attachment-list a {
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}

.attachment-list a::before {
  content: "📎 ";
}

.attachment-list a:hover {
  text-decoration: underline;
}

.request-files {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: #f7f9fc;
}

/* Hidden trap field on the public request form (only bots fill it in) */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Login page ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem 1rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(26, 162, 96, 0.28), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(21, 114, 214, 0.45), transparent 45%),
    linear-gradient(135deg, var(--brand-dark), var(--brand));
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border-radius: 16px;
  padding: 2.25rem 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--brand-accent);
}

.auth-card h1 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-size: 1.4rem;
  color: var(--brand-dark);
}

.auth-card h1::before {
  content: "JMT";
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 -4px 0 var(--brand-accent);
}

.auth-sub {
  margin: 0.5rem 0 1.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-alt {
  margin: 1.4rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.auth-footer {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  text-align: center;
}

.code-links {
  display: flex;
  justify-content: space-between;
  margin-top: 0.9rem;
}

.link-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
}

.link-button:hover {
  text-decoration: underline;
}

/* ---------- Footer note on every page ---------- */
.app-footer {
  padding: 0 1rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: #13213d;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border-left: 4px solid var(--brand-accent);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  max-width: calc(100% - 2rem);
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
