:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d9dee8;
  --blue: #0b4f9c;
  --blue-bright: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #ca8a04;
  --dark: #111827;
  --soft-blue: #dbeafe;
  --soft-green: #dcfce7;
  --soft-red: #fee2e2;
  --soft-yellow: #fef3c7;
  --soft-gray: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}

a {
  color: inherit;
}

/* ===== Main App Layout ===== */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: #f4f7fb;
  color: #1f2937;
  font-family: Arial, sans-serif;
}

.sidebar {
  width: 280px;
  background: #0b2f6b;
  color: white;
  padding: 28px 22px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 34px;
}

.brand-logo {
  background: #2563eb;
  color: white;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand h2 {
  margin: 0;
  font-size: 22px;
}

.brand p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #dbeafe;
}

.nav-section {
  margin: 24px 0 10px;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: #cbd5e1;
  text-transform: uppercase;
}

.sidebar a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.sidebar a.active,
.sidebar a:hover {
  background: #dbeafe;
  color: #0f172a;
  font-weight: 700;
}

.main-content {
  flex: 1;
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 1.7px;
  color: #64748b;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
}

.user-pill {
  background: white;
  border: 1px solid #d5deea;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
}

/* ===== Cards ===== */

.card {
  background: white;
  border: 1px solid #d5deea;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  margin-bottom: 16px;
}

.full-width-card {
  grid-column: 1 / -1;
}

.section-description {
  color: #6b7280;
  font-size: 15px;
  margin-top: 6px;
  margin-bottom: 18px;
}

/* ===== Profile Header ===== */

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.profile-header h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.profile-actions {
  display: flex;
  gap: 10px;
}

/* ===== Buttons ===== */

button {
  border: 1px solid #cbd5e1;
  background: white;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  background: #0b4f9c;
  color: white;
  border-color: #0b4f9c;
}

.primary-button {
  display: inline-block;
  background: #1d4ed8;
  color: white;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  transition: 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.primary-button:hover {
  background: #1e40af;
  transform: translateY(-2px);
}

.secondary-button {
  display: inline-block;
  background: #ffffff;
  color: #1d4ed8;
  border: 1px solid #1d4ed8;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: 0.2s;
}

.secondary-button:hover {
  background: #1d4ed8;
  color: white;
}

.button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--blue-bright);
  color: #fff;
  text-decoration: none;
  display: inline-block;
}

.button.secondary {
  background: #e5e7eb;
  color: #111827;
}

.button.green {
  background: var(--green);
}

.button.red {
  background: var(--red);
}

.button.yellow {
  background: var(--yellow);
}

/* ===== Tabs ===== */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tabs button.active {
  background: #0b4f9c;
  color: white;
  border-color: #0b4f9c;
}

/* ===== Forms ===== */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

label {
  display: block;
  font-weight: 700;
  margin: 16px 0 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 15px;
  box-sizing: border-box;
  background: white;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input[readonly],
select:disabled {
  background: #f1f5f9;
  color: #475569;
}

.save-message {
  margin-top: 12px;
  color: #166534;
  font-weight: 700;
}

/* ===== Dashboard / Module Cards ===== */

.dashboard-grid,
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 28px 0;
}

.feature-card,
.module-card {
  display: block;
  background: #ffffff;
  border: 1px solid #d5deea;
  border-radius: 18px;
  padding: 28px;
  text-decoration: none;
  color: #1f2937;
  min-height: 145px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.feature-card:hover,
.module-card:hover,
.module-card.highlight {
  border-color: #1da1f2;
  background: #eef8ff;
}

.feature-card .icon,
.module-icon {
  font-size: 28px;
  margin-bottom: 16px;
}

.feature-card h3,
.module-card h3 {
  margin: 0 0 12px;
  font-size: 22px;
  text-decoration: none;
}

.feature-card p,
.module-card p {
  margin: 0;
  color: #5b677a;
  text-decoration: none;
}

/* ===== KPI Cards ===== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-grid .card {
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 18px;
  padding: 22px 28px;
  min-height: 95px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.kpi-grid h2 {
  font-size: 42px;
  margin: 0;
}

/* ===== Tables ===== */

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #475569;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: 0;
}

/* ===== GPS Enterprise Status Badges ===== */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Approved = green */

