:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --line: #d6dde6;
    --line-strong: #b8c3d1;
    --text: #1f2933;
    --muted: #607080;
    --brand: #1f6f78;
    --brand-strong: #155e66;
    --accent: #4661c7;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --warn-bg: #fff7d6;
    --ok-bg: #e8f5ee;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 10px 28px rgba(15, 23, 42, .06);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    letter-spacing: 0 !important;
}

html {
    min-width: 0;
}

body.legacy-modern {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}

a,
a:visited {
    color: var(--brand);
}

a:hover {
    color: var(--brand-strong);
    text-decoration: underline;
}

.legacy-appbar {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}

.legacy-appbar__inner {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1280px;
    min-height: 58px;
    padding: 0 22px;
}

.legacy-brand {
    align-items: center;
    color: var(--text) !important;
    display: inline-flex;
    gap: 10px;
    min-width: max-content;
    text-decoration: none;
}

.legacy-brand__mark {
    align-items: center;
    background: var(--brand);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.legacy-brand strong,
.legacy-brand small {
    display: block;
    line-height: 1.15;
}

.legacy-brand small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.legacy-global-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.legacy-global-nav a {
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    font-weight: 600;
    min-height: 34px;
    padding: 7px 12px;
    text-decoration: none;
}

.legacy-global-nav a:hover {
    background: #e8f3f4;
    color: var(--brand-strong);
}

.legacy-main {
    padding: 20px;
}

#wrapper,
#wrapper2 {
    background: transparent;
    margin: 0 auto;
    max-width: 1280px;
    padding: 0;
    width: 100%;
}

h2 {
    background: transparent;
    border-bottom: 2px solid var(--brand);
    color: var(--text);
    font-size: 23px;
    font-weight: 700;
    height: auto;
    line-height: 1.3;
    margin: 0 0 10px;
    padding: 0 0 10px;
}

h3 {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

#pan {
    align-items: center;
    background: transparent;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 0 0 12px;
}

#pan li {
    color: var(--muted);
    display: inline-flex;
    padding: 0;
}

#pan li::after {
    color: var(--line-strong);
    content: "/";
    padding-left: 6px;
}

#pan li:last-child::after {
    content: "";
    padding: 0;
}

#pan li a {
    background: none;
    color: var(--brand);
    padding: 0;
}

.legacy-error,
.legacy-notice {
    border-radius: var(--radius);
    margin: 12px 0;
    max-width: none;
    padding: 10px 14px;
    width: auto;
}

.legacy-error {
    background: var(--danger-bg);
    border: 1px solid #f1b5ae;
    color: var(--danger);
}

.legacy-notice {
    background: var(--ok-bg);
    border: 1px solid #afd7c1;
    color: #276749;
}

input,
select,
textarea,
button {
    font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
input:not([type]),
select,
textarea,
.Text,
.Text2,
.TextIME,
.Num,
.Label,
.LNum {
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--text);
    min-height: 34px;
    padding: 6px 9px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 111, 120, .13);
    outline: 0;
}

textarea {
    min-height: 88px;
    resize: vertical;
}

.Label,
.LNum {
    background: var(--surface-2);
    color: var(--muted);
}

.Num,
.LNum,
.txt_r {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

input[type="checkbox"] {
    height: 16px;
    margin: 0 5px;
    vertical-align: -2px;
    width: 16px;
}

button,
input[type="button"],
input[type="submit"],
.noback_btn,
.opn_btn,
.shiborikomi_btn,
.regi_new a,
#go_mmenu p a,
#go_mmenu2 p a,
#go_mmenu3 p a {
    align-items: center;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #fff !important;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    line-height: 1.2;
    min-height: 34px;
    padding: 7px 12px;
    text-align: center;
    text-decoration: none !important;
    width: auto;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.noback_btn:hover,
.opn_btn:hover,
.shiborikomi_btn:hover,
.regi_new a:hover,
#go_mmenu p a:hover,
#go_mmenu2 p a:hover,
#go_mmenu3 p a:hover {
    background: var(--brand-strong);
    color: #fff !important;
}

input[value="削除"] {
    background: #fff;
    border-color: #d92d20;
    color: #b42318 !important;
}

input[value="削除"]:hover {
    background: #fff1f0;
    color: #912018 !important;
}

.legacy-action-primary {
    background: #0f766e !important;
    border-color: #0f766e !important;
    color: #fff !important;
}

.legacy-action-primary:hover {
    background: #115e59 !important;
}

.legacy-action-secondary,
.legacy-action-done {
    background: #fff !important;
    border-color: var(--line-strong) !important;
    color: var(--text) !important;
}

.legacy-action-secondary:hover,
.legacy-action-done:hover {
    background: #eef7f8 !important;
    color: var(--brand-strong) !important;
}

.legacy-action-done {
    border-color: #9fc6b7 !important;
    color: #276749 !important;
}

.legacy-action-danger {
    background: #fff !important;
    border-color: #d92d20 !important;
    color: #b42318 !important;
}

.w15 { width: 16px !important; }
.w40 { width: 40px !important; }
.w50 { width: 50px !important; }
.w55 { width: 55px !important; }
.w60 { width: 60px !important; }
.w65 { width: 65px !important; }
.w70 { width: 70px !important; }
.w75 { width: 75px !important; }
.w80 { width: 80px !important; }
.w90 { width: 90px !important; }
.w100 { width: 100px !important; }
.w120 { width: 120px !important; }
.w130 { width: 130px !important; }
.w150 { width: 150px !important; }
.w180 { width: 180px !important; }
.w185 { width: 185px !important; }
.w200 { width: 200px !important; }
.w210 { width: 210px !important; }
.w220 { width: 220px !important; }
.w250 { width: 250px !important; }
.w260 { width: 260px !important; }
.w300 { width: 300px !important; }
.w365 { width: 365px !important; }
.w370 { width: 370px !important; }
.w390 { width: 390px !important; }
.w430 { width: 430px !important; }
.w500 { width: 500px !important; }
.w550 { width: 550px !important; }
.w600 { width: 600px !important; }
.w940 { width: 100% !important; }

