@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --border: #d0d6e0;
  --text-main: #1f2933;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #e0ecff;
}

body {
  margin: 0;
  font-family: 'Lexend', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

.page {
  max-width: 1400px; /* was 1100px */
  margin: 2rem auto;
  padding: 0 2rem 3rem; /* slightly larger bezel */
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.9rem;
  letter-spacing: 0.03em;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.wbt-logo {
  height: 60px;
  width: auto;
  border-radius: 0.5rem;
}

.header-text h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: 0.03em;
}

.header-text p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-pill {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.table-card {
  background: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  margin-top: 1.5rem;
  padding: 0.5rem 1rem; /* NEW: internal bezel */
}

.table-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.table-header-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.table-header-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed; /* NEW: prevents layout blowout */
}

thead {
  background: #f3f4f6;
}

th, td {
  padding: 0.75rem 1rem; /* was 0.55rem 0.75rem */
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
  white-space: normal; /* NEW: allows wrapping */
}

th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4b5563;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

tbody tr:hover {
  background: #eef2ff;
}

.fleet-id {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.fleet-id a {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  font-size: inherit;
  display: block;
  width: 100%;
  height: 100%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.status-active {
  background: #ecfdf3;
  color: #166534;
  border-color: #bbf7d0;
}

.status-stored {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fef08a;
}

.status-withdrawn {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

td:nth-child(4) {
  word-break: break-all;
}

td:nth-child(6) {
  word-break: break-word;
}

td:last-child {
  word-break: break-word; /* NEW: fixes Maryborough overflow */
}

.note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.45rem 0.55rem;
  }
}

/* Filter bar container */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Dropdown + text input shared styling */
.filter-bar select,
.filter-bar input {
  font-family: 'Lexend', sans-serif;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.15s ease;
  min-width: 180px;
}

/* Hover effect */
.filter-bar select:hover,
.filter-bar input:hover {
  border-color: var(--accent);
}

/* Focus effect */
.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Make the text input expand nicely */
.filter-bar input {
  flex: 1;
  max-width: 300px;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .filter-bar {
    flex-direction: column;
  }

  .filter-bar select,
  .filter-bar input {
    width: 100%;
  }
}