/* Thai typeface used by Allianz (self-hosted) */
@font-face {
  font-family: 'Prompt';
  src: url('/fonts/prompt/Prompt-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Prompt';
  src: url('/fonts/prompt/Prompt-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Prompt';
  src: url('/fonts/prompt/Prompt-SemiBold.woff2') format('woff2');
  font-weight: 500 900;
  font-style: normal;
  font-display: swap;
}

/* Allianz brand typeface (self-hosted) */
@font-face {
  font-family: 'Allianz Neo';
  src: url('/fonts/allianz-neo/AllianzNeoW04-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Allianz Neo';
  src: url('/fonts/allianz-neo/AllianzNeoW04-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Allianz Neo';
  src: url('/fonts/allianz-neo/AllianzNeoW04-Bold.woff2') format('woff2');
  font-weight: 500 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #092856;
  --accent: #0284c7;
  --dark-green: #064e3b;
  --gold: #d4a238;
  --gold-light: #fde68a;
  --primary-dark: #061834;
  --bg: #eef2f6;
  --surface: #ffffff;
  --gray-soft: #f1f5f9;
  --gray-mid: #cbd5e1;
  --text: #0b162c;
  --muted: #334155;
  --border: #cbd5e1;
  --success: #065f46;
  --warning: #b45309;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(6, 24, 52, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  margin: 0;
  font-family: 'Allianz Neo', 'Prompt', 'Noto Sans Thai', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 18px;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.btn, button, input, select, textarea {
  font-family: 'Allianz Neo', 'Prompt', 'Noto Sans Thai', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 22px;
}

/* --- Top Utility Bar (Larger & Crisp Blue + Dark Green + Gold) --- */
.topbar {
  background: linear-gradient(90deg, #061834 0%, #092856 58%, #064e3b 100%);
  color: #f1f5f9;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 11px 0;
  border-bottom: 1px solid rgba(212, 162, 56, 0.45);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-contact strong {
  color: #fde68a;
  font-weight: 700;
}

.topbar-sep {
  color: rgba(255, 255, 255, 0.35);
}

.topbar-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar-links a {
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.topbar-links a:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
}

.topbar-links a.topbar-admin-pill {
  background: rgba(212, 162, 56, 0.22);
  border-color: rgba(212, 162, 56, 0.65);
  color: #fde68a;
}

.topbar-links a.topbar-admin-pill:hover {
  background: var(--gold);
  color: #061834;
}

/* --- Main Navbar (Larger Bar + Crisp Gray/Blue/Dark-Green/Gold Menu Pills) --- */
.navbar {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(6, 24, 52, 0.1);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 12px 0;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 60%, var(--dark-green) 100%);
  border: 2px solid var(--gold);
  color: #fde68a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 6px 14px rgba(9, 40, 86, 0.24);
}

.brand-logo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(9, 40, 86, 0.18);
}

@media (max-width: 640px) {
  .brand-logo {
    width: 64px;
    height: 64px;
  }
}

.brand-title {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--primary-dark);
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--dark-green);
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 13px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1.5px solid #cbd5e1;
  color: #092244;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-color: var(--gold);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.25);
}

.nav-pill.active {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--dark-green) 100%);
  border-color: var(--gold);
  color: #fde68a;
  box-shadow: 0 6px 14px rgba(6, 78, 59, 0.25);
}

.nav-toggle {
  display: none;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  border: 1.5px solid #94a3b8;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* --- Dropdown Nav --- */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  font-family: inherit;
  cursor: pointer;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  background: #ffffff;
  border: 2px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(6, 24, 52, 0.18);
  padding: 10px;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 6px;
  transition: all 0.15s;
}

.nav-dropdown-item:last-child {
  margin-bottom: 0;
}

.nav-dropdown-item:hover {
  background: linear-gradient(135deg, #eff6ff, #ecfdf5);
  border-color: var(--accent);
}

.nav-dropdown-item strong {
  display: block;
  color: var(--primary-dark);
  font-size: 0.98rem;
  font-weight: 800;
}

.nav-dropdown-item span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #ffffff;
  border-color: rgba(212, 162, 56, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 6px 16px rgba(9, 40, 86, 0.28);
}

.btn-accent {
  background: linear-gradient(135deg, var(--dark-green) 0%, #047857 100%);
  color: #ffffff;
}

.btn-accent:hover {
  filter: brightness(1.08);
}

.btn-gold {
  background: linear-gradient(135deg, #e7bc56 0%, #d4a238 55%, #b8861e 100%);
  color: #061834;
  border-color: #f5d782;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(212, 162, 56, 0.32);
}

.btn-gold:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #ffffff;
}

.hero .btn-outline,
.km-hero-panel .btn-outline {
  background: rgba(6, 24, 52, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;
  font-weight: 700;
}

.hero .btn-outline:hover,
.km-hero-panel .btn-outline:hover {
  background: #ffffff;
  color: var(--primary-dark);
  border-color: #ffffff;
}

.btn-light {
  background: #ffffff;
  color: var(--primary-dark);
  border: 2px solid var(--gold);
  font-weight: 800;
}

.btn-light:hover {
  background: #fef9c3;
  color: var(--primary-dark);
}

.btn-sm {
  padding: 8px 15px;
  font-size: 0.9rem;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-ghost {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #64748b;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: #b91c1c;
  border-color: #b91c1c;
}

/* --- Hero Section (Blue + Sky Blue + Dark Green + Gold Accents) --- */
.hero {
  background: linear-gradient(125deg, #061834 0%, #092856 48%, #0284c7 82%, #064e3b 100%);
  color: #ffffff;
  padding: 72px 0 80px;
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--gold);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 38px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(6, 24, 52, 0.72);
  border: 1.5px solid rgba(253, 230, 138, 0.75);
  color: #fef08a;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.28;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(6, 24, 52, 0.5);
}

.hero p {
  margin: 0 0 26px;
  color: #f8fafc;
  font-size: 1.08rem;
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(6, 24, 52, 0.45);
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-card {
  background: #ffffff;
  color: var(--text);
  border-radius: 18px;
  border: 2px solid var(--gold);
  padding: 28px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.hero-card h3 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 1.25rem;
  font-weight: 800;
}

.hero-quick-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.quick-cat-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  transition: all 0.2s;
  font-weight: 700;
  font-size: 0.98rem;
}

.quick-cat-link:hover {
  border-color: var(--accent);
  background: linear-gradient(90deg, #eff6ff, #ecfdf5);
  color: var(--primary-dark);
}

/* --- Sections --- */
.section {
  padding: 68px 0;
}

.section-alt {
  background: #ffffff;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.section-header h1 {
  margin: 0 0 6px;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* --- Category Tabs --- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff, #f1f5f9);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn.active,
.tab-btn:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--dark-green) 100%);
  border-color: var(--gold);
  color: #fde68a;
}

/* --- Grids & Cards --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 16px rgba(6, 24, 52, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.badge-accent {
  background: #d1fae5;
  color: #064e3b;
  border: 1px solid #a7f3d0;
}

.badge-gold {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.product-meta {
  margin: 16px 0;
  padding: 13px 15px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 4px solid var(--gold);
}

.product-price {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--primary);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0f2fe, #d1fae5);
  border: 1px solid #93c5fd;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  margin-bottom: 14px;
}

/* --- Quote / Contact Form --- */
.quote-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.form-group label {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--primary-dark);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  font-size: 0.96rem;
  font-family: inherit;
  background: #ffffff;
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16);
}

.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: 600;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #064e3b;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* --- Keyman Corporate Sections --- */
.km-section {
  padding: 68px 0;
  border-top: 1px solid var(--border);
}

.km-section-alt {
  background: #ffffff;
}

.km-section-tint {
  background: linear-gradient(180deg, #e8f0fa 0%, #eef2f6 100%);
}

.km-card-box {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.km-hero-panel {
  background: linear-gradient(125deg, #061834 0%, #092856 52%, #064e3b 100%);
  color: #ffffff;
  border: 2px solid var(--gold);
  border-radius: 22px;
  padding: 38px;
  box-shadow: var(--shadow);
}

.km-img-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(6, 24, 52, 0.1);
}

.km-img-frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.km-pillar-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.km-pillar-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.km-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--dark-green));
  color: #fde68a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.km-case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.km-problem {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.9rem;
}

.km-solution {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.9rem;
}

.km-case-study {
  margin-top: 10px;
  padding: 10px 14px;
  background: #eff6ff;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  font-size: 0.9rem;
}

.km-timeline {
  border-left: 3px solid var(--gold);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.km-timeline-item {
  position: relative;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.km-timeline-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dark-green);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px var(--gold);
}

/* --- Footer --- */
.footer {
  background: linear-gradient(180deg, #061834 0%, #041126 100%);
  color: #e2e8f0;
  border-top: 4px solid var(--gold);
  padding: 56px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

.footer h4 {
  margin: 0 0 14px;
  color: #fde68a;
  font-size: 1.06rem;
  font-weight: 800;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin-bottom: 9px;
}

.footer a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

/* --- Floating AI Chatbot Widget --- */
.ai-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  background: linear-gradient(135deg, var(--primary) 0%, var(--dark-green) 100%);
  color: #fde68a;
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 17px 28px;
  font-weight: 800;
  font-family: inherit;
  font-size: 1.08rem;
  box-shadow: 0 14px 32px rgba(6, 24, 52, 0.38);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.ai-chat-window {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 470px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border: 2px solid var(--gold);
  border-radius: 18px;
  box-shadow: 0 26px 56px rgba(6, 24, 52, 0.32);
  z-index: 1000;
  flex-direction: column;
  overflow: hidden;
}

.ai-chat-window.open {
  display: flex;
}

.ai-chat-header {
  background: linear-gradient(90deg, var(--primary-dark), var(--dark-green));
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 13px;
  font-size: 1rem;
  white-space: pre-line;
  line-height: 1.6;
}

.ai-msg-bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
}

.ai-msg-user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
}

.ai-chat-suggestions {
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.ai-chip {
  font-size: 0.88rem;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: var(--primary-dark);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.ai-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

@media (max-width: 640px) {
  .ai-chat-fab { right: 14px; bottom: 14px; padding: 14px 20px; font-size: 1rem; }
  .ai-chat-window { right: 10px; left: 10px; width: auto; max-width: none; bottom: 82px; height: calc(100vh - 110px); }
}

/* --- Admin Layout (Blue + Dark Green + Gold + Gray) --- */
.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, #061834 0%, #092856 62%, #064e3b 100%);
  color: #f1f5f9;
  padding: 20px 14px;
  border-right: 3px solid var(--gold);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.admin-sidebar > div:first-child {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.admin-sidebar > div:last-child {
  flex-shrink: 0;
}

.admin-brand {
  padding: 0 10px 16px;
  border-bottom: 1px solid rgba(212, 162, 56, 0.35);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 162, 56, 0.78) rgba(255, 255, 255, 0.08);
}

.admin-nav::-webkit-scrollbar {
  width: 7px;
}

.admin-nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.admin-nav::-webkit-scrollbar-thumb {
  background: rgba(212, 162, 56, 0.78);
  border-radius: 999px;
}

.admin-nav::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

.admin-nav-group {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #fde68a;
  padding: 12px 10px 4px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.admin-nav a {
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.96rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  transition: all 0.2s;
}

.admin-nav a:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
}

.admin-nav a.active {
  background: linear-gradient(90deg, rgba(212, 162, 56, 0.3), rgba(6, 95, 70, 0.6));
  border-color: var(--gold);
  border-left: 4px solid var(--gold);
  color: #fde68a;
  font-weight: 700;
}

.admin-main {
  padding: 28px 34px;
  overflow-x: auto;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.table-wrap {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: 0 4px 12px rgba(6, 24, 52, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  color: var(--primary-dark);
  font-weight: 800;
}

.status-pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-new { background: #dbeafe; color: #1e40af; }
.status-contacted { background: #fef3c7; color: #92400e; }
.status-quoted, .status-scheduled, .status-qualified { background: #e0f2fe; color: #075985; }
.status-closed { background: #d1fae5; color: #064e3b; }
.status-lost, .status-do_not_contact { background: #fee2e2; color: #991b1b; }

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.pipeline-col {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 360px;
}

.pipeline-col-head {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary-dark);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  justify-content: space-between;
}

.pipeline-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 0.86rem;
}

.ana-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  padding: 16px 8px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.ana-bar-col {
  flex: 1;
  min-width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.ana-bar-fill {
  width: 20px;
  background: linear-gradient(180deg, var(--accent), var(--dark-green));
  border-radius: 6px 6px 0 0;
  min-height: 6px;
}

.ana-bar-label {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 6px;
}

@media (max-width: 1120px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 92px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 3px solid var(--gold);
    flex-direction: column;
    padding: 18px 22px;
    align-items: stretch;
    gap: 10px;
    box-shadow: 0 16px 32px rgba(6, 24, 52, 0.14);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: 1px solid var(--border);
    margin-top: 8px;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .grid-3,
  .grid-4,
  .grid-5,
  .grid-2,
  .footer-grid,
  .admin-shell,
  .km-case-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    height: auto;
    max-height: none;
  }
  .admin-nav {
    max-height: 360px;
  }
}

/* --- 3-Column Health Mega Menu --- */
.nav-mega-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-28%);
  width: 880px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 2px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 22px 48px rgba(6, 24, 52, 0.22);
  padding: 24px 26px;
  z-index: 250;
}

.nav-dropdown:hover .nav-mega-menu,
.nav-dropdown.open .nav-mega-menu {
  display: block;
}

.mega-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr 0.85fr;
  gap: 24px;
}

.mega-col-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
}

.mega-subgroup-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 12px 0 6px;
}

.mega-subgroup-title:first-child {
  margin-top: 0;
}

.mega-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
}

.mega-link:hover {
  background: #eff6ff;
  color: var(--primary);
}

.mega-link.mega-highlight {
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 6px;
}

.mega-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--accent);
  color: #ffffff;
  flex-shrink: 0;
}

