@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600;700&display=swap');

:root {
  --bg: #10151c;
  --panel: #171e27;
  --panel-border: #263140;
  --text: #e7ecf2;
  --text-dim: #8a97a6;
  --amber: #e8912c;
  --amber-dim: #4a3417;
  --green: #4caf6e;
  --green-dim: #17301f;
  --red: #e05a5a;
  --red-dim: #331a1a;
  --gray: #5b6675;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  color: var(--amber);
  font-size: 22px;
}
.brand-name {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 15px;
}

/* ---------- Login ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 40px 36px;
  width: 320px;
  text-align: center;
}
.login-card .brand { justify-content: center; margin-bottom: 4px; }
.login-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 24px;
  letter-spacing: 0.04em;
}
.login-card input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: #0d1218;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
}
.login-card button {
  width: 100%;
}
.error-text {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  margin-top: 10px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--panel-border);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.fleet-count {
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

/* ---------- Buttons ---------- */
button {
  cursor: pointer;
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 6px;
  padding: 10px 18px;
  transition: opacity 0.15s ease;
}
button:hover { opacity: 0.88; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--amber);
  color: #1a1206;
}
.btn-secondary {
  background: #232d39;
  color: var(--text);
  border: 1px solid var(--panel-border);
}

/* ---------- Progress ---------- */
.progress-wrap {
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--panel-border);
  background: #141b23;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: #232d39;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--amber);
  width: 0%;
  transition: width 0.3s ease;
}
.progress-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ---------- Add row ---------- */
main {
  padding: 24px 28px 60px;
  max-width: 980px;
  margin: 0 auto;
}
.add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.add-row input, .add-row select {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
}
.add-row input#regNo { flex: 1; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.06em; }
.add-row input#fleetNo { width: 160px; }

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.upload-label {
  display: inline-block;
}
.upload-hint {
  color: var(--text-dim);
  font-size: 12px;
}
.upload-result {
  color: var(--amber);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Table ---------- */
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
}
thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}
thead th[data-sort]:hover {
  color: var(--text);
}
.sort-arrow {
  display: inline-block;
  width: 10px;
  font-size: 10px;
  color: var(--amber);
}
tbody tr {
  border-bottom: 1px solid #1c2530;
  cursor: pointer;
}
tbody tr:hover { background: #141b23; }
tbody td {
  padding: 13px 12px;
  font-size: 13.5px;
  vertical-align: middle;
}

.plate {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 2px solid var(--gray);
  border-radius: 4px;
  padding: 3px 8px;
  display: inline-block;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.status-ok { background: var(--green-dim); color: var(--green); }
.status-fines { background: var(--amber-dim); color: var(--amber); }
.status-error { background: var(--red-dim); color: var(--red); }
.status-pending { background: #1c2530; color: var(--text-dim); }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

.delete-btn {
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  padding: 4px 8px;
}
.delete-btn:hover { color: var(--red); }

.empty-state {
  color: var(--text-dim);
  text-align: center;
  padding: 50px 0;
  font-size: 14px;
}
.hidden { display: none !important; }

/* ---------- Detail panel ---------- */
.detail-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 92vw;
  background: var(--panel);
  border-left: 1px solid var(--panel-border);
  box-shadow: -12px 0 30px rgba(0,0,0,0.35);
  padding: 26px;
  overflow-y: auto;
}
.detail-close {
  position: absolute;
  top: 16px; right: 16px;
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  padding: 4px 10px;
}
.detail-inner h3 {
  font-family: 'IBM Plex Mono', monospace;
  margin: 0 0 6px;
}
.detail-status {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 18px;
}
.detail-text, #detailText {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  background: #0d1218;
  border-radius: 6px;
  padding: 14px;
  border: 1px solid var(--panel-border);
}
