/* =============================================
   HP Logistics Pricing Portal — style.css
   ============================================= */

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

:root {
  --bg-base:        #0a0b16;
  --bg-surface:     #111226;
  --bg-card:        #161830;
  --bg-card-hover:  #1c1f3a;
  --border:         rgba(255,255,255,0.07);
  --border-hover:   rgba(255,255,255,0.15);

  --accent-purple:  #7c3aed;
  --accent-indigo:  #4f46e5;
  --accent-blue:    #2563eb;
  --accent-cyan:    #06b6d4;
  --accent-green:   #10b981;
  --accent-amber:   #f59e0b;
  --accent-rose:    #f43f5e;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 30px rgba(124,58,237,0.15);
  --transition:  all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Background Particles ---- */
.bg-particles {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: floatParticle linear infinite;
}
@keyframes floatParticle {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.08; }
  90%  { opacity: 0.08; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* ---- HEADER ---- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 11, 22, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.header-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px;
}

/* Logo */
.logo-area { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-icon svg { width: 40px; height: 40px; filter: drop-shadow(0 4px 12px rgba(124,58,237,0.5)); }
.logo-text { display: flex; flex-direction: column; }
.logo-title {
  font-size: 1.1rem; font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #6366f1, #38bdf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: -0.02em;
}
.logo-sub { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }

/* Search */
.header-center { flex: 1; max-width: 500px; margin: 0 auto; }
.search-wrap {
  position: relative; display: flex; align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: var(--transition);
}
.search-wrap:focus-within {
  border-color: var(--accent-purple);
  background: rgba(124,58,237,0.08);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.15);
}
.search-icon {
  position: absolute; left: 14px;
  width: 18px; height: 18px;
  color: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: inherit;
  font-size: 0.9rem; padding: 11px 40px 11px 44px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  position: absolute; right: 12px;
  background: rgba(255,255,255,0.1); border: none; border-radius: 50%;
  width: 22px; height: 22px; cursor: pointer; color: var(--text-muted);
  font-size: 0.65rem; line-height: 1; display: none;
  align-items: center; justify-content: center;
  transition: var(--transition);
}
.search-clear:hover { background: rgba(255,255,255,0.2); color: white; }
.search-clear.visible { display: flex; }

/* Header Right */
.header-right { flex-shrink: 0; display: flex; align-items: center; gap: 12px; }
.clock-area { text-align: right; }
.clock-time { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

/* Add Site Button */
.add-site-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
  border: none; color: white; font-family: inherit;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(124,58,237,0.35);
  transition: var(--transition); white-space: nowrap;
}
.add-site-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,58,237,0.5);
}
.add-site-btn:active { transform: translateY(0); }
.add-site-icon { font-size: 1.1rem; font-weight: 700; line-height: 1; }

/* ---- FILTER BAR ---- */
.filter-bar {
  position: sticky; top: 73px; z-index: 90;
  background: rgba(10,11,22,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.filter-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 10px 24px; display: flex; align-items: center; gap: 6px; overflow-x: auto;
  scrollbar-width: none;
}
.filter-inner::-webkit-scrollbar { display: none; }
.filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  font-size: 0.8rem; font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: var(--transition);
}
.filter-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); border-color: var(--border-hover); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
  border-color: transparent; color: white;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}
.filter-fav.active {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.filter-icon { font-size: 0.85rem; }
.filter-count {
  background: rgba(255,255,255,0.15); color: white;
  font-size: 0.7rem; font-weight: 700; padding: 1px 7px;
  border-radius: 20px; min-width: 22px; text-align: center;
}
.filter-btn.active .filter-count { background: rgba(255,255,255,0.25); }
.filter-divider {
  width: 1px; height: 20px;
  background: var(--border); flex-shrink: 0; margin: 0 4px;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  max-width: 1600px; margin: 0 auto;
  padding: 24px 24px 40px;
  position: relative; z-index: 1;
}
.stats-bar {
  font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: 20px; padding-left: 2px;
}
.stats-bar span { color: var(--accent-purple); font-weight: 600; }

/* ---- CARRIERS GRID ---- */
.carriers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

/* ---- CARRIER CARD ---- */
.carrier-card {
  position: relative; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  animation: cardIn 0.4s ease both;
  display: flex; flex-direction: column; gap: 0;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.carrier-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255,255,255,0.02));
  pointer-events: none;
}
.carrier-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.carrier-card:hover .card-arrow { transform: translateX(4px); opacity: 1; }
.carrier-card.fav-card { border-color: rgba(245,158,11,0.25); }
.carrier-card.fav-card:hover { border-color: rgba(245,158,11,0.4); box-shadow: var(--shadow-card), 0 0 30px rgba(245,158,11,0.1); }
.carrier-card.hidden { display: none !important; }

