/* ── CL Travels Design System ─────────────────────────────────── */
:root {
  --blue:         #2B6CB0;
  --blue-dark:    #1A4F8C;
  --blue-light:   #EBF4FF;
  --orange:       #E85A2C;
  --orange-light: #FEF0E8;
  --navy:         #1A3F7A;
  --navy-mid:     #2255A0;
  --bg:           #F5F8FC;
  --white:        #FFFFFF;
  --text:         #1A2B45;
  --muted:        #5A7090;
  --border:       #DDE6F0;
  --success:      #059669;
  --success-bg:   #ECFDF5;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --warning:      #D97706;
  --warning-bg:   #FFFBEB;
  --sidebar-w:    240px;
  --topbar-h:     60px;
  --radius:       10px;
  --shadow:       0 2px 8px rgba(26,63,122,.08), 0 1px 3px rgba(0,0,0,.06);
}

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

body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

/* ── Admin Layout ─────────────────────────────────────────────── */
.cl-wrap { display: flex; min-height: 100vh; }

.cl-sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, #132F60 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s ease;
}

.cl-sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.cl-sidebar-logo img { height: 34px; display: block; }

.cl-sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }

.cl-nav-section {
  padding: 16px 16px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}

.cl-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s;
  text-decoration: none;
}
.cl-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); border-left-color: rgba(255,255,255,.25); }
.cl-nav-link.active { color: #fff; background: rgba(43,108,176,.35); border-left-color: var(--orange); font-weight: 600; }
.cl-nav-link svg { width: 16px; height: 16px; opacity: .7; flex-shrink: 0; }
.cl-nav-link.active svg { opacity: 1; }

.cl-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.cl-sidebar-footer a { color: rgba(255,255,255,.5); font-size: 12.5px; font-weight: 500; }
.cl-sidebar-footer a:hover { color: #fff; }

.cl-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.cl-topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.cl-topbar-left { display: flex; align-items: center; gap: 12px; }
.cl-topbar-title { font-size: 15px; font-weight: 700; color: var(--text); }
.cl-topbar-user { font-size: 12.5px; color: var(--muted); }

.cl-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
  border-radius: 6px;
}
.cl-hamburger:hover { background: var(--bg); }
.cl-hamburger svg { width: 20px; height: 20px; display: block; }

.cl-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 190;
}
.cl-overlay.show { display: block; }

.cl-content { flex: 1; padding: 24px; }

/* ── User Layout ──────────────────────────────────────────────── */
.cl-user-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.cl-user-nav-logo img { height: 30px; display: block; }

.cl-user-nav-menu { display: flex; align-items: center; gap: 4px; }
.cl-user-nav-menu a {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all .15s;
  text-decoration: none;
}
.cl-user-nav-menu a:hover { color: var(--text); background: var(--bg); }
.cl-user-nav-menu a.active { color: var(--blue); background: var(--blue-light); font-weight: 600; }

.cl-user-nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
  border-radius: 6px;
  line-height: 0;
}
.cl-user-nav-hamburger:hover { background: var(--bg); }

.cl-user-content { max-width: 700px; margin: 0 auto; padding: 28px 20px 60px; }

/* ── Charts grid ──────────────────────────────────────────────── */
.cl-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ── Name row (first + last) ──────────────────────────────────── */
.cl-name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

/* ── Cards ────────────────────────────────────────────────────── */
.cl-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.cl-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--white);
}
.cl-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 4px;
  border-bottom: 2px solid var(--orange);
  display: inline-block;
}
.cl-card-body { padding: 20px; }