.mega-badge-hot {
  background: var(--dark-green);
  color: #fde68a;
}

.mega-badge-new {
  background: var(--accent);
  color: #ffffff;
}

.mega-badge-up {
  background: var(--primary);
  color: #ffffff;
}

@media (max-width: 1120px) {
  .nav-mega-menu {
    position: static;
    transform: none;
    width: 100%;
    box-shadow: none;
    padding: 14px;
    margin-top: 8px;
  }
  .mega-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* --- Rich HTML Article Content Styling (Cloned Keyman & Corporate Policy Posts) --- */
.article-rich-html {
  font-size: 1.03rem;
  line-height: 1.82;
  color: #0b162c;
}

.article-rich-html p {
  margin: 0 0 14px;
}

.article-rich-html h2 {
  margin: 28px 0 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
}

.article-rich-html h3,
.article-rich-html h4 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  font-weight: 800;
  color: var(--primary);
}

.article-rich-html .article-lead {
  padding: 18px 22px;
  background: #eff6ff;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  margin-bottom: 22px;
  color: #0b162c;
  font-size: 1.06rem;
}

.article-rich-html .text-slate-200,
.article-rich-html .text-slate-300 {
  color: #1e293b;
}

.article-rich-html .text-amber-300,
.article-rich-html .text-amber-400 {
  color: var(--primary-dark);
}

