/* Field Technician Portal
   Visual language: work-order clipboard meets equipment panel —
   dark charcoal chrome, stamped condensed headings, safety-orange accent. */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --ink: #1B1F24;
  --ink-soft: #2A2F37;
  --steel: #5B6472;
  --steel-light: #8B93A0;
  --paper: #EEF0F1;
  --panel: #FFFFFF;
  --line: #D8DCE0;
  --accent: #283296;
  --accent-dark: #1C2369;
  --accent-on-dark: #8B93E0;
  --complete: #2F6F4E;
  --complete-bg: #E4EFE9;
  --pending: #9C6B08;
  --pending-bg: #F5EEDD;
  --progress: #2A7F86;
  --progress-bg: #E1EEEF;
  --urgent: #B3261E;
  --urgent-bg: #F6E4E3;
  --unassigned-bg: #ECEDEF;
  --radius: 3px;
  --font-head: 'Barlow Condensed', sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0 0 0.4em; letter-spacing: 0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

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

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--ink);
  color: #C9CDD3;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 18px 20px;
  border-bottom: 1px solid #333944;
  background: #fff;
}
.sidebar .brand img { display: block; width: 100%; height: auto; max-width: 170px; margin: 0 auto; }
.sidebar .brand .tagline {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  color: var(--steel-light);
  letter-spacing: 0.04em;
  margin-top: 8px;
}

.sidebar nav { flex: 1; padding: 14px 0; }
.sidebar nav a {
  display: block;
  padding: 10px 20px;
  color: #C9CDD3;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 0.95rem;
}
.sidebar nav a:hover { background: #262B32; color: #fff; }
.sidebar nav a.active { border-left-color: var(--accent-on-dark); background: #262B32; color: #fff; }

.sidebar .user-box {
  padding: 16px 20px;
  border-top: 1px solid #333944;
  font-size: 0.85rem;
}
.sidebar .user-box .name { color: #fff; font-weight: 500; }
.sidebar .user-box .role { color: var(--steel-light); text-transform: capitalize; }
.sidebar .user-box a { color: var(--accent-on-dark); font-size: 0.82rem; text-decoration: none; }

.main { flex: 1; padding: 32px 40px; max-width: 1100px; }

.topline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.job-list { display: flex; flex-direction: column; gap: 10px; }

.job-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--steel-light);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  flex-wrap: wrap;
}
.job-card:hover { border-left-color: var(--accent); background: #FAFAF9; }
.job-card.status-complete { border-left-color: var(--complete); }
.job-card.status-in_progress { border-left-color: var(--progress); }
.job-card.status-pending { border-left-color: var(--pending); }
.job-card.status-unassigned { border-left-color: var(--steel-light); }

.job-card .job-main { flex: 1; min-width: 220px; }
.job-card .job-title { font-weight: 600; font-size: 1.02rem; margin-bottom: 3px; }
.job-card .job-meta { font-size: 0.83rem; color: var(--steel); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }

.badge.status-complete { background: var(--complete-bg); color: var(--complete); }
.badge.status-complete::before { background: var(--complete); }
.badge.status-in_progress { background: var(--progress-bg); color: var(--progress); }
.badge.status-in_progress::before { background: var(--progress); }
.badge.status-pending { background: var(--pending-bg); color: var(--pending); }
.badge.status-pending::before { background: var(--pending); }
.badge.status-unassigned { background: var(--unassigned-bg); color: var(--steel); }
.badge.status-unassigned::before { background: var(--steel-light); }

.badge.priority-urgent { background: var(--urgent-bg); color: var(--urgent); }
.badge.priority-urgent::before { background: var(--urgent); }
.badge.priority-high { background: var(--pending-bg); color: var(--pending); }
.badge.priority-high::before { background: var(--pending); }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 5px; color: var(--ink-soft); }
input[type=text], input[type=date], input[type=password], input[type=file],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 80px; }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row > .field { flex: 1; min-width: 180px; }

.btn {
  display: inline-block;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { border-color: var(--steel); background: #fff; }

/* ---------- Misc ---------- */
.flash {
  padding: 11px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.9rem;
}
.flash.error { background: var(--urgent-bg); color: var(--urgent); }
.flash.success { background: var(--complete-bg); color: var(--complete); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--steel); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  gap: 10px;
  flex-wrap: wrap;
}
.report-row:last-child { border-bottom: none; }
.report-row .file-name { font-weight: 500; }
.report-row .file-meta { font-size: 0.8rem; color: var(--steel); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--steel);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  background-image: linear-gradient(160deg, var(--ink) 0%, #23272E 100%);
}
.login-box {
  background: var(--panel);
  padding: 36px 34px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 360px;
  border-top: 4px solid var(--accent);
}
.login-box .brand-head {
  margin-bottom: 22px;
  text-align: center;
}
.login-box .brand-head img {
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto 10px;
  display: block;
}
.login-box .brand-head span {
  color: var(--accent-dark);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

@media (max-width: 780px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar .brand { border: none; padding: 14px 16px; white-space: nowrap; }
  .sidebar nav { display: flex; padding: 0; }
  .sidebar nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .sidebar nav a.active { border-left-color: transparent; border-bottom-color: var(--accent-on-dark); }
  .sidebar .user-box { display: none; }
  .main { padding: 20px; }
}
