:root {
  --bg: #F5F5F2;
  --text: #111111;
  --text2: #4A4A45;
  --text3: #6B6B65;

  --green: #007F5F;
  --green-bg: rgba(0,127,95,.12);

  --amber: #D97706;

  --border: rgba(0,0,0,.08);

  --font-head: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: #F3F3EE;
  color: var(--text);
  min-height: 100vh;
}

/* LAYOUT */

.screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
}

/* HERO */

.hero {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 56px;
  height: 56px;

  border-radius: 16px;
  background: #111;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 24px;
}

.logo-name {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 700;
}

.logo-sub {
  font-size: 13px;
  color: var(--text3);
}

.hero-content {
  margin-top: 4rem;
  max-width: 600px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 8px 14px;
  border-radius: 999px;

  background: var(--green-bg);

  color: var(--green);

  margin-bottom: 1.5rem;

  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pulse {
  width: 8px;
  height: 8px;

  border-radius: 50%;
  background: var(--green);
}

.hero h1 {
  font-family: var(--font-head);
  font-size: 82px;
  line-height: .95;
  text-transform: uppercase;

  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 20px;
  line-height: 1.8;
  color: var(--text2);
}

.hero-footer {
  display: flex;
  justify-content: space-between;

  margin-top: 3rem;

  color: var(--text3);
  font-size: 12px;
}

/* LOGIN */

.login-side {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 460px;

  background: white;

  border-radius: 28px;

  padding: 2.5rem;

  border: 1px solid var(--border);

  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.card-mini {
  color: var(--amber);

  font-size: 12px;
  font-weight: 700;

  text-transform: uppercase;

  margin-bottom: .7rem;
}

.card-title {
  font-family: var(--font-head);
  font-size: 42px;

  margin-bottom: .8rem;

  text-transform: uppercase;
}

.card-text {
  color: var(--text2);
  line-height: 1.6;
}

/* FORM */

.form-group {
  margin-top: 1.4rem;
}

.form-group label {
  display: block;

  margin-bottom: 8px;

  font-size: 13px;
  font-weight: 700;

  text-transform: uppercase;

  color: var(--text3);
}

.input-wrap input {
  width: 100%;
  height: 64px;

  border: 2px solid rgba(0,0,0,.08);
  border-radius: 16px;

  background: #ECECE7;

  padding: 0 18px;

  font-size: 16px;

  outline: none;
}

.input-wrap input:focus {
  border-color: var(--amber);
}

/* ACCESS */

.access-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);

  gap: 12px;

  margin-top: 1rem;
}

.access-card {
  min-height: 95px;

  background: #ECECE7;

  border: 2px solid transparent;
  border-radius: 18px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 8px;

  cursor: pointer;

  transition: .2s;
}

.access-card:hover {
  transform: translateY(-2px);
}

.access-card.active {
  border-color: var(--amber);
  background: rgba(217,119,6,.08);
}

.access-icon {
  font-size: 24px;
}

.access-card span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* BUTTON */

.btn-login {
  width: 100%;
  height: 74px;

  margin-top: 1.8rem;

  border: none;
  border-radius: 18px;

  background: #111;
  color: white;

  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 800;

  text-transform: uppercase;

  cursor: pointer;

  transition: .2s;
}

.btn-login:hover {
  opacity: .92;
}

/* LINKS */

.bottom-links {
  margin-top: 1.4rem;

  display: flex;
  justify-content: space-between;
}

.bottom-links a {
  color: var(--text3);
  text-decoration: none;
  font-size: 13px;
}

/* STATUS */

.status-bar {
  margin-top: 1.6rem;

  padding-top: 1.2rem;

  border-top: 1px solid var(--border);

  display: flex;
  justify-content: space-between;

  font-size: 12px;

  color: var(--text3);
}

.status-online {
  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--green);
}

/* RESPONSIVO */

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

  .hero {
    display: none;
  }
}

@media (max-width: 520px) {

  .login-card {
    padding: 1.5rem;
  }

  .access-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 52px;
  }

  .bottom-links {
    flex-direction: column;
    gap: 10px;
  }
/* ADMIN */