input,
select,
textarea {
    max-width: 100%;
}

.legacy-date-field {
    align-items: stretch;
    display: inline-grid;
    grid-template-columns: minmax(0, auto);
    max-width: 100%;
    position: relative;
    vertical-align: middle;
}

.legacy-date-field > input {
    min-width: 0;
    padding-right: 38px !important;
}

.legacy-range .legacy-date-field,
.legacy-pair .legacy-date-field,
.legacy-filter .legacy-date-field {
    width: 100%;
}

.legacy-date-button {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 4px !important;
    bottom: 3px;
    color: #41606a !important;
    display: inline-flex;
    justify-content: center;
    min-height: 0 !important;
    padding: 0 !important;
    position: absolute;
    right: 3px;
    top: 3px;
    width: 30px !important;
}

.legacy-date-button:hover,
.legacy-date-button:focus {
    background: #e8f3f4 !important;
    color: var(--brand-strong) !important;
}

.legacy-date-button::before {
    background: linear-gradient(currentColor, currentColor) 0 4px / 100% 2px no-repeat;
    border: 2px solid currentColor;
    border-radius: 3px;
    content: "";
    height: 15px;
    width: 15px;
}

.legacy-date-picker {
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
    color: var(--text);
    padding: 10px;
    position: fixed;
    width: 296px;
    z-index: 2000;
}

.legacy-date-picker[hidden] {
    display: none;
}

.legacy-date-picker__head {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 34px 1fr 34px;
    margin-bottom: 8px;
}

.legacy-date-picker__month {
    color: var(--text);
    font-weight: 800;
    text-align: center;
}

.legacy-date-picker__nav,
.legacy-date-picker__utility,
.legacy-date-picker__day {
    border-radius: 6px !important;
    display: inline-flex;
    justify-content: center;
    line-height: 1;
    padding: 0 !important;
}

.legacy-date-picker__nav {
    background: #fff !important;
    border: 1px solid var(--line) !important;
    color: var(--text) !important;
    min-height: 34px !important;
    width: 34px !important;
}

.legacy-date-picker__nav:hover,
.legacy-date-picker__utility:hover,
.legacy-date-picker__day:hover {
    background: #e8f3f4 !important;
    border-color: var(--brand) !important;
    color: var(--brand-strong) !important;
}

.legacy-date-picker__week,
.legacy-date-picker__grid {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.legacy-date-picker__week {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
    text-align: center;
}

.legacy-date-picker__day {
    background: #fff !important;
    border: 1px solid transparent !important;
    color: var(--text) !important;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    min-height: 34px !important;
    width: 100% !important;
}

.legacy-date-picker__day--outside {
    color: #97a3b0 !important;
}

.legacy-date-picker__day--today {
    border-color: var(--brand) !important;
}

.legacy-date-picker__day--selected {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}

.legacy-date-picker__foot {
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 10px;
}

.legacy-date-picker__utility {
    background: #fff !important;
    border: 1px solid var(--line-strong) !important;
    color: var(--text) !important;
    min-height: 32px !important;
    min-width: 64px;
}

.pa_center {
    color: var(--muted);
    font-weight: 700;
    padding: 16px 0 0;
    width: auto;
}

body.legacy-login .legacy-main {
    align-items: center;
    display: flex;
    min-height: calc(100vh - 58px);
}

body.legacy-login #wrapper {
    max-width: 760px;
}

#name_btn {
    display: grid;
    gap: 14px;
    margin: 24px auto 0;
    max-width: 520px;
    padding: 0;
    text-align: center;
    width: 100%;
}

#name_btn input {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    color: var(--text) !important;
    min-height: 48px;
    width: 100%;
}

#name_btn input:hover {
    background: #e8f3f4;
    border-color: var(--brand);
    color: var(--brand-strong) !important;
}

#name_btn .Sclose {
    margin: 20px auto 0;
    max-width: 220px;
}

.mmenu_btn {
    display: grid;
    float: none;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin: 0 0 18px;
    padding: 0;
    width: 100%;
}

.mmenu_btn li,
#pmenu_box dt {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    float: none;
    height: auto;
    margin: 0;
    min-height: 54px;
    width: auto;
}

.mmenu_btn .end_btn {
    margin-top: 0;
}

.mmenu_btn a,
#pmenu_box dt a {
    align-items: center;
    color: var(--text) !important;
    display: flex;
    height: 100%;
    justify-content: center;
    min-height: 54px;
    padding: 10px;
    width: 100%;
}

.mmenu_btn a:hover,
#pmenu_box dt a:hover {
    background: #e8f3f4;
    color: var(--brand-strong) !important;
    text-decoration: none;
}

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

.legacy-kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: 78px;
    padding: 12px 14px;
}

.legacy-kpi span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.legacy-kpi strong {
    color: var(--text);
    display: block;
    font-size: 30px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 7px;
}

.legacy-kpi--danger {
    border-left: 5px solid var(--danger);
}

.legacy-kpi--warn {
    border-left: 5px solid #d69e2e;
}

#pmenu_box,
#print_box,
#master_box,
#mlist_box,
.legacy-filter,
.legacy-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 12px 0;
    padding: 16px;
    width: 100%;
}

#mlist_box {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

#pmenu_box dl {
    display: grid;
    gap: 10px 14px;
    grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
    margin: 0;
    width: 100%;
}

#pmenu_box dd {
    align-items: center;
    color: var(--muted);
    display: flex;
    float: none;
    height: auto;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    width: auto;
}