.article-rich-html .text-sky-300,
.article-rich-html .text-sky-400 {
  color: var(--accent);
}

.article-rich-html .text-emerald-300,
.article-rich-html .text-emerald-400 {
  color: var(--dark-green);
}

.article-rich-html .text-red-300,
.article-rich-html .text-red-400,
.article-rich-html .text-rose-300 {
  color: #b91c1c;
}

/* Dark gradient & hex-background cards inside cloned HTML articles */
.article-rich-html [class*="bg-[#0"],
.article-rich-html .bg-gradient-to-r {
  background: linear-gradient(135deg, #061834 0%, #092856 68%, #064e3b 100%);
  color: #f8fafc;
  padding: 20px 24px;
  border-radius: 14px;
  border: 1.5px solid rgba(212, 162, 56, 0.55);
  margin: 20px 0;
  box-shadow: 0 10px 26px rgba(6, 24, 52, 0.14);
}

.article-rich-html [class*="bg-[#0"] p,
.article-rich-html [class*="bg-[#0"] li,
.article-rich-html [class*="bg-[#0"] .text-slate-200,
.article-rich-html [class*="bg-[#0"] .text-slate-300,
.article-rich-html .bg-gradient-to-r p,
.article-rich-html .bg-gradient-to-r li,
.article-rich-html .bg-gradient-to-r .text-slate-200,
.article-rich-html .bg-gradient-to-r .text-slate-300 {
  color: #f1f5f9;
}

.article-rich-html [class*="bg-[#0"] h2,
.article-rich-html [class*="bg-[#0"] h3,
.article-rich-html [class*="bg-[#0"] .text-amber-300,
.article-rich-html [class*="bg-[#0"] .text-amber-400,
.article-rich-html .bg-gradient-to-r h2,
.article-rich-html .bg-gradient-to-r h3,
.article-rich-html .bg-gradient-to-r .text-amber-300,
.article-rich-html .bg-gradient-to-r .text-amber-400 {
  color: #fde68a;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.article-rich-html [class*="bg-[#0"] .text-sky-300,
.article-rich-html [class*="bg-[#0"] .text-sky-400,
.article-rich-html .bg-gradient-to-r .text-sky-300,
.article-rich-html .bg-gradient-to-r .text-sky-400 {
  color: #7dd3fc;
}

.article-rich-html [class*="bg-[#0"] .text-emerald-300,
.article-rich-html [class*="bg-[#0"] .text-emerald-400 {
  color: #6ee7b7;
}

.article-rich-html .bg-emerald-950\/25 {
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  padding: 18px 20px;
  border-radius: 12px;
  color: #064e3b;
}

.article-rich-html .bg-amber-500\/10 {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  padding: 18px 20px;
  border-radius: 12px;
  color: #78350f;
}

.article-rich-html .bg-red-950\/25,
.article-rich-html .bg-red-950\/40 {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  padding: 18px 20px;
  border-radius: 12px;
  color: #7f1d1d;
}

.article-rich-html .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.article-rich-html .flex {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.article-rich-html ul.list-disc {
  list-style: disc;
  padding-left: 24px;
  margin: 8px 0 12px;
}

.article-rich-html ol.list-decimal {
  list-style: decimal;
  padding-left: 24px;
  margin: 8px 0 12px;
}

.article-rich-html li {
  margin-bottom: 6px;
}

.article-rich-html .overflow-x-auto {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.article-rich-html table {
  width: 100%;
  border-collapse: collapse;
}

.article-rich-html th {
  background: var(--primary);
  color: #fde68a;
  padding: 12px 14px;
  text-align: left;
  font-size: 0.92rem;
}

.article-rich-html td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #0b162c;
  font-size: 0.94rem;
}

.article-rich-html [class*="bg-[#0"] table th {
  background: rgba(255, 255, 255, 0.12);
}

.article-rich-html [class*="bg-[#0"] table td {
  color: #f1f5f9;
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.article-rich-html .btn-dark-outline {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid #fde68a;
  color: #fde68a;
  font-weight: 700;
}

.article-rich-html .btn-dark-outline:hover {
  background: #fde68a;
  color: #061834;
}

/* ==========================================================================
   LMS course player — top bar (typography refresh)
   ========================================================================== */
.lms-player-topbar {
  background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 10px rgba(6, 24, 52, 0.06);
  color: #0b1b34;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

.lms-player-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.lms-player-topbar__main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}

.lms-player-topbar__back {
  border-color: rgba(11, 92, 173, 0.35);
  color: #0b5cad;
  background: #ffffff;
  font-weight: 700;
  white-space: nowrap;
}

.lms-player-topbar__meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.lms-player-topbar__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: #0b5cad;
}

.lms-player-topbar__code {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #075985;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lms-player-topbar__sep {
  color: rgba(6, 24, 52, 0.35);
}

.lms-player-topbar__title {
  max-width: 62ch;
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
  color: #0b1b34;
  text-wrap: balance;
}

.lms-player-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lms-player-topbar__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff7e0;
  border: 1px solid #d4a238;
  color: #7a4d00;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.lms-player-topbar__cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 20px;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.005em;
  box-shadow: 0 4px 12px rgba(6, 24, 52, 0.18);
}

.lms-player-topbar__progress {
  min-width: 190px;
}

.lms-player-topbar__progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #7a4d00;
}

.lms-player-topbar__progress-track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(6, 24, 52, 0.12);
}

