/* ============================================================
   DDLSHIP — freight & logistics platform (dark navy + gold)
   ============================================================ */

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 500;
  background: rgba(10, 15, 28, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner { display: flex; align-items: center; gap: 1.1rem; padding: 0.75rem 0; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 900; font-size: 1.08rem; color: #fff; letter-spacing: 0.03em; }
.logo-mark {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  display: flex; align-items: center; justify-content: center;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(59,130,246,0.35);
}
.logo .logo-sub { display: block; font-size: 0.6rem; letter-spacing: 0.18em; color: var(--slate-400); font-weight: 700; margin-top: -2px; }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link { padding: 0.45rem 0.7rem; border-radius: 8px; font-size: 0.86rem; font-weight: 600; color: var(--slate-300); transition: all 0.13s ease; background: none; border: none; }
.nav-link:hover { color: #fff; background: rgba(59,130,246,0.07); }
.nav-link.back-academy { color: #fff; border: 1px solid rgba(59,130,246,0.35); display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-link.back-academy:hover { background: rgba(59,130,246,0.12); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.user-chip { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.75rem 0.3rem 0.4rem; background: var(--slate-800); border: 1px solid var(--border-soft); border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: #e5e7eb; }
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff; font-weight: 800; font-size: 0.72rem;
  display: flex; align-items: center; justify-content: center;
}
.user-chip .role-tag { font-size: 0.64rem; color: var(--slate-400); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 4rem; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(59,130,246,0.07), transparent 60%),
    radial-gradient(700px 340px at 85% 10%, rgba(59,130,246,0.06), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.08; color: #fff; letter-spacing: -0.02em; margin: 1.1rem auto 0.9rem; max-width: 780px; }
.hero h1 .gold { color: #fff; }
.hero .subtitle { color: var(--slate-400); font-size: 1.08rem; max-width: 640px; margin: 0 auto 2.2rem; }
.hero-stats { display: flex; justify-content: center; gap: 2.6rem; flex-wrap: wrap; margin-top: 2.4rem; }
.hero-stat .num { font-size: 1.5rem; font-weight: 800; color: #fff; }
.hero-stat .lbl { font-size: 0.72rem; color: var(--slate-500); letter-spacing: 0.08em; text-transform: uppercase; }

/* Live tracking search bar */
.track-search { max-width: 640px; margin: 0 auto; }
.track-search .search-bar {
  display: flex; align-items: stretch; gap: 0.5rem;
  background: var(--slate-900);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.4rem 0.4rem 0.4rem 1.15rem;
  box-shadow: 0 14px 40px rgba(0,0,0,0.45);
  transition: border-color 0.15s ease;
}
.track-search .search-bar:focus-within { border-color: #3b82f6; }
.track-search input {
  flex: 1; background: none; border: none; outline: none;
  color: #fff; font-family: var(--mono); font-size: 0.98rem; min-width: 0;
}
.track-search input::placeholder { color: var(--slate-600); font-family: inherit; }
.track-search .btn { border-radius: 999px; }
.track-search .search-hint { margin-top: 0.7rem; font-size: 0.75rem; color: var(--slate-500); }

/* ---------- Sections ---------- */
.section { padding: 3.8rem 0; }
.section-alt { background: rgba(255,255,255,0.015); border-top: 1px solid rgba(31,41,55,0.5); border-bottom: 1px solid rgba(31,41,55,0.5); }
.section-head { max-width: 640px; margin-bottom: 2.2rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--slate-300); margin-bottom: 0.5rem; }
.section-head h2 { font-size: 1.9rem; color: #fff; letter-spacing: -0.01em; }
.section-head p { color: var(--slate-400); margin-top: 0.5rem; }

/* ---------- Feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.feature-card { display: flex; flex-direction: column; gap: 0.7rem; }
.feature-card .f-icon {
  width: 46px; height: 46px; flex: none;
  border-radius: 12px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: #3b82f6;
  display: flex; align-items: center; justify-content: center;
}
.feature-card h3 { font-size: 1.05rem; color: #fff; }
.feature-card p { font-size: 0.88rem; color: var(--slate-400); }
.feature-card .f-tag { margin-top: auto; padding-top: 0.5rem; font-size: 0.72rem; color: var(--slate-500); }

/* ---------- Fleet & routes ---------- */
.fleet-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; align-items: start; }
.route-list { display: flex; flex-direction: column; gap: 0.7rem; }
.route-item {
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--slate-900); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.85rem 1rem;
}
.route-item .ports { font-weight: 700; color: #fff; font-size: 0.9rem; }
.route-item .mode-tag { margin-left: auto; }
.route-item .days { font-size: 0.74rem; color: var(--slate-500); white-space: nowrap; }

/* ---------- Quote ---------- */
.quote-box { max-width: 720px; margin: 0 auto; }
.quote-result {
  margin-top: 1.2rem; display: none;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(59,130,246,0.02));
  border: 1px solid rgba(59,130,246,0.35);
  border-radius: 14px; padding: 1.3rem;
}
.quote-result.show { display: block; }
.quote-result .total { font-size: 1.9rem; font-weight: 800; color: #fff; }
.quote-result table { width: 100%; font-size: 0.88rem; }
.quote-result td { padding: 0.3rem 0; color: var(--slate-300); }
.quote-result td:last-child { text-align: right; font-family: var(--mono); color: #fff; }

/* ---------- Support ---------- */
.support-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.support-card .s-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--slate-800); border: 1px solid var(--border-soft); color: #3b82f6; display: flex; align-items: center; justify-content: center; margin-bottom: 0.8rem; }
.support-card h3 { color: #fff; font-size: 0.98rem; margin-bottom: 0.35rem; }
.support-card p { font-size: 0.84rem; color: var(--slate-400); margin-bottom: 0.2rem; }
.faq details { background: var(--slate-900); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 0.7rem; }
.faq summary { padding: 0.9rem 1.1rem; font-weight: 600; color: #fff; font-size: 0.92rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::after { content: "+"; color: var(--slate-500); font-size: 1.2rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 1.1rem 1rem; color: var(--slate-400); font-size: 0.88rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 2.6rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer h4 { color: #fff; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.8rem; }
.footer a, .footer p { display: block; color: var(--slate-400); font-size: 0.85rem; margin-bottom: 0.45rem; }
.footer a:hover { color: #fff; }
.footer .fine-print { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid rgba(31,41,55,0.6); font-size: 0.74rem; color: var(--slate-600); }

/* ---------- Auth ---------- */
.auth-main {
  min-height: 66vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1rem;
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.5rem; color: #fff; margin-bottom: 0.3rem; }
.auth-card .auth-sub { color: var(--slate-400); font-size: 0.9rem; margin-bottom: 1.6rem; }
.auth-switch { margin-top: 1.2rem; text-align: center; font-size: 0.86rem; color: var(--slate-400); }
.auth-switch a { color: var(--slate-200); font-weight: 700; }

/* ---------- Dashboard / portal pages ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-main { flex: 1; padding: 2rem 0 4rem; }
.page-main.landing { padding-top: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.7rem; color: #fff; letter-spacing: -0.01em; }
.page-head .sub { color: var(--slate-400); font-size: 0.9rem; margin-top: 0.2rem; }
.page-head .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.tabs { display: flex; gap: 0.35rem; border-bottom: 1px solid var(--border); margin-bottom: 1.6rem; flex-wrap: wrap; }
.tab {
  padding: 0.65rem 1.1rem;
  font-size: 0.9rem; font-weight: 700;
  color: var(--slate-400);
  border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.13s ease;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: #3b82f6; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi-card { position: relative; overflow: hidden; }
.kpi-card .kpi-icon { position: absolute; right: 1rem; top: 1rem; width: 40px; height: 40px; border-radius: 10px; background: rgba(59,130,246,0.1); color: #3b82f6; display: flex; align-items: center; justify-content: center; }
.kpi-card .kpi-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-500); }
.kpi-card .kpi-value { font-size: 1.9rem; font-weight: 800; color: #fff; margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.kpi-card .kpi-sub { font-size: 0.76rem; color: var(--slate-500); margin-top: 0.2rem; }

.toolbar { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 1.1rem; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  background: var(--slate-900); border: 1px solid var(--border-soft);
  color: #e5e7eb; border-radius: 10px; padding: 0.55rem 0.85rem;
  outline: none; font-size: 0.88rem;
}
.toolbar input:focus, .toolbar select:focus { border-color: #3b82f6; }
.toolbar input { min-width: 240px; }
.toolbar .count { font-size: 0.78rem; color: var(--slate-500); }

/* ---------- Tracking view ---------- */
.track-topline { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.track-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 1.2rem; align-items: start; }
.track-route { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0.8rem 0 1.2rem; }
.track-route .port { font-weight: 800; color: #fff; font-size: 1.02rem; }
.track-route .port .code { display: block; font-size: 0.72rem; color: var(--slate-500); font-family: var(--mono); font-weight: 600; letter-spacing: 0.06em; }
.track-route .route-line { flex: 1; min-width: 60px; display: flex; align-items: center; gap: 0.4rem; color: var(--slate-600); }
.track-route .route-line .rline { flex: 1; height: 2px; background: linear-gradient(90deg, var(--slate-700), #3b82f6, var(--slate-700)); border-radius: 2px; }

.progress-track { height: 8px; background: var(--slate-800); border-radius: 999px; overflow: hidden; margin: 0.9rem 0 0.3rem; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); border-radius: 999px; transition: width 0.4s ease; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--slate-500); }

.timeline { position: relative; margin-top: 0.6rem; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border-soft); }
.tl-item { position: relative; padding-bottom: 1.4rem; }
.tl-item:last-child { padding-bottom: 0.2rem; }
.tl-dot {
  position: absolute; left: -1.6rem; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--slate-800); border: 2px solid var(--slate-600);
  z-index: 1;
}
.tl-item.done .tl-dot { background: #3b82f6; border-color: #2563eb; }
.tl-item.current .tl-dot { background: #60a5fa; border-color: #3b82f6; box-shadow: 0 0 0 5px rgba(59,130,246,0.18); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(59,130,246,0.18); } 50% { box-shadow: 0 0 0 8px rgba(59,130,246,0.06); } }
.tl-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.tl-text { font-weight: 700; color: #e5e7eb; font-size: 0.92rem; }
.tl-item.current .tl-text { color: #fff; }
.tl-where { font-size: 0.74rem; color: var(--slate-500); margin-top: 0.15rem; display: flex; align-items: center; gap: 0.35rem; }
.tl-when { font-size: 0.7rem; color: var(--slate-600); font-family: var(--mono); }

/* ---------- Booking ---------- */
.book-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.2rem; align-items: start; }
.form-section-title {
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--slate-200); margin: 1.4rem 0 0.9rem; padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.form-section-title:first-child { margin-top: 0; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }
.estimate-box { position: sticky; top: 90px; }
.estimate-box .est-total { font-size: 2rem; font-weight: 800; color: #fff; }
.estimate-box .est-rows { margin: 0.9rem 0; }
.estimate-box .est-row { display: flex; justify-content: space-between; font-size: 0.86rem; color: var(--slate-300); padding: 0.28rem 0; border-bottom: 1px dashed rgba(31,41,55,0.7); }
.estimate-box .est-row span:last-child { font-family: var(--mono); color: #fff; }

.success-card { max-width: 620px; margin: 0 auto; text-align: center; }
.success-card .big-check {
  width: 74px; height: 74px; margin: 0 auto 1.2rem;
  border-radius: 50%; background: rgba(34,197,94,0.12);
  border: 2px solid rgba(34,197,94,0.5); color: #4ade80;
  display: flex; align-items: center; justify-content: center;
}
.success-card .track-big { font-size: 1.5rem; font-weight: 800; color: #fff; font-family: var(--mono); margin: 0.8rem 0; }
.success-card .success-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }

/* ---------- Staff workspace ---------- */
.staff-chip-row { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.staff-stat { flex: 1; min-width: 150px; }

/* ---------- Misc page bits ---------- */
.detail-card-title { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate-500); margin-bottom: 1rem; }
.seg { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.attn-banner {
  display: flex; align-items: center; gap: 0.8rem;
  background: rgba(59,130,246,0.07); border: 1px solid rgba(59,130,246,0.3);
  border-radius: 12px; padding: 0.9rem 1.1rem;
  color: var(--slate-200); font-size: 0.9rem; margin-bottom: 1.4rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .fleet-grid, .track-grid, .book-grid { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .estimate-box { position: static; }
}
@media (max-width: 720px) {
  .feature-grid { grid-template-columns: 1fr; }
  .form-2col, .form-3col { grid-template-columns: 1fr; }
  .navbar-inner { gap: 0.6rem; }
  .nav-right { margin-left: 0; width: 100%; }
  .nav-links { overflow-x: auto; width: 100%; padding-bottom: 0.2rem; }
  .hero { padding: 3rem 0 2.6rem; }
  .section { padding: 2.6rem 0; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   DDLShip2 parent-brand strip (platform operates under the
   DDLShip2 Global Shipping Academy domain)
   ============================================================ */
.superbar {
  background: #0b1733;
  border-bottom: 1px solid #22355f;
  font-size: 0.72rem;
}
.superbar .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; padding: 0.42rem 0; flex-wrap: wrap;
}
.superbar .sb-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; letter-spacing: 0.06em;
  color: #93c5fd;
}
.superbar .d2-mini {
  width: 18px; height: 18px; flex: none;
  border-radius: 5px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #ffffff;
  font-weight: 900; font-size: 0.58rem;
  display: flex; align-items: center; justify-content: center;
}
.superbar .sb-tag { color: #5b74ad; font-weight: 600; letter-spacing: 0.04em; }
.superbar .sb-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: none; cursor: pointer;
  color: #60a5fa; font-weight: 700; font-size: 0.72rem;
  padding: 0;
}
.superbar .sb-link:hover { color: #93c5fd; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  color: #8fa7d6;
  margin-left: auto;
}
.sync-pill .sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #64748b;
}
.sync-pill.online { color: #86efac; }
.sync-pill.online .sync-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}
.sync-pill.offline { color: #fca5a5; }
.sync-pill.offline .sync-dot { background: #ef4444; }
.sync-pill.local { color: #8fa7d6; }
.sync-pill.local .sync-dot { background: #64748b; }

/* ============================================================
   DARK BLUE PLATFORM THEME (distinct from the OWOREMITS navy/gold
   reference palette) — applied while DDLSHIP is active
   ============================================================ */
body[data-theme="blue"] {
  --navy-950: #070f24;
  --navy-900: #0b1733;
  --slate-900: #0e1d40;
  --slate-800: #15264e;
  --slate-700: #24386b;
  --slate-600: #3b4f85;
  --border: #22355f;
  --border-soft: #2c4172;
  --gold: #60a5fa;        /* platform accent: blue */
  --gold-light: #93c5fd;
  --gold-dark: #2563eb;
}
body[data-theme="blue"] .navbar { background: rgba(7, 15, 36, 0.92); }
body[data-theme="blue"] .btn-gold { box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3); }
body[data-theme="blue"] .btn-gold:hover { box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45); }
body[data-theme="blue"] .btn-gold-ghost { border-color: rgba(96, 165, 250, 0.5); }
body[data-theme="blue"] .btn-gold-ghost:hover { background: rgba(59, 130, 246, 0.14); }
body[data-theme="blue"] .badge-gold { background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.4); }
body[data-theme="blue"] .pill { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.4); }
body[data-theme="blue"] .st-transit { background: rgba(59, 130, 246, 0.16); border-color: rgba(59, 130, 246, 0.45); }
body[data-theme="blue"] .nav-link:hover { background: rgba(59, 130, 246, 0.08); }
body[data-theme="blue"] .nav-link.back-academy { border-color: rgba(96, 165, 250, 0.4); }
body[data-theme="blue"] .nav-link.back-academy:hover { background: rgba(59, 130, 246, 0.12); }
body[data-theme="blue"] .logo-mark {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.4);
}
body[data-theme="blue"] .hero::before {
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(700px 340px at 85% 10%, rgba(147, 197, 253, 0.07), transparent 60%);
}
body[data-theme="blue"] .feature-card .f-icon { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); }
body[data-theme="blue"] .support-card .s-icon { color: #60a5fa; }
body[data-theme="blue"] .kpi-icon { background: rgba(59, 130, 246, 0.12); }
body[data-theme="blue"] .quote-result {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.02));
  border-color: rgba(59, 130, 246, 0.4);
}
body[data-theme="blue"] .quote-result .total { color: #60a5fa; }
body[data-theme="blue"] .estimate-box .est-total { color: #60a5fa; }
body[data-theme="blue"] .success-card .track-big { color: #60a5fa; }
body[data-theme="blue"] .attn-banner { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.35); }
body[data-theme="blue"] .chip:hover { border-color: #3b82f6; }
body[data-theme="blue"] .field input:focus,
body[data-theme="blue"] .field select:focus,
body[data-theme="blue"] .field textarea:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
body[data-theme="blue"] .toolbar input:focus,
body[data-theme="blue"] .toolbar select:focus { border-color: #3b82f6; }
body[data-theme="blue"] .pw-toggle:hover { background: rgba(59, 130, 246, 0.1); }
body[data-theme="blue"] .tl-item.current .tl-dot { box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.2); }
@keyframes pulseBlue { 0%,100% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); } 50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.07); } }
body[data-theme="blue"] .tl-item.current .tl-dot { animation: pulseBlue 2s infinite; }
body[data-theme="blue"] ::selection { background: rgba(59, 130, 246, 0.35); }

/* ============================================================
   Floating live chat widget
   ============================================================ */
.chat-root {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 900;
  display: none;
}
body[data-theme="blue"] .chat-root { display: block; }
.chat-launcher {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  position: relative;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
  transition: transform 0.15s ease;
}
.chat-launcher:hover { transform: scale(1.06); }
.chat-launcher .pulse-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(96, 165, 250, 0.6);
  animation: chatPulse 2.2s infinite;
  pointer-events: none;
}
@keyframes chatPulse {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
.chat-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px;
  background: #ef4444; color: #fff;
  font-size: 0.68rem; font-weight: 800;
  display: none; align-items: center; justify-content: center;
}
.chat-badge.show { display: flex; }
.chat-panel {
  position: absolute; bottom: 72px; right: 0;
  width: min(340px, calc(100vw - 2rem));
  height: min(480px, calc(100vh - 150px));
  background: #0e1d40;
  border: 1px solid #22355f;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: viewIn 0.18s ease;
}
/* The hidden attribute must win over display:flex (author CSS otherwise overrides the UA rule) */
.chat-panel[hidden] { display: none; }
.chat-head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: #15264e;
  border-bottom: 1px solid #22355f;
}
.chat-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  flex: none;
}
.chat-title { font-weight: 800; color: #fff; font-size: 0.9rem; }
.chat-sub { font-size: 0.68rem; color: #93c5fd; }
.chat-close {
  margin-left: auto; background: none; border: none;
  color: #8fa7d6; font-size: 1.15rem; cursor: pointer;
  padding: 0.2rem 0.4rem; border-radius: 6px;
}
.chat-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.chat-body {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.chat-msg {
  max-width: 82%;
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  font-size: 0.85rem; line-height: 1.45;
  align-self: flex-start;
}
.chat-msg.bot {
  background: #15264e; color: #dbe6ff;
  border: 1px solid #22355f;
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg.typing { color: #93c5fd; font-style: italic; }
.chat-msg .t {
  display: block; font-size: 0.62rem; opacity: 0.6; margin-top: 0.25rem;
}
.chat-action {
  display: block; margin-top: 0.5rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93c5fd;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem; font-weight: 700;
  cursor: pointer; width: 100%; text-align: left;
}
.chat-action:hover { background: rgba(59, 130, 246, 0.25); }
.chat-quick {
  display: flex; gap: 0.4rem; padding: 0.5rem 0.8rem; flex-wrap: wrap;
  border-top: 1px solid #22355f;
}
.chat-quick button {
  background: #15264e; border: 1px solid #22355f;
  color: #93c5fd; border-radius: 999px;
  font-size: 0.72rem; padding: 0.3rem 0.7rem;
  transition: border-color 0.13s ease;
}
.chat-quick button:hover { border-color: #3b82f6; }
.chat-input {
  display: flex; gap: 0.5rem; padding: 0.7rem 0.8rem;
  border-top: 1px solid #22355f;
  background: #0e1d40;
}
.chat-input input {
  flex: 1; min-width: 0;
  background: #0b1733; border: 1px solid #22355f;
  border-radius: 10px; color: #fff;
  padding: 0.55rem 0.8rem; font-size: 0.85rem; outline: none;
}
.chat-input input:focus { border-color: #3b82f6; }
.chat-input button {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none; color: #fff;
  border-radius: 10px; padding: 0 0.95rem; font-size: 1rem;
}
.chat-input button:hover { filter: brightness(1.1); }
