/* ============================================================
   JTour – Shared Layout & Design Tokens
   Brand: White + Blue (#1a56db)
   ============================================================ */

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

:root {
  --blue-900: #1e3a5f;
  --blue-800: #1e40af;
  --blue-700: #1a56db;
  --blue-600: #1d4ed8;
  --blue-500: #3b82f6;
  --blue-200: #bfdbfe;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  --white:    #ffffff;
  --green-50: #f0fdf4; --green-100: #dcfce7; --green-600: #16a34a; --green-700: #15803d;
  --yellow-50:#fefce8; --yellow-100:#fef9c3; --yellow-600: #ca8a04;
  --red-50:   #fef2f2; --red-100:  #fee2e2; --red-600:   #dc2626;
  --orange-50:#fff7ed; --orange-100:#ffedd5; --orange-600: #ea580c;

  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 16px rgba(0,0,0,.10);
}

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--blue-900);
  display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: width .25s;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  min-height: var(--topbar-h);
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--blue-700);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo .logo-icon svg { width: 20px; height: 20px; fill: #fff; }
.sidebar-logo .logo-text { font-size: 18px; font-weight: 700; color: #fff; }
.sidebar-logo .logo-sub  { font-size: 10px; color: rgba(255,255,255,.55); line-height: 1.3; }

/* Nav groups */
.nav-group { padding: 8px 0; }
.nav-group-label {
  padding: 6px 18px 4px;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.4);
  text-transform: uppercase; letter-spacing: .8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  font-size: 13.5px;
  user-select: none;
}
.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.nav-item.active {
  background: rgba(26,86,219,.35);
  color: #fff;
  border-left-color: var(--blue-500);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Submenu */
.nav-parent { cursor: pointer; }
.nav-parent .chevron {
  margin-left: auto;
  transition: transform .2s;
}
.nav-parent.open .chevron { transform: rotate(90deg); }
.nav-sub {
  display: none;
  background: rgba(0,0,0,.15);
  padding: 2px 0;
}
.nav-parent.open + .nav-sub { display: block; }
.nav-sub .nav-item {
  padding-left: 42px;
  font-size: 13px;
}

/* ===== TOPBAR ===== */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.topbar-breadcrumb {
  flex: 1;
  font-size: 13px;
  color: var(--gray-500);
}
.topbar-breadcrumb .bc-sep { margin: 0 6px; }
.topbar-breadcrumb .bc-cur { color: var(--gray-800); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 50%; border: none;
  background: var(--gray-100);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
  position: relative;
  transition: background .15s;
}
.topbar-btn:hover { background: var(--gray-200); }
.topbar-btn svg { width: 18px; height: 18px; }
.badge-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--red-600);
  border-radius: 50%;
  border: 2px solid var(--white);
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--gray-100);
  border-radius: 20px;
  cursor: pointer;
}
.user-avatar {
  width: 30px; height: 30px;
  background: var(--blue-700);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.user-role { font-size: 11px; color: var(--gray-500); }

/* ===== MAIN CONTENT ===== */
.main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.page-header .spacer { flex: 1; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 20px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 15px; font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 8px;
}
.card-title svg { width: 18px; height: 18px; color: var(--blue-700); }

/* ===== KPI CARDS ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 16px;
}
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-label { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.kpi-sub   { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 15px; height: 15px; }

.btn-primary   { background: var(--blue-700); color: #fff; }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success   { background: var(--green-600); color: #fff; }
.btn-success:hover { opacity: .88; }
.btn-danger    { background: var(--red-600); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-warning   { background: var(--yellow-600); color: #fff; }
.btn-outline   { background: transparent; color: var(--blue-700); border: 1.5px solid var(--blue-700); }
.btn-outline:hover { background: var(--blue-50); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-draft    { background: var(--gray-100);   color: var(--gray-600); }
.badge-open     { background: var(--blue-100);   color: var(--blue-800); }
.badge-confirmed{ background: var(--green-100);  color: var(--green-700); }
.badge-pending  { background: var(--yellow-100); color: var(--yellow-600); }
.badge-cancelled{ background: var(--red-100);    color: var(--red-600); }
.badge-partial  { background: var(--orange-100); color: var(--orange-600); }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 16px; background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--gray-600); }
.filter-field input,
.filter-field select {
  height: 34px; padding: 0 10px;
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  min-width: 120px;
}
.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ===== DATA TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gray-50);
  padding: 10px 14px;
  font-size: 12px; font-weight: 700;
  color: var(--gray-600);
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--gray-100); }
tbody tr:hover { background: var(--blue-50); }
tbody td { padding: 11px 14px; font-size: 13px; color: var(--gray-800); }
tbody td.mono { font-family: monospace; font-size: 12px; }
.action-col { display: flex; gap: 6px; }

/* ===== FORM LAYOUT ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }
.form-group label {
  font-size: 12px; font-weight: 600;
  color: var(--gray-600);
}
.form-group input,
.form-group select,
.form-group textarea {
  height: 36px; padding: 0 10px;
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px; color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group textarea { height: auto; padding: 8px 10px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.form-group input[readonly] { background: var(--gray-50); color: var(--gray-500); }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--blue-700);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--blue-100);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex; align-items: center; gap: 4px;
  margin-top: 16px; justify-content: center;
}
.pagination span { font-size: 12px; color: var(--gray-500); margin: 0 8px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: 6px; border: 1px solid var(--gray-200);
  background: var(--white); cursor: pointer;
  font-size: 13px; color: var(--gray-700);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.page-btn:hover { background: var(--gray-100); }
.page-btn.active { background: var(--blue-700); color: #fff; border-color: var(--blue-700); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.tab {
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  color: var(--gray-500); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--blue-700); }
.tab.active { color: var(--blue-700); border-bottom-color: var(--blue-700); }

/* ===== ALERTS ===== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: var(--blue-50);   color: var(--blue-800);  border: 1px solid var(--blue-200); }
.alert-warning { background: var(--yellow-50); color: var(--yellow-600);border: 1px solid var(--yellow-100); }

/* ===== MISC ===== */
.divider { height: 1px; background: var(--gray-100); margin: 20px 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.muted { color: var(--gray-500); }
.bold { font-weight: 700; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .flex-gap { gap: 10px; } .items-center { align-items: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

/* ===== SUMMARY PANEL ===== */
.summary-box {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.summary-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 4px 0;
  color: var(--gray-700);
}
.summary-row.total {
  border-top: 1px solid var(--blue-200);
  margin-top: 8px; padding-top: 10px;
  font-weight: 700; font-size: 15px;
  color: var(--blue-900);
}