#topProgressBar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.3s ease;
}

@media (max-width: 820px) {
  .lms-player-topbar__inner {
    gap: 12px;
  }

  .lms-player-topbar__title {
    font-size: 1.25rem;
    line-height: 1.45;
  }

  .lms-player-topbar__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Affiliate Workspace
   ========================================================================== */
.ws-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  align-items: start;
  background: #f2f6fb;
  border-top: 1px solid #e2e8f0;
}

.ws-sidebar {
  background: linear-gradient(180deg, #061834 0%, #0b2447 100%);
  color: #dbe6f3;
  padding: 22px 16px 26px;
  align-self: stretch;
}

.ws-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ws-brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #f3d27a);
  color: #061834;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
}

.ws-brand-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

.ws-brand-sub {
  font-size: 0.8rem;
  color: #93b4d8;
}

.ws-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.ws-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cfe0f2;
  font-size: 0.98rem;
  font-weight: 600;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.ws-nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.ws-nav-link.is-active {
  background: rgba(212, 162, 56, 0.18);
  color: #fde68a;
  box-shadow: inset 3px 0 0 var(--gold);
}

.ws-nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
}

.ws-sidebar-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-code-box {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.ws-code-label {
  font-size: 0.74rem;
  color: #93b4d8;
  letter-spacing: 0.04em;
}

.ws-code-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.04em;
}

