/* ================================================================
   TRAVELICA ADMIN PANEL — admin.css
   Mobile-first, dark sidebar design
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

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

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #1a73e8;
  --accent: #1a73e8;
  --accent-dk: #1557b0;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --font: 'Poppins', sans-serif;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --top-h: 60px;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ── LAYOUT ───────────────────────────────────────────────── */
.adm-wrap {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.adm-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}

.adm-sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.adm-sidebar-logo img {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.adm-sidebar-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  margin-top: 2px;
}

.adm-nav {
  flex: 1;
  padding: 12px 0;
}

.adm-nav-section {
  padding: 16px 16px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255,255,255,.25);
  text-transform: uppercase;
}

.adm-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  border-radius: 0;
  margin: 1px 0;
  position: relative;
}

.adm-nav-link:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,.9);
}

.adm-nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
}

.adm-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: rgba(255,255,255,.8);
  border-radius: 0 2px 2px 0;
}

.adm-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.adm-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.adm-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.45);
  font-size: 12.5px;
  font-weight: 500;
  transition: color .2s;
  background: none;
  border: none;
  width: 100%;
  padding: 6px 0;
}

.adm-logout-btn:hover { color: #ef4444; }

/* ── TOPBAR (mobile) ──────────────────────────────────────── */
.adm-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--top-h);
  background: var(--sidebar-bg);
  z-index: 199;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.adm-topbar-logo {
  height: 28px;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.adm-hamburger {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.adm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.adm-overlay.open { display: block; }

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.adm-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 32px;
}

/* ── PAGE HEADER ──────────────────────────────────────────── */
.adm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.adm-page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.4px;
}

.adm-page-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
}

/* ── STEPPER / WIZARD BAR ────────────────────────────────── */
.adm-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  overflow-x: auto;
}

.adm-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
}

.adm-step-item:hover {
  background: var(--bg);
  color: var(--text);
}

.adm-step-item.active {
  background: #eff6ff;
  color: var(--accent);
}

.adm-step-item.completed {
  color: var(--green);
}

.adm-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.adm-step-item.active .adm-step-num {
  background: var(--accent);
  color: #fff;
}

.adm-step-item.completed .adm-step-num {
  background: var(--green);
  color: #fff;
}

.adm-step-arrow {
  color: var(--text-3);
  font-size: 14px;
  flex-shrink: 0;
}

/* ── CARDS ────────────────────────────────────────────────── */
.adm-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.adm-card-body { padding: 24px; }
.adm-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.adm-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* ── STAT CARDS ───────────────────────────────────────────── */
.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.adm-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.adm-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.adm-stat-icon.blue { background: #eff6ff; color: var(--accent); }
.adm-stat-icon.green { background: #ecfdf5; color: var(--green); }
.adm-stat-icon.orange { background: #fffbeb; color: var(--orange); }

.adm-stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .3px;
  text-transform: uppercase;
}

.adm-stat-val {
  font-size: 30px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -1px;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  font-family: var(--font);
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); transform: translateY(-1px); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: 7px; background: transparent; border: 1px solid var(--border); color: var(--text-2); transition: all .2s; }
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon.danger:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }

/* ── TABLE ────────────────────────────────────────────────── */
.adm-table-wrap { overflow-x: auto; }

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.adm-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.adm-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: #fafbfc; }

.adm-table-img {
  width: 52px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg);
}

.adm-table-flag { font-size: 22px; }

.adm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.adm-badge-blue { background: #eff6ff; color: var(--accent); }
.adm-badge-green { background: #ecfdf5; color: var(--green); }

/* ── FORMS ────────────────────────────────────────────────── */
.adm-form { display: flex; flex-direction: column; gap: 20px; }

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

.adm-form-group { display: flex; flex-direction: column; gap: 6px; }

.adm-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
}

.adm-form-input,
.adm-form-select,
.adm-form-textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  font-family: var(--font);
  width: 100%;
}

.adm-form-input:focus,
.adm-form-select:focus,
.adm-form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}

.adm-form-textarea { resize: vertical; min-height: 90px; }

.adm-form-hint {
  font-size: 11px;
  color: var(--text-3);
}

/* ── IMAGE PREVIEW ────────────────────────────────────────── */
.adm-img-preview {
  margin-top: 8px;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: none;
}
.adm-img-preview.show { display: block; }