#master_box h3,
#print_box h3,
#mlist_box h3 {
    border-left: 4px solid var(--accent);
    margin: 4px 0 12px;
    padding-left: 10px;
    text-indent: 0;
}

#h3_box {
    margin: 0;
    width: 100%;
}

.regi_new {
    margin: 8px 0 18px;
    width: auto;
}

.regi_new a {
    width: auto;
}

.legacy-filter {
    clear: both;
    border-left: 5px solid var(--brand);
    padding: 18px;
}

.legacy-filter form,
form.legacy-filter {
    align-items: end;
    display: grid;
    gap: 14px 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.legacy-filter-grid {
    grid-template-columns: minmax(180px, .75fr) repeat(2, minmax(240px, 1fr)) minmax(280px, 1.1fr);
}

.legacy-filter-field,
.legacy-filter-options,
.legacy-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.legacy-filter-field--pair {
    grid-column: span 2;
}

.legacy-filter-field--staff {
    min-width: 0;
}

.legacy-filter-field--full {
    grid-column: 1 / -1;
}

form.legacy-filter > div:not([class]) {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.legacy-filter-field > label,
form.legacy-filter > div:not([class]) > label {
    color: #475569;
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    min-width: 0;
    width: 100%;
}

.legacy-range {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.legacy-range span {
    color: #475569;
    font-weight: 700;
    text-align: center;
}

.legacy-pair {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(86px, .36fr) minmax(0, 1fr);
}

.legacy-month-selects {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(96px, 1fr) auto minmax(72px, .7fr) auto;
}

.legacy-filter-grid input:not([type="checkbox"]),
.legacy-filter-grid select {
    width: 100% !important;
}

.legacy-check {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-weight: 700;
    gap: 6px;
    line-height: 1.3;
    min-height: 34px;
}

.legacy-check input {
    flex: 0 0 auto;
    height: 16px !important;
    margin: 0;
    width: 16px !important;
}

.legacy-filter-options,
.legacy-filter-actions {
    justify-content: end;
}

.legacy-filter-options {
    grid-column: span 2;
}

.legacy-filter-actions {
    align-items: flex-start;
}

.legacy-filter-actions .shiborikomi_btn {
    min-width: 128px;
}

.legacy-process-filter {
    margin-top: 14px;
}

.legacy-process-grid {
    display: grid;
    gap: 10px 16px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.legacy-check-grid {
    display: grid;
    gap: 8px 14px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.legacy-check-grid label {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-weight: 700;
    gap: 6px;
    min-height: 32px;
}

.legacy-check-grid input {
    flex: 0 0 auto;
    height: 16px !important;
    margin: 0;
    width: 16px !important;
}

@media (max-width: 520px) {
    .legacy-check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legacy-check-grid label {
        align-items: flex-start;
        font-size: 13px;
        line-height: 1.3;
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 420px) {
    .legacy-check-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.legacy-process-grid label {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    gap: 8px;
    min-height: 36px;
    padding: 6px 10px;
}

#master_box dl,
.w940.clearfix,
.legacy-wide {
    display: grid;
    gap: 10px 12px;
    grid-template-columns: 130px minmax(0, 1fr);
    width: 100% !important;
}

#master_box dt,
.legacy-wide dt {
    align-self: center;
    color: var(--muted);
    float: none;
    font-weight: 700;
    margin: 0;
    padding: 0;
    text-align: right;
    width: auto;
}

#master_box dd,
.legacy-wide dd {
    float: none;
    margin: 0;
    width: auto;
}

#master_box input:not([type="checkbox"]):not([type="radio"]),
#master_box select,
#master_box textarea {
    width: min(100%, 320px);
}

#matter-form {
    padding-bottom: 88px;
}

#basic.legacy-panel {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr);
}

.legacy-matter-strip {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 1px;
    grid-template-columns: 130px minmax(150px, .9fr) minmax(240px, 1.4fr) 130px 110px;
    margin: 0 0 12px;
    overflow: hidden;
}

.legacy-matter-strip div {
    background: var(--surface-2);
    min-width: 0;
    padding: 10px 12px;
}

.legacy-matter-strip span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.legacy-matter-strip strong {
    color: var(--text);
    display: block;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#basic .dlL,
#basic .dlR {
    background: transparent;
    display: grid;
    float: none;
    gap: 10px 12px;
    grid-template-columns: 112px minmax(0, 1fr);
    margin: 0;
    padding: 0;
    width: auto;
}

#basic .dlL::before,
#basic .dlR::before,
#basic .legacy-wide::before {
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    grid-column: 1 / -1;
    padding: 0 0 8px;
}

#basic .dlL::before {
    content: "受注・日程";
}

#basic .dlR::before {
    content: "製品・材料";
}

#basic .legacy-wide::before {
    content: "材料・単価・備考";
}

#basic dt,
#basic dd {
    float: none;
    height: auto;
    line-height: 1.4;
    margin: 0;
    width: auto;
}

#basic dt {
    align-self: center;
    color: var(--muted);
    font-weight: 700;
    text-align: right;
}

#basic .clear {
    display: none;
}

#basic .legacy-wide {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 96px minmax(90px, 1fr));
}

.legacy-inline-field {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.legacy-matter-wide {
    align-items: start;
}

.legacy-matter-wide textarea {
    width: min(100%, 430px) !important;
}

.legacy-matter-wide input[readonly] {
    background: var(--surface-2);
    color: var(--muted);
}

.legacy-billing-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    margin-top: 14px;
}

.legacy-billing-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}

.legacy-billing-box h3 {
    border-left: 4px solid var(--accent);
    margin: 0 0 12px;
    padding-left: 10px;
}

.legacy-billing-head {
    margin-top: 12px;
}

#tab_box {
    align-items: end;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 4px;
    margin: 12px 0 0;
}