/* Stat cards */
.cl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.cl-stat {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--blue);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cl-stat.orange { border-top-color: var(--orange); }
.cl-stat.green  { border-top-color: var(--success); }
.cl-stat.navy   { border-top-color: var(--navy); }
.cl-stat-num { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 5px; }
.cl-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ── Tables ───────────────────────────────────────────────────── */
.cl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cl-table { width: 100%; border-collapse: collapse; }
.cl-table th {
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cl-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cl-table tbody tr:last-child td { border-bottom: none; }
.cl-table tbody tr:hover td { background: #EBF4FF; }
.cl-table .text-danger { color: var(--danger) !important; font-weight: 600; }
.cl-table .text-success { color: var(--success) !important; font-weight: 600; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-cl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn-cl-primary { background: var(--blue); color: #fff !important; }
.btn-cl-primary:hover { background: var(--blue-dark); color: #fff !important; }
.btn-cl-orange { background: var(--orange); color: #fff !important; }
.btn-cl-orange:hover { background: #c9481f; color: #fff !important; }
.btn-cl-ghost { background: var(--white); color: var(--muted); border: 1.5px solid var(--border); }
.btn-cl-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-cl-danger { background: var(--danger); color: #fff !important; }
.btn-cl-danger:hover { background: #b91c1c; color: #fff !important; }
.btn-cl-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-cl-full { width: 100%; justify-content: center; }

/* ── Forms ────────────────────────────────────────────────────── */
.cl-form-group { margin-bottom: 18px; }
.cl-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cl-input {
  display: block;
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
}
.cl-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.cl-input::placeholder { color: #b0bec5; }
textarea.cl-input { resize: vertical; min-height: 90px; }
.cl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Badges ───────────────────────────────────────────────────── */
.cl-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-blue    { background: var(--blue-light);  color: var(--blue); }
.badge-orange  { background: var(--orange-light); color: var(--orange); }
.badge-success { background: var(--success-bg);  color: var(--success); }
.badge-danger  { background: var(--danger-bg);   color: var(--danger); }
.badge-muted   { background: var(--bg);          color: var(--muted); }

/* ── Flash ────────────────────────────────────────────────────── */
.cl-flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 500;
}
.cl-flash-success { background: var(--success-bg); color: #065f46; border-left: 3px solid var(--success); }
.cl-flash-error   { background: var(--danger-bg);  color: #991b1b; border-left: 3px solid var(--danger); }
.cl-flash-info    { background: var(--blue-light);  color: var(--blue-dark); border-left: 3px solid var(--blue); }

/* ── Page headers ─────────────────────────────────────────────── */
.cl-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.cl-page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--orange);
  display: inline-block;
}
.cl-back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.cl-back-link:hover { color: var(--blue); }

/* ── Login ────────────────────────────────────────────────────── */
.cl-login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.cl-login-brand {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.cl-login-brand::before {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(232,90,44,.12);
  pointer-events: none;
}
.cl-login-brand::after {
  content: '';
  position: absolute;
  top: -40px; left: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.cl-login-brand img.logo { width: 200px; margin-bottom: 28px; }
.cl-login-brand-tag { color: rgba(255,255,255,.55); font-size: 14px; text-align: center; line-height: 1.8; max-width: 260px; }
.cl-login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--bg); }
.cl-login-box { width: 100%; max-width: 380px; }
.cl-login-box h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.cl-login-box .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* ── Empty state ──────────────────────────────────────────────── */
.cl-empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.cl-empty svg { width: 44px; height: 44px; margin: 0 auto 12px; display: block; opacity: .3; }
.cl-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Summary boxes (payment detail) ──────────────────────────── */
.cl-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.cl-summary-box { background: var(--white); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.cl-summary-box .amt { font-size: 22px; font-weight: 800; }
.cl-summary-box .lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 3px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cl-sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .cl-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .cl-main { margin-left: 0; }
  .cl-hamburger { display: flex; }
  .cl-login-wrap { grid-template-columns: 1fr; }
  .cl-login-brand { display: none; }
  .cl-row { grid-template-columns: 1fr; }
  .cl-summary { grid-template-columns: repeat(3,1fr); }
  .cl-charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* User nav — collapse to hamburger */
  .cl-user-nav-hamburger { display: flex; }
  .cl-user-nav-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    z-index: 99;
    gap: 0;
  }
  .cl-user-nav-menu.open { display: flex; }
  .cl-user-nav-menu a {
    padding: 13px 20px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--border);
    font-size: 14px !important;
  }
  .cl-user-nav-menu a:last-child { border-bottom: none; }
  /* Name row stacks */
  .cl-name-row { grid-template-columns: 1fr; }
  /* Login form padding */
  .cl-login-form-wrap { padding: 28px 16px; }
}

@media (max-width: 560px) {
  .cl-content { padding: 14px; }
  .cl-user-content { padding: 16px 14px 48px; }
  .cl-stats { grid-template-columns: 1fr 1fr; }
  .cl-summary { grid-template-columns: 1fr; }
  .cl-topbar { padding: 0 14px; }
  .cl-user-nav { padding: 0 14px; }
  .cl-login-box h1 { font-size: 18px; }
  .cl-page-title { font-size: 16px; }
}

/* ── Section labels ─────────────────────────────────────────────── */
.cl-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cl-section-count {
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* ── Trip cards grid ────────────────────────────────────────────── */
.cl-trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.cl-trip-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cl-trip-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}
.cl-trip-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  line-height: 1.3;
}
.cl-trip-dates {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.cl-trip-stats {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cl-trip-stat {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
}
.cl-trip-stat:last-child { border-right: none; }
.cl-trip-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.cl-trip-stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-top: 2px;
}
.cl-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
}
.cl-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.cl-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .3s;
}
.cl-progress-pct {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 32px;
  text-align: right;
}
.cl-trip-card-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Payment group headers ──────────────────────────────────────── */
.cl-payment-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
  flex-wrap: wrap;
}
.cl-payment-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.cl-payment-group-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.cl-payment-group-totals {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.cl-pgt-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.cl-pgt-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.cl-pgt-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 640px) {
  .cl-trip-grid { grid-template-columns: 1fr; }
  .cl-payment-group-header { flex-direction: column; }
  .cl-payment-group-totals { gap: 16px; }
  .cl-pgt-item { align-items: flex-start; }
}
