/* TripTogether - Style triptogether.fr */
:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #14b8a6;
  --accent: #f59e0b;
  --bg: #f0fdfa;
  --card: #ffffff;
  --text: #134e4a;
  --text-light: #64748b;
  --border: #99f6e4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--card);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 42px; height: 42px;
  background: var(--gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.logo h1 {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Navigation */
.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 8px 4px;
  display: flex;
  justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(13, 148, 136, 0.1);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 8px;
}

.nav-item span:first-child { font-size: 1.2rem; }
.nav-item.active { color: var(--primary); background: rgba(13, 148, 136, 0.1); }
.nav-item:hover { color: var(--primary); }

/* Main */
main {
  padding: 70px 14px 80px;
  max-width: 500px;
  margin: 0 auto;
}

.section { display: none; }
.section.active { display: block; }

/* Cards */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* Hero */
.hero {
  background: var(--gradient);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
  color: white;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.3);
}

.hero h2 { font-size: 1.4rem; margin-bottom: 4px; font-weight: 700; }
.hero p { font-size: 0.85rem; opacity: 0.9; margin-bottom: 20px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  text-align: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.65rem; opacity: 0.9; margin-top: 2px; }

/* Lists */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child { border-bottom: none; }

.list-item-spouse {
  padding-left: 20px;
  background: linear-gradient(90deg, #f0fdfa 0%, transparent 100%);
  margin-left: 10px;
  border-left: 3px solid var(--primary-light);
}

.list-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #ccfbf1, #99f6e4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.list-content { flex: 1; }
.list-title { font-weight: 600; font-size: 0.9rem; }
.list-subtitle { font-size: 0.75rem; color: var(--text-light); }
.list-amount { font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.list-actions { display: flex; gap: 6px; }

/* Buttons */
.btn {
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-sm { padding: 8px 12px; font-size: 0.75rem; }
.btn-xs { padding: 5px 10px; font-size: 0.7rem; border-radius: 8px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover { background: var(--bg); }
.icon-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Forms */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--card);
  border-radius: 24px 24px 0 0;
}

.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); }

.modal-close {
  width: 32px; height: 32px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body { padding: 18px; }

.modal-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.modal-footer .btn { flex: 1; }

/* Login screens */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gradient);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.login-overlay.active { display: flex; }

.login-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.login-icon {
  width: 70px; height: 70px;
  background: var(--gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.3);
}

.login-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; color: var(--primary-dark); }
.login-subtitle { font-size: 0.9rem; color: var(--text-light); margin-bottom: 24px; }

.login-input {
  width: 100%;
  padding: 14px;
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.login-input:focus { outline: none; border-color: var(--primary); }
.login-error { color: var(--danger); font-size: 0.8rem; margin-bottom: 14px; display: none; }
.login-cancel { margin-top: 14px; background: none; border: none; color: var(--text-light); cursor: pointer; }

/* Chips */
.chip-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 25px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid var(--border);
  background: white;
  user-select: none;
}

