:root {
  --bg: #0b1220;             /* seen under the image */
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --brand: #2563eb;
  --brand-2: #38bdf8;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2, 6, 23, .18);
}

/* base */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100svh;
}

/* ===== Hero Background (city/port) ===== */
body {
  /* Update path if your image lives elsewhere (e.g., assets/images/bg2.jpg) */
  background: url('images/bg2.jpg') no-repeat center center / cover fixed;
  position: relative;
}

/* Dark gradient overlay to match the night look */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.65), rgba(0,0,0,.55));
  pointer-events: none;
  z-index: 0;
}

/* Accessibility helpers */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
body.no-scroll { overflow: hidden; }

/* Layout containers */
.container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding-inline: 16px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  width: min(980px, 94vw);
  max-height: min(90svh, 900px);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eceff3;
  background: #f9fafb;
}
.modal-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.modal-body {
  padding: 16px;
  overflow: auto;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
  color: #444;
}
.loading::before {
  content: "";
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #ccc;
  border-top-color: #111;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header/Footer (on dark bg) ---------- */
.topbar {
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,.15);
  position: relative;
  z-index: 2;
}
.topbar .wrap { max-width: 1100px; margin: 0 auto; padding: 14px 18px; }
.brand { color: #fff; font-weight: 800; letter-spacing: .2px; }
.nav a { margin-left: 16px; color: #fff; opacity: .85; }
.nav a:hover { opacity: 1; }
.footer {
  color: #fff; opacity: .6; text-align: center;
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,.15);
  background: transparent;
}

a { text-decoration: none; }

/* ---------- Cards & base UI ---------- */
.card {
  background: rgba(255, 255, 255, 1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  width: 100%;
}

h1, h2, h3 { margin: 0 0 12px; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
p.lead { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: black;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.menu a.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
  box-shadow: var(--shadow);
}

/* ---------- Page hero ---------- */
.wrap-cards {
  min-height: calc(100svh - 120px);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  padding: clamp(24px, 4vw, 40px) 16px;
  height: auto;
}
.hero {
  width: 100%;
  max-width: 860px;
  border: 0 solid rgba(255,255,255,.18);
  background: transparent;
  padding: clamp(20px, 5vw, 48px) clamp(16px, 4vw, 36px);
  text-align: center;
  color: #fff;
  border-radius: 16px;
}
.hero h1 {
  font-size: clamp(22px, 4.5vw, 40px);
  margin-bottom: 6px;
  color: #fff;
}
.hero .lead {
  color: rgba(255,255,255,.85);
  margin-bottom: clamp(14px, 3vw, 22px);
}

/* ---------- Google-style search bar ---------- */
.searchbar {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 9999px;
  padding: 8px 10px 8px 16px;
  gap: 10px;
  width: min(680px, 92%);
  margin: 0 auto;
  box-shadow: 0 10px 34px rgba(0,0,0,.28);
}
.searchbar .input {
  flex: 1;
  font-size: clamp(16px, 2.6vw, 18px);
  height: clamp(42px, 6.5vw, 48px);
  border: none;
  outline: none;
  background: transparent;
  color: #0f172a;
  padding: 0 6px;
}
button.btn.search-btnn {
  background: #2f9c43;
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 9999px;
  padding: 10px 18px;
  height: clamp(40px, 6vw, 44px);
  box-shadow: none;
  transition: transform .06s ease, background .25s ease;
}
button.btn.search-btnn:hover { background: #238338; }
button.btn.search-btnn:active { transform: translateY(1px); }

/* ---------- Logos row ---------- */
.logos {
  margin-top: clamp(30px, 7vw, 70px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: clamp(14px, 4vw, 24px);
  align-items: center;
}
.logos img {
  width: clamp(68px, 9vw, 100px);
  height: auto;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* ---------- Forms, tables, etc ---------- */
form.form .row { margin-bottom: 10px; }
.input, .select, .file, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
}
.input:focus, .select:focus, .file:focus, textarea:focus { border-color: var(--brand); }

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: left; }

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  margin: 14px 0;
}

.notice {
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: #f8fafc;
}

.docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.doc {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

/* ---------- Admin layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100svh;
}
.sidebar {
  background: #000;
  color: #fff;
  padding: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .logo { font-weight: 900; letter-spacing: .3px; margin-bottom: 16px; }
.menu { display: grid; gap: 8px; margin-top: 40px; }
.menu a {
  padding: 13px 22px; margin-bottom: 10px;
  color: #fff; border-radius: 5px;
  background: rgb(99 99 99 / 39%);
  border: 1px solid rgb(99 99 99 / 39%);
}
.main { padding: 24px; }
.card.title { display: flex; align-items: center; justify-content: space-between; }

/* ---------- Status pill (results) ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; font-weight: 700; }
.status-pending { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.status-progress { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.status-completed { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

/* ---------- Loader ---------- */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; pointer-events: none; transition: .2s;
}
.loader-overlay.show { opacity: 1; pointer-events: auto; }
.spinner {
  width: 52px; height: 52px;
  border: 5px solid #e2e8f0; border-top-color: var(--brand);
  border-radius: 50%; animation: spin 1s linear infinite;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 1200px) {
  .container { padding-inline: 16px; }
}

@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-bottom: 1px solid rgba(255,255,255,.15);
  }
}

@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {

 .logos {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 logos in one row */
    gap: 12px;
    justify-items: center;
    margin-top: 40px;
  }

  .logos img {
    width: 60px; /* smaller logo size */
    height: auto;
  }

  .topbar .wrap { padding: 12px 14px; }
  .hero { padding: clamp(16px, 5vw, 32px) clamp(12px, 4vw, 18px); }
  .searchbar { width: 100%; padding-left: 14px; }
  .logos img { width: 76px; }
  /* Avoid iOS background-attachment jank on small screens */
  body { background-attachment: scroll; }
}

@media (max-width: 600px) {
  .kv { grid-template-columns: 1fr; }
}


@media (max-width: 480px) {
  .logos img {
    width: 50px; /* slightly smaller for very small screens */
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .actions, .menu, .loader-overlay { display: none !important; }
  .card { box-shadow: none; border-color: #ddd; }
  body { background: #fff !important; color: #000 !important; }
  a { color: #000 !important; }
}
