:root {
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Malgun Gothic", system-ui, sans-serif;
    color: #1a1a2e;
    background: #f4f6fb;
    --date-input-width: var(--date-text-width);
    --date-text-width: 8.25rem;
    --date-picker-btn-width: 1.7rem;
    --month-input-width: 6.25rem;
    /* Shipping register 출고번호 picker; ~2 digits narrower than 10.5rem. */
    --output-no-input-width: 9.5rem;
}

* { box-sizing: border-box; }

body { margin: 0; }

.boot-fail {
    max-width: 42rem;
    margin: 3rem auto;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid #e2e4ea;
    border-radius: 8px;
    line-height: 1.55;
    color: #1a1a2e;
}
.boot-fail p { margin: 0 0 0.75rem; }
.boot-fail-kr { margin: 1rem 0 0; color: #5c6370; font-size: 0.92rem; }
.boot-fail-steps { margin: 0.35rem 0 0; padding-left: 1.35rem; }
.boot-fail-steps li { margin: 0.4rem 0; }

.page { min-height: 100vh; }

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: #1a1a2e;
    color: #fff;
}

.topbar .brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.brand-home-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    display: block;
}
.app-home-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.app-home-title .brand-home-icon {
    width: 1.45rem;
    height: 1.45rem;
}

.usage-banner {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.45;
}
.usage-banner--over {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.usage-banner--warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.usage-banner--unset {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}
.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.85rem;
    margin: 0 0 1rem;
}
.recent-menus-card {
    margin-top: 1rem;
    width: max-content;
    max-width: min(30rem, 100%);
    flex: 0 0 auto;
    padding: 0.65rem 0.75rem;
}
.recent-menus-title {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
}
.recent-menus-hint {
    display: none;
}
.recent-menus-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: 9.5rem; /* ~5 compact rows */
    overflow-y: auto;
}
.recent-menu-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.22rem 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.25;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.recent-menu-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}
.recent-menu-name {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}
.home-notice-card {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}
.home-notice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.home-notice-head h2 {
    margin: 0;
    font-size: 1.05rem;
}
.home-notice-table td,
.home-notice-table th {
    vertical-align: middle;
}
.home-notice-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    width: 1%;
}
.home-notice-actions .secondary-btn {
    flex: 0 0 auto;
}
.notice-popup-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.7rem;
    font-weight: 700;
}
.notice-popup {
    max-height: min(85vh, 40rem);
    display: flex;
    flex-direction: column;
}
.notice-popup--sm {
    width: min(28rem, 94vw);
}
.notice-popup--md {
    width: min(40rem, 94vw);
}
.notice-popup--lg {
    width: min(56rem, 96vw);
}
.notice-popup .modal-body {
    overflow: auto;
    flex: 1 1 auto;
}
.notice-popup-foot {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.55rem 1rem 0.75rem;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.notice-body {
    line-height: 1.55;
    word-break: break-word;
}
.notice-body img {
    display: none !important;
}
.notice-popup-field {
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.15rem;
}
.notice-popup-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    user-select: none;
}
.notice-popup-check--label-left {
    font-size: 0.82rem;
    font-weight: 500;
}
.notice-popup-check input[type="checkbox"] {
    width: 0.75em;
    height: 0.75em;
    margin: 0;
    flex-shrink: 0;
    accent-color: #2563eb;
    vertical-align: middle;
}
.notice-popup-check--label-left input[type="checkbox"] {
    width: 0.85em;
    height: 0.85em;
}
.notice-hide-today {
    margin-top: 0;
    font-weight: 400;
}
.notice-edit-dialog {
    width: min(44rem, 96vw);
}
.notice-edit-dialog .notice-popup-field {
    min-height: 2.4rem;
}
.notice-body-input {
    width: 100%;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9rem;
}
.usage-card h2 {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
}
.usage-card .usage-used {
    font-size: 1.35rem;
    font-weight: 700;
}
.usage-card .usage-quota {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0.15rem 0 0.55rem;
}
.usage-bar {
    height: 0.55rem;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.usage-bar > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: #2563eb;
}
.usage-card.is-warn .usage-bar > span { background: #d97706; }
.usage-card.is-over .usage-bar > span { background: #dc2626; }
.usage-card.is-unset .usage-bar { display: none; }
.usage-foot {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}
input.usage-quotas {
    width: 6.5rem;
}
.mobile-block-card {
    max-width: 26rem;
    text-align: center;
}
.mobile-block-card .subtitle {
    margin: 0;
    line-height: 1.55;
}
.data-table tr.is-over td { background: #fef2f2; }
.data-table tr.is-warn td { background: #fffbeb; }
.topbar .user { margin-left: auto; opacity: 0.85; font-size: 0.9rem; }
.app-version--topbar {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    background: #fbbf24;
    color: #1a1a2e;
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
    flex: 0 0 auto;
}
.app-version--topbar .app-version__label {
    font-weight: 700;
    opacity: 0.8;
}
.app-version--topbar .app-version__id {
    font-weight: 800;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.app-version-stale-bar {
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #f59e0b;
    padding: 0.45rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}
.login-version {
    margin: 0.85rem 0 0;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    color: #92400e;
}
.login-version__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}
.login-version strong {
    display: block;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    color: #1a1a2e;
}
.app-release-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0.55rem 1rem 0.7rem;
    text-align: center;
    background: rgba(11, 16, 32, 0.96);
    color: #ffe082;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.18);
}

.app-release-dock .beian-links {
    margin: 0 0 0.4rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.8rem;
}

.app-release-dock .beian-links a:hover {
    color: #bae6fd;
}
.app-release-dock__line {
    margin: 0;
    font-size: 0.95rem;
}
.app-release-dock__label {
    margin-right: 0.4rem;
    font-weight: 600;
    opacity: 0.9;
}
.app-release-dock__id {
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    color: #fbbf24;
}
.app-release-dock__hint {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
}
.app-release-stale {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fecaca;
}
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    opacity: 0.9;
}
.lang-switch-label { white-space: nowrap; }
.lang-switch select {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 4px;
    padding: 0.2rem 0.35rem;
    color-scheme: dark;
}

.lang-switch select option {
    background-color: #1a1a2e;
    color: #fff;
}
.link-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
}

main { padding: 1.5rem; max-width: 960px; margin: 0 auto; }

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.25rem 8.5rem;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-card {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    max-width: min(92vw, 28rem);
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.25);
    box-sizing: border-box;
}

.login-card__header {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 0.25rem;
}

.login-card__body {
    min-width: 17.5rem;
}

.login-card__header .subtitle {
    margin-bottom: 0;
}