#tab_box h3 {
    margin: 0;
}

#tab_box a {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    color: var(--muted);
    display: inline-flex;
    min-height: 36px;
    padding: 8px 14px;
    text-decoration: none;
}

#tab_box a.active,
#tab_box a:hover {
    background: #fff;
    color: var(--brand-strong);
}

#process.legacy-panel {
    overflow-x: auto;
}

#k_tbl {
    border: 1px solid var(--line);
    margin: 0 0 16px;
    min-width: 920px;
    width: 100%;
}

#k_tbl th,
#k_tbl td {
    border: 1px solid var(--line);
    padding: 7px;
}

#k_tbl th,
#k_tbl .k_th3 {
    background: var(--surface-2);
}

#k_tbl select,
#k_tbl input {
    width: 100%;
}

.legacy-process-meta {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, .75fr) minmax(420px, 1.25fr);
    margin: 0 0 18px;
    min-width: 920px;
}

.legacy-process-meta__group {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.legacy-process-meta__group h4 {
    margin-top: 0 !important;
}

.legacy-process-meta__fields {
    display: grid;
    gap: 10px;
}

.legacy-process-meta__fields--summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.legacy-process-meta__fields--crease {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.legacy-process-meta label {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.legacy-process-meta label span {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.legacy-process-meta input {
    width: 100% !important;
}

#process h4 {
    background: transparent;
    border-left: 4px solid var(--accent);
    color: var(--text);
    font-size: 15px;
    margin: 16px 0 10px;
    padding-left: 10px;
}

.legacy-drawing,
.draw_boxl {
    background: var(--surface-2);
    border: 1px dashed var(--line-strong);
    color: var(--muted);
}

.legacy-drawing {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 180px;
    overflow: hidden;
}

.legacy-drawing img {
    display: block;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.legacy-drawing-actions {
    clear: both;
    display: flex;
    justify-content: flex-end;
    margin: 8px 0 0;
}

#h_tbl_boxh,
#h_tbl_boxd {
    margin-left: 0;
    width: 100%;
}

#h_tbl_boxd {
    max-height: 380px;
    overflow: auto;
}

#ma_btn {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 -1px 2px rgba(15, 23, 42, .05), 0 12px 28px rgba(15, 23, 42, .12);
    bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin: 14px 0;
    padding: 10px;
    position: sticky;
    width: 100%;
    z-index: 20;
}

#ma_btn.legacy-matter-actions {
    display: grid;
    gap: 8px 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-content: normal;
}

#ma_btn input,
#ma_btn button {
    -webkit-text-fill-color: currentColor;
    display: inline-flex;
    flex: 0 0 auto;
    float: none;
    font-size: 13px !important;
    height: auto;
    letter-spacing: 0 !important;
    line-height: 1.15;
    margin: 0;
    min-height: 36px;
    min-width: 82px;
    overflow: visible;
    padding: 8px 12px;
    text-indent: 0;
    white-space: nowrap;
    width: auto;
}

.legacy-matter-actions__primary,
.legacy-matter-actions__prints,
.legacy-matter-actions__status {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.legacy-matter-actions__prints {
    justify-content: center;
}

.legacy-matter-actions__status {
    justify-content: flex-end;
}

#ma_btn .legacy-action-primary {
    min-width: 92px;
}

#ma_btn .legacy-action-secondary,
#ma_btn .legacy-action-done {
    min-width: 88px;
}

#ma_btn .legacy-action-danger {
    min-width: 84px;
}

@media (max-width: 1100px) {
    #ma_btn.legacy-matter-actions {
        grid-template-columns: 1fr;
    }

    .legacy-matter-actions__primary,
    .legacy-matter-actions__prints,
    .legacy-matter-actions__status {
        justify-content: flex-start;
    }
}

.legacy-table-scroll,
.matter_box,
.matter_boxh {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    clear: both;
    float: none;
    max-height: 560px;
    overflow: auto;
    width: 100%;
}

.matter_boxh {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-top: 8px;
}

.matter_box {
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    height: auto;
    margin-top: 0;
}

table {
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.legacy-table-scroll table,
.matter {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    width: 100%;
}

.legacy-table-scroll th,
.legacy-table-scroll td,
.matter th,
.matter td,
#master_box th,
#master_box td {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    text-indent: 0;
    vertical-align: middle;
    white-space: nowrap;
}

.legacy-table-scroll th,
.matter th,
#master_box th {
    background: #edf4f5;
    color: #29414a;
    font-weight: 700;
    position: sticky;
    text-align: left;
    top: 0;
    z-index: 1;
}

.legacy-table-scroll tr:nth-child(even) td,
.matter tr:nth-child(even) td {
    background: var(--surface-2);
}

.legacy-table-scroll tr:hover td,
.matter tr:hover td {
    background: #e8f3f4;
}

.matter td {
    line-height: 1.45;
}

.anken { width: 110px; }
.Tokuisaki { width: 190px; }
.seihin-no { width: 118px; }
.hin { min-width: 320px; }
.nouki { width: 100px; }
.bikou { min-width: 210px; }
.matter-qty { width: 92px; }
.matter-status { width: 112px; }
.shosai { width: 78px; text-align: center; }

.legacy-status-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    min-width: 72px;
    padding: 6px 8px;
}

.legacy-status-badge--input {
    background: #eef2f7;
    color: #475569;
}

.legacy-status-badge--estimate {
    background: #e9efff;
    color: #384aa6;
}

.legacy-status-badge--instruction {
    background: #e4f4f3;
    color: var(--brand-strong);
}

.legacy-status-badge--delivery {
    background: #e8f5ee;
    color: #276749;
}

.legacy-status-badge--complete {
    background: #e5e7eb;
    color: #4b5563;
}

.b_yellow,
tr.b_yellow td {
    background: var(--warn-bg) !important;
}