.admin-page {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
}

.admin-header {
  margin-bottom: 30px;
}

.admin-header h1 {
  font-size: 42px;
  margin-bottom: 8px;
}

.admin-card {
  background: white;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,.08);
}

.admin-card input,
.admin-card select {
  width: 100%;
  height: 60px;

  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.08);

  padding: 0 16px;

  font-size: 16px;

  margin-top: 8px;
}

.vehicle-list {
  margin-top: 30px;

  display: grid;
  gap: 16px;
}

.vehicle-item {
  background: white;

  padding: 20px;

  border-radius: 18px;

  border: 1px solid rgba(0,0,0,.08);
}

.vehicle-item h3 {
  margin-bottom: 8px;
}
}
/* =========================================
   ADMIN DASHBOARD
========================================= */

.admin-body {
  background: #F3F3EE;
  font-family: var(--font-body);
  padding: 36px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  margin-bottom: 32px;
}

.mini-badge {
  font-size: 12px;
  font-weight: 700;

  letter-spacing: .18em;
  text-transform: uppercase;

  color: #C46A00;

  margin-bottom: 12px;
}

.dashboard-title {
  font-family: var(--font-head);

  font-size: 92px;
  line-height: .92;

  text-transform: uppercase;
}

.new-btn {
  height: 84px;
  padding: 0 42px;

  border: none;
  border-radius: 24px;

  background: #050505;
  color: white;

  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;

  text-transform: uppercase;

  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);

  gap: 18px;

  margin-bottom: 38px;
}

.stat-card {
  padding: 28px;

  border-radius: 28px;
  border: 2px solid transparent;
}

.stat-card span {
  display: block;

  margin-bottom: 20px;

  font-size: 13px;
  font-weight: 700;

  letter-spacing: .16em;
  text-transform: uppercase;
}

.stat-card h2 {
  font-family: var(--font-head);

  font-size: 72px;

  margin-bottom: 12px;
}

.stat-card p {
  font-size: 16px;
  color: var(--text2);
}

.warning {
  background: #F5EBCF;
  border-color: #F1D090;
}

.warning span {
  color: #B55C00;
}

.danger {
  background: #F7DDE0;
  border-color: #F0B7BF;
}

.danger span {
  color: #C62828;
}

.success {
  background: #D8F0E7;
  border-color: #B8E7D8;
}

.success span {
  color: #007F5F;
}

.form-panel {
  background: rgba(255,255,255,.72);

  border-radius: 34px;

  padding: 36px;

  backdrop-filter: blur(12px);
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 40px;
}

.green {
  color: #007F5F;
}

.panel-title {
  font-family: var(--font-head);

  font-size: 72px;
  line-height: .95;

  text-transform: uppercase;
}

.status-pill {
  padding: 16px 24px;

  border-radius: 999px;

  background: #D8F0E7;
  color: #007F5F;

  font-size: 14px;
  font-weight: 700;

  letter-spacing: .12em;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);

  gap: 20px;
}

.form-group label {
  display: block;

  margin-bottom: 12px;

  font-size: 14px;
  font-weight: 700;

  letter-spacing: .12em;
  text-transform: uppercase;

  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  height: 84px;

  border-radius: 22px;
  border: 2px solid #D9D7D0;

  background: #ECEBE6;

  padding: 0 22px;

  font-size: 18px;
  font-weight: 500;

  outline: none;
}

.actions {
  display: flex;
  gap: 18px;

  margin-top: 34px;
}

.save-btn,
.attach-btn {
  height: 78px;
  padding: 0 34px;

  border-radius: 22px;

  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;

  text-transform: uppercase;

  cursor: pointer;
}

.save-btn {
  border: none;

  background: black;
  color: white;
}

.attach-btn {
  border: 2px solid #D9D7D0;

  background: white;
  color: black;
}

/* RESPONSIVO */

@media (max-width: 1200px) {

  .form-grid {
    grid-template-columns: repeat(2,1fr);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-title {
    font-size: 62px;
  }

  .panel-title {
    font-size: 48px;
  }

}

@media (max-width: 768px) {

  .dashboard-header {
    flex-direction: column;
    gap: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .dashboard-title {
    font-size: 48px;
  }

}
/* RH */

.operator-section {
  margin-top: 40px;
}

.operator-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);

  gap: 20px;
}

