/* =========================================================
   ROOT THEME VARIABLES
========================================================= */
:root{
  --bg:#f4f6fb;
  --card:#ffffff;
  --border:#e5e9f2;
  --muted:#6b7280;
  --text:#111827;

  --pri:#2563eb;
  --ok:#16a34a;
  --warn:#f59e0b;
  --bad:#dc2626;

  --soft:#f9fafb;
  --radius:14px;
}

/* =========================================================
   RESET & BASE
========================================================= */
*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}

a{
  color:var(--pri);
  text-decoration:none;
}
a:hover{opacity:.9}

/* =========================================================
   LAYOUT
========================================================= */
.container{
  max-width:1100px;
  margin:0 auto;
  padding:18px;
}

/* =========================================================
   TOPBAR
========================================================= */
.topbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  background:#fff;
  position:sticky;
  top:0;
  border-bottom:1px solid var(--border);
  z-index:50;
}

.brand{
  font-weight:900;
  letter-spacing:.4px;
}

.nav a{
  margin-left:14px;
  color:var(--muted);
  font-weight:600;
}
.nav a:hover{color:var(--pri)}

/* =========================================================
   CARDS
========================================================= */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  margin:14px 0;
  box-shadow:0 10px 24px rgba(0,0,0,.05);
}

/* =========================================================
   GRID
========================================================= */
.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
@media (max-width:820px){
  .grid{grid-template-columns:1fr}
}

/* =========================================================
   FORMS
========================================================= */
label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
  font-weight:700;
}

input,select{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  outline:none;
}

input:focus,select:focus{
  border-color:var(--pri);
  box-shadow:0 0 0 3px rgba(37,99,235,.15);
}

/* =========================================================
   BUTTONS
========================================================= */
.btn{
  display:inline-block;
  padding:11px 18px;
  border-radius:12px;
  background:var(--pri);
  color:#fff;
  font-weight:800;
  border:none;
  cursor:pointer;
}
.btn:hover{filter:brightness(1.05)}

.btn.secondary{
  background:#eef2ff;
  color:var(--pri);
}

/* =========================================================
   TEXT & HEADINGS
========================================================= */
.h1{
  font-size:20px;
  font-weight:900;
  margin:0 0 8px;
}

.small{
  color:var(--muted);
  font-size:13px;
}