.badge.approved,
.approved.badge {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

/* Pending / Pending Review = yellow */

.badge.pending,
.pending.badge {
  background: #fef3c7;
  color: #92400e;
  border-color: #facc15;
}

/* Rejected = red */

.badge.rejected,
.rejected.badge {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* Missing = gray */

.badge.missing,
.missing.badge {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

/* Not Required / Neutral = blue-gray */

.badge.neutral,
.neutral.badge {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* General info badge */

.badge.info,
.info.badge {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

/* ===== HR Vault Document Cards ===== */

.document-grid,
.document-vault {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.document-card {
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.document-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.document-card h4 {
  margin: 0 0 6px;
  font-size: 17px;
  color: #1f2937;
}

.document-card p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.35;
}

.document-meta {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-size: 14px;
  margin-bottom: 14px;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.document-actions input[type="file"] {
  flex: 1 1 220px;
  min-width: 220px;
}

.document-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
}

/* ===== Upload Portal ===== */

.upload-box {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.upload-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

/* ===== Onboarding Progress ===== */

.onboarding-card {
  margin-top: 28px;
}

.progress-wrap {
  width: 100%;
  height: 18px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0 12px;
}

.progress-bar {
  height: 100%;
  background: #34a853;
  width: 46%;
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #d9e2ec;
}

.step.done {
  background: #ecfdf3;
  border-color: #86efac;
}

.step.current {
  background: #fffbeb;
  border-color: #facc15;
}

.step.locked {
  background: #f8fafc;
  color: #94a3b8;
}

.step span {
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 12px;
}

.step.done span {
  background: #dcfce7;
  color: #166534;
}

.step.current span {
  background: #fef3c7;
  color: #92400e;
}

.step.locked span {
  background: #e2e8f0;
  color: #334155;
}

/* ===== Directory Toolbar ===== */

.directory-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 25px 0;
}

.directory-toolbar input {
  flex: 1;
}

.directory-toolbar select {
  width: 220px;
}

.directory-toolbar .primary-button {
  white-space: nowrap;
}

/* ===== Other Existing Pages ===== */

.header {
  background: linear-gradient(135deg, #111827, #374151);
  color: #fff;
  padding: 24px 32px;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.header p {
  margin: 0;
  color: #d1d5db;
}

.app {
  display: grid;
  grid-template-columns: 295px 1fr;
  min-height: calc(100vh - 90px);
}

.main {
  padding: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.metric {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 13px;
}

.small {
  color: var(--muted);
  font-size: 13px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
}

.check-row input {
  width: auto;
  margin-top: 3px;
}

.letter {
  background: white;
  border: 1px solid #111827;
  padding: 28px;
  line-height: 1.55;
  font-family: Georgia, "Times New Roman", serif;
  min-height: 620px;
  max-width: 900px;
}

.letter h2 {
  text-align: center;
  margin-top: 0;
}

.letter .sigline {
  margin-top: 32px;
  border-top: 1px solid #111;
  width: 300px;
  padding-top: 6px;
}

.offer-letterhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 3px solid #0b3b8c;
  padding-bottom: 14px;
  margin-bottom: 22px;
}

.offer-letterhead img {
  max-width: 310px;
  height: auto;
}

.offer-contact {
  text-align: right;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #1f2937;
}

.offer-contact strong {
  font-size: 16px;
  color: #0b3b8c;
}

.offer-doc-title {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  margin: 16px 0 20px;
}

.module {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.w9 {
  background: white;
  border: 2px solid #111827;
  border-radius: 6px;
  padding: 18px;
  font-family: "Times New Roman", serif;
  color: #111;
  max-width: 820px;
}

.w9 h2 {
  font-size: 22px;
  margin: 0 0 4px;
  text-align: center;
}

.w9 h3 {
  font-size: 15px;
  margin: 12px 0 6px;
  border-bottom: 1px solid #111;
  padding-bottom: 3px;
}

.w9-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 1px solid #999;
  min-height: 32px;
  align-items: center;
}

.w9-label {
  font-weight: bold;
  padding: 6px;
  border-right: 1px solid #999;
  background: #f8fafc;
}

.w9-value {
  padding: 6px;
}

.masked {
  letter-spacing: 2px;
}

.linkbox {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 12px;
  padding: 12px;
  font-family: monospace;
  word-break: break-all;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #111827, #374151);
}

.login-card {
  width: min(460px, 92vw);
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.login-card img {
  max-width: 260px;
  display: block;
  margin: 0 auto 16px;
}

/* ===== Responsive ===== */

@media (max-width: 1080px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .grid,
  .steps,
  .document-grid,
  .document-vault,
  .grid-2,
  .dashboard-grid,
  .module-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .upload-row,
  .module {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .app-shell {
    flex-direction: column;
  }

  /* Once the sidebar stacks full-width above the page content, a tall
     list of full-width nav links pushes everything else down below the
     fold. Compact, wrapped pills keep it short instead. */
  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .sidebar .nav-section {
    width: 100%;
    margin: 10px 0 2px;
  }

  .sidebar .nav-section:first-child {
    margin-top: 0;
  }

  .sidebar a {
    display: inline-block;
    padding: 8px 14px;
    margin-bottom: 0;
    font-size: 14px;
  }
}

@media (max-width: 700px) {
  .offer-letterhead {
    flex-direction: column;
    align-items: flex-start;
  }

  .offer-contact {
    text-align: left;
  }

  .offer-letterhead img {
    max-width: 260px;
  }
}

@media (max-width: 620px) {
  .grid,
  .form-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .main,
  .main-content {
    padding: 14px;
  }

  /* Tables (rosters, admin lists, etc.) would otherwise force the whole
     page to scroll sideways or crush every column unreadably. Scrolling
     just the table itself, horizontally, keeps everything legible. */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .profile-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .profile-actions {
    flex-wrap: wrap;
  }

  .profile-actions button {
    flex: 1 1 auto;
  }

  .directory-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .directory-toolbar select {
    width: 100%;
  }

  .kpi-grid h2 {
    font-size: 32px;
  }

  .document-actions input[type="file"] {
    min-width: 0;
    width: 100%;
    flex-basis: 100%;
  }

  /* Larger tap targets throughout, now that layouts are single-column
     and there's room to be generous without crowding anything. */
  button,
  .button,
  .primary-button,
  .secondary-button {
    padding: 12px 16px;
  }
}