.chip:hover { border-color: var(--primary); background: #f0fdfa; }

.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.chip-all { background: #f1f5f9; border-color: #cbd5e1; font-weight: 600; }

/* Currency/Language selectors */
.selector { display: flex; gap: 6px; margin-bottom: 14px; }

.selector-btn {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
}

.selector-btn:hover { background: #f0fdfa; border-color: var(--primary); }
.selector-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.selector-btn.active:hover { background: var(--primary-dark); }

.lang-selector { display: flex; gap: 4px; }

.lang-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: white;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.lang-btn.active { background: var(--primary); border-color: var(--primary); }

/* Special cards */
.emergency-card {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: white;
  border: none !important;
}

.emergency-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.emergency-item {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 12px 6px;
}

.emergency-number { display: block; font-size: 1.6rem; font-weight: 700; }
.emergency-label { display: block; font-size: 0.6rem; opacity: 0.9; margin-top: 4px; }

.budget-card {
  background: var(--gradient);
  color: white;
  border: none !important;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  font-size: 0.9rem;
}

.budget-row:last-child { border-bottom: none; }
.budget-expense { color: #fcd34d; }
.budget-remaining { font-size: 1.2rem; font-weight: 700; }

/* Rebalance card */
.rebalance-card {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: white;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 14px;
}

.rebalance-card h3 { margin-bottom: 14px; font-size: 1.1rem; }

.rebalance-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.rebalance-stat {
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.rebalance-stat-value { font-size: 1.3rem; font-weight: 700; }
.rebalance-stat-label { font-size: 0.7rem; opacity: 0.9; margin-top: 4px; }

.rebalance-list { background: rgba(255,255,255,0.1); border-radius: 14px; padding: 12px; }

.rebalance-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
}

.rebalance-item:last-child { border-bottom: none; }
.rebalance-positive { color: #86efac; }
.rebalance-negative { color: #fca5a5; }

/* MyTrip card */
.mytrip-card {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: white;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 14px;
}

.mytrip-card h3 { margin-bottom: 14px; font-size: 1.1rem; }

.mytrip-finance-details {
  background: rgba(255,255,255,0.95);
  border-radius: 14px;
  padding: 14px;
  color: #134e4a;
}

.finance-details-section {
  margin: 12px 0;
  padding: 10px;
  background: #f0fdfa;
  border-radius: 10px;
  border-left: 3px solid #14b8a6;
}

.finance-details-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0d9488;
  margin-bottom: 8px;
}

.finance-detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  font-size: 0.8rem;
  border-bottom: 1px dashed #e2e8f0;
}

.finance-detail-row:last-child {
  border-bottom: none;
}

.finance-detail-row .positive {
  color: #059669;
  font-weight: 500;
}

.finance-detail-row .negative {
  color: #dc2626;
  font-weight: 500;
}

.mytrip-section {
  background: rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.mytrip-section:last-child { margin-bottom: 0; }
.mytrip-section-title { font-size: 0.7rem; opacity: 0.8; margin-bottom: 8px; text-transform: uppercase; }

.mytrip-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
}

.mytrip-item:last-child { border-bottom: none; }
.mytrip-item-title { font-weight: 600; margin-bottom: 3px; }
.mytrip-item-subtitle { opacity: 0.9; font-size: 0.75rem; }

/* Ticket in MyTrip */
.ticket-card {
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}

.ticket-img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.ticket-info { font-size: 0.8rem; }

/* Itinerary */
.itinerary-card {
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  border: 2px solid #86efac;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.itinerary-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.itinerary-date { font-weight: 700; font-size: 1rem; color: var(--primary); }
.itinerary-day { font-size: 0.75rem; color: var(--text-light); background: #e2e8f0; padding: 4px 10px; border-radius: 12px; }
.itinerary-actions { margin-left: auto; }
.itinerary-time { font-size: 0.8rem; color: #0891b2; margin-bottom: 6px; }
.itinerary-route { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }

.itinerary-activities {
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.itinerary-accommodation {
  background: #fef3c7;
  border-radius: 10px;
  padding: 10px 12px;
}

.itinerary-accommodation-title { font-size: 0.85rem; font-weight: 600; color: #92400e; }
.itinerary-link { display: inline-block; margin-top: 6px; font-size: 0.7rem; color: #2563eb; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.photo-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
}

.photo-item img { width: 100%; height: 100%; object-fit: cover; }

.photo-delete {
  position: absolute;
  top: 6px; right: 6px;
  width: 24px; height: 24px;
  background: rgba(220,38,38,0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  display: none;
}

body.is-org .photo-delete { display: flex; align-items: center; justify-content: center; }

.photo-group { margin-bottom: 18px; }
.photo-group-title { font-size: 0.85rem; font-weight: 600; color: var(--primary); margin-bottom: 10px; }

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.active { display: flex; }
.lightbox img { max-width: 95%; max-height: 90vh; object-fit: contain; border-radius: 8px; }

.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-caption {
  position: absolute;
  bottom: 20px; left: 20px; right: 20px;
  color: white;
  font-size: 0.85rem;
  text-align: center;
}

/* Announcements */
.announcement {
  padding: 14px;
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  border-radius: 12px;
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}

.announcement-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--primary-dark); }
.announcement-content { font-size: 0.85rem; color: #475569; }

/* Contact */
.contact-list { display: flex; flex-direction: column; gap: 10px; }

.contact-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  border-radius: 12px;
}

.contact-role { font-size: 0.75rem; color: var(--text-light); width: 100%; }
.contact-name { font-weight: 600; color: var(--primary); }
.contact-phone { color: #2563eb; text-decoration: none; margin-left: auto; }

/* Tips */
.tips-list { display: flex; flex-direction: column; gap: 8px; }

.tip {
  font-size: 0.8rem;
  padding: 10px 12px;
  background: #fffbeb;
  border-radius: 10px;
  border-left: 4px solid var(--accent);
}

/* Bank info */
.bank-info {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
  border: 1px solid var(--border);
}

.bank-title { font-size: 0.75rem; color: var(--text-light); margin-bottom: 8px; font-weight: 600; }
.bank-content { font-family: monospace; font-size: 0.8rem; white-space: pre-line; }

/* Progress bar */
.progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* Toast */
.toast {
  position: fixed;
  top: 80px; left: 14px; right: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 400;
  border-left: 4px solid var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.toast.show { transform: translateY(0); opacity: 1; }

/* Chatbot */
.chatbot-btn {
  position: fixed;
  bottom: 90px;
  right: 16px;
  width: 56px;
  height: 56px;
  background: var(--gradient);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
  transition: all 0.3s;
}

.chatbot-btn:hover { transform: scale(1.05); }

.chatbot-btn.has-ai::after {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 12px; height: 12px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid white;
}

.chat-window {
  position: fixed;
  bottom: 90px; right: 16px;
  width: calc(100% - 32px);
  max-width: 380px;
  height: 500px;
  max-height: calc(100vh - 180px);
  background: var(--card);
  border-radius: 20px;
  z-index: 200;
  display: none;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
}

.chat-window.active { display: flex; }

.chat-header {
  background: var(--gradient);
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.chat-info h4 { font-size: 0.95rem; font-weight: 600; }
.chat-info p { font-size: 0.7rem; opacity: 0.9; }

.chat-close {
  margin-left: auto;
  background: rgba(255,255,255,0.2);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: msgIn 0.3s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
  background: white;
  color: var(--text);
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-message.user {
  background: var(--primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 6px;
}

.chat-message img { max-width: 100%; border-radius: 10px; margin-top: 8px; }
.chat-message a { color: var(--primary); text-decoration: underline; }
.chat-message.user a { color: white; }

.chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  width: fit-content;
}

.chat-typing span {
  width: 8px; height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chat-input-area {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 25px;
  font-size: 0.9rem;
  outline: none;
}

.chat-input:focus { border-color: var(--primary); }

.chat-send {
  width: 44px; height: 44px;
  background: var(--gradient);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Scanner */
.scanner-area {
  border: 3px dashed var(--border);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f8fafc;
}

.scanner-area:hover { border-color: var(--primary); background: #f0fdfa; }
.scanner-area.active { border-color: var(--primary); background: #ccfbf1; }
.scanner-icon { font-size: 3rem; margin-bottom: 12px; }
.scanner-text { color: var(--text-light); font-size: 0.9rem; }

.scanner-preview { margin-top: 16px; display: none; }
.scanner-preview.show { display: block; }
.scanner-preview img { max-width: 100%; max-height: 200px; border-radius: 12px; border: 2px solid var(--border); }

.scanner-result {
  margin-top: 16px;
  padding: 16px;
  background: #f0fdf4;
  border-radius: 12px;
  text-align: left;
  display: none;
}

.scanner-result.show { display: block; }
.scanner-result h4 { color: var(--primary); margin-bottom: 10px; }

.scanner-result-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.scanner-result-item:last-child { border-bottom: none; }
.scanner-result-label { color: var(--text-light); }
.scanner-result-value { font-weight: 600; }

/* Empty state */
.empty {
  text-align: center;
  padding: 30px 20px;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Admin only */
.org-only { display: none; }
body.is-org .org-only { display: flex; }

/* ============ TIMELINE STYLES ============ */
.timeline-day {
  background: #fff;
  border-radius: 16px;
  margin-bottom: 0;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.1);
}

.timeline-day-header {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.timeline-header-empty {
  background: linear-gradient(135deg, #fca5a5, #f87171);
}

.timeline-date {
  font-weight: 700;
  font-size: 1rem;
}

.timeline-day-name {
  font-size: 0.85rem;
  opacity: 0.9;
  flex: 1;
  text-transform: capitalize;
}

.timeline-events {
  padding: 16px;
}

.timeline-event {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  margin-bottom: 0;
}

.timeline-event-time {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-dark);
  min-width: 50px;
}

.timeline-event-content {
  flex: 1;
}

.timeline-event-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.timeline-event-subtitle {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}

.timeline-event-details {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

.timeline-event-personal {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 6px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-radius: 8px;
  display: inline-block;
}

.timeline-event-image {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 6px;
  cursor: pointer;
}

.timeline-event-image:hover {
  text-decoration: underline;
}

.timeline-event-actions {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.timeline-connector {
  width: 2px;
  height: 16px;
  background: linear-gradient(180deg, var(--primary-light), var(--border));
  margin: 0 auto;
  margin-left: 30px;
}

.timeline-day-connector {
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
  margin: 0 auto;
  border-radius: 2px;
}

.timeline-day-empty {
  border: 2px dashed #fca5a5;
  background: #fef2f2;
}

.timeline-empty-content {
  padding: 24px;
  text-align: center;
}

.timeline-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.timeline-empty-text {
  color: #dc2626;
  font-size: 0.9rem;
}

/* My Trip Timeline */
.my-timeline {
  margin-top: 16px;
}

.mytrip-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-radius: 12px;
  margin-top: 12px;
}

.balance-label {
  font-size: 0.9rem;
  color: var(--text);
}

.balance-amount {
  font-size: 1.3rem;
  font-weight: 700;
}

.balance-amount.positive {
  color: var(--success);
}

.balance-amount.negative {
  color: var(--danger);
}

/* My Trip Finance Details */
.mytrip-finance-details {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
}

.finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #e2e8f0;
}

.finance-row:last-child {
  border-bottom: none;
}

.finance-row.finance-total {
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px solid var(--primary-light);
  border-bottom: none;
  font-weight: 700;
}

.finance-row .positive {
  color: var(--success);
  font-weight: 600;
}

.finance-row .negative {
  color: var(--danger);
  font-weight: 600;
}

/* Finance Actions - Pay / Receive */
.finance-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.finance-action-icon {
  font-size: 1.3rem;
}

.finance-action-text {
  flex: 1;
}

.finance-action-text strong {
  color: var(--text);
}

.finance-pay {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.finance-receive {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  color: #15803d;
  border: 1px solid #86efac;
}

/* ============ TICKET CARDS IN CHAT ============ */
.ticket-card-chat {
  max-width: 320px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  color: #134e4a;
  box-shadow: 0 8px 30px rgba(13,148,136,0.2);
  margin: 12px 0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}

.ticket-card-chat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(13,148,136,0.25);
}

.ticket-card-chat:active {
  transform: scale(0.98);
}

.tk-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tk-airline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tk-icon {
  font-size: 1.4rem;
}

.tk-carrier {
  font-weight: 700;
  font-size: 0.95rem;
}

.tk-type {
  font-size: 0.65rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tk-number {
  background: rgba(255,255,255,0.2);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.95rem;
}

.tk-route {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
}

.tk-city {
  text-align: center;
  flex: 1;
}

.tk-code {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0f766e;
  letter-spacing: 2px;
}

.tk-name {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.tk-line {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
}

.tk-line span {
  font-size: 1.2rem;
  margin-bottom: 6px;
  color: #0d9488;
}

.tk-dots {
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(90deg, #0d9488 0px, #0d9488 6px, transparent 6px, transparent 12px);
}

.tk-passenger {
  padding: 12px 18px;
  background: #134e4a;
  color: #fff;
}

.tk-passenger-label {
  font-size: 0.6rem;
  opacity: 0.7;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.tk-passenger-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.tk-details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #e2e8f0;
}

.tk-details-2 {
  grid-template-columns: repeat(3, 1fr);
}

.tk-detail {
  background: #fff;
  padding: 12px 8px;
  text-align: center;
}

.tk-label {
  display: block;
  font-size: 0.55rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.tk-value {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: #134e4a;
}

.tk-highlight {
  color: #0d9488;
  font-size: 1.1rem;
}

.tk-barcode {
  padding: 14px 18px;
  background: #f8fafc;
  border-top: 2px dashed #99f6e4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tk-barcode-lines {
  display: flex;
  gap: 1px;
  height: 40px;
  align-items: center;
}

.tk-boarding {
  text-align: right;
}

.tk-boarding-label {
  font-size: 0.6rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tk-boarding-time {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0d9488;
}

/* Train specific styling */
.ticket-card-chat .tk-header.train {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

/* Bus specific styling */
.ticket-card-chat .tk-header.bus {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

/* Boat specific styling */
.ticket-card-chat .tk-header.boat {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

/* Ticket footer */
.tk-footer {
  padding: 12px 18px;
  text-align: center;
  font-size: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.tk-has-image {
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  color: #0f766e;
  cursor: pointer;
  transition: background 0.2s;
}

.tk-has-image:hover {
  background: linear-gradient(135deg, #ccfbf1, #99f6e4);
}

.tk-no-image-footer {
  background: #f8fafc;
  color: #94a3b8;
}

/* ============ WEATHER WIDGET ============ */
.weather-card {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  border: none !important;
  padding: 16px;
}

.weather-loading, .weather-error {
  text-align: center;
  padding: 20px;
  font-size: 1rem;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.weather-icon {
  font-size: 3rem;
}

.weather-info {
  flex: 1;
}

.weather-temp {
  font-size: 2rem;
  font-weight: 700;
}

.weather-desc {
  font-size: 0.9rem;
  opacity: 0.9;
}

.weather-location {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 4px;
}

.weather-details {
  text-align: right;
}

.weather-wind {
  font-size: 0.85rem;
  opacity: 0.9;
}

.weather-forecast {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.forecast-day {
  flex: 1;
  text-align: center;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px;
}

.forecast-name {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
}

.forecast-icon {
  display: block;
  font-size: 1.5rem;
  margin: 4px 0;
}

.forecast-temp {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ============ ANNOUNCEMENTS ============ */
.announcement {
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #f8fafc;
  border-left: 4px solid #14b8a6;
}

.announcement:last-child {
  margin-bottom: 0;
}

.announcement-urgent {
  background: #fef2f2;
  border-left-color: #dc2626;
}

.announcement-info {
  background: #fefce8;
  border-left-color: #eab308;
}

.announcement-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.announcement-badge {
  font-size: 0.9rem;
}

.announcement-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
}

.announcement-actions {
  display: flex;
  gap: 4px;
}

.announcement-content {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.4;
}

.announcement-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 6px;
}

/* ============ CHECKLIST ============ */
.checklist-card {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 2px solid #86efac !important;
}

.checklist-progress {
  background: #10b981;
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.checklist-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: white;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
}

.checklist-item:hover {
  border-color: #10b981;
}

.checklist-item.checked {
  background: #dcfce7;
  border-color: #86efac;
}

.checklist-item input {
  display: none;
}

.checklist-icon {
  font-size: 1.2rem;
}

.checklist-label {
  font-size: 0.8rem;
  color: #374151;
  flex: 1;
}

.checklist-item.checked .checklist-label {
  text-decoration: line-through;
  color: #6b7280;
}

/* ============ LOCATION ============ */
.location-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 28px;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background: #10b981;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.list-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

.location-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.location-dot.location-active {
  background: #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.location-time {
  color: #94a3b8;
  font-size: 0.7rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 400px) {
  .checklist-items {
    grid-template-columns: 1fr;
  }
  
  .weather-main {
    flex-wrap: wrap;
  }
  
  .weather-details {
    width: 100%;
    text-align: left;
    margin-top: 8px;
  }
}

/* ============ INPUT WITH CURRENCY ============ */
.input-with-currency {
  display: flex;
  gap: 8px;
}

.input-with-currency .form-input {
  flex: 1;
}

.currency-select {
  width: 100px;
  flex-shrink: 0;
}

/* ============ TICKET ASSIGNMENT ============ */
.assign-ticket-info {
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  border-left: 4px solid #14b8a6;
}

.assign-select-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.assign-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.assign-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.assign-checkbox-item:hover {
  background: #f0fdfa;
}

.assign-checkbox-item.checked {
  background: #ccfbf1;
  border-color: #14b8a6;
}

.assign-checkbox-item input {
  width: 18px;
  height: 18px;
  accent-color: #14b8a6;
}

.assign-checkbox-name {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ============ MY TICKETS (Mon Trip) ============ */
.ticket-count {
  background: #14b8a6;
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.my-tickets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.my-ticket-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #a7f3d0;
}

.my-ticket-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
}

.my-ticket-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.my-ticket-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-ticket-info {
  flex: 1;
  min-width: 0;
}

.my-ticket-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f766e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-ticket-route {
  font-size: 0.85rem;
  color: #475569;
  margin-top: 2px;
}

.my-ticket-date {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

.my-ticket-view {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

@media (max-width: 400px) {
  .assign-checkboxes {
    grid-template-columns: 1fr;
  }
}

/* ============ LOCATION TOGGLE IMPROVED ============ */
.location-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.location-status {
  font-size: 0.75rem;
  color: #64748b;
}

.location-help {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 8px 0 0 0;
  font-style: italic;
}