/* Card top bar (color stripe) */
.card-stripe {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Card top action buttons */
.card-top-actions {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 5px;
  z-index: 2;
}
.action-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(8, 9, 20, 0.82);
  backdrop-filter: blur(10px);
  cursor: pointer; font-size: 0.88rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); position: relative;
  color: rgba(255,255,255,0.55);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.action-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.35);
  color: white;
  transform: scale(1.12);
}

/* Favorite Button */
.fav-btn { font-size: 1rem; }
.fav-btn:not(.active) { color: rgba(255,255,255,0.6); }
.fav-btn.active {
  background: rgba(245,158,11,0.22);
  border-color: rgba(245,158,11,0.5);
  color: #fbbf24;
  box-shadow: 0 2px 10px rgba(245,158,11,0.25);
}
.fav-btn.active:hover { background: rgba(245,158,11,0.32); }

/* Note Button */
.note-btn { color: rgba(255,255,255,0.55); }
.note-btn.has-note {
  background: rgba(99,102,241,0.22);
  border-color: rgba(99,102,241,0.45);
  color: #a5b4fc;
  box-shadow: 0 2px 10px rgba(99,102,241,0.2);
}
.note-dot {
  position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #818cf8;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 6px rgba(129,140,248,0.6);
}

/* Delete Button */
.del-btn { color: rgba(255,255,255,0.5); }
.del-btn:hover {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
  color: #fca5a5;
}

/* Card header clickable area */
.card-header {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 12px; padding-top: 10px;
  cursor: pointer;
}
.card-icon-wrap {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
  border: 1px solid var(--border);
}
.card-meta { flex: 1; min-width: 0; padding-right: 60px; }
.card-name {
  font-size: 0.95rem; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.card-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em;
}
.card-arrow {
  color: var(--text-muted); font-size: 1.1rem;
  opacity: 0.4; transition: var(--transition); flex-shrink: 0; margin-top: 4px;
}

/* Card body */
.card-desc {
  font-size: 0.8rem; color: var(--text-muted); line-height: 1.5;
  margin-bottom: 10px; flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Note preview on card */
.card-note-preview {
  font-size: 0.75rem; color: #818cf8;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-sm); padding: 6px 10px;
  margin-bottom: 10px; line-height: 1.4;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* Custom badge */
.custom-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.63rem; font-weight: 700; padding: 1px 6px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(124,58,237,0.15); color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.2);
  margin-left: 4px;
}

/* Card footer */
.card-footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; padding-top: 4px;
}
.card-btn-frame {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 0.78rem; font-weight: 700; padding: 7px 10px;
  border: 1px solid rgba(124,58,237,0.45);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(79,70,229,0.18));
  color: #c4b5fd;
  cursor: pointer; font-family: inherit; transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(124,58,237,0.18);
}
.card-btn-frame:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.38), rgba(79,70,229,0.32));
  border-color: rgba(124,58,237,0.7);
  color: white;
  box-shadow: 0 4px 16px rgba(124,58,237,0.28);
  transform: translateY(-1px);
}
.card-open-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 0.78rem; font-weight: 600; padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.65);
  cursor: pointer; font-family: inherit; transition: var(--transition);
  white-space: nowrap;
}
.card-open-btn:hover {
  background: rgba(255,255,255,0.12);
  color: white;
  border-color: rgba(255,255,255,0.3);
}

