:root { --bs-body-font-family: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif; }
body, .btn, .form-control, .form-select, .tooltip, .popover { font-family: var(--bs-body-font-family); }
body { background: #f5f6f8; font-size: .925rem; }
.card { border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card-header { background: #fff; font-weight: 600; }
.table td, .table th { vertical-align: middle; }
.table-sm td, .table-sm th { padding: .35rem .5rem; }
pre.json { background: #1e1e1e; color: #d4d4d4; padding: .75rem; border-radius: .375rem; max-height: 480px; overflow: auto; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }
textarea.code { font-family: SFMono-Regular, Consolas, monospace; font-size: .8rem; }
.stat { font-size: 1.6rem; font-weight: 600; line-height: 1; }
.stat-label { font-size: .8rem; color: #6c757d; }
.flow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.flow .node { background: #fff; border: 1px solid #dee2e6; border-radius: .5rem; padding: .35rem .65rem; }
.text-mono { font-family: SFMono-Regular, Consolas, monospace; }
.nowrap { white-space: nowrap; }

/* ===== หน้าเข้าสู่ระบบ (โครงเดียวกับ WMS / OMS / Support — สีประจำ Billing: เขียวมรกต → เขียวมะนาว) ===== */
.login-page { min-height: 100vh; margin: 0; background: #f1f5f9; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 2.25rem 3rem; color: #fff;
    background: radial-gradient(circle at 15% 15%, rgba(255, 255, 255, .14), transparent 40%), linear-gradient(150deg, #1e293b 0%, #047857 55%, #65a30d 100%); }
.login-hero::after { content: ""; position: absolute; width: 28rem; height: 28rem; right: -9rem; bottom: -9rem; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.login-brand { display: flex; align-items: center; gap: .75rem; position: relative; z-index: 1; }
.login-brand img { border-radius: .7rem; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25), 0 6px 16px -6px rgba(15, 23, 42, .6); }
.login-hero-body { margin: auto 0; max-width: 34rem; position: relative; z-index: 1; }
.login-art { width: 100%; max-width: 30rem; height: auto; margin-bottom: 1.5rem; filter: drop-shadow(0 18px 30px rgba(15, 23, 42, .35)); }
.login-hero-title { font-size: clamp(1.5rem, 2.4vw, 2.1rem); font-weight: 700; margin-bottom: .5rem; }
.login-hero-text { opacity: .85; margin-bottom: 1.25rem; }
.login-features { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.login-features li { display: flex; align-items: center; gap: .6rem; }
.login-features i { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .6rem; background: rgba(255, 255, 255, .16); flex: none; transition: transform .2s ease; }
.login-features li:hover i { transform: scale(1.12) rotate(-6deg); }
.login-family { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-top: 1.5rem; font-size: .82rem; }
.login-family > span { opacity: .7; }
.login-family a { display: inline-flex; align-items: center; gap: .35rem; color: #fff; text-decoration: none; opacity: .85; }
.login-family a:hover { opacity: 1; }
.login-family img { border-radius: .45rem; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.login-panel { display: flex; flex-direction: column; padding: 1.5rem 2rem; background: var(--bs-body-bg); }
.login-top { display: flex; justify-content: flex-end; }
.login-form-wrap { width: 100%; max-width: 24rem; margin: auto; padding: 2rem 0; }
.login-logo { display: block; height: 46px; width: auto; margin-bottom: 1.75rem; }
.login-field .input-group-text { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.login-field .form-control { padding-top: .65rem; padding-bottom: .65rem; }
.login-field .form-control:focus { box-shadow: none; border-color: var(--bs-border-color); }
.login-field:focus-within { border-radius: var(--bs-border-radius); box-shadow: 0 0 0 .2rem rgba(4, 120, 87, .22); }
.login-eye { border: var(--bs-border-width) solid var(--bs-border-color); border-left: 0; color: var(--bs-secondary-color); background: var(--bs-body-bg); }
.login-submit { position: relative; overflow: hidden; background: linear-gradient(135deg, #047857, #65a30d); border: 0; box-shadow: 0 8px 18px -8px rgba(4, 120, 87, .75); }
.login-submit:hover, .login-submit:focus { background: linear-gradient(135deg, #047857, #65a30d); filter: brightness(1.06); }
.login-submit::after { content: ""; position: absolute; inset: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: skewX(-20deg); animation: login-shine 4.5s ease-in-out 1.2s infinite; }
.login-note { display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem; padding: .7rem .9rem; border-radius: .7rem; border: 1px dashed var(--bs-border-color); color: var(--bs-secondary-color); font-size: .85rem; }
.login-foot { text-align: center; }
.login-top .btn.active { background: #047857; border-color: #047857; color: #fff; }

/* เคลื่อนไหวเบา ๆ */
.login-hero { background-size: 160% 160%; animation: login-bg 18s ease-in-out infinite alternate; }
.login-hero::before { content: ""; position: absolute; width: 14rem; height: 14rem; left: -4rem; top: 30%; border-radius: 50%; background: rgba(255, 255, 255, .07); animation: login-drift 14s ease-in-out infinite alternate; }
.login-hero::after { animation: login-drift 18s ease-in-out infinite alternate-reverse; }
.login-art { animation: login-rise .8s ease-out both, login-float 6s ease-in-out .8s infinite; }
.login-hero-title, .login-hero-text, .login-features li, .login-form-wrap > * { animation: login-rise .7s ease-out both; }
.login-hero-title { animation-delay: .15s; }
.login-hero-text { animation-delay: .25s; }
.login-features li:nth-child(1) { animation-delay: .35s; }
.login-features li:nth-child(2) { animation-delay: .45s; }
.login-features li:nth-child(3) { animation-delay: .55s; }
.login-form-wrap > :nth-child(2) { animation-delay: .08s; }
.login-form-wrap > :nth-child(3) { animation-delay: .16s; }
.login-form-wrap > :nth-child(4) { animation-delay: .24s; }
@keyframes login-bg { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@keyframes login-drift { from { transform: translate(0, 0); } to { transform: translate(2.5rem, -2rem); } }
@keyframes login-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes login-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes login-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) {
    .login-hero, .login-hero::before, .login-hero::after, .login-art, .login-hero-title, .login-hero-text, .login-features li, .login-form-wrap > *, .login-submit::after { animation: none; }
}
@media (max-width: 991.98px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { padding: 1.25rem 1.25rem 2.5rem; }
    .login-hero-body { margin: 1rem 0 0; }
    .login-art, .login-features, .login-family { display: none; }
    .login-hero-title { font-size: 1.3rem; }
    .login-hero-text { margin-bottom: 0; font-size: .9rem; }
    .login-panel { margin-top: -1.25rem; border-radius: 1.25rem 1.25rem 0 0; padding: 1rem 1.25rem; position: relative; }
    .login-form-wrap { padding: 1rem 0; }
    .login-logo { display: none; }
}

/* แถบเมนู: โลโก้ */
.brand-mark { border-radius: .45rem; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); vertical-align: -6px; margin-right: .35rem; }

/* ฝั่งฟอร์ม: พื้นหลังโทนเขียวอ่อน + ลายจุด + แสงฟุ้ง, ฟอร์มอยู่ในการ์ด */
.login-panel { position: relative; overflow: hidden;
    background: radial-gradient(circle at 88% 8%, rgba(132, 204, 22, .20), transparent 38%),
                radial-gradient(circle at 8% 92%, rgba(4, 120, 87, .16), transparent 42%),
                linear-gradient(165deg, #f8fafc 0%, #f0fdf4 55%, #ecfccb 100%); }
.login-panel::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(4, 120, 87, .16) 1.1px, transparent 1.4px); background-size: 20px 20px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 45%, transparent 28%, #000 75%); mask-image: radial-gradient(ellipse at 50% 45%, transparent 28%, #000 75%); }
.login-panel::after { content: ""; position: absolute; width: 22rem; height: 22rem; right: -8rem; bottom: -8rem; border-radius: 50%; pointer-events: none;
    border: 2.5rem solid rgba(4, 120, 87, .05); }
.login-panel > * { position: relative; z-index: 1; }
.login-form-wrap { background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border: 1px solid rgba(4, 120, 87, .10); border-radius: 1.25rem;
    padding: 2.25rem 2.25rem 2rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 24px 48px -24px rgba(4, 120, 87, .35); max-width: 26rem; }
.login-note { background: #f8fafc; }
.login-top .btn-outline-secondary:not(.active) { background: rgba(255, 255, 255, .8); }
@media (max-width: 991.98px) {
    .login-form-wrap { padding: 1.5rem 1.25rem; margin: 1rem auto; box-shadow: 0 16px 32px -20px rgba(4, 120, 87, .35); }
    .login-panel::after { display: none; }
}