.b_red,
tr.b_red td {
    background: var(--danger-bg) !important;
}

.bg_gray td {
    background: #eef0f3 !important;
    color: var(--muted);
}

#go_mmenu,
#go_mmenu2,
#go_mmenu3 {
    background: transparent;
    margin-top: 16px;
    padding: 0;
    width: 100%;
}

#go_mmenu p,
#go_mmenu2 p,
#go_mmenu3 p {
    border: 0;
    height: auto;
    line-height: normal;
    text-indent: 0;
    width: auto;
}

#go_mmenu p a,
#go_mmenu2 p a,
#go_mmenu3 p a {
    background: #fff;
    border-color: var(--line-strong);
    color: var(--text) !important;
    height: auto;
    min-width: 180px;
    width: auto;
}

#go_mmenu p a:hover,
#go_mmenu2 p a:hover,
#go_mmenu3 p a:hover {
    background: var(--surface-2);
    color: var(--brand-strong) !important;
}

.pl30,
.pl60 {
    color: var(--muted);
    margin: 10px 0;
    padding-left: 0;
}

.legacy-table-note {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.legacy-note-chip {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 6px 9px;
}

.legacy-note-chip--warn {
    background: var(--warn-bg);
    color: #7a4d00;
}

.legacy-note-chip--danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.p_red {
    color: var(--danger);
}

.p_blue {
    color: var(--brand);
}

body.legacy-popup {
    background: #fff;
}

body.legacy-popup .legacy-main {
    padding: 12px;
}

body.legacy-popup #wrapper {
    max-width: none;
}

.legacy-picture-popup {
    display: grid;
    gap: 12px;
}

.legacy-picture-meta {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    gap: 10px;
    padding: 10px 12px;
}

.legacy-picture-meta span,
.legacy-picture-form span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.legacy-picture-preview {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    min-height: 360px;
    overflow: hidden;
    padding: 10px;
    text-align: center;
}

.legacy-picture-preview img,
.legacy-picture-preview iframe {
    border: 0;
    max-height: 70vh;
    max-width: 100%;
}

.legacy-picture-preview iframe {
    height: 70vh;
    width: 100%;
}

.legacy-picture-form,
.legacy-picture-actions {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.legacy-picture-form label {
    display: grid;
    gap: 5px;
    min-width: min(460px, 100%);
}

.legacy-picture-actions button {
    background: #fff;
    border-color: #d92d20;
    color: #b42318 !important;
}

.legacy-picture-actions button:hover {
    background: #fff1f0;
    color: #912018 !important;
}

.legacy-stock {
    display: grid;
    gap: 16px;
}

.legacy-stock-search,
.legacy-stock-forms,
.legacy-stock-summary {
    display: grid;
    gap: 12px;
}

.legacy-stock-search {
    align-items: end;
    grid-template-columns: minmax(260px, 1.4fr) minmax(180px, .8fr) auto;
}

.legacy-stock-search label,
.legacy-stock-card label {
    display: grid;
    gap: 5px;
}

.legacy-stock-search span,
.legacy-stock-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.legacy-stock-summary {
    align-items: start;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px;
}

.legacy-stock-summary dl {
    display: grid;
    gap: 8px 12px;
    grid-template-columns: 90px minmax(0, 1fr);
    margin: 0;
}

.legacy-stock-summary dt {
    color: var(--muted);
    font-weight: 700;
}

.legacy-stock-summary dd {
    margin: 0;
}

.legacy-stock-quantity {
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.legacy-stock-print,
.legacy-stock-open {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--text) !important;
    display: inline-flex;
    font-weight: 700;
    min-height: 34px;
    padding: 7px 12px;
    text-decoration: none !important;
}

.legacy-stock-print:hover,
.legacy-stock-open:hover {
    background: #e8f3f4;
    color: var(--brand-strong) !important;
}

.legacy-stock-forms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legacy-stock-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}

.legacy-stock-card h3 {
    margin: 0 0 12px;
}

.legacy-stock-fields {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
}

.legacy-stock-cancel {
    background: #fff;
    border-color: #d92d20;
    color: #b42318 !important;
}

.legacy-stock-cancel:hover {
    background: #fff1f0;
    color: #912018 !important;
}

.legacy-stock-label {
    align-items: end;
    display: flex;
    min-height: 100vh;
    padding: 18px;
}

.legacy-stock-label table {
    background: #000;
    border-spacing: 2px;
    max-width: 650px;
    width: 650px;
}

.legacy-stock-label td {
    background: #fff;
    font-size: 50px;
    padding: 10px;
}

.legacy-stock-label__side {
    text-align: center;
    width: 60px;
}

.legacy-stock-label__name {
    text-align: center;
}

.legacy-stock-label__quantity {
    font-size: 150px !important;
    line-height: 1;
    text-align: center;
}

.legacy-stock-label__barcode {
    text-align: right;
}

.legacy-stock-label__barcode img {
    height: 72px;
    max-width: 420px;
    width: 420px;
}

.legacy-master-print {
    background: #fff;
    color: #111;
    font-size: 12px;
}

.legacy-master-print h2 {
    border: 0;
    font-size: 18px;
    margin: 0 0 8px;
    padding: 0;
}

.legacy-master-print__table {
    border-collapse: separate;
    border-spacing: 1px;
    background: #444;
    width: 100%;
}

.legacy-master-print__table th {
    background: #e0e0e0;
}

.legacy-master-print__table td,
.legacy-master-print__table th {
    padding: 3px 4px;
    vertical-align: top;
}

.legacy-master-print__table td {
    background: #fff;
}

@media (max-width: 720px) {
    .legacy-stock-search,
    .legacy-stock-forms,
    .legacy-stock-summary {
        grid-template-columns: 1fr;
    }

    .legacy-stock-fields {
        grid-template-columns: 1fr;
    }
}