/* ---- CATEGORY SECTION HEADERS ---- */
.section-header {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  padding: 24px 0 8px;
}
.section-header:first-child { padding-top: 0; }
.section-line { flex: 1; height: 1px; background: var(--border); }
.section-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
  white-space: nowrap;
}
.section-icon { font-size: 1rem; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center; padding: 80px 20px;
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); }

/* ---- FOOTER ---- */
.footer {
  text-align: center; padding: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted);
  position: relative; z-index: 1;
}

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: rgba(22, 24, 48, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px; font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  transform: translateY(20px); opacity: 0;
  transition: var(--transition); pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ---- CATEGORY COLORS ---- */
.cat-global  .card-stripe { background: linear-gradient(90deg, #2563eb, #06b6d4); }
.cat-global  .card-icon-wrap { background: rgba(37,99,235,0.1); border-color: rgba(37,99,235,0.2); }
.cat-global  .card-tag { background: rgba(37,99,235,0.15); color: #60a5fa; }

.cat-asian   .card-stripe { background: linear-gradient(90deg, #10b981, #06b6d4); }
.cat-asian   .card-icon-wrap { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); }
.cat-asian   .card-tag { background: rgba(16,185,129,0.15); color: #34d399; }

.cat-booking .card-stripe { background: linear-gradient(90deg, #f59e0b, #f97316); }
.cat-booking .card-icon-wrap { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.2); }
.cat-booking .card-tag { background: rgba(245,158,11,0.15); color: #fbbf24; }

.cat-platform .card-stripe { background: linear-gradient(90deg, #7c3aed, #ec4899); }
.cat-platform .card-icon-wrap { background: rgba(124,58,237,0.1); border-color: rgba(124,58,237,0.2); }
.cat-platform .card-tag { background: rgba(124,58,237,0.15); color: #a78bfa; }

/* Custom sites get purple stripe */
.carrier-card.is-custom .card-stripe { background: linear-gradient(90deg, #7c3aed, #4f46e5); }

/* =============================================
   MODALS
   ============================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal-backdrop.open .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal {
  background: #1a1c35;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  display: flex; flex-direction: column;
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
  max-height: 90vh; overflow: hidden;
}
.modal-addsite { max-width: 520px; }
.modal-confirm { max-width: 360px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header-info { display: flex; align-items: center; gap: 14px; }
.modal-icon { font-size: 1.8rem; }
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.modal-subtitle { font-size: 0.78rem; color: var(--text-muted); }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--text-muted); font-size: 0.85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: white; border-color: var(--border-hover); }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }

.modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-top: 1px solid var(--border); flex-shrink: 0;
  gap: 10px;
}

/* Textarea */
.modal-body textarea {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); font-family: inherit; font-size: 0.88rem;
  padding: 12px 14px; resize: vertical; min-height: 120px;
  transition: var(--transition); outline: none; line-height: 1.6;
}
.modal-body textarea:focus {
  border-color: var(--accent-purple);
  background: rgba(124,58,237,0.06);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.modal-body textarea::placeholder { color: var(--text-muted); }
.char-count { text-align: right; font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

/* Form Styles */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-row { display: flex; gap: 12px; }
.form-group-grow { flex: 1; }
.form-group-icon { width: 80px; flex-shrink: 0; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.required { color: var(--accent-rose); }
.form-group input,
.form-group select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); font-family: inherit; font-size: 0.88rem;
  padding: 10px 12px; outline: none; transition: var(--transition); width: 100%;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-purple);
  background: rgba(124,58,237,0.06);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group select { cursor: pointer; }
.form-group select option { background: #1a1c35; color: var(--text-primary); }
.form-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); font-family: inherit; font-size: 0.88rem;
  padding: 10px 12px; resize: vertical; min-height: 64px;
  outline: none; transition: var(--transition); line-height: 1.5; width: 100%;
}
.form-group textarea:focus {
  border-color: var(--accent-purple);
  background: rgba(124,58,237,0.06);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.form-group textarea::placeholder { color: var(--text-muted); }
.field-error { font-size: 0.75rem; color: var(--accent-rose); min-height: 16px; }
.input-error { border-color: var(--accent-rose) !important; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
  border: none; color: white; font-family: inherit;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
  transition: var(--transition); white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124,58,237,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-secondary); font-family: inherit;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: white; border-color: var(--border-hover); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: var(--radius-md);
  background: transparent; border: none;
  color: var(--text-muted); font-family: inherit;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.btn-ghost:hover { color: var(--text-secondary); }
.btn-danger:hover { color: #f87171 !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .add-site-label { display: none; }
  .add-site-btn { padding: 9px 12px; }
}
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; }
  .header-center { order: 3; width: 100%; max-width: 100%; }
  .header-right { margin-left: auto; }
  .carriers-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
  .main-content { padding: 16px; }
  .form-row { flex-direction: column; }
  .form-group-icon { width: 100%; }
}
@media (max-width: 480px) {
  .carriers-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* =============================================
   IFRAME VIEWER PANEL
   ============================================= */

/* Backdrop (dim the card grid behind) */
.iframe-backdrop {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.iframe-backdrop.open { opacity: 1; pointer-events: all; }

/* Slide-in Panel */
.iframe-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 72%; max-width: 1200px;
  background: #0d0e1c;
  z-index: 150;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -12px 0 60px rgba(0,0,0,0.6), -1px 0 0 rgba(255,255,255,0.05);
}
.iframe-panel.open { transform: translateX(0); }

/* Toolbar */
.iframe-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: #161830;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 12px;
}
.iframe-toolbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.iframe-site-icon { font-size: 1.5rem; flex-shrink: 0; }
.iframe-site-info { display: flex; flex-direction: column; min-width: 0; }
.iframe-site-name {
  font-size: 0.95rem; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.iframe-site-url {
  font-size: 0.72rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.iframe-toolbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Toolbar Buttons */
.iframe-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-size: 0.82rem; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.iframe-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-1px);
}
.iframe-btn-newtab {
  background: rgba(99,102,241,0.2);
  border-color: rgba(99,102,241,0.45);
  color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}
.iframe-btn-newtab:hover {
  background: rgba(99,102,241,0.35);
  color: white;
  border-color: rgba(99,102,241,0.7);
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.iframe-btn-close {
  width: 36px; height: 36px; padding: 0; justify-content: center;
  font-size: 1rem;
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}
.iframe-btn-close:hover {
  background: rgba(239,68,68,0.28);
  border-color: rgba(239,68,68,0.6);
  color: white;
}

/* Notice Banner */
.iframe-notice {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px;
  background: rgba(245,158,11,0.06);
  border-bottom: 1px solid rgba(245,158,11,0.12);
  font-size: 0.78rem; color: rgba(251,191,36,0.85);
  line-height: 1.4; flex-shrink: 0;
}
.iframe-notice-btn {
  background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.25);
  color: #fbbf24; border-radius: var(--radius-sm);
  padding: 2px 8px; font-size: 0.75rem; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.iframe-notice-btn:hover { background: rgba(245,158,11,0.25); }

/* iframe Container */
.iframe-container {
  position: relative; flex: 1; overflow: hidden;
}
#siteFrame {
  width: 100%; height: 100%; border: none;
  background: white; display: block;
}

/* Loading Overlay */
.iframe-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #0d0e1c;
  transition: opacity 0.3s ease;
  z-index: 5;
}
.iframe-loading p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 6px; }
.iframe-loading-url {
  font-size: 0.72rem; color: var(--text-muted);
  max-width: 80%; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.iframe-spinner {
  width: 44px; height: 44px; margin-bottom: 16px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* Blocked Screen */
.iframe-blocked {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  background: #0d0e1c;
  text-align: center; padding: 40px;
  z-index: 4;
}
.iframe-blocked.show { display: flex; }
.iframe-blocked-icon { font-size: 3.5rem; margin-bottom: 20px; opacity: 0.8; }
.iframe-blocked h3 { font-size: 1.1rem; color: var(--text-primary); margin-bottom: 10px; }
.iframe-blocked p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; max-width: 360px; }

/* Card Preview hint tooltip for card-header hover */
.card-header:hover .card-arrow { color: var(--accent-purple); opacity: 0.8; }

/* ---- Responsive iframe panel ---- */
@media (max-width: 1024px) { .iframe-panel { width: 85%; } }
@media (max-width: 768px)  { .iframe-panel { width: 100%; } }

