/* ============================================================
   Gazelle Dashboard — Flat Design Corporativo
   Palette: #007BFF primary, #343A40 dark, #F8F9FA surface,
            #DEE2E6 border, #28A745 green, #FFC107 amber,
            #DC3545 red, #17A2B8 cyan
   Rules: sharp corners (no border-radius), no heavy shadows/gradients,
          mobile-first, big tap targets.
   ============================================================ */

/* ---- reset + base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #F8F9FA;
  color: #343A40;
  line-height: 1.5;
}
a { color: #007BFF; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- topbar ---- */
.topbar {
  background: #fff;
  color: #343A40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 3rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #DEE2E6;
}
.topbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: #007BFF;
}
.topbar-nav { display: flex; gap: 0.5rem; align-items: center; }
.topbar-nav a {
  color: #007BFF;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
}
.topbar-nav a:hover { text-decoration: underline; }
.topbar-nav a.active {
  background: #007BFF;
  color: #fff;
  text-decoration: none;
}
.topbar-nav .nav-logout-form { display: inline; margin: 0; }
.topbar-nav .nav-logout-btn {
  background: none;
  border: none;
  color: #007BFF;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  min-height: 2rem;
}
.topbar-nav .nav-logout-btn:hover { text-decoration: underline; color: #0056b3; }

/* ---- container ---- */
.container { max-width: 900px; margin: 0 auto; padding: 1rem; }

/* ---- toolbar ---- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 2px solid #DEE2E6;
  margin-bottom: 1rem;
}
.health-strip { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.health-dot {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  cursor: default;
}
.health-ok               { background: #28A745; color: #fff; border-color: #1e7e34; }
.health-needs_reauth     { background: #FFC107; color: #343A40; border-color: #d39e00; }
.health-broken           { background: #DC3545; color: #fff; border-color: #bd2130; }
.health-none             { color: #6c757d; font-size: 0.85rem; }

.toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.location-form { display: flex; gap: 0.25rem; align-items: center; }

/* ---- section header ---- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.section-title { font-size: 0.85rem; font-weight: 600; color: #6c757d; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- load grid ---- */
.load-grid { display: flex; flex-direction: column; gap: 1px; background: #DEE2E6; border: 1px solid #DEE2E6; }

/* ---- load card ---- */
.load-card {
  background: #fff;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.load-card:last-child { border-bottom: none; }

/* headline row */
.card-headline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.score-badge {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.25rem 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
}
.score-green { background: #28A745; }
.score-amber { background: #FFC107; color: #343A40; }
.score-red   { background: #DC3545; }

.est-net { font-size: 1.1rem; font-weight: 700; color: #343A40; }
.board-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  background: #17A2B8;
  color: #fff;
  letter-spacing: 0.06em;
}

/* lane row */
.card-lane {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.lane-origin { color: #343A40; }
.lane-arrow  { color: #6c757d; font-size: 0.9em; }
.lane-dest   { color: #343A40; }

/* stats row */
.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
}
.stat { display: flex; gap: 0.25rem; align-items: baseline; }
.stat-label { font-size: 0.7rem; font-weight: 700; color: #6c757d; text-transform: uppercase; }

/* broker row */
.card-broker {
  font-size: 0.85rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.broker-name { font-weight: 600; }
.broker-credit {
  font-size: 0.78rem;
  color: #6c757d;
  padding: 0.1rem 0.35rem;
  border: 1px solid #DEE2E6;
  background: #F8F9FA;
}

/* action buttons */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.25rem;
  border-top: 1px solid #F8F9FA;
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  background: transparent;
  font-family: inherit;
  line-height: 1;
  min-height: 2.5rem;    /* big tap target */
  min-width: 3rem;
}
.btn:hover { opacity: 0.85; }
.btn-primary   { background: #007BFF; color: #fff; border-color: #007BFF; }
.btn-secondary { background: #6c757d; color: #fff; border-color: #6c757d; }
.btn-action    { background: #F8F9FA; color: #343A40; border-color: #DEE2E6; }
.btn-applied   { background: #17A2B8; color: #fff; border-color: #17A2B8; }
.btn-booked    { background: #28A745; color: #fff; border-color: #28A745; }
.btn-passed    { background: #DC3545; color: #fff; border-color: #DC3545; }
.btn-block     { display: block; width: 100%; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; min-height: 2rem; }

/* ---- forms ---- */
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }
.form-input {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #DEE2E6;
  background: #fff;
  color: #343A40;
  font-family: inherit;
  min-height: 2.75rem;
}
.form-input-sm { width: auto; min-height: 2rem; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.form-input:focus { outline: 2px solid #007BFF; outline-offset: -1px; }

/* ---- alerts ---- */
.alert { padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; font-size: 0.9rem; }
.alert-danger { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }

/* ---- login page ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #F8F9FA; }
.login-card { background: #fff; border: 1px solid #DEE2E6; padding: 2rem 1.5rem; width: 100%; max-width: 360px; }
.login-brand { font-size: 1.5rem; font-weight: 700; color: #007BFF; letter-spacing: 0.1em; margin-bottom: 0.25rem; }
.login-tagline { font-size: 0.85rem; color: #6c757d; margin-bottom: 1.25rem; }
.login-card .form-input { margin-bottom: 1rem; }

/* ---- activity table ---- */
.activity-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.activity-table th {
  background: #343A40;
  color: #fff;
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.activity-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid #DEE2E6; }
.activity-table tr:last-child td { border-bottom: none; }
.activity-table tbody tr:nth-child(even) { background: #F8F9FA; }

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-applied { background: #17A2B8; color: #fff; }
.status-booked  { background: #28A745; color: #fff; }
.status-passed  { background: #DC3545; color: #fff; }

/* ---- empty state ---- */
.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: #6c757d;
  border: 1px dashed #DEE2E6;
  background: #fff;
}

/* ---- utilities ---- */
.mono { font-family: ui-monospace, monospace; font-size: 0.8rem; color: #6c757d; }

/* ---- responsive: slightly wider on larger screens ---- */
@media (min-width: 600px) {
  .container { padding: 1.25rem 1.5rem; }
  .card-stats { flex-wrap: nowrap; }
}