body.legacy-print {
    background: #fff;
}

body.legacy-print .legacy-main {
    padding: 0;
}

body.legacy-print #wrapper {
    max-width: none;
    padding: 16px;
}

.legacy-document {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 20px;
    padding: 16px;
    page-break-after: always;
}

.legacy-document table {
    border: 1px solid var(--line);
    border-collapse: collapse;
    margin: 10px 0 16px;
    width: 100%;
}

.legacy-document th,
.legacy-document td {
    border: 1px solid var(--line);
    padding: 7px 9px;
}

.legacy-document th {
    background: var(--surface-2);
    width: 120px;
}

/* Modern Laravel work area */
.app-shell {
    min-height: 100vh;
}

.legacy-window {
    display: flex;
    flex-direction: column;
}

.topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    min-height: 56px;
    padding: 10px 22px;
}

.topbar-title {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
}

.topbar-title span {
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
}

.topbar-title small,
.topbar-meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.nav-list {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 18px;
}

.nav-link {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text) !important;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    min-height: 32px;
    padding: 6px 9px;
    text-decoration: none !important;
}

.nav-link:hover,
.nav-link.is-active {
    background: #e8f3f4;
    border-color: #c9e2e5;
    color: var(--brand-strong) !important;
}

.nav-spacer {
    flex: 1 1 auto;
}

.nav-user {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    padding: 0 6px;
}

.logout-form {
    margin: 0;
}

.logout-form button.nav-link {
    background: #fff;
    border-color: var(--line-strong);
    color: var(--text) !important;
    min-height: 32px;
    padding: 6px 9px;
}

.content {
    flex: 1;
    margin: 0 auto;
    max-width: 1440px;
    padding: 20px;
    width: 100%;
}

.legacy-footer {
    background: #fff;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding: 9px 22px;
}

.notice {
    background: #fff7d6;
    border: 1px solid #ead180;
    border-radius: 8px;
    color: #664a00;
    font-weight: 700;
    margin: 0 0 14px;
    padding: 10px 12px;
}

.modern-home,
.work-screen,
.auth-panel {
    display: grid;
    gap: 16px;
}

.home-command,
.panel,
.home-section,
.home-graph-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.home-command {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 18px;
}

.home-eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    margin: 0 0 5px;
    text-transform: uppercase;
}

.home-command h1 {
    color: var(--text);
    font-size: 30px;
    line-height: 1.2;
    margin: 0;
}

.home-command p {
    color: var(--muted);
    font-weight: 700;
    margin: 8px 0 0;
}

.home-command-actions,
.toolbar,
.filter-pills,
.panel-actions,
.inline-form,
.inline-actions,
.form-actions,
.legacy-actionbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-primary-action,
.home-secondary-action,
.button-link,
.pager-inline a,
.panel-actions a,
.graph-toolbar-actions a,
.legacy-big-button,
.tile {
    text-decoration: none !important;
}

.home-primary-action,
.button-link,
.pager-inline a {
    align-items: center;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #fff !important;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
}

.home-primary-action:hover,
.button-link:hover,
.pager-inline a:hover {
    background: var(--brand-strong);
    color: #fff !important;
}

.home-secondary-action,
.button-link.secondary,
.panel-actions a,
.graph-toolbar-actions a,
.legacy-actionbar .button-link {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--text) !important;
    display: inline-flex;
    font-weight: 800;
    min-height: 34px;
    padding: 7px 12px;
}

.home-secondary-action:hover,
.button-link.secondary:hover,
.panel-actions a:hover,
.graph-toolbar-actions a:hover,
.legacy-actionbar .button-link:hover {
    background: #e8f3f4;
    color: var(--brand-strong) !important;
}

.home-metrics,
.home-stats,
.summary-strip {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-metric,
.summary-item,
.home-stats div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 0;
    padding: 14px;
}

.home-metric {
    color: var(--text) !important;
    text-decoration: none !important;
}

.home-metric:hover {
    border-color: #9fcbd1;
}

.home-metric span,
.summary-item span,
.home-stats span,
.detail-grid span,
.tile span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.home-metric strong,
.summary-item strong,
.home-stats strong {
    color: var(--text);
    display: block;
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-top: 7px;
}

.home-section,
.home-graph-panel,
.panel {
    padding: 16px;
}

.home-section-head,
.panel-heading,
.graph-toolbar {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 0 0 14px;
    padding-bottom: 10px;
}

.home-section-head h2,
.panel-heading h2,
.graph-toolbar h1 {
    border: 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.25;
    margin: 0;
    padding: 0;
}

.home-section-head a,
.panel-heading a {
    font-weight: 800;
}

.panel-heading span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.staff-selector {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.staff-selector form {
    margin: 0;
}

.legacy-staff-button {
    min-width: 84px;
}

.home-action-grid,
.tile-grid,
.home-graph-grid,
.split-grid,
.legacy-menu-grid {
    display: grid;
    gap: 14px;
}

.home-action-grid,
.tile-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.home-action-card,
.tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text) !important;
    display: block;
    min-height: 92px;
    padding: 15px;
}

.home-action-card:hover,
.tile:hover {
    border-color: #9fcbd1;
    color: var(--brand-strong) !important;
}

.home-action-card span,
.tile small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 800;
}

.home-action-card strong,
.tile strong {
    color: inherit;
    display: block;
    font-size: 18px;
    line-height: 1.25;
    margin-top: 8px;
}

.tile small {
    margin-top: 8px;
}

.home-graph-grid,
.split-grid,
.legacy-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-bars,
.graph-bars {
    display: grid;
    gap: 10px;
}

.home-bar-row,
.graph-bar-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(72px, 120px) minmax(0, 1fr) minmax(72px, auto);
}