.operator-card {
  background: white;

  border-radius: 24px;

  padding: 24px;

  border: 1px solid rgba(0,0,0,.08);
}

.operator-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  margin-bottom: 20px;
}

.operator-top h3 {
  font-size: 24px;
  margin-bottom: 6px;
}

.operator-top p {
  color: #666;
}

.operator-info {
  display: grid;
  gap: 10px;

  margin-bottom: 18px;
}

.status {
  padding: 10px 14px;

  border-radius: 999px;

  font-size: 12px;
  font-weight: 700;

  text-transform: uppercase;
}

.green-status {
  background: #D8F0E7;
  color: #007F5F;
}

.red-status {
  background: #F7DDE0;
  color: #C62828;
}

.yellow-status {
  background: #F8EDD1;
  color: #B66A00;
}

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

.alert {
  padding: 12px 14px;

  border-radius: 14px;

  font-size: 13px;
  font-weight: 600;
}

.warning-alert {
  background: #F8EDD1;
  color: #B66A00;
}

.danger-alert {
  background: #F7DDE0;
  color: #C62828;
}

.small {
  font-size: 42px;
}

@media (max-width: 1200px) {

  .operator-grid {
    grid-template-columns: repeat(2,1fr);
  }

}

@media (max-width: 768px) {

  .operator-grid {
    grid-template-columns: 1fr;
  }

}
danger {
  border-left: 5px solid rgb(255, 0, 0);
}



/* STATUS */

.green-status {
  background: rgba(0,127,95,.15);

  color: #007F5F;

  border: 2px solid #007F5F;

  box-shadow:
    0 0 12px rgba(0,127,95,.15);
}

.yellow-status {
  background: rgba(217,119,6,.15);

  color: #D97706;

  border: 2px solid #D97706;

  box-shadow:
    0 0 12px rgba(217,119,6,.15);
}

.red-status {
  background: rgba(198,40,40,.15);

  color: #C62828;

  border: 2px solid #C62828;

  box-shadow:
    0 0 12px rgba(198,40,40,.15);
}
/* CARDS */

.warning {
  border-left: 6px solid #D97706;
}

.danger {
  border-left: 6px solid #C62828;
}

.success {
  border-left: 6px solid #007F5F;
}
/* HEADER */

.header-actions {
  display: flex;
  gap: 12px;
}

/* LOGOUT */

.logout-btn {
  background: #C62828;
  color: white;

  border: none;

  padding: 14px 18px;

  border-radius: 14px;

  cursor: pointer;

  font-weight: 700;
}

.logout-btn:hover {
  opacity: .9;
}

/* STATUS */

.green-status {
  background: rgba(0,127,95,.15);

  color: #007F5F;

  border: 2px solid #007F5F;
}

.yellow-status {
  background: rgba(217,119,6,.15);

  color: #D97706;

  border: 2px solid #D97706;
}

.red-status {
  background: rgba(198,40,40,.15);

  color: #C62828;

  border: 2px solid #C62828;
}
.header-actions {
  display: flex;
  gap: 14px;
}

.empty-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  font-size: 20px;
  font-weight: 600;
  border: 2px dashed rgba(0,0,0,.1);
}

.operator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 2rem;
}

.operator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 1.5rem;
  cursor: pointer;
  transition: .2s;
  border: 2px solid transparent;
}

.operator-card:hover {
  transform: translateY(-4px);
  border-color: #007F5F;
}

.operator-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.operator-top h3 {
  font-size: 32px;
  font-family: 'Barlow Condensed', sans-serif;
  margin-bottom: .4rem;
}

.operator-top p {
  color: #666;
}

.operator-info {
  margin-top: 1rem;
}