.ws-logout {
  color: #fca5a5;
}

.ws-main {
  padding: 26px 28px 40px;
  min-width: 0;
}

.ws-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ws-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.ws-page-title {
  margin: 2px 0 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.3;
}

.ws-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 7px 14px 7px 7px;
  box-shadow: 0 3px 10px rgba(6, 24, 52, 0.05);
}

.ws-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  overflow: hidden;
}

.ws-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ws-avatar-editor {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 0 16px;
  margin-bottom: 14px;
  border-bottom: 1px dashed #cbd5e1;
}

.ws-avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 2rem;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(6, 24, 52, 0.16);
}

.ws-avatar-controls {
  flex: 1;
  min-width: 230px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ws-hint {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 4px 0 0;
}


.ws-user-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.ws-user-role {
  font-size: 0.76rem;
  color: var(--muted);
}

.ws-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ws-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 6px 16px rgba(6, 24, 52, 0.05);
}

.ws-kpi-label {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}

.ws-kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.25;
  margin-top: 2px;
}

.ws-kpi-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.ws-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.ws-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 6px 16px rgba(6, 24, 52, 0.05);
  margin-bottom: 18px;
}

.ws-two-col .ws-card {
  margin-bottom: 0;
}

.ws-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ws-card-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.ws-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.ws-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}