.home-bar-row span,
.graph-bar-row span {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-bar-row strong,
.graph-bar-row strong {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.home-bar-track,
.graph-bar-track {
    background: #e6edf3;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.home-bar-track i,
.graph-bar-track i {
    background: linear-gradient(90deg, var(--brand), var(--accent));
    border-radius: inherit;
    display: block;
    height: 100%;
}

.vendor-bars .home-bar-track i {
    background: linear-gradient(90deg, #287b5f, #5a7f2e);
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
}

.table-wrap table {
    background: #fff;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table-wrap th,
.table-wrap td {
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.table-wrap th {
    background: #edf4f5;
    color: #29414a;
    font-size: 13px;
    font-weight: 800;
    position: sticky;
    top: 0;
    z-index: 1;
}

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

.table-wrap tr:nth-child(even) td {
    background: var(--surface-2);
}

.num {
    font-variant-numeric: tabular-nums;
    text-align: right !important;
}

.nowrap {
    white-space: nowrap;
}

.empty {
    color: var(--muted);
    font-weight: 700;
    padding: 16px !important;
    text-align: center;
}

.table-link {
    color: var(--brand) !important;
    font-weight: 800;
}

.toolbar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 0 14px;
    padding: 12px;
}

.toolbar input,
.toolbar select {
    flex: 1 1 150px;
    min-width: 0;
}

.filter-pills {
    margin: 0 0 12px;
}

.pill,
.status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 6px 9px;
}

.pill {
    background: #e8f3f4;
    color: var(--brand-strong);
}

.status-neutral {
    background: #eef2f7;
    color: #475569;
}

.status-open {
    background: #e9efff;
    color: #384aa6;
}

.status-done {
    background: #e8f5ee;
    color: #276749;
}

.is-overdue {
    color: var(--danger);
    font-weight: 800;
}

.pagination-line {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.pager-inline {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.pager-inline span {
    color: var(--muted);
    font-weight: 800;
}

.pager-inline .is-disabled {
    opacity: .55;
}

.form-panel {
    margin: 0 auto;
    max-width: 760px;
    width: 100%;
}

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

.form-grid label {
    display: grid;
    gap: 6px;
}

.form-grid label > span,
.checkbox-label > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

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

.checkbox-label {
    align-items: center;
    display: grid;
    gap: 6px 10px;
    grid-template-columns: auto auto minmax(0, 1fr);
}

.checkbox-label > span {
    grid-column: 1 / -1;
}

.checkbox-label em {
    color: var(--muted);
    font-style: normal;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
}

.detail-grid div {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    min-width: 0;
    padding: 10px;
}

.detail-grid strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.inline-form {
    margin: 0;
}

.inline-form input,
.inline-form select {
    min-width: 120px;
}

.inline-actions form {
    margin: 0;
}

.link-button {
    background: #fff !important;
    border-color: #d92d20 !important;
    color: #b42318 !important;
}

.link-button:hover {
    background: #fff1f0 !important;
}

.text-block {
    color: var(--text);
    line-height: 1.7;
}

.text-block p {
    margin: 0 0 8px;
}

.legacy-menu-grid {
    align-items: start;
}

.legacy-big-buttons {
    display: grid;
    gap: 10px;
}

.legacy-big-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text) !important;
    display: flex;
    font-weight: 800;
    justify-content: center;
    min-height: 46px;
    padding: 10px;
}

.legacy-big-button:hover {
    background: #e8f3f4;
    color: var(--brand-strong) !important;
}

.legacy-help {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.55;
    padding: 12px;
}

.legacy-frame-stack {
    display: grid;
    gap: 14px;
}

.legacy-actionbar {
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--line);
    border-radius: 8px;
    bottom: 10px;
    box-shadow: var(--shadow);
    margin-top: 14px;
    padding: 10px;
    position: sticky;
    z-index: 10;
}

.koutei-screen {
    display: grid;
    gap: 12px;
}

.koutei-title {
    background: var(--brand);
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    padding: 11px 14px;
}

.koutei-summary,
.koutei-grid {
    background: #fff;
    border: 1px solid var(--line);
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.koutei-summary th,
.koutei-summary td,
.koutei-grid th,
.koutei-grid td {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: 7px 8px;
    vertical-align: top;
}

.koutei-summary th,
.koutei-grid th {
    background: #edf4f5;
    color: #29414a;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
}

.koutei-grid-wrap {
    overflow: auto;
}

.koutei-grid {
    min-width: 1680px;
}

.koutei-line-col {
    width: 180px;
}

.koutei-total-col {
    width: 110px;
}

.koutei-line-info,
.koutei-totals {
    background: #f8fbfc;
    font-size: 12px;
    font-weight: 700;
}

.koutei-product {
    color: var(--text);
    font-weight: 800;
    margin: 4px 0;
}

.koutei-step {
    min-width: 138px;
}

.koutei-step-body {
    display: grid;
    gap: 6px;
}

.koutei-step label {
    display: grid;
    gap: 3px;
}

.koutei-step span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.koutei-step input,
.koutei-step select {
    min-height: 28px;
    padding: 4px 6px;
    width: 100%;
}

.koutei-pager {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-weight: 800;
    gap: 10px;
}

.graph-toolbar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    padding: 14px;
}

.graph-summary-strip {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 14px;
}

.graph-summary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 0;
    padding: 14px;
}

.graph-summary-card span,
.graph-panel-head span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.graph-summary-card strong {
    color: var(--text);
    display: block;
    font-size: 25px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-top: 8px;
}

.graph-summary-card small {
    color: var(--muted);
    display: block;
    font-weight: 700;
    margin-top: 6px;
}

.graph-period-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.graph-period-grid--vendor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.graph-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 0;
    padding: 14px;
}

.graph-panel-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.graph-panel-head h2 {
    border: 0;
    color: var(--text);
    font-size: 17px;
    line-height: 1.25;
    margin: 4px 0 0;
    padding: 0;
}

.graph-panel-head small {
    color: var(--muted);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    padding-top: 2px;
}

.graph-rows {
    display: grid;
    gap: 9px;
}

.graph-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(72px, 118px) minmax(110px, 1fr) minmax(62px, auto);
    min-height: 28px;
}