.login-card h1 { margin: 0; font-size: 1.75rem; }
.subtitle { margin: 0.25rem 0 1.5rem; color: #666; font-size: 0.9rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.field input, .field select {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.actions { margin-top: 1.25rem; }
.primary {
    width: 100%;
    padding: 0.65rem;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.primary:disabled { opacity: 0.6; cursor: wait; }

.alert {
    background: #fee;
    color: #a00;
    padding: 0.65rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.db-status { font-size: 0.75rem; margin-top: 1rem; color: #666; }
.db-status.ok { color: #080; }
.db-status.fail { color: #a00; }

.login-links { font-size: 0.85rem; margin-top: 1.25rem; text-align: center; }
.login-links a { color: #0f3460; }

.preview-hint {
    background: #e8f0fe;
    color: #0f3460;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    text-align: left;
}

.portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem 8.5rem;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    text-align: center;
}

.portal-header h1 { margin: 0; font-size: 2.5rem; }
.portal .tagline { opacity: 0.85; margin: 0.5rem 0 2rem; }

.portal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.card-link {
    display: inline-block;
    min-width: 200px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}
.card-link.primary { background: #fff; color: #0f3460; }
.card-link.secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
}

.portal-note { margin-top: 2rem; opacity: 0.75; font-size: 0.9rem; max-width: 480px; }

.portal-platform .platform-mark {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.7;
    margin: 0 0 0.5rem;
}

.platform-intro {
    margin-top: 0.75rem;
    line-height: 1.7;
    opacity: 0.92;
    max-width: 36rem;
}

/* —— Platform marketing landing (full width) —— */
.platform-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 8.5rem;
    color: #fff;
    background:
        radial-gradient(ellipse 120% 80% at 10% -20%, rgba(56, 189, 248, 0.22), transparent 55%),
        radial-gradient(ellipse 90% 70% at 100% 0%, rgba(99, 102, 241, 0.28), transparent 50%),
        linear-gradient(155deg, #0b1020 0%, #141b3a 38%, #1a3a5c 72%, #0f2744 100%);
}

.platform-page__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.45;
}

.platform-page__glow--1 {
    width: 28rem;
    height: 28rem;
    top: 12%;
    right: 8%;
    background: #38bdf8;
}

.platform-page__glow--2 {
    width: 22rem;
    height: 22rem;
    bottom: 8%;
    left: 5%;
    background: #818cf8;
}

.platform-page__inner {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 3.5rem 2rem 2rem;
    display: grid;
    grid-template-columns: 1fr min(320px, 34%);
    gap: 2.5rem 3rem;
    align-items: start;
}

.platform-hero__badge {
    display: inline-block;
    margin: 0 0 1.25rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(125, 211, 252, 0.35);
}

.platform-hero__title-frame {
    position: relative;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    padding: 0.55rem 1.35rem 0.7rem 1.15rem;
    margin: 0;
}

.platform-hero__title-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.55);
    clip-path: polygon(
        0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px,
        100% calc(100% - 12px), calc(100% - 12px) 100%,
        12px 100%, 0 calc(100% - 12px)
    );
    pointer-events: none;
}

.platform-hero__title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.85rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.platform-hero__lead {
    margin: 1.25rem 0 0;
    max-width: 42rem;
    font-size: 1.08rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.88);
}

.platform-hero__about {
    margin: 1.75rem 0 0;
    max-width: 42rem;
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
    padding-left: 1rem;
    border-left: 3px solid rgba(125, 211, 252, 0.5);
}

.platform-highlights {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.platform-highlights li {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    row-gap: 0.2rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.platform-highlights li:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(125, 211, 252, 0.35);
}

.platform-highlights__icon {
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    align-self: start;
    color: #0c4a6e;
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}

.platform-highlights li strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f0f9ff;
}

.platform-highlights li span:last-child {
    grid-column: 2;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.68);
}

.platform-aside {
    position: sticky;
    top: 2rem;
}

.platform-contact-card {
    text-align: center;
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 20px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.platform-contact-card h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.platform-contact-card__hint {
    margin: 0.5rem 0 1.25rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
}

.platform-contact-card__qr {
    margin: 0;
}

.platform-contact-card__qr img {
    display: block;
    margin: 0 auto;
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.platform-contact-card__qr figcaption {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #7dd3fc;
}

.platform-footer {
    position: relative;
    z-index: 1;
    padding: 1.25rem 2rem 1.75rem;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
}

.platform-footer__sep {
    margin: 0 0.5rem;
}

.platform-footer__beian {
    margin-top: 0.55rem;
}

.beian-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.55rem;
    margin-top: 0.45rem;
    font-size: 0.82rem;
    line-height: 1.3;
}

.beian-links__gongan {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.beian-links img {
    width: 18px;
    height: 20px;
    object-fit: contain;
    flex: none;
}

.beian-links__sep {
    opacity: 0.55;
}

.beian-links a {
    color: inherit;
    text-decoration: none;
}

.beian-links a:hover {
    text-decoration: underline;
}

.platform-footer__beian a,
.platform-footer .beian-links a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}

.platform-footer__beian a:hover,
.platform-footer .beian-links a:hover {
    color: #bae6fd;
    text-decoration: underline;
}

.login-shell .beian-links,
.portal .beian-links {
    color: rgba(255, 255, 255, 0.62);
}

.login-shell .beian-links a:hover,
.portal .beian-links a:hover {
    color: #bae6fd;
}

.platform-landing .wechat-qr {
    margin: 0;
    text-align: center;
}

.platform-landing .wechat-qr figcaption {
    margin-top: 0.75rem;
    font-size: 1rem;
    opacity: 0.95;
}

.platform-landing {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    color: #fff;
}

.platform-body {
    margin: 1.5rem 0;
    line-height: 1.7;
    opacity: 0.92;
}

.platform-body p { margin: 0.4rem 0; }

.platform-contact {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
}

.platform-contact h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.platform-contact .contact-label {
    display: inline-block;
    min-width: 4rem;
    opacity: 0.75;
}

.platform-contact a { color: #a8d4ff; }

.wechat-qr {
    margin: 1rem 0 0;
    text-align: center;
}

.wechat-qr img {
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}

.wechat-qr figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.85;
}

.tenant-name { font-size: 2.2rem; margin: 0; }
.tenant-tagline { margin-top: 0.5rem; }

.tenant-home.tenant-theme-default {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.tenant-login-name {
    font-size: 1.35rem;
    line-height: 1.35;
    margin: 0;
    width: fit-content;
    max-width: 100%;
    text-wrap: balance;
}

.platform-credit {
    margin-top: 1.25rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.45;
    color: #fff;
    text-align: center;
}

.login-shell .platform-credit {
    color: rgba(255,255,255,0.5);
}

.lang-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.lang-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.4);
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}
.lang-btn.active {
    background: rgba(255,255,255,0.2);
    border-color: #fff;
}
.portal-platform .lang-btn,
.tenant-home .lang-btn {
    color: #fff;
}

.apply-form {
    background: #fff;
    color: #1a1a2e;
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    text-align: left;
    margin: 1rem 0;
}
.apply-form textarea { width: 100%; padding: 0.55rem; border-radius: 6px; border: 1px solid #ccc; }
.apply-form .hint { color: #666; }

.phone-verify-row .phone-verify-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.phone-verify-row .phone-verify-controls input {
    flex: 1;
    min-width: 0;
}

.phone-verify-row .phone-verify-controls button.secondary {
    white-space: nowrap;
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
}

.no-permission-card {
    border-left: 4px solid #c77800;
    max-width: 640px;
}

.nav-no-permission {
    line-height: 1.5;
    padding-right: 0.5rem;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.hint { color: #666; font-size: 0.9rem; }

.success {
    background: #e8f8ee;
    color: #0a6b2d;
    padding: 0.65rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.topnav { display: flex; gap: 1rem; }
.topnav a { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 0.9rem; }

.app-nav { display: flex; gap: 1rem; margin-top: 1.5rem; }
.app-nav .card-link {
    background: #fff;
    color: #0f3460;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.data-table th, .data-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 0.9rem;
}
.data-table th { background: #f0f3f8; font-weight: 600; }

.data-table th.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: visible;
}

.data-table th.sortable-th.reorderable-th {
    cursor: grab;
}

.data-table th.sortable-th.reorderable-th.egs-col-edge-hot {
    cursor: col-resize !important;
}

.data-table th.sortable-th.reorderable-th.col-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.data-table th.sortable-th.reorderable-th.col-drag-over {
    box-shadow: inset 3px 0 0 #2563eb;
}

.data-table th.sortable-th:hover {
    background: #e2e8f0;
}

.hint.hint-inline {
    margin: 0.35rem 0 0.5rem;
    font-size: 0.85rem;
}

.data-table th.sortable-th.is-sorted {
    background: #dbeafe !important;
    color: #1e3a8a;
}

.data-table th.sortable-th .sortable-th__inner {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
}

.data-table th.sortable-th .sortable-th__label {
    vertical-align: middle;
}

.data-table th.sortable-th .sort-indicator {
    flex: 0 0 auto;
    display: inline-block;
    margin-left: 0.15rem;
    font-size: 0.7rem;
    line-height: 1;
    color: #1d4ed8;
    font-weight: 700;
}

.form-card { margin-top: 1rem; max-width: 52rem; }
.form-card textarea { width: 100%; padding: 0.55rem; border-radius: 6px; border: 1px solid #cbd5e1; }

.actions-row { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; margin-top: 1rem; }

html:has(.page.with-sidebar),
html:has(.page.with-sidebar) body {
    height: 100%;
    overflow: hidden;
}

.with-sidebar {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    max-width: 100vw;
    overflow: hidden;
    transition: grid-template-columns 0.2s ease;
}

.with-sidebar.sidebar-collapsed {
    grid-template-columns: 4.25rem minmax(0, 1fr);
}

.sidebar {
    background: #16213e;
    color: #fff;
    padding: 1rem 0.75rem;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-desktop-tools {
    display: flex;
    justify-content: flex-end;
    margin: -0.25rem 0 0.45rem;
}

.sidebar-pin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #e8edf5;
    border-radius: 0.4rem;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1;
}

.sidebar-pin-btn:hover {
    background: #0095ff;
    color: #fff;
}

.sidebar-pin-label {
    white-space: nowrap;
}

.sidebar-collapsed .sidebar {
    padding: 0.65rem 0.35rem;
}

.sidebar-collapsed .sidebar-desktop-tools {
    justify-content: center;
    margin-bottom: 0.35rem;
}

.sidebar-collapsed .sidebar-pin-btn {
    padding: 0.45rem;
}

.sidebar-collapsed .menu-label,
.sidebar-collapsed .menu-caret,
.sidebar-collapsed .menu-children {
    display: none !important;
}

.sidebar-collapsed .side-nav {
    margin: 0;
}

.sidebar-collapsed .menu-row {
    justify-content: center;
    gap: 0;
    padding: 0.7rem 0.35rem;
}

.sidebar-collapsed .menu-ico {
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
}

.sidebar-collapsed .nav-svg {
    width: 1.25rem;
    height: 1.25rem;
}

.app-main {
    min-width: 0;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-main > .topbar {
    flex: 0 0 auto;
}

.workspace-tabstrip {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 0.2rem 0.5rem 0;
    background: #252542;
    overflow-x: auto;
}
.workspace-tab {
    display: flex;
    align-items: stretch;
    max-width: 13.5rem;
    min-width: 6.5rem;
    background: #32324a;
    color: #e2e8f0;
    border-radius: 6px 6px 0 0;
    cursor: grab;
    user-select: none;
}
.workspace-tab.dragging {
    opacity: 0.55;
    cursor: grabbing;
}
.workspace-tab.drag-over {
    box-shadow: inset 3px 0 0 #60a5fa;
}
.workspace-tab.active {
    background: #f4f6fb;
    color: #1a1a2e;
}
.workspace-tab-btn {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0.38rem 0.5rem;
    cursor: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    text-align: left;
}
.workspace-tab-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0 0.4rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.75;
}
.workspace-tab-close:hover { opacity: 1; }
.workspace-limit-hint {
    flex: 0 0 auto;
    margin: 0.35rem 1.25rem 0;
}
.workspace-pane {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.workspace-pane[hidden] {
    display: none !important;
}

.app-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: none;
    margin: 0;
    padding: 0.65rem 1.25rem 0.75rem;
}

:is(.app-page, .workspace-pane) > h1:first-of-type {
    flex: 0 0 auto;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}

/* FocusOnNavigate focuses h1 on route change (screen readers). Headings are not interactive — hide focus ring. */
:is(.app-page, .workspace-pane) > h1:focus,
main > h1:focus {
    outline: none;
    box-shadow: none;
}

.topbar .brand:focus {
    outline: none;
    box-shadow: none;
}

.topbar .brand:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
}

:is(.app-page, .workspace-pane) > .filter-bar,
:is(.app-page, .workspace-pane) > .collapsible-query-panel,
:is(.app-page, .workspace-pane) > .hint,
:is(.app-page, .workspace-pane) > p.hint,
:is(.app-page, .workspace-pane) > .alert,
:is(.app-page, .workspace-pane) > .success,
:is(.app-page, .workspace-pane) > .pagination-bar,
:is(.app-page, .workspace-pane) > .perm-toolbar,
:is(.app-page, .workspace-pane) > .perm-page-head,
:is(.app-page, .workspace-pane) > .perm-page-message,
:is(.app-page, .workspace-pane) > .summary-bar,
:is(.app-page, .workspace-pane) > .card {
    flex: 0 0 auto;
}

:is(.app-page, .workspace-pane) > p.row-hint {
    margin: 0 0 0.3rem;
    line-height: 1.35;
}

:is(.app-page, .workspace-pane) > .filter-bar:has(+ p.row-hint) {
    margin-bottom: 0.35rem;
}

:is(.app-page, .workspace-pane) > .collapsible-query-panel ~ .perm-table-wrap,
:is(.app-page, .workspace-pane) > .filter-bar ~ .perm-table-wrap {
    min-height: 0;
}

:is(.app-page, .workspace-pane):has(.daily-output-filters),
:is(.app-page, .workspace-pane):has(.product-monthly-filters) {
    overflow-y: auto;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap,
:is(.app-page, .workspace-pane) > .query-list-wrap {
    flex: 1 1 auto;
    min-height: clamp(22rem, 58vh, calc(100dvh - 10.5rem));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: none;
    background: #fff;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap + .pagination-bar {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap > .data-table,
:is(.app-page, .workspace-pane) > .query-list-wrap > .data-table,
.data-table.query-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap > .data-table thead th,
:is(.app-page, .workspace-pane) > .query-list-wrap > .data-table thead th,
.data-table.query-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f0f3f8;
    box-shadow: 0 1px 0 #e2e8f0;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap > .data-table tfoot,
:is(.app-page, .workspace-pane) > .query-list-wrap > .data-table tfoot {
    position: sticky;
    bottom: 0;
    z-index: 2;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap > .data-table tfoot th,
:is(.app-page, .workspace-pane) > .perm-table-wrap > .data-table tfoot td,
:is(.app-page, .workspace-pane) > .query-list-wrap > .data-table tfoot th,
:is(.app-page, .workspace-pane) > .query-list-wrap > .data-table tfoot td {
    background: #eef2f7;
    font-weight: 600;
    box-shadow: 0 -1px 0 #cbd5e1;
}

.data-table tfoot tr.inquiry-total-row th {
    white-space: nowrap;
}

.data-table tfoot tr.inquiry-grand-row th {
    background: #e2e8f0;
    white-space: nowrap;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap > .data-table thead th.sortable-th.is-sorted,
:is(.app-page, .workspace-pane) > .query-list-wrap > .data-table thead th.sortable-th.is-sorted,
.data-table.query-table thead th.sortable-th.is-sorted {
    background: #dbeafe !important;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap > .data-table th,
:is(.app-page, .workspace-pane) > .perm-table-wrap > .data-table td,
:is(.app-page, .workspace-pane) > .query-list-wrap > .data-table th,
:is(.app-page, .workspace-pane) > .query-list-wrap > .data-table td,
.data-table.query-table th,
.data-table.query-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.data-table.query-table .col-vendor-cd { width: 4.5rem; }
.data-table.query-table .col-name { width: auto; min-width: 7rem; max-width: 14rem; }
.data-table.query-table .col-dept { width: auto; min-width: 6rem; max-width: 12rem; }
.data-table.query-table .col-code { width: auto; min-width: 5rem; max-width: 10rem; }
.data-table.query-table .col-main-proc { width: auto; min-width: 6rem; max-width: 12rem; }
.data-table.query-table .col-status { width: 3.5rem; }
.data-table.query-table .col-date { width: 6.5rem; }
.data-table.query-table .col-datetime {
    width: 9.5rem;
    min-width: 9.5rem;
}
.data-table.query-table .col-person { width: auto; min-width: 7rem; max-width: 12rem; }
.data-table.query-table .col-note {
    width: auto;
    min-width: 8rem;
    max-width: 18rem;
    white-space: normal;
}

.data-table.query-table .col-num {
    width: 4.5rem;
    text-align: right;
}

.data-table.query-table.product-master-table .col-name {
    min-width: 8rem;
    max-width: 16rem;
}

/* prod_cd max 5 digits + 2; prod_type name max 11 + 2; prod_status Y/N + 2. Extra table width goes to 产品名称. */
.data-table.query-table.product-master-table .col-prod-cd {
    width: 5.5rem;
    max-width: 5.5rem;
}

.data-table.query-table.product-master-table .col-prod-type {
    width: 8.5rem;
    max-width: 8.5rem;
}

.data-table.query-table.product-master-table .col-prod-status {
    width: 3.25rem;
    max-width: 3.25rem;
}

.data-table.query-table.product-master-table .col-prod-nm {
    min-width: 10.5rem;
    max-width: 21rem;
}

.data-table.query-table.product-master-table .col-prod-cd,
.data-table.query-table.product-master-table .col-prod-type,
.data-table.query-table.product-master-table .col-prod-status,
.data-table.query-table.product-master-table .col-prod-nm {
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table.query-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

:is(.app-page, .workspace-pane) > .pricing-layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

:is(.app-page, .workspace-pane):not(:has(> .perm-table-wrap, > .query-list-wrap, > .pricing-layout)) {
    overflow-y: auto;
}

.side-nav {
    margin: -0.25rem -0.75rem 0;
}

.side-nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
    margin: 0 0 0.75rem 0.5rem;
}

.menu-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item {
    margin: 0;
    font-size: 0.88rem;
}

.menu-tree > .menu-item + .menu-item {
    margin-top: 1px;
}

.menu-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    color: #e8edf5;
    text-align: left;
    text-decoration: none;
    padding: 0.72rem 0.85rem;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    min-height: 2.65rem;
    box-sizing: border-box;
}

.menu-row:hover,
.menu-folder-btn:hover,
.menu-link:hover {
    background: #0095ff;
    color: #fff;
    text-decoration: none;
}

.menu-row.active {
    background: #0095ff;
    color: #fff;
}

.menu-folder-btn.open {
    background: rgba(0, 149, 255, 0.28);
}

.menu-ico {
    flex: 0 0 1.15rem;
    width: 1.15rem;
    height: 1.15rem;
    display: flex;
    color: inherit;
}

.nav-svg {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}

.menu-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-caret {
    flex: 0 0 0.45rem;
    width: 0;
    height: 0;
    border-left: 0.28rem solid transparent;
    border-right: 0.28rem solid transparent;
    border-top: 0.32rem solid currentColor;
    opacity: 0.85;
    margin-left: 0.25rem;
}

.menu-caret.up {
    border-top: 0;
    border-bottom: 0.32rem solid currentColor;
}

.menu-children {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.22);
}

.menu-children .menu-row {
    padding-left: 2.65rem;
    font-weight: 400;
    min-height: 2.45rem;
}

.menu-disabled {
    opacity: 0.45;
    cursor: default;
}

.menu-folder { font-weight: 700; opacity: 0.9; }
.menu-link { color: #fff; }

.perm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    margin: 0 0 0.5rem;
}

.perm-toolbar .primary,
.perm-toolbar .primary.inline-btn,
.perm-toolbar .secondary-btn {
    width: auto;
}

.perm-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.75rem;
    margin-bottom: 0.35rem;
}

.perm-page-head h1 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
}

.perm-page-head__left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    min-width: 0;
}

.perm-page-head__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.perm-back-link {
    font-size: 0.85rem;
    color: #0f3460;
    text-decoration: none;
    white-space: nowrap;
}

.perm-back-link:hover {
    text-decoration: underline;
}

.perm-page-message {
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.88rem;
}

.role-perm-tools.collapsible-query-panel {
    margin-bottom: 0.4rem;
    padding: 0.45rem 0.65rem;
}

.role-perm-tools.collapsible-query-panel.is-collapsed {
    padding-bottom: 0.45rem;
}

.role-perm-tools__body.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0;
}

.role-perm-tools__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.35rem 0.65rem;
}

.role-perm-tools__row .field.inline label {
    min-width: 4.75rem;
}

.role-perm-tools__hint {
    margin: 0 0 0.15rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #64748b;
}

:is(.app-page, .workspace-pane) > .role-perm-table-wrap {
    min-height: clamp(24rem, calc(100dvh - 11.5rem), calc(100dvh - 7.5rem));
}

.perm-table th:nth-child(n+3),
.perm-table td:nth-child(n+3) {
    text-align: center;
    width: 4.25rem;
}

.perm-table td:nth-child(2) {
    white-space: normal;
    min-width: 9rem;
    text-align: left;
}

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

/* Legacy alias — box styling removed; see :is(.app-page, .workspace-pane) > .perm-table-wrap */
.master-list-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
}

.data-table.query-table,
.data-table.master-list-table {
    width: 100%;
    table-layout: auto;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
}

.data-table.query-table th,
.data-table.query-table td,
.data-table.master-list-table th,
.data-table.master-list-table td {
    white-space: nowrap;
}

tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { background: #f1f5f9; }
tr.code-row-from-comm td { background: #fff8dc; }
tr.code-row-from-comm:hover td { background: #fff3c4; }

.modal-dialog.role-programs-dialog {
    width: min(1080px, 96vw);
    max-height: 90vh;
}
.role-programs-dialog .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    flex: 1 1 auto;
}
.role-programs-dialog .perm-table-wrap {
    flex: 1 1 auto;
    min-height: 12rem;
    overflow: auto;
}
.role-programs-dialog .perm-table {
    overflow: visible;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: none;
    border-radius: 0;
}
.role-programs-dialog .perm-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f0f3f8;
    box-shadow: 0 1px 0 #e2e8f0;
}
.role-programs-dialog .lookup-footer {
    padding: 0.65rem 1rem 0.85rem;
    border-top: 1px solid #e2e8f0;
}

.modal-dialog.master-edit-dialog {
    width: min(920px, 100%);
}

.modal-dialog.customer-edit-dialog {
    width: min(1080px, 96vw);
}

.customer-edit-dialog .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-edit-dialog .customer-type-row,
.customer-edit-dialog .customer-status-dates-row,
.customer-edit-dialog .customer-person-row {
    grid-column: 1 / -1;
    display: grid;
    gap: 0.85rem 1.25rem;
    align-items: end;
}

.customer-edit-dialog .customer-type-row {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.88fr) minmax(0, 1.06fr);
}

.customer-edit-dialog .customer-status-dates-row,
.customer-edit-dialog .customer-person-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-edit-dialog .customer-status-dates-cluster {
    grid-column: 1 / span 2;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) 7.75rem 7.75rem;
    gap: 0.85rem 1.25rem;
    min-width: 0;
    align-items: end;
}

.customer-edit-dialog .customer-type-row > .field,
.customer-edit-dialog .customer-status-dates-row > .field,
.customer-edit-dialog .customer-person-row > .field,
.customer-edit-dialog .customer-status-dates-cluster > .field {
    min-width: 0;
}

.customer-edit-dialog .customer-status-dates-row .field-account select,
.customer-edit-dialog .customer-status-dates-row .field-status select {
    width: 100%;
    min-width: 0;
}

.customer-edit-dialog .customer-status-dates-row .date-input-solo,
.customer-edit-dialog .customer-status-dates-row .pb-edit {
    width: 100%;
    min-width: 0;
}

.customer-edit-dialog .region-address-picker {
    min-width: 0;
    width: 100%;
}

.customer-edit-dialog .region-address-picker .addr-display {
    min-width: 0;
}

.modal-dialog.code-edit-dialog {
    width: min(1080px, 96vw);
    max-height: 92vh;
}

.modal-dialog.code-edit-dialog .form-grid {
    grid-template-columns: 1fr 1fr;
}

.modal-dialog.code-edit-dialog .field.lookup-span {
    grid-column: 1 / -1;
}

.modal-dialog.code-edit-dialog .region-address-picker {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
}

.modal-dialog.code-edit-dialog .region-address-picker .addr-display-wrap {
    min-height: 3.4rem;
    height: auto;
    resize: vertical;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
    font-family: inherit;
}

.modal-dialog.product-edit-dialog {
    width: min(1080px, 100%);
}

.modal-dialog.cost-edit-dialog {
    width: min(624px, 100%);
}

.cost-edit-dialog .form-grid {
    grid-template-columns: 1fr 1fr;
}

.cost-edit-dialog .form-grid .field.span-2,
.cost-edit-dialog .form-grid .span-2 {
    grid-column: 1 / -1;
}

.cost-edit-dialog .field-output-no {
    width: max-content;
    max-width: 100%;
}

.cost-edit-dialog .field-output-no input {
    width: calc(var(--chars, 6) * 1ch + 1.3rem);
    max-width: 100%;
}

.cost-edit-prod-row {
    display: flex;
    gap: 0.85rem 1rem;
    align-items: flex-end;
}

.cost-edit-prod-row .field-prod-cd {
    flex: 0 0 calc((var(--chars, 4) * 1ch + 1.3rem) * 1.25);
    width: calc((var(--chars, 4) * 1ch + 1.3rem) * 1.25);
    max-width: calc((var(--chars, 4) * 1ch + 1.3rem) * 1.25);
}

.cost-edit-prod-row .field-prod-cd input {
    width: 100%;
}

.cost-edit-prod-row .field-prod-nm {
    flex: 1 1 auto;
    min-width: 0;
}

.cost-edit-type-row {
    display: flex;
    gap: 0.85rem 1rem;
    align-items: flex-end;
}

.cost-edit-type-row .field-cost-type {
    flex: 0 0 25%;
    width: 25%;
    max-width: 25%;
}

.cost-edit-type-row .field-amount {
    flex: 0 0 9rem;
    width: 9rem;
    max-width: 9rem;
}

.cost-edit-dialog .form-grid input,
.cost-edit-dialog .form-grid select {
    width: 100%;
    min-width: 0;
    padding: 0.55rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    box-sizing: border-box;
}

.input-line-edit-dialog .input-line-prod-row {
    display: flex;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.input-line-edit-dialog .prod-line-cd {
    flex: 0 0 6.5rem;
    min-width: 0;
}

.input-line-edit-dialog .prod-line-nm {
    flex: 1 1 auto;
    min-width: 0;
}

.input-line-edit-dialog .prod-line-cd .num-input {
    width: 100%;
    min-width: 0;
}

.input-line-edit-dialog .input-prod-nm-pick {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    min-width: 0;
}

.input-line-edit-dialog .input-prod-nm-pick > input {
    flex: 1;
    min-width: 0;
}

.input-line-edit-dialog .input-prod-nm-pick > .region-address-picker {
    flex: 0 0 auto;
    min-width: auto;
}

.input-line-edit-dialog .input-prod-nm-pick > .region-address-picker .addr-display {
    display: none;
}

.input-register-table .col-storage {
    min-width: 8.5rem;
    width: 9.25rem;
    max-width: 10.5rem;
}

.input-register-table .col-input-type {
    min-width: 5.5rem;
    max-width: 7rem;
}

.input-register-table .col-intl-yn {
    min-width: 4.25rem;
    width: 4.25rem;
    max-width: 4.75rem;
}

.input-register-lines-wrap {
    overflow-x: auto;
    overflow-y: auto;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap.input-register-lines-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

:is(.app-page, .workspace-pane) > .input-register-summary {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 1.75rem;
    align-items: center;
    padding: 0.45rem 0.75rem;
    margin: 0 0 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f3460;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap > .input-register-table.pb-grid,
.input-register-table.pb-grid {
    width: max-content !important;
    min-width: 100%;
    table-layout: auto;
}

.input-register-table .col-storage .pb-edit {
    width: 100%;
    max-width: 10rem;
}

.input-register-table .col-input-type .pb-edit {
    width: 100%;
    max-width: 8rem;
}

.input-register-table .col-cost-type .pb-edit {
    width: 100%;
    max-width: 5.5rem;
}

.input-register-table .col-popup {
    min-width: 3.25rem;
    width: 3.25rem;
    text-align: center;
    white-space: nowrap;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.input-register-table .btn-popup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 1.55rem;
    padding: 0.08rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #0f3460;
    cursor: pointer;
    white-space: nowrap;
}

.input-register-table .btn-popup:hover:not(:disabled) {
    background: #f8fafc;
}

.input-register-table .btn-popup:disabled {
    opacity: 0.55;
    cursor: default;
}

.input-register-table.pb-grid .col-note input.pb-edit {
    min-width: 13rem;
    width: 100%;
}

.input-register-table.pb-grid .col-qty .pb-edit {
    width: 4.5rem;
    text-align: right;
}

.input-register-table.pb-grid .col-amt .pb-edit {
    width: 5.5rem;
    text-align: right;
}

.shipping-register-lines-wrap {
    overflow-x: auto;
    overflow-y: auto;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap.shipping-register-lines-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

:is(.app-page, .workspace-pane) > .shipping-register-summary {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 1.75rem;
    align-items: center;
    padding: 0.45rem 0.75rem;
    margin: 0 0 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f3460;
}

:is(.app-page, .workspace-pane) > .perm-table-wrap > .shipping-register-table.pb-grid,
.shipping-register-table.pb-grid {
    width: max-content !important;
    min-width: 100%;
    table-layout: auto;
}

.shipping-register-table .col-prod-cd {
    width: 4.25rem;
    min-width: 4.25rem;
    max-width: 5rem;
}

.shipping-register-table .col-prod-nm {
    min-width: 12rem;
    width: 14rem;
}

.shipping-register-table .col-storage {
    min-width: 8.5rem;
    width: 9.25rem;
    max-width: 10.5rem;
}

.shipping-register-table .col-storage .pb-edit {
    width: 100%;
    max-width: 10rem;
}

.shipping-register-table .col-cost-type {
    min-width: 3.75rem;
    width: 4.25rem;
    max-width: 5rem;
}

.shipping-register-table .col-output-type {
    min-width: 6rem;
    width: 7rem;
    max-width: 10rem;
}

.shipping-register-table .col-date {
    min-width: 5.5rem;
    width: 5.75rem;
    max-width: 6.25rem;
}

.shipping-register-table .col-qty {
    min-width: 4.25rem;
    width: 4.75rem;
    max-width: 5.25rem;
}

.shipping-register-table .col-discount-type {
    min-width: 4.75rem;
    width: 5.25rem;
    max-width: 6rem;
}

.shipping-register-table .col-discount-type .pb-edit {
    width: 100%;
    max-width: 5.5rem;
}

.shipping-register-table .col-discount-amt {
    min-width: 5rem;
    width: 5.5rem;
}

.shipping-register-table .col-discount-amt .pb-edit {
    width: 5rem;
    text-align: right;
}

.shipping-register-table .col-note {
    min-width: 14rem;
    width: 16rem;
    max-width: none;
    white-space: nowrap;
}

.shipping-register-table .col-approval-status {
    min-width: 5.5rem;
    width: 6.5rem;
    white-space: nowrap;
}

.shipping-register-table .col-popup {
    min-width: 3.25rem;
    width: 3.25rem;
    text-align: center;
    white-space: nowrap;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.shipping-register-table .btn-popup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 1.55rem;
    padding: 0.08rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #0f3460;
    cursor: pointer;
    white-space: nowrap;
}

.shipping-register-table .btn-popup:hover:not(:disabled) {
    background: #f8fafc;
}

.shipping-register-table .btn-popup:disabled {
    opacity: 0.55;
    cursor: default;
}

/* PowerBuilder-like editable cells: sunken */
.pb-grid .pb-edit,
.pb-grid input.pb-edit,
.pb-grid select.pb-edit {
    background: #fff !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 2px;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.18);
    min-height: 1.85rem;
    padding: 0.15rem 0.35rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.pb-grid .pb-edit:focus,
.pb-grid input.pb-edit:focus,
.pb-grid select.pb-edit:focus {
    outline: 2px solid rgba(15, 52, 96, 0.25);
    border-color: #64748b !important;
    background: #fff !important;
}

.pb-grid .pb-edit:disabled,
.pb-grid input.pb-edit:disabled,
.pb-grid select.pb-edit:disabled {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
    box-shadow: none;
    color: #6b7280;
}

.pb-grid td.pb-ro {
    color: #334155;
}

.pb-grid .inline-pick {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
}

.pb-grid .inline-pick > input.pb-edit {
    flex: 1 1 auto;
    min-width: 0;
}

.shipping-register-table.pb-grid .col-note input.pb-edit {
    min-width: 13rem;
    width: 100%;
}

.shipping-register-table.pb-grid .col-qty .pb-edit {
    width: 4.5rem;
    text-align: right;
}

.pb-grid .pb-date-text {
    width: 7.1rem;
    max-width: 7.1rem;
    font-variant-numeric: tabular-nums;
}

.picker-hidden-trigger {
    display: none;
}

.unit-barcode-table input,
.unit-barcode-table select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.unit-barcode-table .sort-select {
    width: 3.5rem;
}

.unit-barcode-table .num-input {
    width: 5.5rem;
}

.unit-barcode-table .unit-role-cell {
    white-space: nowrap;
    font-size: 0.85rem;
    color: #475569;
}

.unit-barcode-table tfoot .unit-summary-row td {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    padding-top: 0.55rem;
}

.unit-barcode-section-title {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
    color: #334155;
}

.unit-barcode-rule-hint {
    margin-left: 0.5rem;
    font-size: 0.72rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.3;
}

.employee-edit-dialog {
    width: min(1040px, 100%);
}

.employee-edit-dialog .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.employee-edit-dialog .form-grid .field.span-2 {
    grid-column: span 2;
}

.employee-edit-dialog .form-grid .field.span-4 {
    grid-column: 1 / -1;
}

.employee-edit-dialog .form-grid .field.field-row-start {
    grid-column-start: 1;
}

.employee-edit-dialog h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
    color: #334155;
}

.employee-edit-dialog h3:first-of-type {
    margin-top: 0;
}

.master-edit-dialog .form-grid input,
.master-edit-dialog .form-grid select,
.master-edit-dialog .form-grid textarea {
    width: 100%;
    padding: 0.55rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    box-sizing: border-box;
}

.date-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    width: var(--date-text-width);
    max-width: 100%;
}

.date-input-wrap .date-text,
input.date-text.date-input-solo {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    padding: 0.55rem 0.5rem;
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
}

.date-input-wrap .date-text {
    padding-right: calc(var(--date-picker-btn-width) + 0.2rem);
}

.date-input-wrap .date-picker-hit {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    z-index: 1;
    flex: none;
    width: var(--date-picker-btn-width);
    min-width: var(--date-picker-btn-width);
    max-width: var(--date-picker-btn-width);
    border: 0;
    border-radius: 0 5px 5px 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E") center / 1.05rem no-repeat;
    box-sizing: border-box;
    cursor: pointer;
}

.date-input-wrap .date-picker-hit .date-native {
    position: absolute;
    inset: 0;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0.01;
    cursor: pointer;
    color-scheme: light;
}

/* Firefox rejects showPicker() on near-zero opacity; keep the control hittable
   and see the parent calendar icon through a transparent face. */
.date-input-wrap .date-picker-hit .date-native.date-native-gecko {
    opacity: 1;
    color: transparent;
    caret-color: transparent;
    background: transparent;
}

.date-input-wrap .month-picker-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    z-index: 1;
    width: var(--date-picker-btn-width);
    min-width: var(--date-picker-btn-width);
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0 5px 5px 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E") center / 1.05rem no-repeat;
    cursor: pointer;
}

.date-input-wrap .month-picker-btn:disabled {
    cursor: default;
    opacity: 0.55;
}

.month-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3990;
    background: transparent;
}

.month-picker-panel {
    position: fixed;
    z-index: 4000;
    width: 16rem;
    padding: 0.55rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    box-sizing: border-box;
}

.month-picker-year {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.month-picker-nav {
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.month-picker-nav:hover {
    background: #e2e8f0;
}

.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.28rem;
}

.month-picker-grid button {
    border: 0;
    border-radius: 6px;
    padding: 0.42rem 0;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    font-size: 0.88rem;
}

.month-picker-grid button:hover {
    background: #e2e8f0;
}

.month-picker-grid button.is-current:not(.is-selected) {
    box-shadow: inset 0 0 0 1px #2563eb;
}

.month-picker-grid button.is-selected {
    background: #2563eb;
    color: #fff;
    font-weight: 700;
}

/* data-table / field rules set width on all input[type=date] — keep picker as icon only */
.data-table .date-input-wrap .date-picker-hit,
.perm-table .date-input-wrap .date-picker-hit,
.field .date-input-wrap .date-picker-hit,
.filter-bar .date-input-wrap .date-picker-hit,
.mgmt-table .date-input-wrap .date-picker-hit {
    flex: 0 0 var(--date-picker-btn-width) !important;
    width: var(--date-picker-btn-width) !important;
    min-width: var(--date-picker-btn-width) !important;
    max-width: var(--date-picker-btn-width) !important;
}

.data-table .date-input-wrap .date-picker-hit .date-native,
.perm-table .date-input-wrap .date-picker-hit .date-native,
.field .date-input-wrap .date-picker-hit .date-native,
.filter-bar .date-input-wrap .date-picker-hit .date-native,
.mgmt-table .date-input-wrap .date-picker-hit .date-native {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
}

.master-edit-dialog .form-grid .date-input-wrap {
    width: 100%;
    max-width: var(--date-text-width);
}

.master-edit-dialog .form-grid .date-input-wrap .date-text {
    width: 100%;
    padding: 0.55rem calc(var(--date-picker-btn-width) + 0.2rem) 0.55rem 0.5rem;
    border-radius: 6px;
}

.master-edit-dialog .form-grid .date-input-wrap .date-picker-hit {
    width: var(--date-picker-btn-width);
    min-width: var(--date-picker-btn-width);
    padding: 0;
    border: 0;
    border-radius: 0 5px 5px 0;
}

.date-input-wrap .date-text:disabled,
.date-input-wrap .date-picker-hit:has(.date-native:disabled) {
    background: #f1f5f9;
    opacity: 1;
    cursor: default;
}

.perm-table input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.folder-row td { background: #f8fafc; font-weight: 600; }

.closing-progress {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-size: 0.92rem;
    font-weight: 600;
}

.closing-progress__spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #93c5fd;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: closing-spin 0.8s linear infinite;
}

@keyframes closing-spin {
    to { transform: rotate(360deg); }
}

.closing-notice {
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}

.closing-status-card {
    margin-bottom: 0.5rem;
    padding: 0.65rem 0.85rem;
}

.closing-status-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}

.closing-status-card p {
    margin: 0;
    font-size: 0.88rem;
}

.collapsible-query-panel {
    margin-bottom: 1.25rem;
    padding: 0.65rem 0.85rem 0.85rem;
}

.collapsible-query-panel.is-collapsed {
    padding-bottom: 0.65rem;
}

.collapsible-query-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.65rem;
}

.collapsible-query-panel.is-collapsed .collapsible-query-panel__header {
    margin-bottom: 0;
}

.collapsible-query-panel__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: auto;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.collapsible-query-panel__chevron {
    font-size: 0.75rem;
    line-height: 1;
}

.collapsible-query-panel__summary {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collapsible-query-panel__header > .primary.inline-btn {
    margin-left: auto;
    width: auto;
    padding: 0 1rem;
}

.collapsible-query-panel__body.filter-bar {
    margin-bottom: 0;
    padding-top: 0.15rem;
}

.output-inquiry-filters:not(.collapsible-query-panel) > .collapsible-query-panel__body--flat {
    display: contents;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
}

.field.inline {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0;
    min-width: 0;
}

.field.inline label {
    margin-bottom: 0;
    font-size: 0.8rem;
    line-height: 1.25;
    font-weight: 600;
    color: #334155;
}

.filter-bar .field.inline.field-check {
    flex: 0 1 auto;
    min-width: auto;
    max-width: none;
    justify-content: flex-end;
}

.filter-bar label.chk {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.2;
    margin: 0;
}

.filter-bar label.chk input[type="checkbox"] {
    width: 0.75rem;
    height: 0.75rem;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #0f3460;
}

.filter-bar .field.inline {
    flex: 0 1 11.5rem;
    min-width: 9.5rem;
    max-width: 14rem;
}

.filter-bar .field.inline.wide {
    flex: 1 1 16rem;
    max-width: 22rem;
}

.filter-bar .field.inline.wide2x {
    flex: 0 1 23rem;
    min-width: 19rem;
    max-width: 28rem;
}

.filter-bar.product-master-filters > .field.inline.field-prod-cd {
    flex: 0 0 7.25rem;
    min-width: 7.25rem;
    max-width: 7.25rem;
}

.filter-bar.product-master-filters > .field.inline.field-prod-type {
    flex: 0 0 9.5rem;
    min-width: 9.5rem;
    max-width: 9.5rem;
}

.filter-bar.product-master-filters > .field.inline.field-prod-status {
    flex: 0 0 5.5rem;
    min-width: 5.5rem;
    max-width: 5.5rem;
}

.filter-bar.product-master-filters > .field.inline.field-prod-nm {
    flex: 1 1 18.5rem;
    min-width: 14.5rem;
    max-width: 18.5rem;
}

.filter-bar.price-inquiry-filters {
    --pi-select-width: 6.75rem;
    --pi-prod-width: 17.25rem;
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: 0.7rem;
    row-gap: 0.55rem;
    overflow-x: visible;
}

.price-inquiry-filters > .filter-bar-actions {
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
    align-self: flex-end;
}

/* Override .filter-bar .field.inline min/max (9.5–14rem) so per-field widths apply. */
.filter-bar.price-inquiry-filters > .field.inline {
    flex: 0 0 auto;
    margin-bottom: 0;
    min-width: 0;
    max-width: none;
}

.filter-bar.price-inquiry-filters > .field.inline.field-select-type {
    flex: 0 0 var(--pi-select-width);
    width: var(--pi-select-width);
    min-width: var(--pi-select-width);
    max-width: var(--pi-select-width);
}

.filter-bar.price-inquiry-filters > .field.inline.field-select-type select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-inline: 0.4rem 1.5rem;
    font-size: 0.85rem;
}

.filter-bar.price-inquiry-filters > .field.inline.field-date {
    flex: 0 0 var(--date-input-width);
    width: var(--date-input-width);
    min-width: var(--date-input-width);
    max-width: var(--date-input-width);
}

.filter-bar.price-inquiry-filters > .field.inline.field-prod {
    flex: 0 0 var(--pi-prod-width);
    width: var(--pi-prod-width);
    min-width: var(--pi-prod-width);
    max-width: var(--pi-prod-width);
}

.filter-bar.price-inquiry-filters > .field.inline.field-user {
    flex: 0 0 9.5rem;
    width: 9.5rem;
    min-width: 9.5rem;
    max-width: 9.5rem;
}

.filter-bar.price-inquiry-filters > .field.inline.field-prod-type,
.filter-bar.price-inquiry-filters > .field.inline.field-price-type {
    flex: 0 0 8rem;
    width: 8rem;
    min-width: 8rem;
    max-width: 8rem;
}

.price-inquiry-filters .region-address-picker {
    min-width: 0;
    width: 100%;
}

.filter-bar > .filter-bar-inline-action {
    flex: 0 0 auto;
    align-self: flex-end;
    margin: 0;
    padding: 0 0 0.35rem;
    white-space: nowrap;
}

.filter-bar .field.inline.field-batch-decision {
    flex: 0 1 9.5rem;
    min-width: 8.5rem;
    max-width: 11rem;
}

.price-approval-filters {
    flex-wrap: wrap;
    overflow-x: visible;
    align-items: flex-end;
    column-gap: 0.7rem;
    row-gap: 0.55rem;
}

.price-approval-filters > .field.inline.field-prod {
    flex: 0 0 auto;
    width: 17rem;
    max-width: none;
}

.price-approval-filters .field.inline.field-prod .region-address-picker {
    min-width: 0;
    width: 100%;
}

.prod-cost-filters > .field.inline.field-prod {
    flex: 0 0 auto;
    width: 17rem;
    max-width: none;
}

.prod-cost-filters > .field.inline.field-prod-status {
    flex: 0 0 auto;
    width: 5.75rem;
    min-width: 5rem;
    max-width: 6rem;
}

.prod-cost-filters .field.inline.field-prod .region-address-picker {
    min-width: 0;
    width: 100%;
}

.prod-cost-table th.col-prod-cd,
.prod-cost-table td.col-prod-cd {
    width: 7rem;
    min-width: 7rem;
}

.filter-bar .field.inline.field-action {
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
}

.filter-bar .field.inline.field-action label {
    visibility: hidden;
}

.filter-bar .field.inline.field-action .link-btn-inline {
    align-self: flex-start;
    white-space: nowrap;
    padding-top: 0.35rem;
}

/* label + input + button on one row (e.g. doc no + generate) */
.field.inline:has(> label + input + button) {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 0.4rem;
    max-width: 18rem;
}

.field.inline:has(> label + input + button) > label {
    grid-column: 1 / -1;
}

.field.inline:has(> label + input + button) > input {
    grid-column: 1;
    min-width: 0;
}

.field.inline:has(> label + input + button) > button {
    grid-column: 2;
    align-self: end;
    justify-self: start;
    width: auto;
    white-space: nowrap;
}

/* yyMMdd-NNN document numbers (input/output/order no) */
.filter-bar .field.inline.doc-no-field {
    flex: 0 1 18rem;
    min-width: 16rem;
    max-width: 26rem;
}

.field.inline.doc-no-field:has(> label + input + button) {
    max-width: 28rem;
}

.field.inline.doc-no-field:has(> label + input + button) > input,
.field.inline.doc-no-field .order-no-picker .doc-no-input,
input.doc-no-input {
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
    min-width: 10.5em;
    width: 100%;
    letter-spacing: 0.02em;
}

.field.inline.doc-no-field .order-no-picker {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    align-self: stretch;
}

.field.inline.doc-no-field .doc-no-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.field.inline.doc-no-field .doc-no-controls .order-no-picker {
    flex: 0 0 10.5rem;
    width: 10.5rem;
    min-width: 10.5rem;
    max-width: 10.5rem;
}

.filter-bar.slip-filters > .field.inline.doc-no-field,
.filter-bar.receipt-filters > .field.inline.doc-no-field {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
}

.filter-bar.receipt-filters .doc-no-controls .order-no-picker,
.filter-bar.receipt-filters .region-address-picker.order-no-picker {
    flex: 0 0 10.5rem;
    width: 10.5rem;
    min-width: 10.5rem;
    max-width: 10.5rem;
}

.filter-bar.slip-filters .doc-no-controls .order-no-picker,
.filter-bar.slip-filters .region-address-picker.order-no-picker {
    flex: 0 0 var(--output-no-input-width);
    width: var(--output-no-input-width);
    min-width: var(--output-no-input-width);
    max-width: var(--output-no-input-width);
}

.filter-bar.slip-filters .order-no-picker .doc-no-input,
.filter-bar.receipt-filters .order-no-picker .doc-no-input,
.filter-bar.slip-filters .order-no-picker .addr-display,
.filter-bar.receipt-filters .order-no-picker .addr-display {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.field.inline.doc-no-field .doc-no-generate-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0 0.55rem;
    font-size: 0.85rem;
}

.filter-bar.order-register-filters {
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: 0.7rem;
    row-gap: 0.55rem;
    overflow-x: visible;
}

.filter-bar.order-register-filters > .field.inline {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    margin-bottom: 0;
}

.filter-bar.order-register-filters > .field.inline.doc-no-field {
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
}

.filter-bar.order-register-filters .doc-no-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.filter-bar.order-register-filters .doc-no-controls .order-no-picker {
    flex: 0 0 10.5rem;
    width: 10.5rem;
    min-width: 10.5rem;
    max-width: 10.5rem;
    box-sizing: border-box;
}

.filter-bar.order-register-filters .doc-no-controls .order-no-picker .doc-no-input,
.filter-bar.order-register-filters .doc-no-controls .doc-no-input {
    min-width: 0;
    width: 100%;
}

.filter-bar.order-register-filters .doc-no-controls .order-no-picker .addr-display {
    min-width: 0;
}

.filter-bar.order-register-filters .doc-no-controls .doc-no-generate-btn {
    flex: 0 0 auto;
    flex-shrink: 0;
    margin-left: 0;
    white-space: nowrap;
}

.filter-bar.order-register-filters > .filter-bar-actions {
    display: flex;
    flex-wrap: wrap;
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-end;
}

/* Orderer name is short (emp/contacts); default picker ~14rem — use ~half. */
.filter-bar.order-register-filters > .field.inline.field-orderer {
    flex: 0 0 7.5rem;
    width: 7.5rem;
    min-width: 7.5rem;
    max-width: 7.5rem;
}

.filter-bar.order-register-filters > .field.inline.field-orderer .region-address-picker {
    min-width: 0;
    width: 100%;
}

.filter-bar.order-register-filters > .field.inline.field-orderer .region-address-picker .addr-display {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Purchase order print — keep filters on one row (month 7.25rem, order_from ≤4 chars, vendor ≤30, order_no CHAR(10)). */
.filter-bar.purchase-order-filters {
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: 0.7rem;
    row-gap: 0.55rem;
    overflow-x: visible;
}

.filter-bar.purchase-order-filters > .field.inline {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    margin-bottom: 0;
}

.filter-bar.purchase-order-filters > .filter-bar-actions {
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-end;
}

.filter-bar.purchase-order-filters select,
.filter-bar.purchase-order-filters input[type="month"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 0.85rem;
}

.filter-bar.purchase-order-filters select {
    padding-inline: 0.4rem 1.45rem;
}

.filter-bar.purchase-order-filters > .field.inline.field-po-month {
    flex: 0 0 var(--month-input-width);
    width: var(--month-input-width);
    min-width: var(--month-input-width);
    max-width: var(--month-input-width);
}

.filter-bar.purchase-order-filters > .field.inline.field-po-month input[type="month"] {
    padding-inline: 0.45rem 0.2rem;
    font-variant-numeric: tabular-nums;
}

.filter-bar.purchase-order-filters > .field.inline.field-po-order-from {
    flex: 0 0 6.75rem;
    width: 6.75rem;
    min-width: 6.75rem;
    max-width: 6.75rem;
}

.filter-bar.purchase-order-filters > .field.inline.field-po-vendor {
    flex: 0 0 14rem;
    width: 14rem;
    min-width: 14rem;
    max-width: 14rem;
}

.filter-bar.purchase-order-filters > .field.inline.field-po-vendor .region-address-picker {
    min-width: 0;
    width: 100%;
}

.filter-bar.purchase-order-filters > .field.inline.field-po-order-no {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
}

.filter-bar.purchase-order-filters > .field.inline.field-po-order-no .order-no-picker,
.filter-bar.purchase-order-filters > .field.inline.field-po-order-no .region-address-picker {
    min-width: 11.25rem;
    width: 14rem;
}

.filter-bar.purchase-order-filters > .field.inline.field-po-order-no .order-no-picker .doc-no-input,
.filter-bar.purchase-order-filters > .field.inline.field-po-order-no .order-no-picker .addr-display {
    min-width: 0;
    width: 100%;
}

/* Order review — compact filters on one row; order_no CHAR(10), type/status/decision short labels. */
.filter-bar.order-review-filters {
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: 0.7rem;
    row-gap: 0.55rem;
    overflow-x: visible;
}

.filter-bar.order-review-filters > .field.inline {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    margin-bottom: 0;
}

.filter-bar.order-review-filters > .filter-bar-actions {
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    max-width: 100%;
    justify-content: flex-end;
}

.filter-bar.order-review-filters select,
.filter-bar.order-review-filters input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 0.85rem;
}

.filter-bar.order-review-filters select {
    padding-inline: 0.35rem 1.35rem;
}

.filter-bar.order-review-filters > .field.inline.field-or-order-no,
.filter-bar.order-review-filters > .field.inline.doc-no-field.field-or-order-no {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
}

.filter-bar.order-review-filters .doc-no-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    width: auto;
}

.filter-bar.order-review-filters .doc-no-controls .order-no-picker,
.filter-bar.order-review-filters > .field.inline.field-or-order-no .order-no-picker {
    flex: 0 0 10.5rem;
    width: 10.5rem;
    min-width: 10.5rem;
    max-width: 10.5rem;
    box-sizing: border-box;
}

.filter-bar.order-review-filters .doc-no-controls .order-no-picker .doc-no-input,
.filter-bar.order-review-filters .doc-no-controls .order-no-picker .addr-display,
.filter-bar.order-review-filters > .field.inline.field-or-order-no .order-no-picker .doc-no-input,
.filter-bar.order-review-filters > .field.inline.field-or-order-no .doc-no-input {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.filter-bar.order-review-filters > .field.inline.field-or-order-no .order-no-picker .addr-display {
    min-width: 0;
}

.filter-bar.order-review-filters > .field.inline.field-or-date {
    flex: 0 0 var(--date-input-width);
    width: var(--date-input-width);
    min-width: var(--date-input-width);
    max-width: var(--date-input-width);
}

.filter-bar.order-review-filters > .field.inline.field-or-order-type {
    flex: 0 0 6.5rem;
    width: 6.5rem;
    min-width: 6.5rem;
    max-width: 6.5rem;
}

.filter-bar.order-review-filters > .field.inline.field-or-vendor {
    flex: 0 0 14rem;
    width: 14rem;
    min-width: 14rem;
    max-width: 14rem;
}

.filter-bar.order-review-filters > .field.inline.field-or-vendor .region-address-picker {
    min-width: 0;
    width: 100%;
}

.filter-bar.order-review-filters > .field.inline.field-or-prod {
    flex: 0 0 auto;
    width: 17rem;
    max-width: none;
}

.filter-bar.order-review-filters > .field.inline.field-or-prod .region-address-picker {
    min-width: 0;
    width: 100%;
}

.filter-bar.order-review-filters > .field.inline.field-or-approval {
    flex: 0 0 7.25rem;
    width: 7.25rem;
    min-width: 7.25rem;
    max-width: 7.25rem;
}

.filter-bar.order-review-filters > .field.inline.field-or-decision {
    flex: 0 0 6.25rem;
    width: 6.25rem;
    min-width: 6.25rem;
    max-width: 6.25rem;
}

.filter-bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-end;
}

.filter-bar > .filter-bar-actions {
    flex: 0 0 auto;
}

.price-master-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

.price-master-filters .filter-bar-row {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.7rem;
    row-gap: 0.55rem;
    align-items: flex-end;
    width: 100%;
}

.price-master-filters .filter-bar-row--primary {
    align-items: flex-end;
}

.price-master-version-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.price-master-version-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.price-master-yymm-hint {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 400;
    color: #64748b;
    line-height: 1.25;
    max-width: 36rem;
}

.price-master-filters .filter-bar-row--secondary {
    padding-top: 0.15rem;
    border-top: 1px solid #eef2f7;
}

.price-master-filters .field.inline.field-yymm,
.price-master-filters .field.inline.ff-month {
    flex: 0 0 var(--month-input-width);
    width: var(--month-input-width);
    min-width: var(--month-input-width);
    max-width: var(--month-input-width);
}

.price-master-filters .field.inline.field-version {
    flex: 0 1 12rem;
    min-width: 10.5rem;
    max-width: 14rem;
}

.price-master-filters .field.inline.field-version .price-version-picker {
    width: 100%;
}

.price-master-filters .field.inline.field-prod-type {
    flex: 0 1 10rem;
    min-width: 9rem;
    max-width: 12rem;
}

.price-master-filters .field.inline.field-prod-cd {
    flex: 0 1 6.5rem;
    min-width: 5.5rem;
    max-width: 7.5rem;
}

.price-master-filters .field.inline.field-prod-nm {
    flex: 0 1 9rem;
    min-width: 8rem;
    max-width: 11rem;
}

.price-master-filters .field.inline.field-approval {
    flex: 0 1 8rem;
    min-width: 7rem;
    max-width: 10rem;
}

.price-master-filters .field.inline.field-bulk-date,
.price-master-filters .field.inline.field-apply-from,
.price-master-filters .field.inline.field-apply-to {
    flex: 0 0 auto;
    width: var(--date-input-width);
    min-width: var(--date-input-width);
    max-width: var(--date-input-width);
}

.price-master-filters .field.inline.field-action {
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
}

.price-master-filters .field.inline.field-action label {
    visibility: hidden;
}

.price-master-filters .filter-bar-row--secondary > .filter-bar-actions {
    margin-left: auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-end;
    flex: 0 1 auto;
    flex-wrap: wrap;
}

.lookup-table .lookup-row-selectable {
    cursor: pointer;
}

.lookup-table .lookup-row-selectable:hover {
    background: #f1f5f9;
}

.lookup-table .lookup-group-row td {
    background: #e8eef4;
    font-weight: 600;
    color: #334155;
    padding: 0.28rem 0.45rem;
    border-top: 1px solid #cbd5e1;
}

.price-version-lookup-dialog .price-version-lookup-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.price-version-lookup-dialog .price-version-lookup-filters .field.inline {
    flex: 0 1 10rem;
    min-width: 9rem;
    max-width: 12rem;
    margin-bottom: 0;
}

.price-version-lookup-dialog .price-version-lookup-filters .field.inline.field-version-search {
    flex: 1 1 14rem;
    min-width: 12rem;
    max-width: 22rem;
}

.price-version-lookup-dialog .price-version-lookup-filters .primary.inline-btn {
    margin-bottom: 0.1rem;
}

.price-master-table input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
    margin: 0;
    accent-color: #0f3460;
}

