:root {
    --primary: #0F172A;
    --secondary: #2563EB;
    --accent: #10B981;
    --primary-rgb: 15, 23, 42;
    --secondary-rgb: 37, 99, 235;
    --accent-rgb: 16, 185, 129;
    --genz-bg: #eef2f8;
    --genz-surface: #ffffff;
    --genz-text: #0f172a;
    --genz-muted: #475569;
    --genz-border: #d8e2ef;
    --genz-mint: #00c9a7;
    --genz-blue: #3b82f6;
    --genz-violet: #7c3aed;
    --genz-amber: #d97706;
    --genz-radius: 20px;
    --genz-radius-sm: 14px;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--genz-text);
    line-height: 1.6;
}

.bg-primary-custom { background-color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }

.btn-secondary-custom {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}
.btn-secondary-custom:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

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

/* Hero */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 50%, #0f172a 100%);
    padding: 2rem 0 4rem;
    min-height: 80vh;
}
.min-vh-75 { min-height: 75vh; }

.hero-mockup .mockup-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,.3);
}
.mockup-header {
    background: #f1f5f9;
    padding: 12px 16px;
    display: flex;
    gap: 6px;
}
.mockup-header span {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}
.mockup-body { padding: 1.5rem; }
.stat-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.stat-box {
    flex: 1;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}
.stat-box.accent { background: rgba(var(--accent-rgb), .1); }
.stat-box strong { display: block; font-size: 1.25rem; }
.chart-placeholder {
    height: 120px;
    background: linear-gradient(180deg, rgba(var(--secondary-rgb),.2) 0%, transparent 100%);
    border-radius: 8px;
}

.module-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}
.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* Auth */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #1e3a5f);
    padding: 1rem;
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.auth-card-wide { max-width: 560px; }
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #94a3b8;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.divider span { padding: 0 1rem; font-size: .875rem; }

/* Dashboard */
.dashboard-body {
    background: #f8fafc;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--primary);
    color: #e2e8f0;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-section {
    padding: .75rem 1.5rem .25rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s;
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,.1);
}

.dashboard-main {
    flex: 1;
    margin-left: 0;
}
@media (min-width: 992px) {
    .dashboard-main { margin-left: 260px; }
    .dashboard-body { padding-bottom: 0; }
}

