:root{
  color-scheme: only light;
  --wrap: clamp(980px, 92vw, 1200px);

  /* спокойная десатурированная гамма */
  --accent:#3B6EA5;
  --accent-700:#2E5B85;
  --accent-100:#EEF3F9;
  --accent-200:#D6E2F0;

  --bg:#f8fafc;
  --card:#ffffff;
  --line:#e8eef5;
  --soft:#f3f6fb;

  --text:#0f172a;
  --muted:#64748b;

  --radius:12px;

  --fs-xs:12.5px;
  --fs-sm:13.5px;
  --fs-md:15px;
  --fs-lg:16px;
  --fs-xl:18px;
  --lh:1.45;
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);-webkit-tap-highlight-color:transparent;line-height:var(--lh)}

/* Header */
.topbar{position:sticky;top:0;z-index:40;background:#fff;border-bottom:1px solid var(--line);color:var(--text);padding:10px 16px}
@media (max-width:980px){ .topbar{position:static} }
.topbar .wrap{max-width:var(--wrap);margin:auto;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.logo{display:flex;align-items:center;gap:10px}
.logo-badge{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:var(--accent-100);color:var(--accent-700);font-size:18px}
.brand{font-weight:700;letter-spacing:.2px;font-size:var(--fs-lg)}
.header-flex{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap}
.col-badge{display:inline-flex;gap:8px;align-items:center;border:1px solid var(--accent-200);padding:6px 10px;border-radius:999px;background:var(--accent-100);font-size:var(--fs-sm);color:var(--accent-700)}
.col-badge .dot{width:8px;height:8px;border-radius:50%;background:#22c55e}
.hbtn{display:inline-flex;gap:6px;align-items:center;border:1px solid var(--accent-200);padding:7px 10px;border-radius:10px;color:var(--accent-700);text-decoration:none;background:#fff;font-weight:500;font-size:var(--fs-sm);cursor:pointer;transition:all 0.2s ease}
.hbtn:hover{background:var(--accent-100);transform:translateY(-1px)}
.hbtn .ico{width:16px;height:16px;color:var(--accent-700)}
.hbtn--wa .ico{color:#25D366}
.hbtn--tg .ico{color:#2AABEE}
@media (max-width:560px){ .hbtn .txt{display:none} }

/* Page */
.container{max-width:var(--wrap);margin:auto;padding:18px}
.toolbar{display:flex;gap:12px;align-items:center;margin:0 0 14px;flex-wrap:wrap}
.count{color:var(--muted);font-size:var(--fs-sm)}

/* ===== Manager ===== */
.manager{
  display:grid;grid-template-columns:72px 1fr auto;align-items:center;gap:12px;
  background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 1px 4px rgba(2,6,23,.03);
  padding:12px 14px;margin:0 0 14px 0
}
.m-ava{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;font-weight:700;color:#fff;background:var(--accent);position:relative;overflow:hidden;font-size:var(--fs-xl)}
.manager-photo{width:100%;height:100%;object-fit:cover;border-radius:50%;position:absolute;top:0;left:0}
.m-grow{min-width:0;display:flex;flex-direction:column;align-items:flex-start}
.m-name{font-weight:700;font-size:var(--fs-lg)}
.m-sub{font-size:var(--fs-xs);color:var(--muted);margin-top:2px}
.m-note{font-size:var(--fs-sm);color:var(--muted);margin-top:6px;word-break:break-word}
.m-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.m-btn{
  display:inline-flex;gap:6px;align-items:center;justify-content:center;
  padding:9px 12px;border-radius:10px;text-decoration:none;
  font-weight:500;border:1px solid var(--accent-200);
  background:#fff;color:var(--accent-700);
  min-height:38px;font-size:var(--fs-sm)
}
.m-btn .ico{width:16px;height:16px;color:var(--accent-700)}
.m-btn.primary{background:var(--accent-100)}
.m-btn--wa .ico{color:#25D366}
.m-btn--tg .ico{color:#2AABEE}
.m-btn:hover{background:var(--accent-100)}
@media (max-width:920px){
  .manager{grid-template-columns:72px 1fr;grid-template-areas:"ava info" "actions actions"}
  .m-ava{grid-area:ava}
  .m-grow{grid-area:info}
  .m-actions{grid-area:actions;justify-content:stretch}
  .m-btn{flex:1}
}
@media (max-width:560px){
  .manager{grid-template-columns:1fr;grid-template-areas:"ava" "info" "actions";row-gap:8px}
  .m-ava{justify-self:center}
  .m-grow{align-items:center}
  .m-name,.m-sub{text-align:center;width:100%}
  .m-actions{display:grid;gap:8px;grid-template-columns:1fr}
  .m-btn{width:100%}
}

/* ===== Custom Content Block ===== */
.custom-content {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(2,6,23,.03);
  margin: 0 0 14px 0;
  padding: 16px;
}

.custom-content-inner {
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: #374151;
}

.custom-content-inner h1, .custom-content-inner h2, .custom-content-inner h3,
.custom-content-inner h4, .custom-content-inner h5, .custom-content-inner h6 {
  margin: 16px 0 8px 0;
  font-weight: 600;
  color: #1f2937;
}

.custom-content-inner h1 { font-size: var(--fs-xxl); }
.custom-content-inner h2 { font-size: var(--fs-xl); }
.custom-content-inner h3 { font-size: var(--fs-lg); }
.custom-content-inner h4 { font-size: var(--fs-md); }
.custom-content-inner h5, .custom-content-inner h6 { font-size: var(--fs-sm); }

.custom-content-inner p {
  margin: 8px 0;
  line-height: 1.6;
}

.custom-content-inner a {
  color: var(--accent-700);
  text-decoration: underline;
}

.custom-content-inner a:hover {
  color: var(--accent);
}

.custom-content-inner img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}

.custom-content-inner ul, .custom-content-inner ol {
  margin: 8px 0;
  padding-left: 20px;
}

.custom-content-inner li {
  margin: 4px 0;
}

.custom-content-inner blockquote {
  border-left: 4px solid var(--accent-200);
  margin: 16px 0;
  padding: 8px 16px;
  background: var(--soft);
  font-style: italic;
  color: #6b7280;
}

/* Hotel group */
.hotel{position:relative;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:0 1px 3px rgba(2,6,23,.03);margin-bottom:16px}
.hotel-head{position:relative;display:grid;grid-template-columns:240px 1fr;gap:12px;padding:12px}
.hotel-thumb{width:240px;height:170px;border-radius:10px;overflow:hidden;background:var(--soft);aspect-ratio:4/3}
.hotel-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.hotel-info{display:flex;flex-direction:column;gap:4px}
.hotel-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hotel-badges{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.hotel-name{font-size:var(--fs-xl);font-weight:700}
.badge{font-size:var(--fs-xs);padding:4px 8px;border-radius:999px;border:1px solid #fbbf24;background:linear-gradient(135deg, #fef3c7, #fde68a);color:#92400e;font-weight:600;display:inline-flex;align-items:center;gap:2px;box-shadow:0 1px 2px rgba(251, 191, 36, 0.1)}

/* Special styling for hotel star category */
.badge-stars {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border: 1px solid #d1d5db;
  color: #6b7280;
  font-weight: 600;
  text-shadow: none;
}

/* Special styling for hotel user rating */
.badge-rating {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: 1px solid #22c55e;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-rating .rating-label {
  font-size: var(--fs-xs);
  opacity: 0.9;
  font-weight: 500;
}

/* Color-coded rating backgrounds based on 1-5 scale */
.badge-rating.rating-bad {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1px solid #ef4444;
}

.badge-rating.rating-poor {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: 1px solid #f97316;
}

.badge-rating.rating-good {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  border: 1px solid #eab308;
}

.badge-rating.rating-very-good {
  background: linear-gradient(135deg, #84cc16, #65a30d);
  border: 1px solid #84cc16;
}

.badge-rating.rating-excellent {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: 1px solid #22c55e;
}

.badge-stars:hover, .badge-rating:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}
.loc{color:var(--muted);font-size:var(--fs-sm)}

/* Бейдж для горящего тура в заголовке */
.hot-tour-badge-header {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
  color: white;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  animation: pulse-hot 2s infinite;
  backdrop-filter: blur(10px);
}

@keyframes pulse-hot {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.6);
  }
}

/* Адаптивность для бейджа в заголовке */
@media (max-width: 768px) {
  .hot-tour-badge-header {
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 6px 10px;
  }
}
.desc{font-size:var(--fs-md);color:#374151}
@media (max-width:992px){
  .hotel-head{grid-template-columns:1fr}
  .hotel-thumb{width:100%;height:200px}
}

/* ===== Тур ===== */
.variants{display:grid;gap:10px;padding:0 12px 12px}
.variant{
  position:relative;display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:14px;
  padding:12px 12px 12px 16px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 1px 2px rgba(2,6,23,.02);overflow:hidden
}
.variant::before{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--accent-200)}
.variant:hover{box-shadow:0 2px 6px rgba(2,6,23,.04)}
@media (max-width:1080px){ .variant{grid-template-columns:minmax(0,1fr) 230px} }
@media (max-width:860px){
  .variant{grid-template-columns:1fr}
  .facts-col{order:1}
  .v-price{order:2;min-width:auto;width:100%;align-items:flex-end;text-align:right;margin-top:8px}
}

/* Слева — факты */
.facts-col{display:flex;flex-direction:column;gap:6px;color:#111827;font-size:var(--fs-md)}
.frow{display:flex;gap:10px;flex-wrap:wrap;align-items:baseline}
.frow .lead{font-weight:600}
.frow .sep{color:var(--muted)}
.frow.small{color:#374151;font-size:var(--fs-sm)}
.flight-line{display:flex;gap:8px;align-items:baseline;color:#344153;font-size:var(--fs-sm)}
.flight-line .ico{width:16px;height:16px;color:#94a3b8;flex:0 0 auto}
.flight-line .air{font-weight:600;color:#1f2937}

/* Tour operator display */
.operator-row {
  gap: 8px;
  align-items: baseline;
  color: #374151;
  font-size: var(--fs-sm);
  padding: 4px 0;
}

.operator-label {
  color: var(--muted);
  font-weight: 500;
}

.operator-name {
  color: var(--accent-700);
  font-weight: 600;
  background: var(--accent-100);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--accent-200);
  font-size: var(--fs-xs);
}

/* User operator display - hidden by default */
.user-operator {
  display: none;
}

/* Show operators when enabled by collection owner */
.show-operators .user-operator {
  display: flex;
}

/* Always visible for collection owners */
.always-visible {
  display: flex !important;
}

/* Справа — цена и КНОПКИ в нижнем правом углу */
.v-price{min-width:220px;text-align:right;display:flex;flex-direction:column;gap:8px;align-items:flex-end;margin-top:auto}
.meta{font-size:var(--fs-xs);color:var(--muted)}
.amount{font-size:var(--fs-xl);font-weight:600;line-height:1}
.amount a{color:var(--accent-700);text-decoration:none}
.amount a:hover{color:var(--accent);text-decoration:underline}

/* Price editing styles */
.price-container {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.price-old {
  font-size: var(--fs-sm); color: var(--muted);
  text-decoration: line-through; font-weight: 400;
  opacity: 0.7;
}
.price-new {
  font-size: var(--fs-xl); font-weight: 600;
  color: var(--accent-700);
}
.price-new.discount {
  color: #22c55e; /* Зеленый цвет для скидки */
}
.price-new.markup {
  color: var(--text); /* Обычный черный цвет - ничем не выдает наценку */
}
.price-edited-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); color: #28a745;
  background: rgba(40, 167, 69, 0.1); padding: 2px 6px;
  border-radius: 4px; margin-top: 2px;
}
.price-discount-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); color: #22c55e;
  background: rgba(34, 197, 94, 0.1); padding: 2px 6px;
  border-radius: 4px; margin-top: 2px;
  font-weight: 600;
}

/* Reset price button */
.btn-reset-price {
  background: var(--accent-100) !important;
  color: var(--accent-700) !important;
  border: 1px solid var(--accent-200) !important;
}
.btn-reset-price:hover {
  background: var(--accent-200) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 110, 165, 0.15);
}

/* Price tracking toggle button */
.edit-panel .btn-success {
  background: #28a745;
  color: white;
  border: 1px solid #28a745;
}
.edit-panel .btn-success:hover {
  background: #218838;
  border-color: #1e7e34;
}
.edit-panel .btn-success .ico {
  color: white;
}

/* Кнопки — в одну линию на ПК, справа внизу; на мобилке тоже снизу справа */
.actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;flex-wrap:wrap;margin-top:2px}
@media (min-width:861px){ .actions{flex-wrap:nowrap} } /* ПК — строго в одну линию */

.btn-more,.btn-track{
  background:#fff;border:1px solid var(--accent-200);color:var(--accent-700);
  border-radius:10px;padding:9px 12px;font-size:var(--fs-sm);text-decoration:none;font-weight:500;min-height:38px;white-space:nowrap
}
.btn-more:hover,.btn-track:hover{background:var(--accent-100)}
.btn-track{display:inline-flex;gap:6px;align-items:center}
.btn-track .ico{width:16px;height:16px;color:#2AABEE}

/* Modern Light Edit Mode Styles */
.edit-panel {
  background: linear-gradient(135deg, #f8faff 0%, #e6f3ff 100%);
  border: 1px solid #c8ddf5;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(59, 110, 165, 0.1);
}

.edit-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #c8ddf5;
}

.edit-panel-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: #2c5aa0;
  margin: 0;
}

.edit-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.edit-action-card {
  background: white;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  min-height: 80px;
}

.edit-action-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

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

.edit-action-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #495057;
  margin: 0;
}

.edit-action-description {
  font-size: var(--fs-xs);
  color: #6c757d;
  margin-bottom: 8px;
  line-height: 1.3;
}

.edit-panel .btn {
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 28px;
  margin-bottom: 4px;
  margin-right: 6px;
}

.edit-panel .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.edit-panel .btn-primary {
  background: #3B6EA5;
  border-color: #3B6EA5;
  color: white;
}

.edit-panel .btn-primary:hover {
  background: #2c5aa0;
  border-color: #2c5aa0;
}

.edit-panel .btn-outline {
  background: white;
  border-color: #3B6EA5;
  color: #3B6EA5;
}

.edit-panel .btn-outline:hover {
  background: #f0f6ff;
  border-color: #2c5aa0;
  color: #2c5aa0;
}

.edit-panel .btn-success {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

.edit-panel .btn-success:hover {
  background: #218838;
  border-color: #1e7e34;
}

.edit-panel .btn-warning {
  background: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

.edit-panel .btn-warning:hover {
  background: #e0a800;
  border-color: #d39e00;
}

.edit-panel .btn-danger {
  background: #dc3545;
  border-color: #dc3545;
  color: white;
}

.edit-panel .btn-danger:hover {
  background: #c82333;
  border-color: #bd2130;
}

.edit-panel .ico {
  width: 14px;
  height: 14px;
}

/* Inline forms */
.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
  padding: 4px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: var(--fs-xs);
  min-width: 100px;
  flex: 1;
}

.inline-form input:focus,
.inline-form select:focus {
  outline: none;
  border-color: #3B6EA5;
  box-shadow: 0 0 0 2px rgba(59, 110, 165, 0.1);
}

/* Status indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-indicator.active {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-indicator.inactive {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Inline editing for individual tours */
.tour-edit-inline {
  margin-top: 12px;
  padding: 12px;
  background: #f8faff;
  border: 1px solid #c8ddf5;
  border-radius: 8px;
  display: none;
}

.tour-edit-inline.active {
  display: block;
}

.tour-edit-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tour-edit-form input {
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: var(--fs-sm);
  min-width: 100px;
}

.tour-edit-form textarea {
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: var(--fs-sm);
  min-width: 200px;
  min-height: 60px;
  resize: vertical;
}

.tour-edit-form .btn {
  padding: 6px 12px;
  font-size: var(--fs-sm);
  border-radius: 6px;
  border: 1px solid;
  background: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tour-edit-form .btn-save {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

.tour-edit-form .btn-save:hover {
  background: #218838;
  border-color: #1e7e34;
}

.tour-edit-form .btn-cancel {
  background: #6c757d;
  border-color: #6c757d;
  color: white;
}

.tour-edit-form .btn-cancel:hover {
  background: #5a6268;
  border-color: #545b62;
}

.edit-buttons-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.edit-btn {
  padding: 4px 8px;
  font-size: var(--fs-xs);
  border-radius: 4px;
  border: 1px solid;
  background: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 28px;
}

.edit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.edit-btn.btn-edit {
  border-color: #3B6EA5;
  color: #3B6EA5;
}

.edit-btn.btn-edit:hover {
  background: #f0f6ff;
  border-color: #2c5aa0;
}

.edit-btn.btn-delete {
  border-color: #dc3545;
  color: #dc3545;
}

.edit-btn.btn-delete:hover {
  background: #ffebee;
  border-color: #c82333;
}

.edit-btn.btn-reset {
  border-color: #ffc107;
  color: #856404;
}

.edit-btn.btn-reset:hover {
  background: #fff3cd;
  border-color: #e0a800;
}

@media (max-width: 768px) {
  .tour-edit-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .tour-edit-form input,
  .tour-edit-form textarea {
    min-width: auto;
  }
  
  .edit-buttons-row {
    justify-content: center;
  }
}

/* Tourist Linking Styles */
.tourist-linking {
  border-top: 1px solid #ddd;
  padding-top: 16px;
  margin-top: 16px;
  width: 100%;
}

.tourist-form {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}

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

.tourist-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tourist-form .form-group label {
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--text);
}

.tourist-form .form-group input {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: var(--fs-sm);
  transition: border-color 0.2s ease;
}

.tourist-form .form-group input:focus {
  outline: none;
  border-color: #3B6EA5;
  box-shadow: 0 0 0 2px rgba(59, 110, 165, 0.1);
}

.tourist-form .form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tourist-form .linked-info {
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* Simplified Tourist Search */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-loading,
.search-error,
.no-results {
  padding: 12px;
  text-align: center;
  color: #6c757d;
  font-size: var(--fs-sm);
}

.search-error {
  color: #dc3545;
}

.no-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.tourist-result {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tourist-result:hover {
  background-color: #f8f9fa;
}

.tourist-result:last-child {
  border-bottom: none;
}

.tourist-info .tourist-name {
  font-weight: 500;
  color: #495057;
  margin-bottom: 2px;
  font-size: var(--fs-sm);
}

.tourist-info .tourist-phone {
  font-size: var(--fs-xs);
  color: #6c757d;
  font-family: monospace;
}

.tourist-meta {
  font-size: var(--fs-xs);
  color: #adb5bd;
}

@media (max-width: 768px) {
  .tourist-form .form-row {
    grid-template-columns: 1fr;
  }
  
  .tourist-form .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mode-toggle {
    flex-direction: column;
  }
  
  .mode-btn {
    text-align: center;
  }
  
  .tourist-result {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .tourist-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

.modal {
  display: none; position: fixed; z-index: 1000; left: 0; top: 0;
  width: 100%; height: 100%; background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.modal-content {
  background-color: #fff; margin: 5vh auto; padding: 24px;
  border-radius: 16px; width: 90%; max-width: 600px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  max-height: 85vh; overflow-y: auto;
  position: relative;
}
.close {
  color: #aaa; float: right; font-size: 28px; font-weight: bold;
  cursor: pointer; line-height: 1; position: absolute;
  top: 16px; right: 20px; z-index: 1001;
}
.close:hover { color: #000; }

/* Bulk update modal specific styles */
.bulk-modal-content {
  background-color: #fff; margin: 3vh auto; padding: 28px;
  border-radius: 16px; width: 95%; max-width: 700px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
  max-height: 90vh; overflow-y: auto;
  position: relative;
}
.modal h2 {
  margin: 0 0 24px 0; font-size: var(--fs-xl);
  color: var(--text); text-align: center;
  padding-bottom: 12px; border-bottom: 2px solid var(--line);
}
.tour-selection {
  max-height: 250px; overflow-y: auto;
  border: 1px solid var(--line); padding: 16px;
  border-radius: 12px; background: var(--soft);
  margin-bottom: 20px;
}
.tour-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 8px;
  background: white; border-radius: 8px;
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}
.tour-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--accent-200);
}
.tour-item input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer;
}
.tour-item label {
  flex: 1; cursor: pointer; margin: 0;
  font-size: var(--fs-sm); line-height: 1.4;
}
.select-all-container {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; padding: 8px 12px;
  background: var(--accent-100); border-radius: 8px;
}
.select-all-container input[type="checkbox"] {
  width: 18px; height: 18px;
}
.select-all-container label {
  font-weight: 600; color: var(--accent-700);
  cursor: pointer; margin: 0;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { 
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px;
  font-size: var(--fs-md);
}
.form-actions { display: flex; gap: 12px; justify-content: flex-end; }

.login-form {
  max-width: 400px; margin: 40px auto; padding: 24px;
  background: white; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.login-form h2 { text-align: center; margin-top: 0; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; }
.btn-login { 
  width: 100%; padding: 12px; background: #3B6EA5; color: white; 
  border: none; border-radius: 6px; font-size: var(--fs-md); cursor: pointer;
}
.btn-login:hover { background: #2E5B85; }

.comment {
  background: var(--soft); border: none; border-left: 2px solid var(--accent-200); padding: 8px 12px; margin-top: 10px;
  border-radius: 0 4px 4px 0; font-size: var(--fs-sm); line-height: 1.4;
  max-width: 100%; box-sizing: border-box; overflow: hidden;
}
.comment-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-weight: 600; color: var(--accent-700); font-size: var(--fs-sm);
}
.comment-text {
  color: var(--text); white-space: pre-wrap; font-size: var(--fs-md);
  line-height: 1.6; padding: 12px 16px; background: rgba(255, 255, 255, 0.7);
  border-radius: 8px; border: 1px solid var(--line);
  font-weight: 700; letter-spacing: 0.1px;
  word-wrap: break-word; word-break: break-word;
  overflow-wrap: break-word; max-width: 100%;
  box-sizing: border-box;
}

/* Modern comment label styling */
.comment-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--accent-700);
  padding: 4px 8px; background: var(--accent-100); border-radius: 6px;
}

/* Comment action buttons */
.comment-actions {
  display: flex; gap: 4px; align-items: center;
}
.btn-comment-edit, .btn-comment-delete {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: none; border-radius: 6px;
  background: transparent; cursor: pointer; transition: background-color 0.2s;
}
.btn-comment-edit:hover {
  background: var(--accent-100);
}
.btn-comment-delete:hover {
  background: #ffebee;
}
.btn-comment-edit .ico, .btn-comment-delete .ico {
  width: 14px; height: 14px;
}
.btn-comment-edit .ico {
  color: var(--accent-700);
}
.btn-comment-delete .ico {
  color: #c62828;
}

/* Add comment button */
.btn-add-comment {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 6px 10px; border: 1px dashed var(--accent-200); border-radius: 6px;
  background: transparent; color: var(--accent-700); cursor: pointer;
  font-size: var(--fs-xs); transition: all 0.2s;
}
.btn-add-comment:hover {
  background: var(--accent-100); border-style: solid;
}
.btn-add-comment .ico {
  width: 14px; height: 14px; color: var(--accent-700);
}

/* Compact comment style for better integration */
.variant .comment {
  background: #f8fafc; border: none; border-left: 3px solid var(--accent-200); padding: 8px 12px; margin-top: 10px;
  border-radius: 0 6px 6px 0; font-size: var(--fs-sm); line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  max-width: 100%; box-sizing: border-box; overflow: hidden;
}
.variant .comment-header {
  margin-bottom: 6px; font-weight: 600; color: var(--accent-700);
}
.variant .comment-text {
  font-size: var(--fs-sm); color: var(--text); line-height: 1.6;
  padding: 10px 14px; background: rgba(255, 255, 255, 0.8);
  border-radius: 6px; border: 1px solid rgba(59, 110, 165, 0.1);
  font-weight: 700; letter-spacing: 0.2px;
  word-wrap: break-word; word-break: break-word;
  overflow-wrap: break-word; max-width: 100%;
  box-sizing: border-box; white-space: pre-wrap;
}
.variant .comment-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--accent-700);
  padding: 3px 6px; background: var(--accent-100); border-radius: 4px;
}
.variant .btn-more {
  padding: 4px 8px; font-size: var(--fs-xs); min-height: 28px;
}

/* Comment action buttons - modern lightweight design */
.comment-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.btn-comment-edit, .btn-comment-delete {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 8px 14px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; font-size: var(--fs-sm);
  font-weight: 500; text-decoration: none; transition: all 0.15s ease;
  position: relative; overflow: hidden; white-space: nowrap;
}
.btn-comment-edit {
  color: var(--accent-700);
}
.btn-comment-edit:hover {
  background: var(--accent-100); transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 110, 165, 0.15);
}
.btn-comment-delete {
  color: #dc3545;
}
.btn-comment-delete:hover {
  background: #fff1f2; transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}
.btn-comment-edit .ico, .btn-comment-delete .ico {
  width: 14px; height: 14px; transition: transform 0.15s ease; flex-shrink: 0;
}
.btn-comment-edit:hover .ico, .btn-comment-delete:hover .ico {
  transform: scale(1.1);
}

/* Variant context - compact modern design */
.variant .comment-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.variant .btn-comment-edit, .variant .btn-comment-delete {
  display: inline-flex !important; gap: 5px; align-items: center;
  padding: 6px 12px !important; border: none !important; border-radius: 6px;
  background: var(--soft) !important; cursor: pointer; font-size: var(--fs-sm) !important;
  font-weight: 500; text-decoration: none; transition: all 0.15s ease;
  opacity: 1 !important; visibility: visible !important; white-space: nowrap;
  min-width: auto; width: auto;
}
.variant .btn-comment-edit {
  color: var(--accent-700) !important;
}
.variant .btn-comment-edit:hover {
  background: var(--accent-100) !important; transform: translateY(-1px);
  box-shadow: 0 1px 4px rgba(59, 110, 165, 0.12);
}
.variant .btn-comment-delete {
  color: #dc3545 !important;
}
.variant .btn-comment-delete:hover {
  background: #fff1f2 !important; transform: translateY(-1px);
  box-shadow: 0 1px 4px rgba(220, 53, 69, 0.12);
}
.variant .btn-comment-edit .ico, .variant .btn-comment-delete .ico {
  width: 13px !important; height: 13px !important; transition: transform 0.15s ease;
  flex-shrink: 0;
}
.variant .btn-comment-edit:hover .ico, .variant .btn-comment-delete:hover .ico {
  transform: scale(1.1);
}

/* Mobile responsive styles for modals */
@media (max-width: 768px) {
  .modal-content {
    margin: 3vh auto; padding: 16px;
    width: 95%; max-width: none;
    border-radius: 12px;
  }
  .bulk-modal-content {
    margin: 2vh auto; padding: 20px;
    width: 98%; max-height: 95vh;
  }
  .close {
    top: 12px; right: 16px;
    font-size: 24px;
  }
  .tour-selection {
    max-height: 200px;
  }
  .tour-item {
    padding: 8px 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .tour-item label {
    font-size: var(--fs-xs);
  }
  .form-actions {
    flex-direction: column;
    gap: 8px;
  }
  .form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .bulk-modal-content {
    margin: 1vh auto; padding: 16px;
    width: 100%; height: 100vh;
    border-radius: 0;
  }
  .modal h2 {
    font-size: var(--fs-lg);
    margin-bottom: 16px;
  }
  .tour-selection {
    max-height: 150px;
    padding: 12px;
  }
}

/* Add comment button in variant context */
.variant .btn-add-comment {
  display: inline-flex; gap: 4px; align-items: center;
  padding: 4px 8px; border: 1px dashed var(--accent-200); border-radius: 4px;
  background: transparent; color: var(--accent-700); cursor: pointer;
  font-size: var(--fs-xs); transition: all 0.2s;
}
.variant .btn-add-comment:hover {
  background: var(--accent-100); border-style: solid;
}
.variant .btn-add-comment .ico {
  width: 12px; height: 12px; color: var(--accent-700);
}

/* Footer */
.footer{margin-top:24px;padding:18px;border-top:1px solid var(--line);color:var(--muted);text-align:center;font-size:var(--fs-sm)}

/* =================================================================
   Profile Photo Styles
   ================================================================= */

.user-profile {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.profile-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-200);
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-photo:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-avatar:hover {
  background: var(--accent-700);
  transform: scale(1.05);
}

/* Profile Modal */
.profile-modal-content {
  max-width: 600px;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

.profile-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.profile-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.profile-section h3 {
  margin: 0 0 16px 0;
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 600;
}

/* Profile Forms */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.form-group label {
  font-weight: 600;
  color: var(--text);
  font-size: var(--fs-sm);
}

.form-group input,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: var(--fs-sm);
  background: white;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-100);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.disabled-field {
  background: var(--soft) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
}

.form-help {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
}

/* Responsive form layout */
@media (max-width: 768px) {
  .profile-modal-content {
    padding: 16px;
    max-width: 95vw;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}

.profile-photo-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.current-photo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.profile-photo-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-200);
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 48px;
}

.photo-upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.upload-progress {
  background: var(--soft);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar::after {
  content: '';
  display: block;
  width: 30%;
  height: 100%;
  background: var(--accent);
  animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(300%); }
  100% { transform: translateX(-100%); }
}

.progress-text {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.upload-message {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: center;
  margin-top: 12px;
  display: none;
}

.upload-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.upload-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.upload-message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.photo-url-section {
  background: var(--soft);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.photo-url-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.photo-url-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: var(--fs-sm);
  background: white;
  margin-bottom: 8px;
}

.photo-url-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-100);
}

.profile-help {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .edit-actions-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .edit-action-card {
    padding: 10px;
    min-height: auto;
  }
  
  .profile-modal-content {
    padding: 16px;
  }
  
  .profile-photo-large,
  .profile-avatar-large {
    width: 100px;
    height: 100px;
  }
  
  .profile-avatar-large {
    font-size: 40px;
  }
  
  .photo-upload-form {
    flex-direction: column;
  }
}