.filter-bar > .badge {
    align-self: flex-end;
    margin-bottom: 0.15rem;
}

.filter-bar .inline-btn { width: auto; padding: 0 1rem; }

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin: 0.75rem 0 1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #d0d7de);
    border-radius: 6px;
    background: var(--surface-muted, #f6f8fa);
}

.pagination-bar-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-bar-size label {
    margin: 0;
    white-space: nowrap;
}

.pagination-bar-size select {
    min-width: 4.5rem;
}

.pagination-bar-info {
    flex: 1 1 auto;
    min-width: 10rem;
    color: var(--text-muted, #57606a);
}

.pagination-bar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pagination-bar-nav .secondary-btn {
    min-width: 4rem;
    padding: 0 0.65rem;
}

.control-height,
.field input,
.field select,
.field textarea,
.primary.inline-btn,
.secondary-btn,
.filter-bar > button,
.filter-bar-actions > button:not(.shipping-register-filter-toggle) {
    min-height: 2.125rem;
    box-sizing: border-box;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select {
    padding: 0 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
}

.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid rgba(15, 52, 96, 0.2);
    border-color: #0f3460;
}

input[type="checkbox"],
input[type="radio"] {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus,
input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Native date inputs: compact width, minimal gap before calendar icon */
.field input[type="date"],
.filter-bar input[type="date"],
.data-table input[type="date"],
.perm-table input[type="date"] {
    width: var(--date-input-width);
    max-width: 100%;
    min-width: 0;
    padding-inline: 0.45rem 0.2rem;
    font-variant-numeric: tabular-nums;
}

.field.inline:has(> input[type="date"]),
.filter-bar .field.inline:has(> input[type="date"]),
.field.inline:has(> .date-input-wrap),
.filter-bar .field.inline:has(> .date-input-wrap) {
    flex: 0 0 auto;
    width: var(--date-input-width);
    min-width: var(--date-input-width);
    max-width: var(--date-input-width);
}

.field.inline:has(> .date-input-wrap) > .date-input-wrap,
.filter-bar .field.inline:has(> .date-input-wrap) > .date-input-wrap,
.data-table .date-input-wrap,
.perm-table .date-input-wrap {
    width: 100%;
    max-width: 100%;
}

.field input[type="date"]::-webkit-datetime-edit,
.filter-bar input[type="date"]::-webkit-datetime-edit,
.data-table input[type="date"]::-webkit-datetime-edit {
    padding: 0;
    min-width: 0;
}

.field input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.filter-bar input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.data-table input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.field input[type="date"]::-webkit-datetime-edit-text,
.field input[type="date"]::-webkit-datetime-edit-month-field,
.field input[type="date"]::-webkit-datetime-edit-day-field,
.field input[type="date"]::-webkit-datetime-edit-year-field {
    padding: 0 0.04rem;
}

.field input[type="date"]::-webkit-calendar-picker-indicator,
.filter-bar input[type="date"]::-webkit-calendar-picker-indicator,
.data-table input[type="date"]::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.date-input-wrap .date-picker-hit .date-native::-webkit-datetime-edit,
.date-input-wrap .date-picker-hit .date-native::-webkit-datetime-edit-fields-wrapper,
.date-input-wrap .date-picker-hit .date-native::-webkit-datetime-edit-text,
.date-input-wrap .date-picker-hit .date-native::-webkit-datetime-edit-month-field,
.date-input-wrap .date-picker-hit .date-native::-webkit-datetime-edit-day-field,
.date-input-wrap .date-picker-hit .date-native::-webkit-datetime-edit-year-field {
    display: none;
}

.date-input-wrap .date-picker-hit .date-native::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 1;
    cursor: pointer;
}

.primary.inline-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    width: auto;
}