/* File upload label */
.adm-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 16px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: border-color .2s, background .2s;
  width: 100%;
  justify-content: center;
}

.adm-upload-label:hover {
  border-color: var(--accent);
  background: #eff6ff;
  color: var(--accent);
}

.adm-upload-label input[type="file"] {
  display: none;
}

.adm-current-img {
  margin-bottom: 8px;
}

/* ── TOGGLE SWITCH / CHECKBOX CARD ───────────────────────── */
.adm-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: border-color .2s, background .2s;
}
.adm-switch-card:hover {
  border-color: var(--accent);
  background: #f0f7ff;
}
.adm-switch-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.adm-switch-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.adm-switch-desc {
  font-size: 12px;
  color: var(--text-2);
}
.adm-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.adm-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.adm-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 26px;
}
.adm-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.adm-switch input:checked + .adm-slider {
  background-color: var(--accent);
}
.adm-switch input:checked + .adm-slider:before {
  transform: translateX(20px);
}

/* ── DYNAMIC LIST (includes/excludes/itinerary) ───────────── */
.adm-dyn-list { display: flex; flex-direction: column; gap: 8px; }

.adm-dyn-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.adm-dyn-item input { flex: 1; }

.adm-add-row {
  margin-top: 6px;
}

/* ── ITINERARY BUILDER ────────────────────────────────────── */
.adm-itin-list { display: flex; flex-direction: column; gap: 12px; }

.adm-itin-item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.adm-itin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  cursor: pointer;
  user-select: none;
}

.adm-itin-day-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .5px;
}

.adm-itin-day-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-left: 10px;
}

.adm-itin-body {
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.adm-itin-body.open { display: flex; }

.adm-itin-preview {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: none;
}
.adm-itin-preview.show { display: block; }

/* ── MODAL ────────────────────────────────────────────────── */
.adm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.adm-modal-overlay.open { display: flex; }

.adm-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
}

.adm-modal-lg {
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.adm-flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  overflow-y: auto;
  max-height: 52vh;
  margin: 16px 0;
  padding: 4px;
}

.adm-flag-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
}

.adm-flag-btn:hover {
  background: #eff6ff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.adm-modal h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}

.adm-modal p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 20px;
}

.adm-modal-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── TOAST ────────────────────────────────────────────────── */
.adm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.adm-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e293b;
  color: #fff;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  pointer-events: all;
  animation: toastIn .3s cubic-bezier(.4,0,.2,1) forwards;
  min-width: 260px;
  max-width: 360px;
}

.adm-toast.success .adm-toast-icon { color: var(--green); }
.adm-toast.error   .adm-toast-icon { color: var(--red); }
.adm-toast.info    .adm-toast-icon { color: var(--accent); }

.adm-toast.hide {
  animation: toastOut .3s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(32px); }
}

/* ── EMPTY STATE ──────────────────────────────────────────── */
.adm-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-3);
}

.adm-empty-icon { font-size: 42px; margin-bottom: 12px; }
.adm-empty h3 { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }
.adm-empty p { font-size: 13px; }

/* ── LOGIN PAGE ───────────────────────────────────────────── */
.adm-login-page {
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.adm-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,.3);
}

.adm-login-logo {
  height: 40px;
  margin: 0 auto 8px;
}

.adm-login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.adm-login-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 28px;
}

.adm-login-form { display: flex; flex-direction: column; gap: 16px; }

.adm-error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
}

/* ── SEARCH & FILTER ──────────────────────────────────────── */
.adm-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.adm-search {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
  flex: 1;
  min-width: 180px;
}

.adm-search-icon {
  padding: 0 10px;
  color: var(--text-3);
  flex-shrink: 0;
}

.adm-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 9px 10px 9px 0;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
  background: transparent;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .adm-sidebar {
    transform: translateX(-100%);
  }
  .adm-sidebar.open {
    transform: translateX(0);
  }
  .adm-topbar { display: flex; }
  .adm-main {
    margin-left: 0;
    padding: 76px 16px 24px;
  }
  .adm-stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .adm-stats-grid { grid-template-columns: 1fr; }
  .adm-form-row { grid-template-columns: 1fr; }
  .adm-page-header { flex-direction: column; align-items: flex-start; }
  .adm-modal-btns { flex-direction: column-reverse; }
  .adm-toast-container { right: 12px; left: 12px; bottom: 16px; }
  .adm-toast { max-width: 100%; }
}
