/* ============================================================
   Transport App - Mobile First CSS
   ============================================================ */

:root {
  --primary:   #4CAF50;
  --primary-d: #388E3C;
  --secondary: #FFC107;
  --danger:    #F44336;
  --bg:        #F0F2F5;
  --card:      #ffffff;
  --text:      #212121;
  --text-muted:#757575;
  --border:    #E0E0E0;
  --radius:    14px;
  --shadow:    0 2px 12px rgba(0,0,0,0.10);
  --nav-h:     64px;
  --top-h:     56px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 12px);
}

/* ---- TOP BAR ---- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--top-h);
  background: var(--primary);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.top-bar .app-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  letter-spacing: 0.3px;
}
.top-bar .top-icon {
  color: rgba(255,255,255,0.9);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}
.top-bar .top-icon:hover { background: rgba(255,255,255,0.15); }

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
  padding-top: 6px;
}
.nav-item .nav-icon { font-size: 22px; line-height: 1; }
.nav-item.active { color: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}
/* FAB Add Slip button in nav */
.nav-item.nav-fab {
  flex: 0 0 68px;
}
.nav-fab-btn {
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(76,175,80,0.4);
  margin-bottom: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-fab-btn:active { transform: scale(0.93); }
.nav-fab-btn .nav-icon { font-size: 26px; color: #fff; }
.nav-item.nav-fab .nav-label { color: var(--primary); font-weight: 600; }

/* ---- PAGE CONTENT ---- */
.page { padding: 14px; }

/* ---- CARDS ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 16px; }
.card-header {
  padding: 14px 16px 10px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Summary Cards Row */
.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.summary-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 10px;
  text-align: center;
}
.summary-card .s-icon { font-size: 22px; margin-bottom: 4px; }
.summary-card .s-val {
  font-size: 20px; font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.summary-card .s-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- FORM STYLES ---- */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-control {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
}
textarea.form-control {
  height: 80px;
  padding: 12px 14px;
  resize: vertical;
}
.select2-container--default .select2-selection--single {
  height: 48px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  padding: 0 14px !important;
  display: flex;
  align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0 !important;
  font-size: 15px;
  color: var(--text);
  line-height: 48px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 48px !important;
}
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(76,175,80,0.12) !important;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  text-decoration: none;
  padding: 0 20px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(76,175,80,0.3);
}
.btn-primary:hover { background: var(--primary-d); }
.btn-secondary {
  background: var(--secondary);
  color: #333;
  box-shadow: 0 3px 10px rgba(255,193,7,0.3);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-block { width: 100%; }
.btn-sm { height: 36px; font-size: 13px; border-radius: 8px; padding: 0 12px; }

/* ---- LIST ITEMS ---- */
.list-item {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  gap: 12px;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f5f5f5; }
.list-item .item-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.list-item .item-body { flex: 1; min-width: 0; }
.list-item .item-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .item-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-item .item-right { text-align: right; flex-shrink: 0; }
.list-item .item-amount { font-weight: 700; color: var(--primary); font-size: 15px; }
.list-item .item-date { font-size: 11px; color: var(--text-muted); }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green { background: #E8F5E9; color: #2E7D32; }
.badge-amber { background: #FFF8E1; color: #F57F17; }
.badge-red   { background: #FFEBEE; color: #C62828; }

/* ---- ALERTS / FLASH ---- */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid var(--primary); }
.alert-danger  { background: #FFEBEE; color: #C62828; border-left: 4px solid var(--danger); }

/* ---- DATE FILTER ---- */
.date-filter {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.date-filter .date-input {
  flex: 1;
  min-width: 130px;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
}
.date-filter .btn { height: 40px; font-size: 13px; }

/* ---- SECTION TITLE ---- */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 16px 0 8px;
}

/* ---- TOTAL ROW (Slip) ---- */
.total-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  text-align: center;
  margin: 16px 0;
}
.total-box .t-label { font-size: 12px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }
.total-box .t-val   { font-size: 32px; font-weight: 800; margin-top: 2px; }

/* ---- FAB (floating action button) ---- */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 16px;
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(76,175,80,0.4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px;
  text-decoration: none;
  z-index: 150;
  transition: transform 0.2s;
}
.fab:active { transform: scale(0.92); }

/* ---- OFFLINE INDICATOR ---- */
.offline-bar {
  background: var(--danger);
  color: #fff;
  text-align: center;
  padding: 6px;
  font-size: 13px;
  display: none;
}
.offline-bar.show { display: block; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .e-icon { font-size: 48px; margin-bottom: 10px; }
.empty-state .e-text { font-size: 15px; }

/* ---- VIEW SLIP DETAIL ---- */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .d-label { color: var(--text-muted); font-size: 12px; }
.detail-row .d-val   { font-weight: 600; text-align: right; }

/* ---- RESPONSIVE: wider screens ---- */
@media (min-width: 480px) {
  .summary-row { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  body { max-width: 480px; margin: 0 auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .top-bar { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .fab { right: calc(50% - 240px + 16px); }
}
