:root {
  --primary: #FF6F00;
  --dark: #121212;
  --light: #FFFFFF;
  --gray: #F5F5F5;
  --text: #333333;
}

body {
  font-family: 'Sarabun', sans-serif;
  background: var(--light);
  color: var(--text);
  line-height: 1.6;
}

body.auth-background {
  background: transparent;
}

.auth-hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('https://img.freepik.com/free-photo/landschaftsaufnahme-einer-strasse-nebenda-berg_181624-33991.jpg?auto=format&fit=crop&w=1200&q=60'),
    url('https://img.freepik.com/free-photo/young-man-using-digital-tablet-working_1098-17314.jpg?auto=format&fit=crop&w=1200&q=60'),
    url('https://img.freepik.com/free-photo/sunrise-mist-touch-forest_181624-16068.jpg?auto=format&fit=crop&w=1200&q=60');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.12;
  filter: saturate(0.55);
  pointer-events: none;
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  background: var(--dark);
  color: var(--light);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

header .header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.brand-wrap {
  flex: 1;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--light);
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

nav.nav-links {
  display: none;
  gap: 1rem;
}

@media (min-width: 901px) {
  nav.nav-links {
    display: flex;
  }
}

nav.nav-links a {
  color: var(--light);
  text-decoration: none;
  font-weight: 500;
}

.nav-links.open {
  display: flex;
}

header nav a {
  color: var(--light);
  text-decoration: none;
  margin-right: 1rem;
  font-weight: 500;
}

header nav a:last-child {
  margin-right: 0;
}

.primary-label {
  color: var(--primary);
}

.primary {
  color: var(--primary);
}

.hero {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 111, 0, 0.9), rgba(255, 111, 0, 0.6));
  color: var(--light);
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 2rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.search-row input[type="search"] {
  flex: 1;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 1rem;
}

.card {
  background: var(--light);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #ececec;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.6rem;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: var(--light);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn.secondary {
  background: #333;
}

.btn:hover {
  opacity: 0.9;
}

.section {
  padding: 3rem 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.label-pill {
  background: var(--gray);
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.severity-badge {
  display: inline-flex;
  padding: 0.2rem 0.9rem;
  border-radius: 999px;
  color: var(--light);
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
}
.severity-badge.fraud {
  background: #ef4444;
}
.severity-badge.damage {
  background: #f59e0b;
}
.severity-badge.missing {
  background: #6366f1;
}
.severity-badge.other {
  background: #4ade80;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

table th,
table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e5e5e5;
}

.hero small,
.card small {
  color: rgba(255, 255, 255, 0.85);
}

footer {
  background: var(--dark);
  color: var(--light);
  padding: 2rem 0;
  margin-top: 4rem;
}

footer .flex {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal .modal-content {
  background: var(--light);
  padding: 1.5rem;
  border-radius: 16px;
  min-width: min(600px, 100%);
}

.chat-panel {
  position: fixed;
  bottom: 90px;
  right: 1.5rem;
  width: min(320px, calc(100% - 3rem));
  background: var(--dark);
  color: var(--light);
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}

.chat-panel.active {
  display: flex;
}

.chat-panel header {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-panel .messages {
  flex: 1;
  min-height: 180px;
  padding: 1rem;
  overflow-y: auto;
  background: #0d0d0d;
}

.chat-panel .messages div {
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.5rem;
  border-radius: 8px;
}

.chat-panel .messages .message {
  position: relative;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  max-width: 80%;
}

.chat-panel .messages .message.outgoing {
  background: rgba(255, 111, 0, 0.65);
  align-self: flex-end;
}

.chat-panel .messages .message .meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.2rem;
}

.chat-panel footer {
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 0.5rem;
}

.chat-panel textarea {
  flex: 1;
  border-radius: 10px;
  border: none;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--light);
  resize: none;
}

.chat-panel input[type="file"] {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  padding: 0.4rem;
  color: var(--light);
}

.chat-panel button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1rem;
}
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 900px) {
  .header-row {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
  }

  nav.nav-links {
    flex-direction: column;
    width: 100%;
    display: none;
    margin-top: 1rem;
  }

  nav.nav-links a {
    margin-bottom: 0.5rem;
  }

  nav.nav-links.open {
    display: flex;
  }

  .tag-group {
    width: 100%;
    justify-content: flex-start;
    display: none;
  }

  .tag-group.open {
    display: flex;
  }
}

@media (max-width: 600px) {
  nav.nav-links a {
    padding: 0.15rem 0;
    font-size: 0.9rem;
  }

  .tag-group .btn,
  .tag-group button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .nav-toggle {
    padding: 0.3rem 0.7rem;
  }
}

.tag-group span {
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  background: var(--gray);
  font-size: 0.85rem;
}

.chat-button {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  border-radius: 999px;
  width: 60px;
  height: 60px;
  background: var(--primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  color: var(--light);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  header .flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .section {
    padding: 2rem 0;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  header nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row button {
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    width: min(320px, calc(100% - 2rem));
    bottom: 80px;
    right: 1rem;
  }
}