/* =========================================================
   ROWS & CHIPS
========================================================= */
.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.kv{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.kv div{
  background:var(--soft);
  border:1px solid var(--border);
  padding:8px 12px;
  border-radius:999px;
  font-size:13px;
  color:var(--muted);
}

/* =========================================================
   BADGES
========================================================= */
.badge{
  display:inline-block;
  padding:4px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:#f1f5f9;
  color:var(--muted);
}

.badge.ok{background:#dcfce7;color:var(--ok)}
.badge.warn{background:#fef3c7;color:var(--warn)}
.badge.bad{background:#fee2e2;color:var(--bad)}

/* =========================================================
   DIVIDER
========================================================= */
.hr{
  height:1px;
  background:var(--border);
  margin:14px 0;
}

/* =========================================================
   TABLES
========================================================= */
table{
  width:100%;
  border-collapse:collapse;
}
th,td{
  padding:11px;
  border-bottom:1px solid var(--border);
  text-align:left;
}
th{
  font-size:12px;
  color:var(--muted);
  font-weight:800;
}
tr:hover td{background:#f9fafb}
/* =========================================================
   HERO SEARCH – FINAL POLISH
========================================================= */
.hero-search{
  padding:60px 20px 70px;
}

.search-box{
  max-width:900px;
  margin:0 auto;
  background:#ffffff;
  padding:18px;
  border-radius:16px;
  box-shadow:0 12px 28px rgba(0,0,0,.12);
  display:grid;
  grid-template-columns:2fr 2fr 1.5fr 1fr auto;
  gap:12px;
}

.search-box .field{
  display:flex;
}

.search-box input{
  width:100%;
  padding:14px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  font-size:14px;
}

.search-box .seats input{
  text-align:center;
  font-weight:700;
}

.search-box button{
  padding:14px 22px;
  border-radius:12px;
  background:linear-gradient(135deg,#2563eb,#1d4ed8);
  color:#ffffff;
  font-weight:900;
  border:none;
  cursor:pointer;
  font-size:14px;
  white-space:nowrap;
}

.search-box button:hover{
  filter:brightness(1.05);
}

/* Mobile */
@media(max-width:900px){
  .search-box{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   PUBLIC RESULTS (NEW)
========================================================= */
.results-wrap{
  max-width:1100px;
  margin:34px auto;
  padding:0 16px;
}

.departure-card{
  display:flex;
  justify-content:space-between;
  gap:16px;
  background:#fff;
  border-radius:16px;
  padding:18px;
  margin-bottom:16px;
  box-shadow:0 8px 18px rgba(0,0,0,.08);
}

.departure-card h3{
  margin:0 0 4px;
  font-size:18px;
  font-weight:900;
}

.departure-card .meta{
  font-size:13px;
  color:#555;
}

.departure-card .badges span{
  display:inline-block;
  margin:6px 6px 0 0;
  padding:5px 10px;
  border-radius:999px;
  background:#f1f5f9;
  font-size:12px;
}

.departure-card .badges .ok{
  background:#dcfce7;
  color:#166534;
}

.departure-card .right{
  text-align:right;
  min-width:160px;
}

.departure-card .price{
  font-size:24px;
  font-weight:900;
  color:#16a34a;
}
.departure-card .price small{
  font-size:12px;
  color:#555;
}

.btn-book{
  display:inline-block;
  margin-top:10px;
  padding:10px 16px;
  background:#2563eb;
  color:#fff;
  border-radius:10px;
  font-weight:800;
}

/* Mobile */
@media(max-width:768px){
  .departure-card{flex-direction:column}
  .departure-card .right{text-align:left}
}

/* =========================================================
   PUBLIC FOOTER
========================================================= */
.public-footer{
  background:#0f172a;
  color:#cbd5f5;
  padding:30px 20px 12px;
  font-size:14px;
}

.footer-inner{
  display:flex;
  flex-wrap:wrap;
  gap:30px;
  justify-content:space-between;
  max-width:1100px;
  margin:auto;
}

.footer-brand strong{font-size:16px;color:#fff}

.footer-links a,
.footer-login a{
  color:#cbd5f5;
  margin-right:12px;
  font-size:13px;
}
.footer-links a:hover,
.footer-login a:hover{color:#fff;text-decoration:underline}

.footer-login{
  text-align:right;
}
.footer-login .login-title{
  display:block;
  font-weight:700;
  margin-bottom:6px;
  color:#94a3b8;
}

.footer-bottom{
  text-align:center;
  margin-top:18px;
  font-size:12px;
  color:#94a3b8;
}
.no-results{
  background:#ffffff;
  border:1px dashed var(--border);
  padding:20px;
  border-radius:14px;
  text-align:center;
  color:var(--muted);
  margin-top:20px;
}
/* =========================
   Public Footer
========================= */

.public-footer {
  background: #0f172a;
  color: #cbd5f5;
  padding: 30px 20px 12px;
  font-size: 14px;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
  max-width: 1100px;
  margin: auto;
}

.footer-brand strong {
  font-size: 16px;
  color: #ffffff;
}

.footer-links a,
.footer-login a {
  color: #cbd5f5;
  text-decoration: none;
  margin-right: 12px;
  font-size: 13px;
}

.footer-links a:hover,
.footer-login a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-login {
  text-align: right;
}

.footer-login .login-title {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #94a3b8;
}

.footer-bottom {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .footer-login {
    text-align: left;
  }
}
/* =========================
   Header UX Upgrade
========================= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0f172a;
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-link {
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 14px;
}

.nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav a:hover {
  background: rgba(255,255,255,0.12);
}

.nav a.active {
  background: #2563eb;
  color: #ffffff;
}

/* User box */
.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.username {
  color: #e5e7eb;
}

.role-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.role-admin { background: #7c3aed; }
.role-agent { background: #0284c7; }
.role-operator { background: #16a34a; }
.role-system { background: #ca8a04; }

.logout {
  color: #fca5a5;
  font-weight: 600;
  text-decoration: none;
}

.logout:hover {
  text-decoration: underline;
}

/* Hamburger */
.hamburger {
  display: none;
  font-size: 22px;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
}

/* Mobile */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 56px;
    right: 12px;
    background: #020617;
    padding: 10px;
    border-radius: 10px;
    flex-direction: column;
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
  }

  .nav.open {
    display: flex;
  }

  .userbox {
    display: none;
  }
}
/* =========================
   Public Landing Page
========================= */

.hero {
  background: linear-gradient(120deg, #020617, #0f172a);
  color: #fff;
  padding: 60px 20px 40px;
  text-align: center;
}

.hero-inner {
  max-width: 900px;
  margin: auto;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 10px;
}

.hero-sub {
  color: #cbd5f5;
  font-size: 16px;
}

.hero-trust {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 14px;
  color: #a5b4fc;
  flex-wrap: wrap;
}

/* Search */
.search-card {
  background: #fff;
  max-width: 900px;
  margin: -30px auto 40px;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.search-grid input,
.search-grid button {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e5e9f2;
}

.search-grid button {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

@media (max-width: 900px) {
  .search-grid {
    grid-template-columns: 1fr;
  }
}

/* Results */
.results {
  max-width: 1100px;
  margin: auto;
  padding: 0 18px 40px;
}

.departure-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.dep-left h3 {
  margin: 0 0 6px;
}

.route {
  color: #6b7280;
  font-size: 14px;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.meta span {
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.dep-right {
  text-align: right;
}

.price {
  font-size: 20px;
  font-weight: 800;
}

.btn-book {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 16px;
  background: #16a34a;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}

.empty-state {
  background: #fff;
  padding: 30px;
  text-align: center;
  border-radius: 14px;
  color: #6b7280;
  margin-top: 20px;
}
/* =========================================================
   OPTION 5 – CONVERSION POLISH (APPEND ONLY)
   (Do NOT remove existing CSS. Paste at end.)
========================================================= */

/* Trust strip (optional if you add it in HTML) */
.trust-strip{
  display:flex;
  justify-content:center;
  gap:20px;
  margin:14px 0 30px;
  font-size:13px;
  color:#475569;
  flex-wrap:wrap;
}

/* Seat urgency chips */
.seat{
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  display:inline-block;
}

.seat-ok{
  background:#dcfce7;
  color:#166534;
}

.seat-warn{
  background:#fef3c7;
  color:#92400e;
}

.seat-danger{
  background:#fee2e2;
  color:#991b1b;
}

/* Departing soon */
.depart-soon{
  background:#2563eb;
  color:#ffffff;
  padding:4px 10px;
  border-radius:6px;
  font-size:11px;
  font-weight:800;
  display:inline-block;
}

/* Book Now CTA – upgraded */
.btn-book{
  display:inline-block;
  margin-top:10px;
  padding:12px 20px;
  background:linear-gradient(135deg,#16a34a,#22c55e);
  color:#fff;
  border-radius:12px;
  text-decoration:none;
  font-weight:900;
  letter-spacing:.3px;
  box-shadow:0 10px 20px rgba(34,197,94,.35);
  transition:transform .15s ease, box-shadow .15s ease;
}

.btn-book:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 30px rgba(34,197,94,.45);
}

/* Confidence line under CTA */
.confidence-line{
  margin-top:6px;
  font-size:11px;
  color:#64748b;
}

/* Small visual improvement to results cards (won’t break old design) */
.departure-card{
  border:1px solid rgba(0,0,0,.04);
}
/* =========================
   LOGIN PAGE FIX (APPEND)
========================= */

/* Apply only to login page */
body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6fb;
}

/* Constrain login box */
.login-box {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  padding: 26px 24px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
}

/* Improve form spacing */
.login-box label {
  margin-top: 14px;
}

.login-box button {
  margin-top: 18px;
}