.secondary-btn {
    padding: 0 1rem;
    border: 1px solid #0f3460;
    background: #fff;
    color: #0f3460;
    border-radius: 6px;
    cursor: pointer;
}

.secondary-btn:disabled,
.primary.inline-btn:disabled,
.primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.link-btn-inline {
    background: none;
    border: none;
    color: #0f3460;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    text-decoration: underline;
}

main > h1:first-child {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
}

main > h1 + .hint {
    margin-top: 0;
    margin-bottom: 1rem;
}

.summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #475569;
}

.data-table th,
.data-table td {
    vertical-align: middle;
}

.data-table th.num,
.data-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table td:has(> .num-input),
.data-table td:has(> input[type="number"]) {
    text-align: right;
}

.data-table input,
.data-table select {
    width: 100%;
    min-height: 1.875rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
}

.data-table input.num-input,
.data-table .num-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}


.form-card h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.85rem 1.25rem;
}

.form-grid .field {
    margin-bottom: 0;
}

.form-grid .field.span-2 {
    grid-column: 1 / -1;
}

input.readonly-field {
    background: #f3f4f6;
    color: #334155;
    cursor: default;
}

.badge {
    font-size: 0.8rem;
    background: #eef2f8;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
}
.codes-table input, .codes-table select { width: 100%; min-width: 4rem; font-size: 0.85rem; padding: 0.3rem; }
.codes-table .num-input { width: 4.5rem; }
.row-new td { background: #fffde7; }
.row-error td { background: #ffebee; }
.alert-inline { color: #b71c1c; font-size: 0.85rem; }
.row-selected td { background: #e8f4fc; }
.detail-panel { margin-top: 1rem; }
.detail-panel h3 { margin-top: 0; font-size: 1rem; }
.data-table.compact th, .data-table.compact td { padding: 0.35rem 0.5rem; font-size: 0.85rem; }

.pricing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 1rem;
    margin-top: 1rem;
    align-items: stretch;
}
@media (max-width: 900px) { .pricing-layout { grid-template-columns: minmax(0, 1fr); } }
.pricing-master h3, .pricing-detail h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    flex: 0 0 auto;
}
.pricing-layout > .pricing-master,
.pricing-layout > .pricing-detail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.pricing-layout .hint {
    flex: 0 0 auto;
}
.pricing-layout .perm-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.pricing-layout .perm-table-wrap > .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}
.pricing-layout .perm-table-wrap > .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f0f3f8;
    box-shadow: 0 1px 0 #e2e8f0;
}
.pricing-layout .pricing-master tbody tr {
    cursor: pointer;
}
.pricing-layout .pricing-master tbody tr.row-no-price td {
    background: #ffe8cc;
}
.pricing-layout .pricing-master tbody tr.row-selected td {
    background: #e8f4fc;
}
.pricing-layout .pricing-master td.num {
    text-align: right;
    white-space: nowrap;
}

