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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1d23;
  color: #e0e0e0;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  background: #12141a;
  border-bottom: 1px solid #2a2d35;
  padding: 14px 24px;
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.nav-sub {
  font-size: 13px;
  color: #888;
}
.nav-version {
  font-size: 12px;
  color: #555;
  margin-left: auto;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background: #20232b;
  border: 1px solid #2a2d35;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter-group input[type="date"] {
  background: #2a2d35;
  border: 1px solid #3a3d45;
  border-radius: 4px;
  color: #e0e0e0;
  padding: 8px 10px;
  font-size: 14px;
}
.filter-group input[type="date"]:focus {
  outline: none;
  border-color: #5b8def;
}
.filter-clients {
  flex: 1;
  min-width: 200px;
}
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.cb-label {
  font-size: 13px;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.cb-label input[type="checkbox"] {
  accent-color: #5b8def;
}
.filter-actions {
  justify-content: flex-end;
}
.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-actions button {
  background: #5b8def;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.filter-actions button:hover {
  background: #4a7de0;
}
.filter-actions button:disabled {
  background: #3a3d45;
  color: #666;
  cursor: not-allowed;
}
#btnRefresh {
  background: #2a2d35;
  border: 1px solid #3a3d45;
  color: #aaa;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
}
#btnRefresh:hover:not(:disabled) {
  background: #353840;
  color: #e0e0e0;
}

/* Inline filters row */
.inline-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.inline-sep {
  color: #3a3d45;
}
.inline-label {
  color: #888;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.cache-status {
  font-size: 12px;
  color: #555;
  margin-left: auto;
}

/* Summary */
.summary {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 12px;
  min-height: 20px;
}

/* Loader */
.loader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 32px 0;
  justify-content: center;
  color: #888;
  font-size: 14px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #333;
  border-top-color: #5b8def;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  background: #20232b;
  color: #999;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid #2a2d35;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
thead th.sortable {
  cursor: pointer;
  user-select: none;
}
thead th.sortable:hover {
  color: #ccc;
}
thead th.sorted {
  color: #5b8def;
}
.sort-icon {
  font-size: 10px;
}
tbody tr {
  border-bottom: 1px solid #2a2d35;
  transition: background 0.1s;
}
tbody tr:hover {
  background: #252830;
}
tbody td {
  padding: 10px 14px;
  white-space: nowrap;
}
td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Copy buttons */
.copy-btns {
  display: inline-flex;
  gap: 2px;
}
.copy-btns button {
  background: #2a2d35;
  border: 1px solid #3a3d45;
  color: #e0e0e0;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 13px;
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.copy-btns button:hover {
  background: #353840;
  border-color: #5b8def;
}
.copy-btns button.copied {
  background: #1a4d2e;
  border-color: #2ecc71;
  color: #2ecc71;
}
a.mawb-link {
  background: #2a2d35;
  border: 1px solid #3a3d45;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: inline-block;
  line-height: 1;
}
a.mawb-link:hover {
  background: #353840;
  border-color: #5b8def;
}

/* Muted text */
.muted {
  color: #666;
  font-size: 12px;
}

/* Completed rows */
.row-completed td {
  opacity: 0.45;
}

/* Action buttons */
.btn-action {
  background: transparent;
  border: 1px solid #3a3d45;
  border-radius: 3px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-complete {
  color: #4caf84;
  border-color: #2a4d3a;
}
.btn-complete:hover {
  background: #1a3d2a;
}
.btn-uncomplete {
  color: #888;
  border-color: #3a3d45;
}
.btn-uncomplete:hover {
  background: #2a2d35;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 12px;
  }
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-actions {
    align-items: stretch;
  }
  .filter-actions button {
    width: 100%;
  }
}
