/* =============================================================================
 * Tripploy Travel — global styles
 * ============================================================================= */

:root {
  --brand-primary:   #0284c7;   /* sky-600 — travel/aviation blue */
  --brand-secondary: #0369a1;   /* sky-700 */
  --brand-accent:    #f59e0b;   /* amber-500 — highlight for actions */
  --success:         #16a34a;
  --danger:          #dc2626;
  --warning:         #f59e0b;
  --info:            #0284c7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: var(--brand-primary); color: white; }
.btn-primary:hover:not(:disabled)   { background: var(--brand-secondary); }
.btn-secondary { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; }
.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled)    { background: #b91c1c; }
.btn-success   { background: var(--success); color: white; }
.btn-success:hover:not(:disabled)   { background: #15803d; }
.btn-ghost     { background: transparent; color: #64748b; }
.btn-ghost:hover:not(:disabled)     { background: #f1f5f9; }

/* ---------- Inputs ---------- */
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  transition: border-color 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}
.textarea { resize: vertical; min-height: 60px; }

/* ---------- Cards ---------- */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  color: #1e293b;
}

/* ---------- Tables ---------- */
.t-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.t-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.t-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.t-table tbody tr:hover { background: #f8fafc; }

/* ---------- Sidebar navigation ---------- */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}
.nav-item:hover { background: #f1f5f9; color: #0f172a; }
.nav-item.active { background: rgba(2, 132, 199, 0.1); color: var(--brand-primary); }
.nav-section {
  padding: 12px 12px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 600;
}

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  overflow-y: auto;
}
.modal-card {
  background: white;
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: modal-in 0.15s ease-out;
}
@keyframes modal-in {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body   { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ---------- Toasts ---------- */
.toast {
  padding: 12px 16px;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
  animation: toast-in 0.2s ease-out;
  min-width: 250px;
}
.toast-info    { background: var(--info); }
.toast-success { background: var(--success); }
.toast-danger  { background: var(--danger); }
.toast-warning { background: var(--warning); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ---------- Utility for stat cards ---------- */
.stat-card {
  padding: 16px;
  border-radius: 8px;
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.stat-label { font-size: 11px; text-transform: uppercase; color: #64748b; letter-spacing: 0.03em; font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 700; color: #0f172a; margin-top: 4px; }

/* ---------- Status pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pill-green  { background: #dcfce7; color: #166534; }
.pill-red    { background: #fee2e2; color: #991b1b; }
.pill-amber  { background: #fef3c7; color: #92400e; }
.pill-blue   { background: #dbeafe; color: #1e40af; }
.pill-gray   { background: #f1f5f9; color: #475569; }
.pill-purple { background: #f3e8ff; color: #6b21a8; }

/* ============================================================
 * MOBILE ADAPTATIONS  (< 768px)
 * ============================================================ */
@media (max-width: 767px) {
  /* Reduce card / page padding on mobile */
  .card { border-radius: 6px; }

  /* Tighter padding for containers on small screens.
     Overrides Tailwind's p-6 (24px) → 12px on mobile. */
  #main-content .p-6 { padding: 12px !important; }
  #main-content .p-4 { padding: 10px !important; }

  /* Tables scroll horizontally with visible indicator */
  .t-table {
    font-size: 12px;
    min-width: 500px;
  }
  .t-table th, .t-table td {
    padding: 8px 6px;
  }

  /* Modals: smaller padding, near full-width */
  .modal-card {
    max-width: 100% !important;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  .modal-header  { padding: 12px 14px; }
  .modal-body    { padding: 12px 14px; }
  .modal-footer  { padding: 10px 14px; flex-wrap: wrap; }

  /* Buttons: allow wrapping in tight layouts */
  .btn { font-size: 13px; padding: 7px 10px; }

  /* Stat cards: tighter on mobile */
  .stat-card { padding: 12px; }
  .stat-value { font-size: 20px; }

  /* Toasts: don't overlap screen edges */
  .toast { min-width: 200px; max-width: calc(100vw - 32px); font-size: 13px; }
}

/* Small tweaks for very small phones */
@media (max-width: 400px) {
  .modal-header h3 { font-size: 15px; }
  .stat-value { font-size: 18px; }
}
