/* ===================== Root & Base ===================== */
:root {
  --bg: #ffffff;
  --card: #f9f9f9;
  --text: #111111;
  --muted: #666666;
  --accent-blue: #0b7bff;
  --accent-red: #ff3444;
  --accent-police: #e0e0e0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* ===================== Header ===================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  border-bottom: 3px solid var(--accent-blue);
  background: var(--bg);
  gap: 12px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo {
  height: 60px;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.site-info {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--accent-blue);
}

/* ===================== Admin Links ===================== */
.admin-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-links a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-blue);
  border-radius: 6px;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.admin-links a:hover {
  background: #0066cc;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* ===================== Main & Sidebar ===================== */
.main {
  display: flex;
  gap: 20px;
  margin-top: 16px;
}

.sidebar {
  width: 250px;
  background: var(--card);
  padding: 12px;
  border-radius: 10px;
  height: fit-content;
}

.sidebar h2 {
  margin: 0 0 8px 0;
}

.sidebar a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 6px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.sidebar a:hover {
  background: linear-gradient(90deg, rgba(11,123,255,0.06), rgba(255,52,68,0.06));
}

.content {
  flex: 1;
}

/* ===================== Cards ===================== */
.card {
  background: var(--card);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(0,0,0,0.05);
}

/* ===================== Tables ===================== */
/* ===================== Modern Table with Borders ===================== */

/* Responsive table wrapper */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* subtle shadow */
  background: #fff;
  margin: 20px 0;
}

/* Table base styles */
.table {
  width: 100%;
  border-collapse: collapse; /* ensures borders don’t double up */
  table-layout: auto;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* Table headers */
.table th {
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  background: #f4f6f8; /* light gray header */
  color: #333;
  border: 1px solid #d0d4d9; /* border for header cells */
}

/* Table cells */
.table td {
  padding: 10px;
  font-size: 0.92rem;
  color: #555;
  border: 1px solid #d0d4d9; /* border for each cell */
  transition: background 0.2s ease;
}

/* Row hover effect */
.table tbody tr:hover {
  background: #e8f0fe; /* highlight row on hover */
}

/* Alternate row shading (optional) */
.table tbody tr:nth-child(even) td {
  background: #f9fbfc;
}

/* Links inside table */
.table a {
  color: #1e90ff;
  text-decoration: none;
  font-weight: 500;
}

.table a:hover {
  text-decoration: underline;
  color: #0b61c1;
}

/* Make Date column slightly wider */
.table th:nth-child(2),
.table td:nth-child(2) {
  min-width: 140px;
}

/* Rounded corners for table */
.table th:first-child {
  border-top-left-radius: 12px;
}
.table th:last-child {
  border-top-right-radius: 12px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .table th,
  .table td {
    padding: 8px 6px;
    font-size: 0.85rem;
  }

  .table-wrapper {
    overflow-x: auto;
  }
}



/* ===================== Footer ===================== */
.footer {
  background: linear-gradient(135deg, #f5f7fa, #e0e0e0);
  color: var(--text);
  padding: 40px 16px;
  border-top: 3px solid var(--accent-blue);
  font-size: 0.95rem;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
  border-radius: 16px 16px 0 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: radial-gradient(circle at top left, rgba(11,123,255,0.1), transparent 70%);
  pointer-events: none;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.footer-left p,
.footer-left h3 {
  margin: 4px 0;
  line-height: 1.6;
}

.footer-left h3 {
  font-size: 1.2rem;
  color: var(--accent-blue);
  font-weight: 700;
}

.footer-right {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-right a {
  display: inline-block;
  padding: 10px 18px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-red));
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.footer-right a:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  background: linear-gradient(90deg, var(--accent-red), var(--accent-blue));
}

/* ===================== Pagination & Breadcrumbs ===================== */
.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pagination a,
.pagination span {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,0.02);
  color: var(--text);
  text-decoration: none;
}

.pagination .current {
  background: var(--accent-blue);
  color: white;
  font-weight: 700;
}

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ===================== Checkpoint Cards ===================== */
.checkpoint-card {
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  background: var(--card);
}

.checkpoint-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.small {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ===================== Admin Styles ===================== */
.admin-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-nav a {
  padding: 8px 10px;
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.admin-nav a.active {
  background: var(--accent-blue);
  font-weight: 700;
  color: #fff;
}

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  .main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .header {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
  }

  .header-left {
    justify-content: center;
    gap: 8px;
  }

  .admin-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .site-logo {
    height: 80px;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .table th,
  .table td {
    padding: 8px;
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) {
  .site-logo {
    height: 70px;
  }

  .site-title {
    font-size: 1.2rem;
  }

  .admin-links a {
    padding: 6px 10px;
    font-size: 0.95rem;
  }

  .small {
    font-size: 0.8rem;
  }

  .footer {
    padding: 30px 12px;
  }

  .footer-left h3 {
    font-size: 1.1rem;
  }

  .footer-right a {
    padding: 6px 12px;
    font-size: 0.95rem;
  }
}

/* ===================== Sidebar Mobile ===================== */
@media (max-width: 768px) {
  .main {
    flex-direction: column;
  }
  .content {
    order: 1;
  }
  .sidebar {
    order: 2;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 30px;
  }
}