.graph-row-label {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graph-bar-cell {
    background: #e6edf3;
    border-radius: 999px;
    height: 16px;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.graph-bar {
    background: linear-gradient(90deg, var(--brand), var(--accent));
    border-radius: inherit;
    bottom: 3px;
    display: block;
    left: 0;
    min-width: 2px;
    position: absolute;
    top: 3px;
}

.vendor-graph-rows .graph-bar {
    background: linear-gradient(90deg, #287b5f, #5a7f2e);
}

.graph-row.is-negative .graph-bar {
    background: linear-gradient(90deg, #b42318, #d92d20);
}

.graph-row.is-zero .graph-bar {
    min-width: 0;
}

.graph-benchmark-line,
.graph-target-line {
    background: #d97706;
    bottom: 0;
    display: block;
    position: absolute;
    top: 0;
    width: 2px;
    z-index: 1;
}

.graph-benchmark-line {
    left: var(--graph-benchmark);
}

.graph-row-value {
    color: var(--text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    text-align: right;
}

.graph-table-panel {
    margin-top: 14px;
}

.legacy-graph-compare-source {
    display: none !important;
}

.analytics-wide {
    grid-column: 1 / -1;
}

.print-view .topbar,
.print-view .nav-list,
.print-view .legacy-footer {
    display: none;
}

.print-view .content {
    max-width: none;
    padding: 0;
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding: 10px 14px;
    }

    .nav-list {
        padding: 8px 10px;
    }

    .content {
        padding: 14px;
    }

    .home-command {
        grid-template-columns: 1fr;
    }

    .home-command-actions {
        align-items: stretch;
    }

    .home-command-actions a {
        flex: 1 1 150px;
    }

    .home-metrics,
    .home-stats,
    .summary-strip,
    .graph-period-grid,
    .home-graph-grid,
    .split-grid,
    .legacy-menu-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .legacy-appbar__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 10px 14px;
    }

    .legacy-global-nav {
        justify-content: flex-start;
        width: 100%;
    }

    .legacy-main {
        padding: 14px;
    }

    h2 {
        font-size: 20px;
    }

    #basic.legacy-panel {
        grid-template-columns: 1fr;
    }

    .legacy-billing-grid {
        grid-template-columns: 1fr;
    }

    .legacy-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legacy-matter-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #basic .legacy-wide,
    #master_box dl,
    .w940.clearfix,
    .legacy-wide {
        grid-template-columns: 1fr;
    }

    #basic dt,
    #master_box dt,
    .legacy-wide dt {
        text-align: left;
    }

    #pmenu_box dl {
        grid-template-columns: 1fr;
    }

    .legacy-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legacy-filter-field--pair {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .nav-link,
    .logout-form button.nav-link {
        justify-content: center;
        flex: 1 1 calc(50% - 6px);
    }

    .nav-spacer {
        display: none;
    }

    .home-command h1 {
        font-size: 24px;
    }

    .home-metric strong,
    .summary-item strong,
    .home-stats strong {
        font-size: 23px;
    }

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

    .home-bar-row,
    .graph-bar-row,
    .graph-row {
        grid-template-columns: 1fr;
    }

    .home-bar-row strong,
    .graph-bar-row strong,
    .graph-row-value {
        text-align: left;
    }

    .toolbar {
        align-items: stretch;
    }

    .toolbar input,
    .toolbar select,
    .toolbar button,
    .toolbar .button-link {
        flex: 1 1 100%;
        width: 100%;
    }

    .legacy-actionbar {
        bottom: 0;
        border-radius: 8px 8px 0 0;
        margin-left: -14px;
        width: calc(100% + 28px);
    }

    .legacy-global-nav a {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

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

    .legacy-filter form.legacy-filter-grid,
    .legacy-filter-grid {
        grid-template-columns: 1fr !important;
    }

    .legacy-filter-options,
    .legacy-filter-field--pair {
        grid-column: auto;
    }

    form.legacy-filter > div:not([class]) {
        align-items: stretch;
        flex-direction: column;
    }

    .legacy-range,
    .legacy-pair {
        grid-template-columns: 1fr;
    }

    .legacy-range span {
        display: none;
    }

    .legacy-filter-actions {
        align-items: stretch;
    }

    .legacy-kpi-grid,
    .legacy-matter-strip {
        grid-template-columns: 1fr;
    }

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

    #ma_btn {
        align-items: stretch;
        bottom: 0;
        border-radius: 8px 8px 0 0;
        margin-left: -14px;
        width: calc(100% + 28px);
    }

    #ma_btn.legacy-matter-actions {
        grid-template-columns: 1fr;
    }

    #ma_btn input,
    #ma_btn button {
        flex: 1 1 calc(50% - 8px);
    }

    .w260,
    .w300,
    .w365,
    .w370,
    .w390,
    .w430,
    .w500,
    .w550,
    .w600 {
        width: 100% !important;
    }
}

@media print {
    .legacy-appbar,
    #pan,
    .legacy-filter,
    #go_mmenu,
    #go_mmenu2,
    #go_mmenu3,
    #ma_btn {
        display: none !important;
    }

    body.legacy-modern,
    .legacy-main,
    #wrapper {
        background: #fff;
        margin: 0;
        padding: 0;
        width: auto;
    }

    .legacy-table-scroll,
    .matter_box {
        border: 0;
        max-height: none;
        overflow: visible;
    }

    .legacy-document {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}