.prod-prices-filters .field.inline.prod-prices-prod-cd {
    flex: 0 1 23rem;
    min-width: 18rem;
    max-width: 28rem;
}

.prod-prices-filters .field.inline.prod-prices-prod-type,
.prod-prices-filters .field.inline.prod-prices-approval {
    flex: 0 1 11.5rem;
    min-width: 9.5rem;
    max-width: 14rem;
}

.pricing-layout .pricing-master table input[type="checkbox"],
.pricing-layout .pricing-detail table input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
    margin: 0;
    accent-color: #0f3460;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.detail-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
    padding-top: 0.5rem;
}
.btn-compact,
.primary.inline-btn.btn-compact,
.secondary-btn.btn-compact {
    min-height: 1.625rem;
    padding: 0.1rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
    width: auto;
    flex: 0 0 auto;
}
.detail-footer .btn-compact { min-width: 0; }

.required-mark { color: #c62828; margin-left: 0.15rem; }
.hint-inline { font-size: 0.85rem; color: #666; font-weight: normal; margin-left: 0.35rem; }

.dev-code-hint {
    display: block;
    margin-top: 0.35rem;
    font-weight: 600;
    color: #0f3460;
}

.region-address-picker {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    min-width: 12rem;
}
.region-address-picker .addr-display {
    flex: 1;
    min-width: 5rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #f8fafc;
}
.region-address-picker .addr-display:not([readonly]):not(:disabled) {
    background: #fff;
}
.region-address-picker .addr-detail {
    flex: 1;
    min-width: 6rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
}
.region-address-picker .pick-btn {
    flex: 0 0 auto;
    min-width: 2rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
}
.region-address-picker .pick-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.region-address-picker.picker-btn-only {
    min-width: auto;
}

.order-line-prod-cd {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.order-line-prod-cd > .num-input {
    width: 5.5rem;
    min-width: 0;
}

.order-line-prod-nm {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    min-width: 0;
}

.order-line-prod-nm > input {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* Hide duplicate product name in prod-cd column (name has its own column). */
.order-register-table .order-line-prod-cd .region-address-picker .addr-display,
.order-register-table .order-line-prod-nm .region-address-picker .addr-display {
    display: none !important;
}

.order-register-table .order-line-prod-cd .region-address-picker,
.order-register-table .order-line-prod-nm .region-address-picker {
    min-width: auto;
    flex: 0 0 auto;
}

/* Column widths: order_type labels ~2–3 chars; unit codes ≤3 (EA/BOX/INB); qty numeric; prod_nm up to 50 chars. */
.order-register-table {
    table-layout: fixed;
}

.order-register-table .col-order-type {
    width: 8.75rem;
}

.order-register-table .col-order-type select {
    min-width: 0;
    padding-left: 0.35rem;
    padding-right: 1.4rem;
}

.order-register-table .col-prod-cd {
    width: 5.5rem;
    min-width: 5rem;
}

.order-register-table .col-prod-nm {
    min-width: 12rem;
    width: 18%;
    max-width: 22rem;
}

.order-register-table .col-note {
    min-width: 10rem;
    width: 16%;
    max-width: 22rem;
}

.order-register-table .col-note input {
    min-width: 0;
    width: 100%;
}

.order-register-table .col-unit {
    width: 5.5rem;
    min-width: 5rem;
}

.order-register-table .col-unit select {
    min-width: 0;
    width: 100%;
    padding-left: 0.3rem;
    padding-right: 1.2rem;
}

.order-register-table .col-qty {
    width: 6.75rem;
}

.order-register-table .col-qty input {
    min-width: 0;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}

.order-register-table .col-storage {
    min-width: 10.5rem;
    width: 12rem;
    max-width: 14rem;
}

.order-register-table .col-storage .pb-edit {
    width: 100%;
    min-width: 10rem;
}

.order-register-table .col-price {
    width: 7.25rem;
}

.order-register-table .col-price input {
    min-width: 0;
    width: 100%;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}

.order-register-table .col-date {
    width: 8.75rem;
    min-width: 8.25rem;
}

.order-register-table .col-date .date-input-solo,
.order-register-table .col-date .pb-edit {
    width: 100%;
    min-width: 0;
}

.input-register-table .col-prod-cd {
    width: 5.5rem;
    max-width: 5.5rem;
}

.input-register-table .col-prod-nm {
    min-width: 12rem;
    width: 14rem;
}

.input-register-table .col-standard {
    min-width: 6rem;
    max-width: 8rem;
}

.input-register-table .col-prod-unit {
    min-width: 5rem;
    max-width: 7rem;
}

.input-register-table .col-cost-type {
    min-width: 5.5rem;
}

.input-register-table .col-manager {
    min-width: 5rem;
    max-width: 7rem;
}

.input-register-table .col-approval-user {
    min-width: 4.5rem;
    max-width: 6rem;
}

.input-register-table .col-unit {
    min-width: 3.75rem;
    width: 4rem;
    max-width: 4.5rem;
}

.input-register-table .col-unit select {
    min-width: 3.75rem;
    max-width: 100%;
}

.input-register-table .prod-cd-input {
    width: 100%;
    max-width: 5rem;
    min-width: 4.5rem;
}

.input-register-table .input-prod-nm-pick {
    min-width: 0;
}

.input-register-table .input-prod-nm-pick > input {
    flex: 1;
    min-width: 0;
}

.input-register-table .input-prod-nm-pick > .region-address-picker {
    min-width: auto;
    flex: 0 0 auto;
}

.input-register-table .input-prod-nm-pick > .region-address-picker .addr-display {
    display: none;
}

.modal-dialog.confirm-dialog {
    width: min(420px, 100%);
}
.confirm-message {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
}

.confirm-dialog-footer {
    margin-top: 0;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.modal-overlay-stacked {
    z-index: 2100;
}
.idle-session-overlay {
    z-index: 2200;
}
.idle-session-dialog .idle-session-count {
    margin: 0.35rem 0 0.85rem;
    text-align: center;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
    color: #b45309;
}
.modal-dialog {
    background: #fff;
    border-radius: 8px;
    width: min(720px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.modal-header h2, .modal-header h3 { margin: 0; font-size: 1.05rem; flex: 1; }
.modal-header.modal-drag-handle { cursor: move; user-select: none; }
.modal-dialog.movement-dialog { width: min(980px, 100%); }
.movement-title-meta { margin-left: 1rem; font-weight: 500; font-size: 0.88em; color: #475569; }
.movement-dialog tr.movement-open-row td { background: #eef6ff; font-weight: 600; }
.modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0 0.25rem;
}
.modal-body { padding: 0.75rem 1rem 1rem; overflow: auto; }
.lookup-list-wrap { max-height: 50vh; overflow: auto; }
.modal-dialog.order-prod-lookup-dialog {
    width: min(1360px, 96vw);
    max-width: 96vw;
}
.order-prod-lookup-dialog .lookup-list-wrap {
    overflow: auto;
}
.order-prod-lookup-dialog .lookup-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}
.order-prod-lookup-dialog .lookup-table th,
.order-prod-lookup-dialog .lookup-table td {
    white-space: nowrap;
}
.lookup-search-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.lookup-search-row input { flex: 1; min-width: 0; }
.lookup-search-row .inline-btn { width: auto; white-space: nowrap; }

/* Receiving: import-from-shipping popup toolbar (label + input + search + import). */
.output-import-search-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-width: 0;
}
.output-import-search-row > label {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
}
.output-import-search-row > input {
    flex: 1 1 auto;
    min-width: 8rem;
    width: auto;
}
.output-import-search-row > .inline-btn {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}
.lookup-table { width: 100%; }

.modal-dialog.prod-lookup-dialog {
    width: min(820px, 96vw);
}
.prod-lookup-dialog .lookup-table {
    table-layout: fixed;
    width: 100%;
}
.prod-lookup-dialog .lookup-table th {
    white-space: nowrap;
}
.prod-lookup-dialog .col-lookup-prod-cd { width: 6.75rem; }
.prod-lookup-dialog .col-lookup-prod-nm { width: auto; }
.prod-lookup-dialog .col-lookup-standard { width: 6.5rem; }
.prod-lookup-dialog .col-lookup-inner { width: 8.5rem; }
.prod-lookup-dialog .col-lookup-unit { width: 4.5rem; }
.prod-lookup-dialog .lookup-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-dialog.customer-lookup-dialog .lookup-table {
    table-layout: fixed;
    width: 100%;
}
.modal-dialog.customer-lookup-dialog .col-lookup-cust-cd {
    width: 8.75rem;
}
.modal-dialog.customer-lookup-dialog .col-lookup-cust-nm {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.modal-dialog.customer-lookup-dialog .col-lookup-select {
    width: 6.5rem;
    text-align: center;
    white-space: nowrap;
}
.lookup-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.lookup-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}
.lookup-footer .primary.inline-btn { width: auto; }

.multi-select-dropdown {
    position: relative;
    width: 100%;
}

.multi-select-dropdown.open {
    z-index: 1300;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

.multi-select-trigger:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.multi-select-summary {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.multi-select-caret {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 0.75rem;
}

.multi-select-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1290;
    background: transparent;
}

.multi-select-panel {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 2;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    max-height: 11rem;
    display: flex;
    flex-direction: column;
}

.multi-select-panel-header {
    padding: 0.15rem 0.35rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.multi-select-select-all {
    width: 100%;
    max-width: none;
    font-weight: 600;
}

.multi-select-list {
    overflow-y: auto;
    padding: 0.15rem 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.multi-select-item,
.field label.multi-select-item,
.multi-select-dropdown label.multi-select-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    min-width: 0;
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

.multi-select-item:hover {
    background: #f1f5f9;
    border-radius: 4px;
}

.multi-select-item input[type="checkbox"],
.field .multi-select-item input[type="checkbox"] {
    flex: 0 0 auto;
    width: 0.75rem;
    height: 0.75rem;
    min-height: 0;
    margin: 0;
    padding: 0;
    order: 0;
    accent-color: #0f3460;
}

.multi-select-item > span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    order: 1;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    max-width: 28rem;
    padding: 0.25rem 0;
}
.checkbox-group .chk {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

label.file-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
}
label.file-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}
label.file-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* PGM_HELP help_type color rules (IMP-922) */
.help-type-badge {
    display: inline-block;
    min-width: 1.4rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    color: #fff;
}
.help-type-select { border-left: 4px solid transparent; padding-left: 0.35rem; }
.help-type-p, .help-type-badge.help-type-p, .help-type-select.help-type-p { border-left-color: #2563eb; }
.help-type-badge.help-type-p { background: #2563eb; }
.help-type-o, .help-type-badge.help-type-o, .help-type-select.help-type-o { border-left-color: #059669; }
.help-type-badge.help-type-o { background: #059669; }
.help-type-c, .help-type-badge.help-type-c, .help-type-select.help-type-c { border-left-color: #d97706; }
.help-type-badge.help-type-c { background: #d97706; }
.help-type-a, .help-type-badge.help-type-a, .help-type-select.help-type-a { border-left-color: #dc2626; }
.help-type-badge.help-type-a { background: #dc2626; }
tr.help-type-row.help-type-p td:first-child { box-shadow: inset 4px 0 0 #2563eb; }
tr.help-type-row.help-type-o td:first-child { box-shadow: inset 4px 0 0 #059669; }
tr.help-type-row.help-type-c td:first-child { box-shadow: inset 4px 0 0 #d97706; }
tr.help-type-row.help-type-a td:first-child { box-shadow: inset 4px 0 0 #dc2626; }

/* Contextual help drawer (IMP-923) */
.help-toggle {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 1.75rem;
}
.help-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1100;
}
.help-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(450px, 94vw);
    height: 100vh;
    background: #fff;
    z-index: 1101;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.18);
    padding: 1rem 1.25rem 1.5rem;
    overflow: auto;
}
.help-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.help-drawer-header h2 { margin: 0; font-size: 1.05rem; }
.help-drawer-summary {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #1e293b;
    font-weight: 500;
}
.help-section { margin: 1rem 0; }
.help-section h3 {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.help-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
}
.help-list li { margin-bottom: 0.35rem; }
.help-section.help-type-p { border-left: 3px solid #2563eb; padding-left: 0.6rem; }
.help-section.help-type-o { border-left: 3px solid #059669; padding-left: 0.6rem; }
.help-section.help-type-c { border-left: 3px solid #d97706; padding-left: 0.6rem; }
.help-section.help-type-a { border-left: 3px solid #dc2626; padding-left: 0.6rem; }

/* --- Mobile / narrow screens --- */
.menu-toggle,
.sidebar-backdrop,
.sidebar-mobile-header {
    display: none;
}

@media (max-width: 900px) {
    .platform-page__inner {
        grid-template-columns: 1fr;
        padding: 2.5rem 1.25rem 1.5rem;
        gap: 2rem;
    }

    .platform-highlights {
        grid-template-columns: 1fr;
    }

    .platform-aside {
        position: static;
        max-width: 360px;
        margin: 0 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .with-sidebar {
        display: block;
    }

    .with-sidebar.sidebar-collapsed {
        grid-template-columns: unset;
    }

    .sidebar-desktop-tools {
        display: none;
    }

    .sidebar-collapsed .menu-label,
    .sidebar-collapsed .menu-caret,
    .sidebar-collapsed .menu-children {
        display: revert !important;
    }

    .sidebar-collapsed .menu-row {
        justify-content: flex-start;
        gap: 0.65rem;
        padding: 0.72rem 0.85rem;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1200;
        width: min(17.5rem, 88vw);
        min-height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: none;
        padding-top: 0;
    }

    .page.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1199;
        border: none;
        padding: 0;
        margin: 0;
        background: rgba(15, 23, 42, 0.45);
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0.22s ease;
    }

    .page.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.65rem 0.75rem 0.35rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        margin-bottom: 0.35rem;
    }

    .sidebar-mobile-title {
        font-weight: 700;
        font-size: 0.95rem;
    }

    .sidebar-close {
        border: none;
        background: transparent;
        color: #fff;
        font-size: 1.6rem;
        line-height: 1;
        padding: 0.15rem 0.35rem;
        cursor: pointer;
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.4);
        background: transparent;
        color: #fff;
        border-radius: 4px;
        font-size: 1.25rem;
        line-height: 1;
        min-width: 2.75rem;
        min-height: 2.75rem;
        padding: 0;
        cursor: pointer;
        flex: 0 0 auto;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 0.45rem 0.65rem;
        padding: 0.55rem 0.75rem;
    }

    .topbar .brand {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.95rem;
    }

    .topbar .app-version--topbar {
        order: 1;
        font-size: 0.72rem;
        padding: 0.12rem 0.45rem;
    }

    .topbar .user {
        display: none;
    }

    .topbar .lang-switch {
        order: 2;
        margin-left: auto;
        font-size: 0.8rem;
    }

    .topbar .help-toggle,
    .topbar .logout-btn {
        order: 3;
        min-height: 2.75rem;
        padding: 0.35rem 0.65rem;
    }

    main {
        padding: 1rem 0.75rem;
    }

    .app-page {
        padding: 0.55rem 0.75rem 0.65rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .filter-bar .field.inline,
    .filter-bar .field.inline.wide,
    .filter-bar .field.inline.wide2x,
    .filter-bar .field.block {
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    .field.inline:has(> label + input + button) {
        max-width: none;
    }

    .filter-bar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .filter-bar-actions .primary,
    .filter-bar-actions .inline-btn {
        width: auto;
        flex: 0 0 auto;
        min-height: 2.125rem;
    }

    .perm-toolbar,
    .perm-page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .perm-page-head__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .perm-page-head__actions .primary.inline-btn,
    .perm-page-head__actions .secondary-btn {
        flex: 0 0 auto;
        width: auto;
    }

    .actions-row {
        flex-wrap: wrap;
        align-items: center;
    }

    .actions-row .primary,
    .actions-row .inline-btn,
    .actions-row button {
        width: auto;
        flex: 0 0 auto;
        min-height: 2.125rem;
    }

    .detail-footer {
        justify-content: flex-end;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        max-width: none;
    }

    .data-table {
        font-size: 0.82rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.45rem 0.4rem;
    }

    .menu-item { margin: 0; font-size: 0.88rem; }
    .menu-row {
        min-height: 2.75rem;
    }

    .portal {
        padding: 1.25rem 1rem 5.5rem;
    }

    .portal h1 {
        font-size: 1.5rem;
    }

    /* Let the workspace grow with content; scroll on main (nested flex + overflow:hidden
       clips everything after filters expand, e.g. shipping register after output_no load). */
    .app-main > main.app-page {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    .workspace-pane {
        flex: 0 0 auto;
        min-height: min-content;
        overflow: visible;
    }

    :is(.app-page, .workspace-pane) > .perm-table-wrap,
    :is(.app-page, .workspace-pane) > .query-list-wrap {
        flex: 0 0 auto;
        min-height: min(12rem, 38vh);
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }

    :is(.app-page, .workspace-pane) > .perm-table-wrap.input-register-lines-wrap,
    :is(.app-page, .workspace-pane) > .perm-table-wrap.shipping-register-lines-wrap {
        flex: 0 0 auto;
        min-height: min(14rem, 42vh);
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }

    :is(.app-page, .workspace-pane) > .pricing-layout {
        flex: 0 0 auto;
        min-height: min-content;
        overflow: visible;
    }

    :is(.app-page, .workspace-pane) > .collection-register-body {
        flex: 0 0 auto;
        min-height: min-content;
        overflow: visible;
    }

    .collection-register-body > .collection-splitter {
        display: none;
    }

    .collection-register-body > .collection-panel-top,
    .collection-register-body > .collection-panel-bottom {
        flex: 0 0 auto;
        min-height: min-content;
        overflow: visible;
    }

    .collection-register-body .perm-table-wrap {
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }
}

@media (min-width: 769px) {
    .sidebar {
        position: sticky;
        top: 0;
        align-self: start;
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* Receipt / shipping slip report header (legacy dw_ip030r_g1 / dw_op030r_g1 logo) */
.report-doc-header {
    position: relative;
    display: block;
    min-height: 72px;
    margin-bottom: 1rem;
    padding: 0 8rem;
}

.report-doc-logo-wrap {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    display: block;
    width: max-content;
    line-height: 0;
    background: transparent;
}

.report-doc-logo {
    display: block;
    max-height: 72px;
    max-width: 12.5rem;
    width: auto;
    height: auto;
    object-fit: contain;
    background: transparent;
    image-rendering: -webkit-optimize-contrast;
}

/* AYS wordmark is much wider than HDC; shrink on 입고단/출고단 only. */
.slip-report .report-doc-logo-ays,
.rc-report .report-doc-logo-ays {
    max-height: 52px;
    max-width: 10.5rem;
}

.slip-report,
.rc-report {
    overflow: visible;
}

.report-doc-title {
    text-align: center;
    margin: 0 0 0.5rem;
}

.report-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    justify-content: center;
    font-size: 0.9rem;
    margin: 0;
}

.po-report .report-doc-header {
    padding: 0;
}

.po-report .po-meta {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0.15rem;
    text-align: right;
    white-space: nowrap;
}

@media print {
    /* Hide app chrome — print report body only */
    .sidebar,
    .sidebar-backdrop,
    .topbar,
    .workspace-tabstrip,
    .app-version-stale-bar,
    .help-drawer-overlay,
    .help-drawer,
    .no-print {
        display: none !important;
    }

    html,
    body {
        background: #fff !important;
    }

    .page,
    .page.with-sidebar,
    .app-main,
    .app-page,
    main {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: auto !important;
    }

    .rc-report,
    .slip-report,
    .po-report,
    .st-report,
    .rpt-report,
    .pm-report {
        margin: 0 !important;
        overflow: visible !important;
    }

    /* Logo left + title centered on one band (stats reports). */
    .rpt-report .report-doc-header,
    .pm-report .report-doc-header {
        position: relative !important;
        display: block !important;
        min-height: 14mm !important;
        margin-bottom: 3mm !important;
        padding: 0 42mm !important;
    }

    .rpt-report .report-doc-logo-wrap,
    .pm-report .report-doc-logo-wrap {
        position: absolute !important;
        left: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: auto !important;
        max-width: 40mm !important;
        line-height: 0 !important;
    }

    .rpt-report .report-doc-logo,
    .pm-report .report-doc-logo,
    .report-doc-logo {
        display: block !important;
        max-height: 12mm !important;
        max-width: 40mm !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }

    .rpt-report .report-doc-body,
    .pm-report .report-doc-body {
        text-align: center !important;
    }

    .rpt-report .report-doc-title,
    .pm-report .report-doc-title {
        text-align: center !important;
        margin: 0 0 1.5mm !important;
        font-size: 16pt !important;
        line-height: 1.25 !important;
    }

    .rpt-report .report-doc-meta,
    .pm-report .report-doc-meta {
        justify-content: center !important;
        font-size: 9pt !important;
        margin: 0 !important;
    }

    .po-report .report-doc-header {
        position: relative !important;
        padding: 0 !important;
    }

    .po-report .po-meta,
    .po-report .po-print-meta {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        justify-content: flex-start !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        font-size: 10pt !important;
        gap: 0.5mm !important;
        margin: 0 !important;
    }

    .slip-report .report-doc-logo {
        max-height: 14mm;
        max-width: 42mm;
    }

    .slip-report .report-doc-logo-ays,
    .rc-report .report-doc-logo-ays {
        max-height: 44px;
        max-width: 168px;
    }
}