.dashboard-header {
    background: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-left {
    flex-shrink: 0;
}
.header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.header-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #64748b;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.header-settings-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Navbar company logo switcher */
.nav-company-switch .dropdown-toggle::after {
    display: none;
}
.nav-company-trigger--readonly {
    cursor: default;
    pointer-events: none;
}
.nav-company-switch--static .nav-company-trigger--readonly {
    border-color: transparent;
    background: transparent;
}
.nav-company-trigger {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem .65rem .35rem .4rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    max-width: min(240px, 52vw);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.nav-company-trigger:hover,
.nav-company-switch.show .nav-company-trigger {
    border-color: #94a3b8;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}
.nav-company-trigger-logo {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-company-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
    display: block;
}
.nav-company-fallback,
.nav-company-item-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 700;
    font-size: .95rem;
    color: #1e3a5f;
    background: linear-gradient(135deg, #e0f2fe, #f1f5f9);
}
.nav-company-trigger-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
    line-height: 1.2;
}
.nav-company-trigger-label {
    font-size: .65rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.nav-company-trigger-name {
    font-size: .85rem;
    font-weight: 700;
    color: #0f172a;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-company-chevron {
    flex-shrink: 0;
    font-size: .75rem;
    color: #64748b;
    transition: transform .15s;
}
.nav-company-switch.show .nav-company-chevron {
    transform: rotate(180deg);
}
.nav-company-item-fallback {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: .9rem;
}
.nav-company-menu {
    min-width: 280px;
    padding: .35rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-top: .35rem !important;
}
.nav-company-menu-head {
    pointer-events: none;
}
.nav-company-form {
    margin: 0;
}
.nav-company-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem;
    border-radius: 10px;
    width: 100%;
    text-align: left;
}
.nav-company-item.active {
    background: #eff6ff;
}
.nav-company-item-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 2px;
    flex-shrink: 0;
    background: #fff;
}
.nav-company-item-name {
    font-weight: 600;
    font-size: .9rem;
    color: #0f172a;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dashboard platform logo — ตรงกับหน้าเว็บ (site_logo / logo.png) */
.dashboard-sidebar-brand {
    background: #fff !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: .85rem 1rem !important;
}
.sidebar .dashboard-sidebar-brand {
    border-bottom-color: rgba(255, 255, 255, .1);
}
.dashboard-platform-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}
.sidebar .dashboard-platform-logo .site-logo-nav {
    height: 40px;
    max-width: 200px;
}
.offcanvas .dashboard-platform-logo .site-logo-nav {
    height: 44px;
    max-width: 220px;
}
.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}
.dashboard-content { padding: 1.5rem; }

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    height: 100%;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.stat-icon.bg-success-subtle i { color: #047857 !important; }
.stat-icon.bg-danger-subtle i { color: #b91c1c !important; }
.stat-icon.bg-primary-subtle i { color: #1d4ed8 !important; }
.stat-icon.bg-warning-subtle i { color: #b45309 !important; }

/* Dashboard home — professional icon UI */
.dash-home { max-width: 1200px; }
.dash-welcome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.dash-welcome-title { font-size: 1.35rem; font-weight: 800; color: #0f172a; letter-spacing: -.02em; }
.dash-welcome-sub { font-size: .88rem; color: #64748b; margin-top: .2rem; }
.dash-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .75rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 600;
}
.dash-section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.dash-kpi {
    display: flex;
    align-items: center;
    gap: .85rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    height: 100%;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.dash-kpi-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.dash-kpi-body { min-width: 0; }
.dash-kpi-label { display: block; font-size: .7rem; color: #64748b; font-weight: 600; }
.dash-kpi-value { display: block; font-size: 1.2rem; font-weight: 800; color: #0f172a; line-height: 1.2; }
.dash-kpi-icon.tone-emerald { background: #d1fae5; color: #047857; }
.dash-kpi-icon.tone-rose { background: #ffe4e6; color: #be123c; }
.dash-kpi-icon.tone-blue { background: #dbeafe; color: #1d4ed8; }
.dash-kpi-icon.tone-amber { background: #fef3c7; color: #b45309; }

.dash-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: .65rem;
}
.dash-app-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .55rem;
    padding: 1rem .65rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.dash-app-tile:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .1);
    color: inherit;
}
.dash-app-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}
.dash-app-label { display: block; font-size: .82rem; font-weight: 700; color: #0f172a; }
.dash-app-sub { display: block; font-size: .68rem; color: #64748b; margin-top: .1rem; }
.dash-app-icon.tone-blue { background: #dbeafe; color: #1d4ed8; }
.dash-app-icon.tone-indigo { background: #e0e7ff; color: #4338ca; }
.dash-app-icon.tone-violet { background: #ede9fe; color: #6d28d9; }
.dash-app-icon.tone-teal { background: #ccfbf1; color: #0f766e; }
.dash-app-icon.tone-emerald { background: #d1fae5; color: #047857; }
.dash-app-icon.tone-cyan { background: #cffafe; color: #0e7490; }
.dash-app-icon.tone-amber { background: #fef3c7; color: #b45309; }
.dash-app-icon.tone-rose { background: #ffe4e6; color: #be123c; }
.dash-app-icon.tone-purple { background: #f3e8ff; color: #7e22ce; }
.dash-app-icon.tone-slate { background: #f1f5f9; color: #475569; }
.dash-app-icon.tone-gray { background: #f8fafc; color: #64748b; }
.dash-app-icon.tone-sky { background: #e0f2fe; color: #0369a1; }
.dash-app-icon.tone-green { background: #dcfce7; color: #15803d; }

.dash-quick-list { display: flex; flex-direction: column; gap: .35rem; }
.dash-quick-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-size: .85rem;
    font-weight: 600;
    transition: background .12s;
}
.dash-quick-item i { font-size: 1.1rem; color: #2563eb; width: 1.25rem; text-align: center; }
.dash-quick-item:hover { background: #f1f5f9; color: #1d4ed8; }
.dash-chart-empty-icon {
    display: inline-flex;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 1.75rem;
}
.dms-setup-create { border-left: 4px solid #2563eb !important; }

/* Onboarding — แนะนำผู้ใช้ใหม่เพิ่มร้านก่อน */
.onboard-shop-banner {
    margin-bottom: 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .22);
}
.onboard-shop-banner-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.15rem;
}
.onboard-shop-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.onboard-shop-body { flex: 1; min-width: min(100%, 220px); }
.onboard-shop-body strong { font-size: .95rem; }
.onboard-shop-body p { opacity: .92; line-height: 1.45; }
.onboard-shop-steps {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    padding-left: 0;
    list-style: none;
}
.onboard-shop-steps li {
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    font-size: .72rem;
    font-weight: 600;
}
.onboard-shop-steps li.active {
    background: #fff;
    color: #1d4ed8;
}
.onboard-shop-cta { font-weight: 700; color: #1e40af !important; }
.dash-onboard-hint { border: 1px dashed #cbd5e1; background: #f8fafc; }

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: .5rem 0 calc(.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #64748b;
    font-size: .7rem;
    padding: .5rem .75rem;
    min-width: 56px;
    min-height: 48px;
    justify-content: center;
}
.mobile-bottom-nav .nav-item i { font-size: 1.25rem; }
.mobile-bottom-nav .nav-item.active { color: var(--secondary); }

.admin-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1) !important;
}

/* PWA install banner */
.pwa-install-banner {
    position: fixed;
    bottom: 80px;
    left: 1rem; right: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 1rem;
    border-radius: 12px;
    z-index: 999;
    display: none;
}
@media (min-width: 992px) {
    .pwa-install-banner { bottom: 1rem; left: auto; right: 1rem; max-width: 320px; }
}

/* Logo */
.brand-logo { height: auto; width: auto; max-width: 300px; max-height: 80px; }
.brand-logo-sm { height: 44px; width: auto; max-width: 200px; }
.sidebar .brand-logo-sm, .offcanvas .brand-logo-sm { max-width: 220px; height: 48px; }
.site-logo { height: auto; display: block; object-fit: contain; min-height: 32px; }
.logo-on-dark {
    filter: brightness(0) invert(1);
    opacity: .92;
}

.genz-hero-screenshot {
    aspect-ratio: 16 / 10;
    width: 100%;
    height: auto;
    object-fit: cover;
    background: #e2e8f0;
}
/* Hero v2 — ข้อความซ้าย + รูปขวาขนาดพอดี */
.genz-hero-v2 { padding-bottom: .5rem; }
.genz-hero-visual {
    background: #fff;
    border-radius: 20px;
    padding: .75rem;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, .04),
        0 20px 48px rgba(37, 99, 235, .12);
    border: 1px solid rgba(255, 255, 255, .8);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.genz-hero-visual-img {
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;
    display: block;
    border-radius: 14px;
}
@media (min-width: 992px) {
    .genz-hero-visual { max-width: 100%; margin-right: 0; }
    .genz-hero-visual-img { max-height: 380px; }
}
@media (max-width: 991.98px) {
    .genz-hero-v2 .genz-h1 { font-size: 1.75rem; text-align: center; }
    .genz-hero-v2 .genz-lead { text-align: center; }
    .genz-hero-v2 .genz-pill { display: table; margin: 0 auto 1rem; }
    .genz-hero-v2 .d-flex.flex-wrap.gap-2.mb-4 { justify-content: center; }
    .genz-hero-v2 .d-flex.flex-wrap.gap-2:last-child { justify-content: center; }
    .genz-hero-visual-img { max-height: 220px; }
    .genz-hero-visual { padding: .5rem; border-radius: 16px; }
}
@media (max-width: 575.98px) {
    .genz-hero-visual-img { max-height: 180px; }
    .genz-hero-v2 .btn-lg { font-size: 1rem; padding: .6rem 1.25rem; }
}

.sr-only-focusable:not(:focus):not(:focus-within) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Gen Z Public UI ===== */
.landing-page {
    background: #e8eef6;
}
.site-nav {
    background: rgba(255,255,255,.82) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(59,130,246,.14);
    box-shadow: 0 1px 0 rgba(59,130,246,.06), 0 8px 28px rgba(15,23,42,.07);
    padding: .65rem 0;
}
.landing-page .site-nav {
    background: rgba(232,240,254,.88) !important;
    border-bottom-color: rgba(59,130,246,.2);
}
.site-nav .navbar-brand { padding: 0; margin-right: 1rem; }
.site-nav .nav-link {
    color: var(--genz-text) !important;
    font-weight: 600;
    font-size: .95rem;
    padding: .5rem .85rem !important;
    border-radius: 999px;
    transition: background .15s, color .15s;
}
.site-nav .nav-link:hover {
    background: #f1f5f9;
    color: var(--genz-blue) !important;
}
.site-nav .navbar-toggler-icon {
    filter: invert(1) brightness(.2);
}
.btn-genz-primary {
    background: linear-gradient(135deg, var(--genz-mint), #10b981);
    border: none;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0,201,167,.35);
}
.btn-genz-primary:hover {
    background: linear-gradient(135deg, #00b894, #059669);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,201,167,.4);
}
.btn-genz-outline {
    background: #fff;
    border: 2px solid var(--genz-border);
    color: var(--genz-text);
    font-weight: 700;
}
.btn-genz-outline:hover {
    border-color: var(--genz-mint);
    color: var(--genz-text);
    background: #f0fdf9;
}
.btn-genz-dark {
    background: var(--genz-text);
    color: #fff;
    font-weight: 700;
    border: none;
}
.btn-genz-dark:hover { background: #1e293b; color: #fff; }

.genz-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #dbeafe 0%, #ecfdf5 38%, #ede9fe 72%, #f1f5f9 100%);
    color: var(--genz-text);
}
.landing-page .genz-hero {
    background: linear-gradient(135deg, #c7d9f8 0%, #b8f0e4 30%, #d4c4fc 62%, #e8eef6 100%);
}
.genz-hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: .65;
}
.genz-blob-1 {
    width: 480px; height: 480px;
    background: rgba(59,130,246,.35);
    top: -140px; right: -100px;
}
.genz-blob-2 {
    width: 400px; height: 400px;
    background: rgba(0,201,167,.32);
    bottom: -120px; left: -80px;
}
.landing-page .genz-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 85%, rgba(124,58,237,.12) 0%, transparent 42%),
        radial-gradient(circle at 85% 20%, rgba(37,99,235,.14) 0%, transparent 40%);
    pointer-events: none;
}
.genz-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    padding: .45rem 1rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}
.genz-pill-sm { font-size: .78rem; padding: .35rem .85rem; margin-bottom: .75rem; }
.genz-pill-blue {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}
.genz-pill-violet {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #c4b5fd;
}
.genz-h1 {
    font-size: clamp(2.1rem, 5.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.02em;
    margin-bottom: 1.25rem;
    color: var(--genz-text);
}
.genz-h2 {
    font-size: clamp(1.65rem, 3.5vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--genz-text);
    margin-bottom: .75rem;
}
.genz-gradient-text {
    background: linear-gradient(120deg, var(--genz-blue), var(--genz-mint));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.genz-lead {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--genz-muted);
    max-width: 520px;
    margin-bottom: 1.5rem;
}
.genz-body { font-size: 1.05rem; line-height: 1.7; color: var(--genz-muted); }
.genz-sub { font-size: 1.05rem; color: var(--genz-muted); max-width: 520px; margin: 0 auto; }
.genz-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(59,130,246,.18);
    color: #334155;
    padding: .45rem .9rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}
.landing-page .genz-chip:nth-child(1) { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.landing-page .genz-chip:nth-child(2) { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.landing-page .genz-chip:nth-child(3) { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.genz-hero-card {
    background: transparent;
    border: none;
    border-radius: var(--genz-radius);
    padding: 0;
    box-shadow: none;
}
.genz-hero-screenshot {
    display: block;
    width: 100%;
    height: auto;
    box-shadow:
        0 24px 56px rgba(37,99,235,.18),
        0 8px 24px rgba(15,23,42,.1);
}
.genz-stats { padding: 2.5rem 0; background: var(--genz-surface); border-bottom: 1px solid var(--genz-border); }
.genz-band {
    background: linear-gradient(105deg, #1e3a8a 0%, #0e7490 48%, #047857 100%);
    border-bottom: none;
    position: relative;
}
.genz-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: .5;
    pointer-events: none;
}
.genz-band .container { position: relative; z-index: 1; }
.genz-stat-card {
    text-align: center;
    padding: 1.35rem 1rem;
    background: rgba(255,255,255,.96);
    border-radius: var(--genz-radius-sm);
    border: none;
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
    transition: transform .2s;
}
.genz-band .genz-stat-card:hover { transform: translateY(-3px); }
.genz-stats .col-6:nth-child(1) .genz-stat-num { color: #1d4ed8; }
.genz-stats .col-6:nth-child(2) .genz-stat-num { color: #7c3aed; }
.genz-stats .col-6:nth-child(3) .genz-stat-num { color: #0d9488; }
.genz-stats .col-6:nth-child(4) .genz-stat-num { color: #d97706; }
.genz-stat-num { font-size: 1.75rem; font-weight: 800; color: var(--genz-blue); line-height: 1; }
.genz-stat-label { font-size: .9rem; color: #334155; font-weight: 600; margin-top: .35rem; }
.genz-section { padding: 4rem 0; background: var(--genz-surface); }
.genz-section-alt { background: var(--genz-bg); }
.genz-tint-sky {
    background: linear-gradient(180deg, #f8fbff 0%, #e8f2ff 100%);
}
.genz-tint-mesh {
    background:
        radial-gradient(ellipse at 10% 20%, rgba(59,130,246,.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(0,201,167,.14) 0%, transparent 50%),
        linear-gradient(180deg, #eef6ff 0%, #ecfdf5 100%);
}
.genz-tint-warm {
    background: linear-gradient(180deg, #faf5ff 0%, #fff7ed 55%, #f8fafc 100%);
}
.genz-section-head { margin-bottom: 2.5rem; }
.genz-bento-card {
    display: block;
    padding: 1.25rem 1rem;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(148,163,184,.25);
    border-radius: var(--genz-radius-sm);
    transition: transform .2s, box-shadow .2s, border-color .2s;
    color: inherit;
    box-shadow: 0 4px 16px rgba(15,23,42,.05);
}
.genz-bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(37,99,235,.12);
    border-color: color-mix(in srgb, var(--c) 40%, white);
}
.genz-bento-card-static {
    cursor: default;
    pointer-events: none;
}
.genz-bento-card-static:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(15,23,42,.05);
    border-color: var(--genz-border);
}

/* หน้า /features — แค่ icon + คำอธิบาย */
.features-catalog { padding-top: 2rem; }
.feature-catalog-card {
    background: #fff;
    border: 1px solid var(--genz-border);
    border-radius: 1.25rem;
    padding: 1.5rem 1.35rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.feature-catalog-card:hover {
    border-color: rgba(13, 148, 136, .35);
    box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}
.feature-catalog-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
    background: color-mix(in srgb, var(--fc) 12%, white);
    color: var(--fc);
}
.feature-catalog-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 .4rem;
    color: var(--genz-text);
}
.feature-catalog-tagline {
    font-size: .9rem;
    color: var(--genz-muted);
    line-height: 1.55;
    margin: 0 0 1rem;
}
.feature-catalog-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: .82rem;
    color: #475569;
}
.feature-catalog-benefits li {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    margin-bottom: .35rem;
}
.feature-catalog-benefits li i {
    color: #10b981;
    margin-top: .15rem;
    flex-shrink: 0;
}
.features-catalog-cta { padding-bottom: 1rem; }
.genz-bento-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--c) 22%, white);
    color: var(--c);
    font-size: 1.35rem;
    margin-bottom: .75rem;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, transparent);
}
.genz-bento-title { font-size: 1rem; font-weight: 800; margin: 0 0 .25rem; color: var(--genz-text); }
.genz-bento-desc { font-size: .82rem; color: var(--genz-muted); margin: 0; line-height: 1.45; }
.genz-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.genz-list li {
    display: flex; align-items: center; gap: .6rem;
    margin-bottom: .65rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--genz-text);
}
.genz-list i { color: var(--genz-mint); font-size: 1.1rem; font-weight: 700; }
.genz-team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    max-width: 400px;
    margin: 0 auto;
}
.genz-team-tile {
    background: rgba(255,255,255,.9);
    border: 1px solid var(--genz-border);
    border-radius: var(--genz-radius-sm);
    padding: 1rem;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(15,23,42,.07);
}
.genz-team-tile i { display: block; font-size: 1.5rem; margin-bottom: .35rem; }
.genz-team-tile.center {
    grid-column: 2;
    grid-row: 2;
    background: linear-gradient(135deg, #34d399, #3b82f6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 32px rgba(59,130,246,.28);
}
.genz-team-tile.owner { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.genz-team-tile.admin { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.genz-team-tile.staff { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.genz-team-tile.acc { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.genz-price-card {
    position: relative;
    text-align: center;
    padding: 1.5rem 1rem;
    background: rgba(255,255,255,.95);
    border: 1px solid var(--genz-border);
    border-radius: var(--genz-radius);
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 6px 20px rgba(15,23,42,.06);
}
.landing-page .row.g-3.justify-content-center > .col-6:nth-child(1) .genz-price-card {
    background: linear-gradient(180deg, #fff 0%, #eff6ff 100%);
    border-color: #bfdbfe;
}
.landing-page .row.g-3.justify-content-center > .col-6:nth-child(2) .genz-price-card {
    background: linear-gradient(180deg, #fff 0%, #f5f3ff 100%);
    border-color: #ddd6fe;
}
.landing-page .row.g-3.justify-content-center > .col-6:nth-child(3) .genz-price-card {
    background: linear-gradient(180deg, #fff 0%, #ecfdf5 100%);
}
.landing-page .row.g-3.justify-content-center > .col-6:nth-child(4) .genz-price-card {
    background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
    border-color: #fed7aa;
}
.genz-price-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(15,23,42,.1); }
.genz-price-card.featured {
    border: 2px solid var(--genz-mint);
    box-shadow: 0 16px 40px rgba(0,201,167,.22);
    background: linear-gradient(180deg, #fff 0%, #d1fae5 100%) !important;
}
.genz-price-badge {
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    background: var(--genz-mint);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    padding: .25rem .75rem;
    border-radius: 999px;
}
.genz-price-people { font-size: .8rem; color: var(--genz-muted); font-weight: 600; }
.genz-price-name { font-size: 1rem; font-weight: 800; margin: .25rem 0; }
.genz-price-amount { font-size: 2rem; font-weight: 800; color: var(--genz-blue); line-height: 1.1; }
.genz-cta-band {
    background: linear-gradient(125deg, #0f172a 0%, #1e40af 42%, #0e7490 72%, #047857 100%);
    padding: 3.5rem 0;
    position: relative;
    overflow: hidden;
}
.landing-page .genz-cta-band::before {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(0,201,167,.25);
    filter: blur(60px);
    top: -80px; right: -60px;
    pointer-events: none;
}
.landing-page .genz-cta-band::after {
    content: '';
    position: absolute;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: rgba(59,130,246,.3);
    filter: blur(60px);
    bottom: -100px; left: -40px;
    pointer-events: none;
}
.landing-page .genz-cta-band .container { position: relative; z-index: 1; }
.genz-footer {
    background: var(--genz-text);
    color: #fff;
}
.genz-footer-tag {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,.6);
    margin-bottom: 1rem;
}
.site-logo-nav {
    height: 48px;
    width: auto;
    max-width: 260px;
    min-width: 120px;
    display: block;
}
.site-logo-footer {
    max-height: 56px;
    max-width: 280px;
    opacity: .95;
}
@media (min-width: 992px) {
    .site-logo-nav { max-height: 62px; max-width: 300px; }
}
@media (max-width: 991px) {
    .site-nav .navbar-collapse {
        background: #fff;
        border: 1px solid var(--genz-border);
        border-radius: var(--genz-radius-sm);
        padding: .75rem;
        margin-top: .5rem;
        box-shadow: 0 8px 24px rgba(15,23,42,.08);
    }
}

/* Landing page (legacy) */
.landing-nav {
    background: #ffffff !important;
    border-bottom: 1px solid var(--genz-border);
    box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.landing-hero {
    position: relative;
    overflow: hidden;
    padding: 3rem 0 4rem;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 45%, #0f172a 100%);
    color: #fff;
}
.landing-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(16,185,129,.18), transparent 35%),
        radial-gradient(circle at 85% 70%, rgba(37,99,235,.2), transparent 40%);
    pointer-events: none;
}
.landing-badge {
    display: inline-block;
    background: rgba(16,185,129,.15);
    color: #6ee7b7;
    border: 1px solid rgba(16,185,129,.35);
    padding: .45rem .9rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.landing-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}
.landing-title span {
    background: linear-gradient(90deg, #60a5fa, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.landing-lead {
    font-size: 1.1rem;
    color: rgba(255,255,255,.78);
    max-width: 540px;
    margin-bottom: 1.75rem;
}
.btn-landing-outline {
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
    background: transparent;
}
.btn-landing-outline:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-color: rgba(255,255,255,.5);
}
.trust-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.85);
    padding: .4rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
}
.landing-hero-visual { position: relative; }
.landing-float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: .65rem;
    background: #fff;
    color: #0f172a;
    padding: .65rem .9rem;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,.2);
    font-size: .8rem;
    animation: landing-float 4s ease-in-out infinite;
}
.landing-float-card i { font-size: 1.25rem; color: var(--secondary); }
.landing-float-card strong { display: block; line-height: 1.2; }
.landing-float-card small { color: #64748b; }
.landing-float-doc { top: 8%; left: -4%; }
.landing-float-ai { bottom: 10%; right: -2%; animation-delay: 1.5s; }
@keyframes landing-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.landing-stats {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    margin-top: -1px;
}
.landing-stat-item { padding: .5rem; }
.landing-stat-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
}
.landing-stat-label { font-size: .85rem; color: #64748b; margin-top: .25rem; }
.landing-module-card {
    padding: 1.25rem .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.landing-module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15,23,42,.08);
    border-color: #cbd5e1;
}
.landing-module-icon {
    width: 52px; height: 52px;
    margin: 0 auto;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--mod-color) 12%, white);
    color: var(--mod-color);
    font-size: 1.4rem;
}
.landing-team-section { background: #f8fafc; }
.landing-checklist li {
    margin-bottom: .65rem;
    color: #475569;
    font-size: .95rem;
}
.landing-checklist i { color: var(--accent); margin-right: .5rem; }
.landing-team-visual {
    position: relative;
    min-height: 280px;
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(15,23,42,.15);
}
.landing-team-hub {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 96px; height: 96px;
    border-radius: 50%;
    background: rgba(16,185,129,.2);
    border: 2px solid rgba(16,185,129,.5);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    gap: .2rem;
}
.landing-team-hub i { font-size: 1.5rem; }
.landing-team-card {
    position: absolute;
    background: #fff;
    border-radius: 12px;
    padding: .65rem .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.landing-team-card i { font-size: 1.1rem; }
.landing-team-card.owner { top: 12%; left: 8%; color: #2563eb; }
.landing-team-card.admin { top: 18%; right: 10%; color: #7c3aed; }
.landing-team-card.staff { bottom: 18%; left: 12%; color: #059669; }
.landing-team-card.acc { bottom: 14%; right: 8%; color: #d97706; }
.landing-price-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    transition: transform .2s, box-shadow .2s;
}
.landing-price-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.landing-price-card.featured {
    border: 2px solid var(--secondary);
    box-shadow: 0 12px 28px rgba(37,99,235,.12);
}
.landing-price-tag {
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .65rem;
    border-radius: 999px;
}
.landing-price-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.1;
}
.landing-demo-cta {
    background: linear-gradient(135deg, #0f172a, #1e40af);
}
.landing-footer { background: var(--primary); color: #fff; }
@media (max-width: 767px) {
    .landing-float-doc, .landing-float-ai { display: none; }
    .site-logo-nav { max-height: 44px; max-width: 200px; }
}

/* AI Chat */
.ai-chat-page { max-width: 900px; margin: 0 auto; }
.ai-chat-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .25rem 0;
}
.ai-chat-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}
.ai-chat-hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}
.ai-chat-hero-sub {
    font-size: .9rem;
    color: #475569;
    margin-top: .15rem;
}
.ai-chat-container {
    display: flex;
    flex-direction: column;
    min-height: 420px;
}
.ai-chat-container .card-body {
    flex: 1;
    min-height: calc(100vh - 260px);
    max-height: calc(100vh - 200px);
}
.ai-suggestions-label {
    font-size: .75rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: .5rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.ai-suggest-btn {
    background: #ede9fe !important;
    color: #4c1d95 !important;
    border: 1px solid #c4b5fd !important;
    font-weight: 600;
    font-size: .82rem;
}
.ai-suggest-btn:hover {
    background: #ddd6fe !important;
    color: #3b0764 !important;
}
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
    background: #f1f5f9;
    border-radius: 12px;
    padding: .75rem;
    margin-bottom: .75rem;
}
.ai-msg {
    display: flex;
    gap: .75rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}
.ai-msg.user { flex-direction: row-reverse; }
.ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
}
.ai-msg.assistant .ai-avatar {
    background: #4f46e5;
    color: #fff;
}
.ai-msg.user .ai-avatar {
    background: #1d4ed8;
    color: #fff;
}
.ai-bubble {
    border-radius: 16px;
    padding: .85rem 1.1rem;
    max-width: 88%;
    font-size: 1rem;
    line-height: 1.65;
    border: 1px solid transparent;
}
.ai-msg.assistant .ai-bubble {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .06);
}
.ai-msg.user .ai-bubble {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1e40af;
}
.ai-input-bar {
    display: flex;
    gap: .5rem;
    padding: .75rem 0 0;
    margin-top: auto;
    background: transparent;
}
.ai-input-bar .form-control {
    border-radius: 24px;
    padding: .8rem 1.25rem;
    font-size: 1rem;
    color: #0f172a;
    background: #fff;
    border: 2px solid #cbd5e1;
}
.ai-input-bar .form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.ai-input-bar .form-control::placeholder {
    color: #64748b;
}
.ai-input-bar .btn {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
@media (max-width: 991.98px) {
    .ai-chat-container .card-body {
        min-height: calc(100vh - 300px);
        max-height: none;
        padding-bottom: calc(1rem + 70px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .ai-input-bar {
        position: sticky;
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        padding: .75rem;
        margin: 0 -.75rem -.75rem;
        border-top: 1px solid #e2e8f0;
        z-index: 50;
    }
}

/* Documents */
.doc-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: 1rem .5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: var(--primary);
    font-size: .75rem;
    transition: all .15s;
}
.doc-type-btn:hover, .doc-type-btn:active {
    border-color: var(--secondary);
    background: rgba(var(--secondary-rgb), .05);
    color: var(--secondary);
}
.doc-type-btn i { font-size: 1.5rem; color: var(--secondary); }
.doc-list-item { padding: 1rem !important; }

/* POS */
.pos-shell { max-width: 1400px; margin: 0 auto; }
.pos-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}
.pos-topbar-main { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.pos-title { font-size: 1.35rem; font-weight: 700; color: var(--primary); }
.pos-search-form {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 420px;
}
.pos-search-form i {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.pos-search-form .form-control {
    padding-left: 2.25rem;
    border-radius: 10px;
    border-color: #e2e8f0;
}
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1rem;
    align-items: start;
}
.pos-catalog { min-width: 0; }
.pos-cat-scroll {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
}
.pos-cat-pill {
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: .35rem .85rem;
    font-size: .8rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
}
.pos-cat-pill.active, .pos-cat-pill:hover {
    border-color: var(--secondary);
    background: rgba(var(--secondary-rgb), .08);
    color: var(--secondary);
}
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .65rem;
}
.pos-product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .5rem;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    min-height: 130px;
}
.pos-product-card:active, .pos-product-card.added {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .08);
    transform: scale(.97);
}
.pos-product-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.pos-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pos-product-thumb i { font-size: 1.75rem; color: var(--secondary); opacity: .6; }
.pos-product-name {
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
}
.pos-product-price { font-size: .85rem; color: var(--accent); font-weight: 700; }
.pos-product-card { position: relative; }
.pos-product-card.is-out { opacity: .45; cursor: not-allowed; }
.pos-stock-badge {
    position: absolute;
    top: .35rem;
    right: .35rem;
    font-size: .6rem;
    font-weight: 700;
    padding: .1rem .35rem;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
    z-index: 1;
}
.pos-stock-badge.low { background: #fef3c7; color: #b45309; }
.pos-stats-pill {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: .25rem .85rem;
}
.pos-stats-sep { opacity: .4; }
.pos-topbar-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pos-search-bar .pos-search-form { max-width: none; }
.pos-main-col { min-width: 0; }
.pos-history-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}
.pos-history-list { display: flex; flex-direction: column; gap: .35rem; max-height: 220px; overflow-y: auto; }
.pos-history-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    text-align: left;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    background: #fafafa;
    padding: .5rem .65rem;
    font-size: .82rem;
    cursor: pointer;
}
.pos-history-item:hover { background: #f0fdf9; border-color: #a7f3d0; }
.pos-pay-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
}
.pos-pay-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .75rem .5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: .78rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
}
.pos-pay-btn i { font-size: 1.35rem; }
.pos-pay-btn.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .08);
    color: var(--accent);
}
.pos-pay-btn:disabled { opacity: .4; cursor: not-allowed; }
.pos-qr-wrap { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pos-qr-img { max-width: 200px; border-radius: 8px; }
.pos-checkout-total .display-6 { line-height: 1.1; }
.pos-cart-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
    position: sticky;
    top: 1rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, .06);
}
.pos-cart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: .5rem .75rem;
    min-height: 120px;
}
.pos-cart-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem 0;
    border-bottom: 1px solid #f8fafc;
}
.pos-cart-line-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
}
.pos-qty-num {
    min-width: 1.25rem;
    text-align: center;
    font-size: .85rem;
    font-weight: 600;
}
.pos-cart-foot {
    padding: .85rem 1rem 1rem;
    border-top: 1px solid #f1f5f9;
}
.pos-image-upload { cursor: pointer; display: inline-block; }
.pos-image-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: .75rem;
    overflow: hidden;
}
.pos-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.pos-image-preview i { font-size: 1.5rem; }
.pos-cart-bar {
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    left: 0; right: 0;
    background: var(--primary);
    color: #fff;
    padding: .65rem 1rem;
    z-index: 900;
    box-shadow: 0 -4px 12px rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    gap: .75rem;
}
.pos-cart-bar-btn {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    color: #fff;
    padding: .25rem 0;
    font-size: .9rem;
}
@media (max-width: 991.98px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart-panel {
        position: fixed;
        inset: 0 0 0 auto;
        width: min(100%, 360px);
        max-height: none;
        height: 100%;
        z-index: 1050;
        border-radius: 0;
        transform: translateX(100%);
        transition: transform .25s ease;
    }
    .pos-cart-panel.is-open { transform: translateX(0); }
    .pos-product-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .dashboard-content:has(.pos-shell) { padding-bottom: 5rem; }
}

/* Mobile Side Nav (Offcanvas) */
.mobile-side-nav { padding: .5rem 0; }
.mobile-side-section {
    padding: .75rem 1.25rem .25rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    font-weight: 600;
}
.mobile-side-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.25rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 1rem;
    min-height: 48px;
}
.mobile-side-link:active { background: #f1f5f9; }
.mobile-side-link i { font-size: 1.25rem; width: 24px; text-align: center; }
@media (min-width: 992px) {
    .pos-cart-bar { bottom: 0; left: 260px; }
}

/* Content Studio */
.content-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all .15s;
    font-size: .85rem;
}
.content-type-btn.active, .content-type-btn:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .05);
}
.content-type-btn i { font-size: 1.5rem; color: var(--secondary); }
.generated-text {
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: .95rem;
}

/* Unified Chat Hub */
.chat-channel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 1.25rem 1rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    height: 100%;
    text-align: center;
}
.chat-channel-card:hover {
    border-color: var(--ch-color, var(--accent));
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
    transform: translateY(-2px);
    color: inherit;
}
.chat-channel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--ch-color) 12%, #fff);
    color: var(--ch-color);
    font-size: 1.5rem;
}
.chat-channel-icon-sm {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    border-radius: 10px;
}
.chat-channel-label {
    font-weight: 600;
    font-size: .9rem;
}
.chat-channel-desc {
    font-size: .75rem;
    color: #64748b;
    line-height: 1.3;
}
.chat-channel-nav .nav-link {
    font-size: .85rem;
    padding: .4rem .75rem;
}
.chat-channel-nav .nav-link.active {
    background: var(--accent);
}
.chat-channel-card {
    position: relative;
}
.chat-channel-badge {
    position: absolute;
    top: .5rem;
    right: .5rem;
    font-size: .65rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: 6px;
}
.chat-badge-on { background: #dcfce7; color: #15803d; }
.chat-badge-ready { background: #fef3c7; color: #b45309; }
.chat-badge-off { background: #f1f5f9; color: #64748b; }
.chat-guide-card .card-body { font-size: .9rem; }
.chat-guide-steps {
    padding-left: 1.25rem;
    margin: 0;
}
.chat-guide-steps li {
    margin-bottom: .6rem;
    line-height: 1.45;
}
.chat-guide-steps li:last-child { margin-bottom: 0; }

/* Unified Chat — LINE inbox */
.unified-chat-inbox-row { min-height: 420px; }
.unified-chat-thread-list-wrap { max-height: 520px; overflow: hidden; display: flex; flex-direction: column; }
.unified-chat-thread-list { overflow-y: auto; flex: 1; }
.unified-chat-thread-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    padding: .85rem 1rem;
    transition: background .15s ease;
}
.unified-chat-thread-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.unified-chat-thread-avatar-ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #64748b;
    font-size: 1.1rem;
}
.unified-chat-thread-meta { min-width: 0; }
.unified-chat-media {
    max-width: 180px;
    max-height: 180px;
    border-radius: .5rem;
    display: block;
}
.unified-chat-thread-item:hover,
.unified-chat-thread-item.active {
    background: #f0fdf9;
}
.unified-chat-pane { min-height: 420px; }
.unified-chat-messages {
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    min-height: 280px;
    max-height: 420px;
}
.unified-chat-msg {
    display: flex;
    flex-direction: column;
    margin-bottom: .75rem;
    max-width: 85%;
}
.unified-chat-msg.in { align-items: flex-start; }
.unified-chat-msg.out { align-items: flex-end; margin-left: auto; }
.unified-chat-bubble {
    padding: .55rem .85rem;
    border-radius: 1rem;
    font-size: .92rem;
    line-height: 1.45;
    word-break: break-word;
}
.unified-chat-msg.in .unified-chat-bubble {
    background: #fff;
    border: 1px solid #e2e8f0;
}
.unified-chat-msg.out .unified-chat-bubble {
    background: #06c755;
    color: #fff;
}
.unified-chat-time { margin-top: .15rem; font-size: .72rem; }

/* Chat — ตั้งค่าง่าย Messenger */
.chat-easy-steps { display: flex; flex-direction: column; gap: 1rem; }
.chat-easy-step {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.chat-easy-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0084ff;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
}
.chat-easy-step-body { min-width: 0; flex: 1; }
.chat-badge-easy { background: #dbeafe; color: #1d4ed8; }
.chat-channel-easy { border-color: #93c5fd; }

/* Dashboard CTA Banner */
.dashboard-cta-banner {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.dashboard-cta-banner a { color: #fff; font-weight: 600; }

/* Course cards */
.course-card { transition: transform .15s; }
.course-card:active { transform: scale(.98); }

/* Mobile form */
.mobile-form .form-control-lg { font-size: 1rem; }

/* Demo Trial */
.try-hero {
    background: linear-gradient(135deg, var(--primary), #1e3a5f);
    padding: 2.5rem 0;
}
.try-feature-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    height: 100%;
    transition: transform .15s, box-shadow .15s;
}
.try-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.try-feature-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: .75rem;
}
.try-feature-icon-lg {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.try-badge {
    font-size: .7rem;
    padding: .2rem .5rem;
    border-radius: 6px;
    font-weight: 600;
}
.try-badge-ok { background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.try-badge-out { background: #fef3c7; color: #92400e; }
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.try-sticky-cta {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--primary);
    padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.try-tabs-section { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
.try-nav-pills .nav-link {
    border-radius: 24px;
    padding: .5rem 1rem;
    font-size: .875rem;
    color: #64748b;
    margin: 0 .15rem;
}
.try-nav-pills .nav-link.active {
    background: var(--secondary);
}
.try-step-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.try-step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.try-step-text { padding-top: .25rem; }
.try-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #64748b;
}
.mock-phone {
    max-width: 280px;
    margin: 0 auto;
    background: var(--primary);
    border-radius: 24px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
.mock-phone-screen {
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    min-height: 200px;
}
.mock-doc-bar {
    background: var(--secondary);
    color: #fff;
    padding: .5rem 1rem;
    font-size: .85rem;
}
.mock-line {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 8px;
}
.mock-line.short { width: 60%; }
.mock-fb-post {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .75rem;
}
.mock-pos-total {
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: .5rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
}
.demo-doc-preview {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
}
.demo-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: .75rem;
    margin-bottom: .75rem;
}
.demo-doc-meta { font-size: .85rem; margin-bottom: 1rem; }
.demo-doc-table { font-size: .85rem; margin-bottom: 0; }

/* Try Documents Builder */
.try-doc-builder .try-doc-section .card-header { font-size: .9rem; padding: .65rem 1rem; }
.try-doc-logo-lock {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}
.try-lock-badge {
    font-size: .75rem;
    color: #64748b;
    background: #fff;
    padding: .2rem .5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.try-product-chip { font-size: .75rem; }
.try-doc-item-row .item-line-total { font-size: .8rem; }
.try-doc-totals { font-size: .9rem; }
.try-vat-lock .form-check-input:disabled { opacity: 1; }
.demo-doc-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: .75rem;
    margin-bottom: .75rem;
}
.demo-doc-title-box { text-align: right; }
.demo-doc-type-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
}
.demo-doc-summary {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid #e2e8f0;
    font-size: .9rem;
}
.demo-doc-grand {
    font-size: 1.05rem;
    margin-top: .35rem;
    padding-top: .35rem;
    border-top: 1px dashed #e2e8f0;
}
.demo-doc-watermark { font-style: italic; }
.try-doc-preview-wrap .demo-doc-preview { min-height: 400px; }

/* Try Documents v3 — /try/documents?tab=demo */
.try-demo-wrap-doc {
    background: linear-gradient(180deg, #f1f5f9 0%, #fff 12rem);
    border-radius: var(--genz-radius-sm);
    padding: 0;
}
.try-demo-wrap-doc-inner { padding: 1rem 0 0; }
.try-doc-v3 { --doc-accent: #0d9488; --doc-border: #e2e8f0; }
.try-doc-alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.try-doc-alert-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.try-doc-alert-warn i { font-size: 1.1rem; margin-top: .1rem; }
.try-doc-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--doc-border);
    border-radius: 16px;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, .04);
}
.try-doc-topbar-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin-bottom: .5rem;
}
.try-doc-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.try-doc-type-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .85rem;
    border: 1px solid var(--doc-border);
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: .8rem;
    font-weight: 600;
    transition: all .2s ease;
    cursor: pointer;
}
.try-doc-type-pill:hover:not(:disabled) {
    border-color: var(--doc-accent);
    color: var(--doc-accent);
}
.try-doc-type-pill.active {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(13, 148, 136, .35);
}
.try-doc-type-pill:disabled { opacity: .55; cursor: not-allowed; }
.try-doc-topbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}
.try-doc-quota-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .5rem;
    font-size: .8rem;
    color: #475569;
    padding: .4rem .75rem;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 10px;
}
.try-doc-quota-chip i { color: var(--doc-accent); }
.try-doc-quota-track {
    width: 72px;
    height: 4px;
    background: #ccfbf1;
    border-radius: 4px;
    overflow: hidden;
}
.try-doc-quota-fill {
    height: 100%;
    background: var(--doc-accent);
    border-radius: 4px;
    transition: width .3s ease;
}
.try-doc-date-field {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .65rem;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    background: #fff;
    font-size: .85rem;
    color: #64748b;
    margin: 0;
}
.try-doc-date-field input {
    border: 0;
    padding: 0;
    font-size: .85rem;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    width: 8.5rem;
}
.try-doc-block {
    background: #fff;
    border: 1px solid var(--doc-border);
    border-radius: 14px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .03);
}
.try-doc-block-head {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.15rem .5rem;
}
.try-doc-step {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0f172a, #334155);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.try-doc-block-title {
    font-size: .95rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
}
.try-doc-block-sub {
    font-size: .78rem;
    color: #64748b;
    margin: .15rem 0 0;
}
.try-doc-add-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    color: var(--doc-accent);
}
.try-doc-add-btn:hover { background: var(--doc-accent); color: #fff; border-color: var(--doc-accent); }
.try-doc-block-body { padding: 0 1.15rem 1.15rem; }
.try-doc-logo-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .65rem;
    padding: .65rem .85rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    margin-bottom: .85rem;
}
.try-doc-lock-tag {
    font-size: .72rem;
    color: #64748b;
    background: #fff;
    padding: .25rem .55rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.try-doc-field { margin-bottom: .75rem; }
.try-doc-field label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: .3rem;
}
.try-doc-field .form-control {
    border-radius: 10px;
    border-color: #e2e8f0;
    font-size: .9rem;
}
.try-doc-field .form-control:focus {
    border-color: var(--doc-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.try-doc-chips-wrap {
    padding: 0 1.15rem .65rem;
}
.try-doc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.try-doc-chips .try-product-chip {
    font-size: .75rem;
    font-weight: 600;
    padding: .35rem .65rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    transition: all .15s ease;
}
.try-doc-chips .try-product-chip:hover {
    border-color: var(--doc-accent);
    color: var(--doc-accent);
    background: #f0fdfa;
}
.try-doc-items-list { padding: 0 .65rem; }
.try-doc-item-row {
    padding: .85rem .75rem;
    margin-bottom: .5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.try-doc-item-row .item-name { font-weight: 600; }
.try-doc-item-labels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .35rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #94a3b8;
    margin-top: .5rem;
    margin-bottom: .2rem;
}
.try-doc-item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .35rem;
}
.try-doc-item-actions {
    display: flex;
    gap: .35rem;
    margin-top: .5rem;
    justify-content: flex-end;
}
.try-doc-item-actions .btn { padding: .2rem .45rem; font-size: .75rem; border-radius: 6px; }
.try-doc-summary-bar {
    padding: 1rem 1.15rem;
    background: #f8fafc;
    border-top: 1px solid var(--doc-border);
}
.try-doc-vat-note {
    font-size: .75rem;
    color: #64748b;
    margin-bottom: .65rem;
}
.try-doc-summary-lines { font-size: .88rem; }
.try-doc-summary-line {
    display: flex;
    justify-content: space-between;
    padding: .2rem 0;
}
.try-doc-summary-line.muted { color: #64748b; }
.try-doc-summary-line.grand {
    margin-top: .35rem;
    padding-top: .5rem;
    border-top: 1px dashed #cbd5e1;
    font-size: 1rem;
}
.try-doc-summary-line.grand strong { color: var(--doc-accent); }
.try-doc-generate-btn {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    padding: 1rem 1.25rem;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #0d9488 100%);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .2);
    transition: transform .2s ease, box-shadow .2s ease;
}
.try-doc-generate-btn i { font-size: 1.35rem; }
.try-doc-generate-btn small { font-size: .72rem; font-weight: 500; opacity: .85; }
.try-doc-generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(13, 148, 136, .35);
    color: #fff;
}
.try-doc-generate-btn:disabled { opacity: .55; transform: none; }
.try-doc-preview-panel { top: 5.5rem; }
.try-doc-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}
.try-doc-live-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #0d9488;
    margin-bottom: .25rem;
}
.try-doc-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    animation: try-doc-pulse 1.5s ease infinite;
}
@keyframes try-doc-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(.85); }
}
.try-doc-preview-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
}
.try-doc-preview-actions {
    display: flex;
    gap: .35rem;
    flex-shrink: 0;
}
.try-doc-action-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    background: #fff;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}
.try-doc-action-btn:hover { border-color: #94a3b8; background: #f8fafc; }
.try-doc-action-btn.line:hover { background: #06c755; border-color: #06c755; color: #fff; }
.try-doc-action-btn.wa:hover { background: #25d366; border-color: #25d366; color: #fff; }
.try-doc-paper-wrap {
    padding: 1rem;
    background: linear-gradient(145deg, #e2e8f0, #f1f5f9);
    border-radius: 16px;
    border: 1px solid #cbd5e1;
}
.try-doc-paper {
    background: #fff;
    border-radius: 8px;
    min-height: 480px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .12), 0 0 0 1px rgba(15, 23, 42, .04);
    padding: 1.25rem;
    overflow: auto;
}
.try-doc-paper .demo-doc-preview-inner { padding: .25rem; }
.try-doc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    text-align: center;
    color: #94a3b8;
}
.try-doc-empty i { font-size: 3rem; margin-bottom: 1rem; opacity: .5; }
.try-doc-empty p { margin: 0; font-size: .9rem; line-height: 1.5; }
#tryDocResultMsg .alert { border-radius: 10px; margin-top: .75rem; }
@media (max-width: 991.98px) {
    .try-doc-topbar { flex-direction: column; align-items: stretch; }
    .try-doc-preview-panel { position: static !important; }
    .try-doc-paper { min-height: 360px; }
    .try-doc-type-pill span { display: none; }
    .try-doc-type-pill { padding: .5rem .65rem; }
    .try-doc-type-pill i { font-size: 1.1rem; }
}

/* ===== Formal document sheet (issuer branding) ===== */
.doc-sheet {
    background: #fff;
    color: #0f172a;
    font-size: .9rem;
    line-height: 1.45;
}
.doc-sheet-print {
    padding: 14mm 12mm;
    min-height: 260mm;
    box-shadow: 0 4px 24px rgba(15, 23, 42, .12);
    border: 1px solid #e2e8f0;
}
.demo-doc-preview .doc-sheet {
    border: none;
    padding: 0;
}
.doc-sheet-header {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    border-bottom: 2px solid #1e3a5f;
    padding-bottom: .85rem;
    margin-bottom: 1rem;
}
.doc-sheet-logo {
    max-height: 56px;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: .5rem;
    display: block;
}
.doc-sheet-issuer-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}
.doc-sheet-issuer-line {
    font-size: .82rem;
    color: #475569;
    margin-top: .15rem;
}
.doc-sheet-title { text-align: right; min-width: 200px; }
.doc-sheet-type {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e3a5f;
    margin: 0 0 .35rem;
    letter-spacing: .02em;
}
.doc-sheet-meta-row {
    font-size: .85rem;
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}
.doc-sheet-subject {
    margin-bottom: .75rem;
    padding: .5rem .75rem;
    background: #f8fafc;
    border-radius: 6px;
    font-size: .88rem;
}
.doc-sheet-parties { margin-bottom: 1rem; }
.doc-sheet-party-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-bottom: .2rem;
}
.doc-sheet-party-name { font-weight: 700; font-size: 1rem; }
.doc-sheet-party-line { font-size: .85rem; color: #475569; }
.doc-sheet-table {
    font-size: .84rem;
}
.doc-sheet-table thead th {
    background: #f1f5f9;
    font-weight: 600;
    border-color: #cbd5e1 !important;
}
.doc-sheet-table td { border-color: #e2e8f0 !important; vertical-align: middle; }
.doc-sheet-summary {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}
.doc-sheet-summary-box {
    min-width: 260px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .65rem .85rem;
    background: #fafbfc;
}
.doc-sheet-sum-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .2rem 0;
    font-size: .88rem;
}
.doc-sheet-sum-grand {
    margin-top: .35rem;
    padding-top: .45rem;
    border-top: 2px solid #1e3a5f;
    font-size: 1rem;
    color: #1e3a5f;
}
.doc-sheet-notes {
    margin-top: .85rem;
    font-size: .84rem;
    color: #334155;
}
.doc-sheet-signatures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
    padding-top: 1rem;
    page-break-inside: avoid;
}
.doc-sig-block { text-align: center; min-height: 140px; }
.doc-sig-space {
    height: 56px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: .25rem;
}
.doc-sig-img { max-height: 52px; max-width: 160px; object-fit: contain; }
.doc-sig-line {
    border-bottom: 1px solid #334155;
    margin: 0 auto .45rem;
    width: 85%;
}
.doc-sig-label { font-weight: 600; font-size: .88rem; }
.doc-sig-name { font-size: .85rem; margin-top: .2rem; }
.doc-sig-title { font-size: .78rem; color: #64748b; }
.doc-sig-date { font-size: .78rem; color: #64748b; margin-top: .35rem; }
.issuer-sig-pad canvas {
    display: block;
    width: 100%;
    height: 120px;
    cursor: crosshair;
    touch-action: none;
}
@media print {
    .doc-sheet-signatures { margin-top: 2rem; }
}

/* Pricing — ทีม 1-4 คน */
.pricing-plan-card { transition: transform .2s, box-shadow .2s; }
.pricing-plan-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(15,23,42,.1) !important; }
.pricing-plan-recommended { border: 2px solid var(--secondary) !important; }
.pricing-users-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #f1f5f9;
    color: var(--secondary);
    font-weight: 600;
    font-size: .85rem;
    padding: .35rem .75rem;
    border-radius: 999px;
}
.landing-price-card { transition: transform .15s; }
.landing-price-card:hover { transform: translateY(-2px); }
.pricing-team-note { background: linear-gradient(135deg, #f8fafc, #fff); }
.billing-plan-row:last-child { border-bottom: 0 !important; }
@media print {
    body:not(.doc-print-body):not(.ctr-print-page) * { visibility: hidden; }
    .try-doc-print-area, .try-doc-print-area * { visibility: visible; }
    .try-doc-print-area { position: absolute; left: 0; top: 0; width: 100%; }
    body.doc-print-body, body.doc-print-body *, body.ctr-print-page, body.ctr-print-page * { visibility: visible; }
    .demo-doc-watermark { display: none; }
}
.try-ocr-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem 1rem;
    background: #f8fafc;
}
.try-feature-header .try-feature-icon-lg { margin-top: .25rem; }

/* Try v2 */
.try-nav { border-bottom: 1px solid var(--genz-border); }
.try-hero-v2 {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #0f172a 100%);
    padding: 3rem 0 3.5rem;
}
.try-hero-pill {
    display: inline-block;
    background: rgba(0, 201, 167, .15);
    color: #5eead4;
    font-weight: 700;
    font-size: .85rem;
    padding: .4rem 1rem;
    border-radius: 999px;
}
.try-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
}
.try-hero-sub { color: rgba(255,255,255,.78); font-size: 1.05rem; max-width: 560px; }
.try-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}
.try-stat-card {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
}
.try-stat-num { font-size: 1.75rem; font-weight: 800; color: #fff; line-height: 1; }
.try-stat-label { font-size: .75rem; color: rgba(255,255,255,.65); margin-top: .35rem; }
.try-features-section { background: var(--genz-bg); }
.try-group-title { color: var(--genz-text); }
.try-feature-card-v2 { position: relative; padding-right: 2rem; }
.try-feature-card-v2:hover .try-card-arrow { opacity: 1; transform: translateX(2px); }
.try-card-arrow {
    position: absolute;
    right: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--genz-muted);
    opacity: .35;
    transition: .2s;
}
.try-sticky-cta-v2 {
    background: rgba(15, 23, 42, .96);
    backdrop-filter: blur(8px);
}
.try-feature-header-v2 { background: #fff; }
.try-quota-pill {
    font-size: .8rem;
    font-weight: 700;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, .12);
    color: var(--accent);
    white-space: nowrap;
}
.try-quota-pill-out { background: #fef3c7; color: #92400e; }
.try-nav-pills-v2 .nav-link.active { background: var(--primary); }
.try-demo-wrap { border-radius: var(--genz-radius-sm); }
.try-tabs-section-v2 { background: var(--genz-bg); }
@media (max-width: 575.98px) {
    .try-hero-stats { grid-template-columns: 1fr; }
    .try-feature-card-v2 { padding-right: 1rem; }
    .try-card-arrow { display: none; }
}

/* Legal pages */
.legal-page {
    background: linear-gradient(165deg, #f0f9ff 0%, #f8fafc 40%, #ecfdf5 100%);
    min-height: calc(100vh - 80px);
}
.legal-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem 2.25rem;
    box-shadow: 0 16px 48px rgba(15, 23, 42, .08);
    border: 1px solid rgba(59, 130, 246, .1);
}
.legal-card h1 { color: #0f172a; font-size: 1.75rem; }
.legal-body h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: .75rem;
    color: #0f172a;
}
.legal-body p, .legal-body li {
    line-height: 1.7;
    color: #334155;
}
.legal-body ul { padding-left: 1.25rem; }
.legal-body a { color: #2563eb; text-decoration: underline; }
.legal-modal .modal-content {
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, .12);
    box-shadow: 0 24px 64px rgba(15, 23, 42, .18);
}
.legal-modal .modal-body { max-height: min(70vh, 640px); }
.legal-link-btn {
    color: #2563eb !important;
    text-decoration: underline;
    font-size: inherit;
    vertical-align: baseline;
}
.legal-link-btn:hover { color: #1d4ed8 !important; }
@media (max-width: 575.98px) {
    .legal-card { padding: 1.25rem 1rem; }
}

/* ===== Platform Admin (แยกจากสมาชิก) ===== */
.admin-body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: #f0f2f8;
    min-height: 100vh;
}
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: #e2e8f0;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.admin-sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(245,158,11,.2);
    color: #fbbf24;
    padding: .4rem .75rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 700;
}
.admin-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.admin-nav-section {
    padding: .75rem 1.25rem .25rem;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    font-weight: 700;
}
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    transition: background .15s, color .15s;
}
.admin-nav-link:hover, .admin-nav-link.active {
    background: rgba(255,255,255,.06);
    color: #fff;
}
.admin-sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,.08);
}
.admin-main {
    flex: 1;
    margin-left: 0;
}
@media (min-width: 992px) {
    .admin-main { margin-left: 260px; }
}
.admin-header {
    background: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-page-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    flex: 1;
}
.admin-content { padding: 1.5rem; }
.admin-alert {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: .75rem 1rem;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
}
.admin-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.admin-card-head {
    padding: .85rem 1.25rem;
    font-weight: 700;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.admin-card-body { padding: 1.25rem; }
.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .85rem 1rem;
    margin-bottom: .5rem;
}
.admin-tabs .nav-link {
    font-weight: 700;
    font-size: .9rem;
    color: #64748b;
    border-radius: 999px;
    padding: .5rem 1rem;
}
.admin-tabs .nav-link.active {
    background: #1a1a2e;
    color: #fff;
}
.btn-admin-primary {
    background: #1a1a2e;
    color: #fff;
    font-weight: 700;
    border: none;
}
.btn-admin-primary:hover {
    background: #16213e;
    color: #fff;
}
.admin-offcanvas { background: #1a1a2e; color: #fff; }
.admin-offcanvas .btn-close { filter: invert(1); }
.admin-offcanvas .admin-nav-link { color: #cbd5e1; }
.admin-menu-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }

/* Blog */
.blog-hero { background: linear-gradient(180deg, #f8fafc 0%, #fff 100%); }
.blog-badge { background: rgba(0, 201, 167, .12); color: #0d9488; font-weight: 700; }
.blog-hero-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; }
.blog-hero-lead { color: var(--genz-muted); max-width: 640px; }
.blog-cat-pill {
    display: inline-block;
    padding: .4rem .9rem;
    border-radius: 999px;
    border: 1px solid var(--genz-border);
    color: var(--genz-muted);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: .2s;
}
.blog-cat-pill:hover, .blog-cat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.blog-card {
    display: block;
    background: #fff;
    border: 1px solid var(--genz-border);
    border-radius: var(--genz-radius-sm);
    overflow: hidden;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}
.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}
.blog-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
}
.blog-card-featured .blog-card-img { height: 200px; }
.blog-card-body { padding: 1.25rem; }
.blog-cat-label {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    color: var(--genz-mint);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .5rem;
}
.blog-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--genz-text);
    line-height: 1.4;
    margin-bottom: .5rem;
}
.blog-card-excerpt {
    font-size: .9rem;
    color: var(--genz-muted);
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-article-cover {
    height: 320px;
    background-size: cover;
    background-position: center;
}
.blog-article-header { max-width: 800px; }
.blog-article-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}
.blog-article-lead { font-size: 1.15rem; color: var(--genz-muted); }
.blog-article-body { font-size: 1.05rem; line-height: 1.8; }
.blog-article-body h2 { font-size: 1.35rem; font-weight: 800; margin-top: 2rem; margin-bottom: .75rem; }
.blog-article-body p { margin-bottom: 1rem; }
.blog-article-body a { color: var(--secondary); font-weight: 600; }
.blog-article-cta { background: #f8fafc; border: 1px solid var(--genz-border); }
.site-footer { background: #f8fafc; border-top: 1px solid var(--genz-border); }

/* Landing — บทความล่าสุด */
.landing-blog { overflow: hidden; }
.landing-blog-head .genz-h2 { margin-bottom: .35rem; }
.genz-pill-teal { background: rgba(13, 148, 136, .12); color: #0d9488; }
.landing-blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--genz-border);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.landing-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .1);
    border-color: rgba(0, 201, 167, .35);
}
.landing-blog-card-hero { flex-direction: row; }
@media (max-width: 991.98px) {
    .landing-blog-card-hero { flex-direction: column; }
}
.landing-blog-card-img-wrap {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.landing-blog-card-hero .landing-blog-card-img-wrap {
    width: 52%;
    min-height: 280px;
}
@media (max-width: 991.98px) {
    .landing-blog-card-hero .landing-blog-card-img-wrap { width: 100%; min-height: 200px; }
}
.landing-blog-card:not(.landing-blog-card-hero) .landing-blog-card-img-wrap {
    aspect-ratio: 16 / 10;
}
.landing-blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.landing-blog-card:hover .landing-blog-card-img { transform: scale(1.04); }
.landing-blog-cat {
    position: absolute;
    top: .85rem;
    left: .85rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .3rem .65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #0d9488;
    backdrop-filter: blur(6px);
}
.landing-blog-card-body {
    padding: 1.25rem 1.35rem 1.35rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.landing-blog-card-hero .landing-blog-card-body {
    padding: 1.5rem 1.75rem;
    justify-content: center;
}
.landing-blog-date {
    font-size: .8rem;
    color: var(--genz-muted);
    margin-bottom: .4rem;
}
.landing-blog-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--genz-text);
    line-height: 1.35;
    margin: 0 0 .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.landing-blog-card-hero .landing-blog-title {
    font-size: clamp(1.2rem, 2.5vw, 1.55rem);
    -webkit-line-clamp: 3;
}
.landing-blog-excerpt {
    font-size: .9rem;
    color: var(--genz-muted);
    line-height: 1.55;
    margin: 0 0 .75rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.landing-blog-card-hero .landing-blog-excerpt { -webkit-line-clamp: 3; }
.landing-blog-more {
    font-size: .85rem;
    font-weight: 700;
    color: #0d9488;
    margin-top: auto;
}
.landing-blog-card:hover .landing-blog-more i { transform: translateX(3px); }
.landing-blog-more i { transition: transform .2s ease; display: inline-block; }

/* DMS Hub — ศูนย์เอกสาร */
.dms-hub { max-width: 1200px; width: 100%; min-width: 0; }

.dms-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #2563eb 100%);
    color: #fff;
}
.dms-hero-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 .25rem; letter-spacing: -.02em; }
.dms-hero-sub { margin: 0; font-size: .9rem; opacity: .85; }
.dms-hero-actions .btn-light { font-weight: 600; color: #0f172a; }

.dms-company-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1.1rem;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.dms-company-info { display: flex; align-items: center; gap: .75rem; }
.dms-company-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: #eff6ff; color: #2563eb;
    border-radius: 10px; font-size: 1.1rem;
}
.dms-company-name { font-weight: 700; font-size: .95rem; color: #0f172a; }
.dms-company-meta { font-size: .78rem; color: #64748b; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.dms-badge { font-size: .7rem; font-weight: 600; padding: .15em .55em; border-radius: 6px; }
.dms-badge-vat { background: #d1fae5; color: #047857; }
.dms-badge-novat { background: #f1f5f9; color: #64748b; }
.dms-company-actions { display: flex; align-items: center; gap: .75rem; }
.dms-company-select { min-width: 180px; border-color: #e2e8f0; }
.dms-company-limit { font-size: .75rem; color: #94a3b8; white-space: nowrap; }

.dms-stepper {
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
}
.dms-stepper-track { display: flex; align-items: center; gap: 0; min-width: 0; }
a.dms-step {
    text-decoration: none;
    color: inherit;
}
.dms-step {
    display: flex; align-items: center; gap: .65rem;
    flex: 1; min-width: 0;
    padding: .65rem .85rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    text-align: left;
}
.dms-step:hover { border-color: #93c5fd; background: #f8fafc; }
.dms-step.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.dms-step.is-done:not(.is-active) .dms-step-num { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.dms-step-num {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 800;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
}
.dms-step.is-active .dms-step-num { background: #2563eb; border-color: #2563eb; color: #fff; }
.dms-step-body { min-width: 0; }
.dms-step-title { display: block; font-size: .82rem; font-weight: 700; color: #0f172a; }
.dms-step-desc { display: block; font-size: .7rem; color: #94a3b8; }
.dms-step-line { flex: 0 0 20px; height: 2px; background: #e2e8f0; margin: 0 .35rem; }

.dms-callout {
    display: flex; gap: .85rem; align-items: flex-start;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
}
.dms-callout i { font-size: 1.25rem; flex-shrink: 0; margin-top: .1rem; }
.dms-callout-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.dms-quick-create {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding: .75rem 1rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}
.dms-quick-label { font-size: .75rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; margin-right: .25rem; }
.dms-quick-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .45rem .85rem;
    font-size: .82rem; font-weight: 600;
    color: #1e40af;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.dms-quick-btn:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.dms-quick-btn i { font-size: 1rem; }

.dms-kpi {
    display: flex; align-items: center; gap: .85rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    height: 100%;
}
.dms-kpi-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.dms-kpi-num { font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: #0f172a; }
.dms-kpi-label { font-size: .72rem; color: #64748b; font-weight: 500; }
.dms-kpi-revenue { background: linear-gradient(135deg, #f0fdf4, #fff); border-color: #bbf7d0; }

.dms-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.dms-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.15rem;
    font-weight: 700; font-size: .9rem;
    color: #0f172a;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.dms-panel-body { padding: 1.15rem; }

.dms-cat-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.dms-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .75rem;
    font-size: .78rem; font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    text-decoration: none;
    transition: all .15s;
}
.dms-chip:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.dms-chip.active { background: #2563eb; border-color: #2563eb; color: #fff; }

.dms-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}
.dms-empty i { font-size: 2.5rem; opacity: .35; display: block; margin-bottom: .75rem; }

.dms-doc-table { }
.dms-doc-thead {
    display: grid;
    grid-template-columns: 1.4fr 1fr .7fr .8fr;
    gap: .5rem;
    padding: .5rem 1.15rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.dms-doc-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: .25rem;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background .12s;
}
@media (min-width: 768px) {
    .dms-doc-item {
        grid-template-columns: 1.4fr 1fr .7fr .8fr;
        align-items: center;
        gap: .5rem;
    }
}
.dms-doc-item:hover { background: #f8fafc; }
.dms-doc-item:last-child { border-bottom: none; }
.dms-doc-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    min-width: 0;
}
.dms-doc-type {
    font-size: .68rem; font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: .1em .45em;
    border-radius: 4px;
    margin-left: .35rem;
}
.dms-doc-no {
    font-weight: 700;
    font-size: .92rem;
    color: #0f172a;
    margin-top: .2rem;
    word-break: break-word;
    flex: 1 1 100%;
}
.dms-doc-customer { font-size: .85rem; color: #475569; }
.dms-doc-date { font-size: .85rem; color: #64748b; }
.dms-doc-amount { font-weight: 800; font-size: .95rem; color: #047857; text-align: right; }
.dms-doc-mobile-meta { grid-column: 1 / -1; }

.dms-activity-list { padding: .5rem 0; }
.dms-activity-item {
    display: flex; gap: .75rem;
    padding: .65rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
}
.dms-activity-item:last-child { border-bottom: none; }
.dms-activity-dot {
    width: 8px; height: 8px;
    margin-top: .45rem;
    border-radius: 50%;
    background: #2563eb;
    flex-shrink: 0;
}
.dms-activity-text { font-size: .82rem; color: #334155; }
.dms-activity-time { font-size: .72rem; color: #94a3b8; margin-top: .15rem; }

/* legacy DMS */
.dms-stat-card {
    background: #fff;
    border: 1px solid var(--genz-border);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    height: 100%;
}
.dms-stat-num { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.dms-stat-label { font-size: .75rem; color: var(--genz-muted); margin-top: .25rem; }
.dms-stat-icon { font-size: 1.25rem; margin-bottom: .35rem; }
.dms-stat-revenue { background: linear-gradient(135deg, #f0fdf4, #fff); border-color: #bbf7d0; }
.dms-doc-row { transition: background .15s; }
.dms-doc-row:hover { background: #f8fafc; }
.doc-item-row .item-line-total { font-size: .85rem; }

@media (max-width: 575.98px) {
    .dms-hero {
        padding: 1.15rem;
        flex-direction: column;
        align-items: stretch;
    }
    .dms-hero-main { min-width: 0; }
    .dms-hero-sub { font-size: .82rem; line-height: 1.45; }
    .dms-hero-actions { width: 100%; }
    .dms-hero-actions .dropdown,
    .dms-hero-actions .btn { width: 100%; }
    .dms-hero-title { font-size: 1.25rem; }
    .dms-step-desc { display: none; }
    .dms-step { padding: .5rem .55rem; min-width: 0; }
    .dms-step-title { font-size: .75rem; white-space: nowrap; }
    .dms-step-line { flex: 0 0 8px; margin: 0 .2rem; }
    .dms-quick-create { gap: .4rem; }
    .dms-quick-btn { flex: 1 1 calc(50% - .25rem); justify-content: center; min-width: 0; }
    .dms-quick-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dms-kpi { padding: .75rem .85rem; gap: .6rem; }
    .dms-kpi-num { font-size: 1.1rem; }
    .dms-kpi-icon { width: 38px; height: 38px; font-size: 1rem; }
    .dms-doc-main { min-width: 0; }
    .dms-doc-amount { font-size: .88rem; }
    .dms-company-bar { padding: .75rem; }
    .dms-company-select { min-width: 0; width: 100%; max-width: 100%; }
    .dms-company-actions { width: 100%; flex-wrap: wrap; }
}

/* ===== Contrast / Readability fixes ===== */
.text-muted { color: #64748b !important; }
.small.text-muted, .form-text { color: #64748b !important; }

.badge.bg-secondary-subtle,
.badge.bg-secondary-subtle.text-secondary {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}
.badge.bg-warning-subtle,
.badge.bg-warning-subtle.text-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}
.badge.bg-info-subtle,
.badge.bg-info-subtle.text-info {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
}
.badge.bg-primary-subtle,
.badge.bg-primary-subtle.text-primary {
    background-color: #dbeafe !important;
    color: #1d4ed8 !important;
}
.badge.bg-success-subtle,
.badge.bg-success-subtle.text-success {
    background-color: #d1fae5 !important;
    color: #047857 !important;
}
.badge.bg-danger-subtle,
.badge.bg-danger-subtle.text-danger {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}
.badge.bg-light.text-muted {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}
.badge.bg-light.text-dark { color: #1e293b !important; }

.sidebar-section { color: #94a3b8 !important; }

.btn-outline-secondary {
    --bs-btn-color: #475569;
    --bs-btn-border-color: #94a3b8;
}
.btn-outline-secondary:hover {
    --bs-btn-color: #0f172a;
    background-color: #f8fafc;
}

.card-header.bg-white,
.card-header.bg-white strong,
.card-header.bg-white .fw-bold { color: #0f172a; }

.dms-stat-label { color: #64748b !important; }
.dms-stat-num { color: #0f172a; }

.doc-status-badge {
    display: inline-block;
    font-weight: 600;
    font-size: .75rem;
    padding: .35em .65em;
    border-radius: 6px;
    line-height: 1.2;
}
.doc-status-draft { background: #f1f5f9; color: #475569; }
.doc-status-submitted,
.doc-status-sent { background: #dbeafe; color: #1d4ed8; }
.doc-status-pending_approval { background: #fef3c7; color: #92400e; }
.doc-status-approved,
.doc-status-paid { background: #d1fae5; color: #047857; }
.doc-status-rejected,
.doc-status-overdue { background: #fee2e2; color: #b91c1c; }
.doc-status-cancelled,
.doc-status-void,
.doc-status-partial { background: #e2e8f0; color: #334155; }

.site-nav .site-logo-nav,
.auth-card .site-logo,
.auth-card .brand-logo {
    filter: none;
}

.dashboard-header .page-title,
.dashboard-content h2,
.dashboard-content h4,
.dashboard-content h5 { color: #0f172a; }

.list-group-item-action { color: #0f172a; }
.list-group-item-action .text-muted { color: #64748b !important; }

/* ===== PromptPay QR Module ===== */
.pp-page .pp-card { border-radius: 16px; }
.pp-amount-input { font-size: 1.5rem !important; font-weight: 700; text-align: center; }
.pp-generate-btn { border-radius: 12px; min-height: 52px; }
.pp-qr-preview-card { border-radius: 16px; min-height: 420px; }
.pp-qr-image-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    max-width: 320px;
    box-shadow: 0 8px 24px rgba(15,23,42,.08);
}
.pp-qr-image { width: 100%; height: auto; display: block; }
.pp-qr-placeholder { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pp-pdf-section { background: #f8fafc; page-break-inside: avoid; }
@media (max-width: 767px) {
    .pp-amount-input { font-size: 2rem !important; }
    .pp-generate-btn { font-size: 1.1rem; min-height: 56px; }
    .pp-qr-preview-card { min-height: auto; }
    .pp-qr-actions .btn { flex: 1 1 45%; }
}
@media print {
    .pp-qr-actions, .sidebar, .dashboard-header, .no-print { display: none !important; }
    .pp-qr-image-wrap { box-shadow: none; border: 1px solid #ccc; }
}

/* ===== Loan calculator ===== */
.loan-calc-page { max-width: 1100px; margin: 0 auto; }
.loan-calc-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.loan-calc-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(217, 119, 6, .35);
}
.loan-calc-hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}
.loan-calc-hero-sub {
    font-size: .9rem;
    color: #475569;
    margin-top: .15rem;
}
.loan-stat-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
}
.loan-stat-primary .fs-3 { line-height: 1.2; }
.loan-schedule-table th,
.loan-schedule-table td { font-size: .85rem; white-space: nowrap; }
.loan-money-input { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
#resMonthly, #resInterest, #resTotal, #resPrincipal { font-variant-numeric: tabular-nums; }
.loan-calc-public-section {
    padding-top: 2rem;
    padding-bottom: 4rem;
    background: var(--genz-bg, #eef2f8);
    min-height: 60vh;
}
.loan-register-cta-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .25);
}
.loan-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    padding: .75rem 0;
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(135deg, #0f172a, #1e293b);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .15);
}

/* ===== LINE group pairing ===== */
.line-pair-code-box {
    padding: .75rem 1rem;
    background: #ecfdf5;
    border: 2px solid #6ee7b7;
    border-radius: 12px;
}
.line-pair-code {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: .15em;
    color: #047857;
    font-family: ui-monospace, monospace;
}

/* ===== Accounting / Expenses ===== */
.acct-page { max-width: 1100px; margin: 0 auto; }
.acct-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.acct-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(5, 150, 105, .35);
}
.acct-hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}
.acct-hero-sub {
    font-size: .9rem;
    color: #475569;
    margin-top: .15rem;
}
.acct-stat-card .fs-4 { line-height: 1.2; }
.acct-upload-zone { min-height: 140px; }
.acct-expense-list { border-top: 1px solid #e2e8f0; }
.acct-expense-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.acct-expense-item:hover { background: #f8fafc; }
.acct-expense-thumb-wrap { flex-shrink: 0; text-decoration: none; }
.acct-expense-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    display: block;
}
.acct-expense-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 1.25rem;
}
.acct-expense-title {
    font-weight: 600;
    color: #0f172a;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.acct-expense-meta {
    font-size: .78rem;
    color: #64748b;
    margin-top: .15rem;
}
.acct-expense-amount {
    flex-shrink: 0;
    font-size: .95rem;
    white-space: nowrap;
}
.acct-expense-delete { flex-shrink: 0; }
.acct-receipt-full { max-height: 70vh; object-fit: contain; }
.acct-detail-amount { font-size: 2rem; font-weight: 800; }
.acct-detail-list dt { color: #64748b; font-weight: 500; }
.acct-detail-list dd { color: #0f172a; }

/* ===== Slip Verification ===== */
.slip-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    overflow: hidden;
}
.slip-upload-zone:hover { border-color: var(--secondary, #6366f1); background: #f1f5f9; }
.slip-upload-zone img { max-height: 360px; object-fit: contain; }
.slip-trust-ring {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #22c55e;
    background: #f0fdf4;
    line-height: 1.1;
}
.slip-trust-ring[data-score^="0"],
.slip-trust-ring[data-score^="1"],
.slip-trust-ring[data-score^="2"],
.slip-trust-ring[data-score^="3"] { border-color: #ef4444; background: #fef2f2; }
.slip-trust-ring[data-score^="4"],
.slip-trust-ring[data-score^="5"] { border-color: #f59e0b; background: #fffbeb; }
.slip-result-image { max-height: 70vh; object-fit: contain; }

/* ===== Dashboard company switcher ===== */
.dashboard-company-bar {
    margin-bottom: 1.25rem;
}
@media (max-width: 575.98px) {
    .dashboard-company-bar .dms-company-actions {
        width: 100%;
    }
    .dashboard-company-bar .dms-company-select {
        flex: 1;
        min-width: 0;
    }
}
.dashboard-chart-empty {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
}

/* Dashboard setup panel */
.dashboard-setup-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.dashboard-setup-links li {
    margin-bottom: .5rem;
}
.dashboard-setup-links a {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #334155;
    text-decoration: none;
    font-size: .9rem;
    padding: .45rem 0;
}
.dashboard-setup-links a:hover {
    color: var(--secondary);
}
.dashboard-setup-checklist li {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem 0;
    font-size: .88rem;
    color: #64748b;
}
.dashboard-setup-checklist li.done {
    color: #0f172a;
}
.nav-company-trigger-logo--setup {
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.1rem;
}
.nav-company-trigger--setup {
    border-color: #bfdbfe;
    background: #f8fafc;
}

/* ===== Document footer (issuer only — no platform branding) ===== */
.doc-sheet-footer {
    margin-top: 1.25rem;
    padding-top: .45rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: .68rem;
    color: #94a3b8;
    letter-spacing: .01em;
}

/* ===== Mobile app-like dashboard ===== */
.tsu-mobile-app {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}
@media (max-width: 991.98px) {
    .tsu-mobile-app {
        overflow-x: hidden;
        max-width: 100vw;
    }
    .tsu-mobile-app .dashboard-wrapper,
    .tsu-mobile-app .dashboard-main,
    .tsu-mobile-app .dashboard-content {
        max-width: 100%;
        min-width: 0;
    }
    .tsu-mobile-app .dashboard-main {
        overflow-x: hidden;
    }
    .tsu-mobile-app .dashboard-header {
        padding: .65rem 1rem;
        padding-top: calc(.65rem + env(safe-area-inset-top, 0px));
        backdrop-filter: blur(12px);
        background: rgba(255, 255, 255, .92);
        box-shadow: 0 1px 0 rgba(15, 23, 42, .06);
        gap: .5rem;
    }
    .tsu-mobile-app .nav-company-trigger {
        max-width: min(200px, 46vw);
        padding: .3rem .5rem .3rem .35rem;
    }
    .tsu-mobile-app .nav-company-trigger-text {
        display: none;
    }
    .tsu-mobile-app .nav-company-trigger-logo {
        width: 34px;
        height: 34px;
    }
    .tsu-mobile-app .page-title {
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .tsu-mobile-app .dashboard-content {
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
    .tsu-mobile-app .card {
        border-radius: 14px;
    }
    .tsu-mobile-app .btn,
    .tsu-mobile-app .form-control,
    .tsu-mobile-app .form-select {
        min-height: 44px;
    }
    .tsu-mobile-app .mobile-bottom-nav {
        backdrop-filter: blur(16px);
        background: rgba(255, 255, 255, .94);
        border-top: 1px solid rgba(226, 232, 240, .9);
    }
    .tsu-mobile-app .mobile-bottom-nav .nav-item {
        border-radius: 12px;
        transition: color .15s, background .15s;
    }
    .tsu-mobile-app .mobile-bottom-nav .nav-item.active {
        color: var(--secondary);
        background: rgba(37, 99, 235, .08);
    }
    .tsu-mobile-app .mobile-bottom-nav .nav-item span {
        font-weight: 600;
        font-size: .65rem;
    }
    .tsu-mobile-app .dms-hero {
        border-radius: 16px;
    }
    .tsu-mobile-app .dms-stepper {
        margin-left: -.25rem;
        margin-right: -.25rem;
        padding-left: .25rem;
        padding-right: .25rem;
    }
    .tsu-mobile-app .dms-stepper-track {
        width: max-content;
        min-width: 100%;
        scroll-snap-type: x proximity;
        padding-bottom: .25rem;
    }
    .tsu-mobile-app .dms-step {
        scroll-snap-align: start;
        flex: 0 0 auto;
        min-width: 4.5rem;
    }
    .tsu-mobile-app .dms-step-line {
        flex: 0 0 6px;
    }
    .tsu-mobile-app .issuer-sig-pad canvas {
        width: 100%;
        height: 120px;
    }
    .dash-app-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: .5rem;
    }
    .dash-app-tile { padding: .75rem .35rem; }
    .dash-app-icon { width: 42px; height: 42px; font-size: 1.15rem; border-radius: 12px; }
    .dash-app-sub { display: none; }
    .dash-kpi-value { font-size: 1rem; }
    .dash-welcome-title { font-size: 1.15rem; }
}

/* Contracts module */
.ctr-hub { max-width: 1100px; width: 100%; min-width: 0; }
.ctr-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .5rem;
}
.ctr-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .85rem .5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: #1e40af;
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    transition: background .15s, border-color .15s;
}
.ctr-type-card i { font-size: 1.35rem; }
.ctr-type-card:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.ctr-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
}
.ctr-list-item:hover { background: #f8fafc; }
.ctr-list-item:last-child { border-bottom: none; }
.ctr-list-main { min-width: 0; }
.ctr-list-title { font-weight: 700; font-size: .92rem; margin: .2rem 0; }
.ctr-doc-sheet { border-radius: 14px; }
.ctr-content { line-height: 1.65; font-size: .92rem; }
.ctr-content h1, .ctr-content h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: .75rem; }
.ctr-sig-img { max-height: 72px; max-width: 200px; display: block; margin: 0 auto; }
.ctr-thai-doc {
    font-family: 'Sarabun', 'TH Sarabun New', 'Angsana New', serif;
    font-size: 1.05rem;
    line-height: 1.75;
    color: #0f172a;
    text-align: justify;
}
.ctr-thai-title {
    text-align: center;
    font-size: 1.35rem !important;
    font-weight: 700;
    letter-spacing: .02em;
    margin-bottom: 1rem !important;
}
.ctr-thai-lead { text-indent: 2.5rem; margin-bottom: .35rem; }
.ctr-thai-clause { text-indent: 2.5rem; margin-bottom: .65rem; }
.ctr-thai-indent { margin-left: 3.5rem; margin-bottom: .35rem; }
.ctr-thai-closing { text-indent: 2.5rem; margin-top: 1.25rem; margin-bottom: 1.5rem; }
.ctr-thai-sigs { margin-top: 2rem; }
.ctr-thai-sigs p { margin-bottom: 2rem; text-align: center; }
.ctr-thai-sig-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    display: inline-block;
    margin-top: .35rem;
}
.ctr-sig-signer-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}
.ctr-save-bar {
    position: sticky;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid #e2e8f0;
    padding: 1rem 0;
    margin-bottom: .5rem;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .08);
    backdrop-filter: blur(6px);
}
@media (min-width: 992px) {
    .ctr-save-bar { bottom: 0; }
}
.ctr-thai-notes { margin-top: .75rem; }
.ctr-quill-editor { min-height: 360px; }
.ctr-quill-editor .ql-editor {
    font-family: 'Sarabun', 'TH Sarabun New', serif;
    font-size: 1rem;
    line-height: 1.7;
    min-height: 320px;
}
.ctr-quill-editor .ql-toolbar {
    border-top-left-radius: .375rem;
    border-top-right-radius: .375rem;
    background: #f8fafc;
}
.ctr-quill-editor .ql-container {
    border-bottom-left-radius: .375rem;
    border-bottom-right-radius: .375rem;
}
@media print {
    .ctr-thai-doc { font-size: 14pt; }
    .ctr-thai-sigs p { page-break-inside: avoid; }
}

/* Settings — Telegram setup steps */
.tg-setup-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.tg-setup-step {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}
.tg-setup-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .8rem;
    font-weight: 800;
}
.tg-setup-step strong { display: block; margin-bottom: .15rem; color: #0f172a; }
.tg-setup-step code {
    font-size: .78em;
    background: #f1f5f9;
    padding: .1em .35em;
    border-radius: 4px;
}

/* น้องกิล — NPC ความคิดเห็นมุมขวาล่าง */
.gil-npc {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    pointer-events: none;
}
.gil-npc > * { pointer-events: auto; }
.gil-npc-panel {
    width: min(320px, calc(100vw - 2rem));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .18);
    border: 1px solid rgba(226, 232, 240, .9);
    padding: 1rem 1rem 1.1rem;
    position: relative;
    animation: gilSlideUp .25s ease;
}
@keyframes gilSlideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.gil-npc-close {
    position: absolute;
    top: .5rem;
    right: .5rem;
    border: none;
    background: transparent;
    color: #64748b;
    padding: .25rem;
    line-height: 1;
}
.gil-npc-panel-head {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-right: 1.5rem;
}
.gil-npc-greeting { color: #475569; line-height: 1.45; }
.gil-stars { display: flex; gap: .35rem; }
.gil-star {
    border: none;
    background: transparent;
    padding: 0;
    color: #cbd5e1;
    font-size: 1.35rem;
    line-height: 1;
    transition: color .15s, transform .15s;
}
.gil-star:hover,
.gil-star.active { color: #fbbf24; transform: scale(1.08); }
.gil-npc-trigger {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    filter: drop-shadow(0 6px 16px rgba(37, 99, 235, .25));
    transition: transform .2s;
}
.gil-npc-trigger:hover { transform: translateY(-2px) scale(1.02); }
.gil-npc-avatar { display: block; width: 72px; height: 84px; }
.gil-avatar-svg { width: 100%; height: 100%; display: block; }
.gil-npc-bubble {
    position: absolute;
    right: calc(100% + .5rem);
    bottom: 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .45rem .65rem;
    font-size: .75rem;
    color: #334155;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
    animation: gilBubble 2.5s ease-in-out infinite;
    transition: opacity .2s ease;
}
.gil-npc-bubble.is-changing { opacity: 0; }
.gil-npc-bubble::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: 10px;
    border: 6px solid transparent;
    border-left-color: #fff;
}
@keyframes gilBubble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.gil-npc-hide {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .1);
}
.gil-npc-mini {
    position: fixed;
    right: .75rem;
    bottom: 5.5rem;
    z-index: 1039;
}
.gil-npc-mini button {
    border: none;
    background: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 4px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.gil-npc-mini .gil-avatar-svg { width: 36px; height: 42px; }
@media (max-width: 991.98px) {
    .tsu-mobile-app .gil-npc {
        bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
        right: .65rem;
    }
    .tsu-mobile-app .gil-npc-mini {
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }
    .gil-npc-bubble {
        right: 0;
        bottom: calc(100% + .4rem);
        white-space: normal;
        max-width: min(11.5rem, 52vw);
        text-align: center;
        line-height: 1.35;
        font-size: .68rem;
        padding: .4rem .55rem;
    }
    .gil-npc-bubble::after {
        right: 1.1rem;
        bottom: -5px;
        left: auto;
        border: 5px solid transparent;
        border-top-color: #fff;
        border-left-color: transparent;
    }
    .gil-npc-avatar { width: 64px; height: 74px; }
}

/* Print documents from dashboard — hide app chrome (logout, nav, etc.) */
@media print {
    .tsu-mobile-app .sidebar,
    .tsu-mobile-app .mobile-bottom-nav,
    .tsu-mobile-app .dashboard-header,
    .tsu-mobile-app .offcanvas,
    .tsu-mobile-app .no-print,
    .tsu-mobile-app .doc-print-hide,
    .gil-npc,
    .gil-npc-mini {
        display: none !important;
    }
    .tsu-mobile-app .dashboard-main {
        margin-left: 0 !important;
    }
    .tsu-mobile-app .dashboard-content {
        padding: 0 !important;
    }
    .tsu-mobile-app .doc-print-zone {
        box-shadow: none !important;
        border: none !important;
    }
    .tsu-mobile-app .doc-print-zone .card,
    .tsu-mobile-app .doc-print-zone .card-body {
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
}