.ws-muted {
  color: #64748b;
  font-size: 0.9rem;
}

.ws-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

.ws-empty {
  margin: 10px 0;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
  text-align: center;
  font-size: 0.95rem;
}

.ws-copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
}

.ws-input {
  flex: 1;
  min-width: 200px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.92rem;
  color: var(--text);
  background: #f8fafc;
  font-family: inherit;
}

.ws-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding-top: 8px;
}

.ws-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.ws-chart-bar {
  width: 100%;
  max-width: 26px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  min-height: 4px;
}

.ws-chart-day {
  font-size: 0.7rem;
  color: #64748b;
}

.ws-inline-stats {
  display: flex;
  gap: 22px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.ws-inline-stats strong {
  display: block;
  font-size: 1.2rem;
  color: var(--primary-dark);
}

.ws-inline-stats span {
  font-size: 0.8rem;
  color: #64748b;
}

.ws-table-wrap {
  overflow-x: auto;
}

.ws-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ws-table th {
  text-align: left;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #475569;
  background: #f8fafc;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.ws-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
}

.ws-table tr:last-child td {
  border-bottom: 0;
}

.ws-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: #0b5cad;
  border: 1px solid #cfe3f7;
  white-space: nowrap;
}

.ws-badge.is-gold {
  background: #fff7e0;
  color: #7a4d00;
  border-color: #f0d79a;
}

.ws-badge.is-green {
  background: #e8f7ef;
  color: #065f46;
  border-color: #b7e4cc;
}

.ws-badge.is-blue {
  background: #e7f1fd;
  color: #0b4f8a;
  border-color: #c6ddf6;
}

.ws-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0;
}

.ws-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ws-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ws-filter .ws-input {
  flex: 1 1 220px;
}

.ws-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: #475569;
}

.ws-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.6;
}

.ws-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.ws-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #475569;
}

.ws-field-wide {
  grid-column: 1 / -1;
}

.ws-profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
}

.ws-profile-meta span {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
}

.ws-profile-meta strong {
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.ws-qr-wrap {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
}

.ws-qr {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.ws-url-cell {
  max-width: 420px;
}

.ws-url {
  display: block;
  font-size: 0.82rem;
  color: #475569;
  word-break: break-all;
}

.ws-materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.ws-material {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fbfdff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ws-material:hover {
  border-color: #7dd3fc;
  box-shadow: 0 6px 16px rgba(11, 92, 173, 0.1);
}

.ws-material-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.ws-material-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.4;
}

.ws-material-desc {
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.5;
}

.ws-material-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: #7a4d00;
}

.ws-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.ws-template {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: #fbfdff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-template-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--primary-dark);
}

.ws-template-text {
  margin: 0;
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.6;
  flex: 1;
}

@media (max-width: 1080px) {
  .ws-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ws-shell {
    grid-template-columns: 1fr;
  }

  .ws-sidebar {
    padding: 16px;
  }

  .ws-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .ws-nav-link {
    width: auto;
  }

  .ws-sidebar-foot {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .ws-code-box {
    margin-bottom: 0;
  }

  .ws-two-col,
  .ws-form-grid,
  .ws-profile-meta {
    grid-template-columns: 1fr;
  }

  .ws-main {
    padding: 18px 16px 32px;
  }
}