.status {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.green-status {
  background: rgba(0,127,95,.12);
  color: #007F5F;
}

.red-status {
  background: rgba(198,40,40,.12);
  color: #C62828;
}

.yellow-status {
  background: rgba(217,119,6,.12);
  color: #D97706;
}
.focus-panel {
  max-width: 1400px;
  margin: auto;
}

.action-row {
  display: flex;
  gap: 16px;
  margin-top: 2rem;
}

.back-btn {
  background: #111111;
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 18px 28px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}

.delete-btn {
  background: rgba(198,40,40,.12);
  color: #C62828;
  border: 2px solid rgba(198,40,40,.2);
  border-radius: 18px;
  padding: 20px 28px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  transition: .2s;
}

.delete-btn:hover {
  background: #C62828;
  color: white;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #555;
}

.form-group input,
.form-group select {
  min-height: 72px;
  border-radius: 20px;
  border: 2px solid rgba(0,0,0,.08);
  background: #ECECE7;
  padding: 0 22px;
  font-size: 18px;
  font-family: 'Barlow', sans-serif;
  transition: .2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #007F5F;
  background: white;
  outline: none;
}

.save-btn {
  background: #111111;
  color: white;
  border: none;
  border-radius: 18px;
  padding: 20px 34px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: .2s;
}

.save-btn:hover {
  transform: translateY(-2px);
}
/* ── SPA additions ── */

.first-login-banner {
  display: none;
  align-items: center;
  gap: 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-left: 4px solid #e6a800;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: .95rem;
  color: #856404;
  animation: slideDown .3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dashboard {
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Responsividade SPA ── */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {

  .admin-body {
    padding: 20px;
  }

  .dashboard-title {
    font-size: 52px;
  }

  .panel-title {
    font-size: 40px;
  }

  .new-btn {
    height: 60px;
    padding: 0 22px;
    font-size: 20px;
    border-radius: 16px;
  }

  .save-btn,
  .attach-btn {
    height: 60px;
    padding: 0 24px;
    font-size: 20px;
  }

  .stat-card h2 {
    font-size: 52px;
  }

  .form-panel {
    padding: 24px;
    border-radius: 24px;
  }

}

/* Mobile (≤ 640px) */
@media (max-width: 640px) {

  .admin-body {
    padding: 14px;
  }

  /* Header: empilha título e ações */
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
  }

  .dashboard-title {
    font-size: 38px;
    line-height: 1;
  }

  .panel-title {
    font-size: 30px;
  }

  /* Ações do header: quebra em duas linhas se necessário */
  .header-actions {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .header-actions .new-btn,
  .header-actions a.new-btn {
    flex: 1 1 auto;
    height: 50px;
    font-size: 15px;
    padding: 0 14px;
    border-radius: 12px;
    text-align: center;
    justify-content: center;
  }

  .logout-btn {
    flex: 1 1 auto;
    height: 50px;
    font-size: 15px;
    border-radius: 12px;
    text-align: center;
  }

  /* Badge de ID — não estoura mais */
  .status-pill {
    font-size: 11px;
    padding: 10px 14px;
    word-break: break-all;
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  /* Panel top: empilha título e badge */
  .panel-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  /* Stats: 1 coluna */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 20px;
    border-radius: 20px;
  }

  .stat-card h2 {
    font-size: 42px;
  }

  /* Form: 1 coluna */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .form-group input,
  .form-group select {
    min-height: 58px;
    font-size: 16px;
    border-radius: 14px;
    padding: 0 16px;
  }

  /* Botões de ação: empilha */
  .actions {
    flex-direction: column;
    gap: 10px;
  }

  .save-btn,
  .attach-btn {
    height: 54px;
    font-size: 18px;
    border-radius: 14px;
    padding: 0 20px;
    width: 100%;
    text-align: center;
  }

  .new-btn {
    height: 50px;
    font-size: 16px;
    padding: 0 16px;
    border-radius: 12px;
  }

  /* Cards de operador/veículo: 1 coluna */
  .operator-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .operator-card {
    padding: 18px;
    border-radius: 18px;
  }

  .operator-top h3 {
    font-size: 22px;
  }

  /* QR section: empilha */
  #qrSection .panel-top + div {
    flex-direction: column;
  }

  /* Not-authorized page */
  .dashboard-title[style*="72px"] {
    font-size: 48px !important;
  }

}
