/*
 * 制作管理システム Filament 共通テーマ
 *
 * Work / Master / Admin の全パネルから読み込まれます。
 * 画面固有の調整は各画面側へ置き、共通ルールのみをここに追加してください。
 */

:root {
    --app-section-gap: 1rem;
    --app-section-radius: 0.75rem;
}

/* システム名を1行で表示し、サイドバー内で過度に大きくしない。 */
.fi-sidebar-header .fi-logo,
.fi-topbar .fi-logo {
    font-size: 0.9em !important;
    line-height: 1.15 !important;
    letter-spacing: -0.08em !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
}

.fi-sidebar-header {
    gap: 0.5rem !important;
}

/* 業務画面で横幅を有効活用する。 */
.fi-main,
.fi-main-ctn {
    width: 100%;
    max-width: none;
}

/* セクションの見た目と間隔を全パネルで統一する。 */
.fi-section {
    overflow: hidden;
    border-radius: var(--app-section-radius);
}

.fi-section + .fi-section {
    margin-top: var(--app-section-gap);
}

.fi-section-header {
    min-height: 3.25rem;
    align-items: center;
}

.fi-section-content-ctn,
.fi-section-content {
    width: 100%;
}

/* 長い入力項目やテーブルが親要素を押し広げないようにする。 */
.fi-section .fi-fo-component-ctn,
.fi-section .fi-fo-field-wrp,
.fi-section .fi-ta-ctn {
    min-width: 0;
    width: 100%;
}

.fi-section .grid {
    align-items: start;
}

.fi-section-heading,
.fi-section-description {
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .fi-topbar .fi-logo {
        font-size: 0.9em !important;
    }

    .fi-section-header,
    .fi-section-content-ctn,
    .fi-section-content {
        padding-inline: 1rem !important;
    }

    /* 4列フォームなどをスマートフォンでは1列に統一する。 */
    .fi-section .grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .fi-section .col-span-1,
    .fi-section .col-span-2,
    .fi-section [class*='col-span-'] {
        grid-column: 1 / -1 !important;
    }
}

/*
 * 全画面のセクション見出しを左寄せで統一する。
 * Filamentの標準クラスと、内側のflex/grid要素の双方を明示的に左寄せする。
 */
html body .fi-section > .fi-section-header {
    width: 100% !important;
    text-align: left !important;
    align-items: stretch !important;
}

html body .fi-section > .fi-section-header > div.flex.items-center.gap-3 {
    width: 100% !important;
    justify-content: flex-start !important;
    text-align: left !important;
}

html body .fi-section > .fi-section-header > div.flex.items-center.gap-3 > .grid.flex-1 {
    width: 100% !important;
    min-width: 0 !important;
    justify-items: start !important;
    text-align: left !important;
    margin-inline: 0 auto !important;
}

html body .fi-section .fi-section-header-heading,
html body .fi-section .fi-section-header-description {
    width: 100% !important;
    text-align: left !important;
    justify-self: start !important;
    margin-inline: 0 !important;
}

/* 開閉ボタンやヘッダー操作は右端に配置する。 */
html body .fi-section > .fi-section-header .fi-icon-btn,
html body .fi-section > .fi-section-header .fi-section-header-actions,
html body .fi-section > .fi-section-header [class*="header-action"] {
    margin-inline-start: auto !important;
    flex: 0 0 auto !important;
}

/* app-semantic-ui:start
 * 業務状態・参照項目・概要カードの共通表現。
 * パネル識別色とは分離し、操作の意味に応じて色を使う。
 */
:root {
    --app-semantic-primary-bg: rgb(219 234 254);
    --app-semantic-primary-text: rgb(30 64 175);
    --app-semantic-success-bg: rgb(220 252 231);
    --app-semantic-success-text: rgb(22 101 52);
    --app-semantic-warning-bg: rgb(254 249 195);
    --app-semantic-warning-text: rgb(133 77 14);
    --app-semantic-danger-bg: rgb(254 226 226);
    --app-semantic-danger-text: rgb(153 27 27);
    --app-semantic-gray-bg: rgb(243 244 246);
    --app-semantic-gray-text: rgb(55 65 81);
}

.app-record-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    background: rgb(255 255 255);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.app-overview-item {
    display: grid;
    align-content: center;
    gap: 0.25rem;
    min-width: 0;
}

.app-overview-item.is-wide {
    grid-column: span 2 / span 2;
}

.app-overview-label {
    color: rgb(107 114 128);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
}

.app-overview-value {
    min-width: 0;
    overflow: hidden;
    color: rgb(17 24 39);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-status-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.375rem;
    border-radius: 9999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1rem;
}

.app-status-badge::before {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background: currentColor;
    content: '';
}

.app-status-badge.is-primary {
    background: var(--app-semantic-primary-bg);
    color: var(--app-semantic-primary-text);
}

.app-status-badge.is-success {
    background: var(--app-semantic-success-bg);
    color: var(--app-semantic-success-text);
}

.app-status-badge.is-warning {
    background: var(--app-semantic-warning-bg);
    color: var(--app-semantic-warning-text);
}

.app-status-badge.is-danger {
    background: var(--app-semantic-danger-bg);
    color: var(--app-semantic-danger-text);
}

.app-status-badge.is-gray {
    background: var(--app-semantic-gray-bg);
    color: var(--app-semantic-gray-text);
}

/* 参照セクションは編集セクションより控えめな背景にする。 */
.app-reference-section.fi-section,
.fi-section.app-reference-section {
    border-color: rgb(209 213 219);
    background: rgb(249 250 251);
}

.app-reference-section > .fi-section-header {
    background: rgb(243 244 246 / 0.75);
}

/* disabledを薄くし過ぎず、参照項目であることを明確にする。 */
.fi-fo-field-wrp input:disabled,
.fi-fo-field-wrp textarea:disabled,
.fi-fo-field-wrp select:disabled,
.fi-input:disabled {
    border-color: rgb(209 213 219) !important;
    background: rgb(243 244 246) !important;
    color: rgb(55 65 81) !important;
    cursor: default !important;
    opacity: 1 !important;
}

fieldset:disabled .fi-section {
    border-color: rgb(209 213 219);
}

fieldset:disabled .fi-section-content-ctn,
fieldset:disabled .fi-section-content {
    background: rgb(249 250 251 / 0.45);
}

.dark .app-record-overview {
    border-color: rgb(55 65 81);
    background: rgb(17 24 39);
}

.dark .app-overview-label {
    color: rgb(156 163 175);
}

.dark .app-overview-value {
    color: rgb(243 244 246);
}

.dark .app-status-badge.is-primary {
    background: rgb(30 58 138 / 0.55);
    color: rgb(191 219 254);
}

.dark .app-status-badge.is-success {
    background: rgb(20 83 45 / 0.55);
    color: rgb(187 247 208);
}

.dark .app-status-badge.is-warning {
    background: rgb(113 63 18 / 0.55);
    color: rgb(254 240 138);
}

.dark .app-status-badge.is-danger {
    background: rgb(127 29 29 / 0.55);
    color: rgb(254 202 202);
}

.dark .app-status-badge.is-gray {
    background: rgb(55 65 81);
    color: rgb(229 231 235);
}

.dark .app-reference-section.fi-section,
.dark .fi-section.app-reference-section {
    border-color: rgb(75 85 99);
    background: rgb(31 41 55 / 0.55);
}

.dark .app-reference-section > .fi-section-header {
    background: rgb(55 65 81 / 0.45);
}

.dark .fi-fo-field-wrp input:disabled,
.dark .fi-fo-field-wrp textarea:disabled,
.dark .fi-fo-field-wrp select:disabled,
.dark .fi-input:disabled {
    border-color: rgb(75 85 99) !important;
    background: rgb(31 41 55) !important;
    color: rgb(209 213 219) !important;
}

.dark fieldset:disabled .fi-section-content-ctn,
.dark fieldset:disabled .fi-section-content {
    background: rgb(31 41 55 / 0.25);
}

@media (max-width: 767px) {
    .app-record-overview {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-overview-item.is-wide {
        grid-column: auto;
    }
}
/* app-semantic-ui:end */
/* app-responsive-grid-fallback:start
 * Filamentへ追加する独自Blade内のレスポンシブgrid指定を共通化する。
 * Vite/Tailwindの生成有無に依存せず、既存の sm:/md:/lg:/xl:grid-cols-* を有効にする。
 */
.grid {
    display: grid;
    min-width: 0;
}

.grid > * {
    min-width: 0;
}

[class~="grid-cols-1"] {
    grid-template-columns: minmax(0, 1fr);
}

[class~="grid-cols-2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

[class~="grid-cols-3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 640px) {
    [class~="sm:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [class~="sm:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    [class~="sm:grid-cols-4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    [class~="sm:grid-cols-5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    [class~="sm:grid-cols-6"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 768px) {
    [class~="md:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-6"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-7"] {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1024px) {
    [class~="lg:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [class~="lg:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    [class~="lg:grid-cols-4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    [class~="lg:grid-cols-5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    [class~="lg:grid-cols-6"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1280px) {
    [class~="xl:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-6"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-7"] {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-[1.4fr_1fr]"] {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) !important;
    }
}

/* 数値集計は同じ高さに揃え、狭い列でも値がはみ出さないようにする。 */
.fi-section .grid > div,
.app-record-overview > div {
    min-width: 0;
}

.fi-section .grid .text-2xl,
.fi-section .grid .text-xl,
.app-record-overview .app-overview-value {
    overflow-wrap: anywhere;
}

/* スマートフォンでは従来どおり1列を優先する。 */
@media (max-width: 767px) {
    .fi-section .grid[class*="grid-cols-"],
    .fi-section .grid[class*="sm:grid-cols-"],
    .fi-section .grid[class*="md:grid-cols-"],
    .fi-section .grid[class*="lg:grid-cols-"],
    .fi-section .grid[class*="xl:grid-cols-"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
/* app-responsive-grid-fallback:end */

/* app-business-tabs:start
 * 業務画面共通タブ。URL履歴連動、件数表示、横スクロール操作を共通化する。
 */
.business-tabs {
    min-width: 0;
}

.business-tabs__bar {
    display: flex;
    min-width: 0;
    align-items: stretch;
    border-bottom: 1px solid rgb(229 231 235);
}

.business-tabs__scroll-button {
    display: flex;
    width: 2.25rem;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgb(255 255 255);
    color: rgb(107 114 128);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.business-tabs__scroll-button:first-child {
    border-right: 1px solid rgb(229 231 235);
}

.business-tabs__scroll-button:last-child {
    border-left: 1px solid rgb(229 231 235);
}

.business-tabs__scroll-button:hover,
.business-tabs__scroll-button:focus-visible {
    background: rgb(249 250 251);
    color: rgb(31 41 55);
    outline: none;
}

.business-tabs__scroller {
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.business-tabs__list {
    display: flex;
    width: max-content;
    min-width: 100%;
    gap: 0.25rem;
    padding-inline: 0.25rem;
}

.business-tabs__tab {
    display: inline-flex;
    min-height: 2.85rem;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: rgb(107 114 128);
    cursor: pointer;
    padding: 0.7rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.business-tabs__tab:hover {
    border-bottom-color: rgb(209 213 219);
    color: rgb(31 41 55);
}

.business-tabs__tab:focus-visible {
    border-radius: 0.375rem 0.375rem 0 0;
    outline: 2px solid rgb(59 130 246);
    outline-offset: -2px;
}

.business-tabs__tab.is-active {
    border-bottom-color: rgb(37 99 235);
    color: rgb(29 78 216);
}

.business-tabs__count {
    display: inline-flex;
    min-width: 1.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgb(243 244 246);
    color: rgb(75 85 99);
    padding: 0.125rem 0.4rem;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1rem;
}

.business-tabs__tab.is-active .business-tabs__count {
    background: rgb(219 234 254);
    color: rgb(30 64 175);
}

.business-tabs__hint {
    display: none;
    margin: 0;
    padding: 0.5rem 0.75rem 0;
    color: rgb(107 114 128);
    font-size: 0.75rem;
    line-height: 1rem;
}

.business-tabs__content {
    min-width: 0;
}

.dark .business-tabs__bar {
    border-bottom-color: rgb(255 255 255 / 0.1);
}

.dark .business-tabs__scroll-button {
    background: rgb(17 24 39);
    color: rgb(156 163 175);
}

.dark .business-tabs__scroll-button:first-child,
.dark .business-tabs__scroll-button:last-child {
    border-color: rgb(255 255 255 / 0.1);
}

.dark .business-tabs__scroll-button:hover,
.dark .business-tabs__scroll-button:focus-visible {
    background: rgb(255 255 255 / 0.05);
    color: rgb(229 231 235);
}

.dark .business-tabs__tab {
    color: rgb(156 163 175);
}

.dark .business-tabs__tab:hover {
    border-bottom-color: rgb(75 85 99);
    color: rgb(229 231 235);
}

.dark .business-tabs__tab.is-active {
    border-bottom-color: rgb(96 165 250);
    color: rgb(147 197 253);
}

.dark .business-tabs__count {
    background: rgb(255 255 255 / 0.1);
    color: rgb(209 213 219);
}

.dark .business-tabs__tab.is-active .business-tabs__count {
    background: rgb(59 130 246 / 0.2);
    color: rgb(147 197 253);
}

.dark .business-tabs__hint {
    color: rgb(156 163 175);
}

@media (max-width: 639px) {
    .business-tabs__hint {
        display: block;
    }
}
/* app-business-tabs:end */

/* app-unsaved-changes:start
 * 業務フォームの未保存・保存中・保存済み状態を共通表示する。
 */
.business-save-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.96);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.1);
    backdrop-filter: blur(8px);
}

.business-save-bar.is-compact {
    position: static;
    justify-content: flex-end;
    box-shadow: none;
    background: rgb(249 250 251);
}

.business-save-status {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
    color: rgb(75 85 99);
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.business-save-status__dot {
    width: 0.625rem;
    height: 0.625rem;
    flex: 0 0 0.625rem;
    border-radius: 9999px;
    background: rgb(34 197 94);
    box-shadow: 0 0 0 3px rgb(34 197 94 / 0.14);
}

.business-save-status.is-dirty {
    color: rgb(180 83 9);
    font-weight: 700;
}

.business-save-status.is-dirty .business-save-status__dot {
    background: rgb(245 158 11);
    box-shadow: 0 0 0 3px rgb(245 158 11 / 0.16);
}

.business-save-status.is-saving {
    color: rgb(29 78 216);
    font-weight: 700;
}

.business-save-status.is-saving .business-save-status__dot {
    background: rgb(59 130 246);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.16);
    animation: business-save-pulse 1.1s ease-in-out infinite;
}

.business-save-status__text {
    flex: 0 0 auto;
}

.business-save-status__hint {
    min-width: 0;
    color: rgb(107 114 128);
    font-weight: 400;
}

.dark .business-save-bar {
    border-color: rgb(255 255 255 / 0.1);
    background: rgb(17 24 39 / 0.96);
}

.dark .business-save-bar.is-compact {
    background: rgb(255 255 255 / 0.04);
}

.dark .business-save-status {
    color: rgb(209 213 219);
}

.dark .business-save-status.is-dirty {
    color: rgb(253 186 116);
}

.dark .business-save-status.is-saving {
    color: rgb(147 197 253);
}

.dark .business-save-status__hint {
    color: rgb(156 163 175);
}

@keyframes business-save-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (max-width: 767px) {
    .business-save-bar {
        bottom: 0.5rem;
        align-items: stretch;
        flex-direction: column;
    }

    .business-save-status {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .business-save-status__hint {
        width: 100%;
        padding-left: 1.125rem;
    }

    .business-save-bar .fi-btn {
        width: 100%;
        justify-content: center;
    }
}
/* app-unsaved-changes:end */


/* business-detail-table:start
 * 横長の業務明細を、列幅制御・折り返し・固定列・列切替で扱いやすくする。
 * 画面幅が狭い場合は固定列を解除し、セル同士の重なりを防止する。
 */
.business-detail-table {
    position: relative;
    min-width: 0;
    max-width: 100%;
    container-name: business-detail-table;
    container-type: inline-size;
}

.business-detail-table .fi-ta-ctn,
.business-detail-table .fi-ta-content-ctn,
.business-detail-table .fi-ta-content {
    min-width: 0 !important;
    max-width: 100% !important;
}

.business-detail-table .fi-ta-content {
    position: relative;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    isolation: isolate;
    box-shadow: inset -10px 0 12px -14px rgb(15 23 42 / 0.45), inset 10px 0 12px -14px rgb(15 23 42 / 0.3);
    -webkit-overflow-scrolling: touch;
}

/* 長い文字列で列が無制限に広がらないよう、セルごとに幅と折り返しを管理する。 */
.business-detail-table .fi-ta-table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0;
}

.business-detail-table .fi-ta-cell,
.business-detail-table .fi-ta-header-cell,
.business-detail-table th,
.business-detail-table td {
    box-sizing: border-box;
    min-width: 7.5rem;
    max-width: 18rem;
    vertical-align: middle;
}

/* Filament内側のnowrapや最小幅がセル外へ文字を描画しないようにする。 */
.business-detail-table .fi-ta-cell > *,
.business-detail-table .fi-ta-header-cell > *,
.business-detail-table td > *,
.business-detail-table th > * {
    min-width: 0 !important;
    max-width: 100%;
}

.business-detail-table .fi-ta-text,
.business-detail-table .fi-ta-text-item,
.business-detail-table .fi-ta-header-cell-label,
.business-detail-table .fi-ta-header-cell-label span,
.business-detail-table td span:not(.fi-badge),
.business-detail-table th span:not(.fi-badge) {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.4;
}

.business-detail-table .business-table-primary-column {
    position: sticky !important;
    left: 0;
    z-index: 4;
    width: 16rem;
    min-width: 12rem;
    max-width: 22rem;
    overflow: hidden;
    background: rgb(255 255 255);
    box-shadow: 1px 0 0 rgb(229 231 235), 8px 0 12px -12px rgb(15 23 42 / 0.55);
    white-space: normal !important;
}

.business-detail-table .business-table-primary-column .fi-ta-text,
.business-detail-table .business-table-primary-column .fi-ta-text-item,
.business-detail-table .business-table-primary-column span:not(.fi-badge) {
    display: block;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.business-detail-table thead .business-table-primary-column {
    z-index: 7;
    background: rgb(249 250 251);
}

.business-detail-table tbody tr:hover .business-table-primary-column {
    background: rgb(249 250 251);
}

.business-detail-table .business-table-secondary-column {
    width: 11rem;
    min-width: 8rem;
    max-width: 15rem;
}

.business-detail-table .business-table-code-column {
    width: 8rem;
    min-width: 6rem;
    max-width: 10rem;
}

.business-detail-table .business-table-amount-column {
    width: 9rem;
    min-width: 7.5rem;
    max-width: 11rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
}

.business-detail-table .business-table-amount-column .fi-ta-text,
.business-detail-table .business-table-amount-column .fi-ta-text-item,
.business-detail-table .business-table-amount-column span {
    white-space: nowrap !important;
    overflow-wrap: normal;
    word-break: normal;
}

/* Filamentの行操作セルを右端へ固定する。 */
.business-detail-table .fi-ta-actions-header-cell,
.business-detail-table .fi-ta-actions-cell,
.business-detail-table th:has(.fi-ta-actions),
.business-detail-table td:has(.fi-ta-actions) {
    position: sticky !important;
    right: 0;
    z-index: 5;
    width: 7.5rem;
    min-width: 7.5rem;
    max-width: 9rem;
    overflow: visible;
    background: rgb(255 255 255);
    box-shadow: -1px 0 0 rgb(229 231 235), -8px 0 12px -12px rgb(15 23 42 / 0.55);
}

.business-detail-table thead .fi-ta-actions-header-cell,
.business-detail-table thead th:has(.fi-ta-actions) {
    z-index: 8;
    background: rgb(249 250 251);
}

.business-detail-table tbody tr:hover .fi-ta-actions-cell,
.business-detail-table tbody tr:hover td:has(.fi-ta-actions) {
    background: rgb(249 250 251);
}

.business-table-mobile-guide {
    display: none;
}

.dark .business-detail-table .business-table-primary-column,
.dark .business-detail-table .fi-ta-actions-header-cell,
.dark .business-detail-table .fi-ta-actions-cell,
.dark .business-detail-table th:has(.fi-ta-actions),
.dark .business-detail-table td:has(.fi-ta-actions) {
    background: rgb(17 24 39);
    box-shadow: 1px 0 0 rgb(55 65 81), 8px 0 12px -12px rgb(0 0 0 / 0.8);
}

.dark .business-detail-table thead .business-table-primary-column,
.dark .business-detail-table thead .fi-ta-actions-header-cell,
.dark .business-detail-table thead th:has(.fi-ta-actions),
.dark .business-detail-table tbody tr:hover .business-table-primary-column,
.dark .business-detail-table tbody tr:hover .fi-ta-actions-cell,
.dark .business-detail-table tbody tr:hover td:has(.fi-ta-actions) {
    background: rgb(31 41 55);
}

/* 左右の固定列を置く余裕がない幅では固定を解除し、中央列への重なりを防ぐ。 */
@container business-detail-table (max-width: 60rem) {
    .business-detail-table .business-table-primary-column,
    .business-detail-table .fi-ta-actions-header-cell,
    .business-detail-table .fi-ta-actions-cell,
    .business-detail-table th:has(.fi-ta-actions),
    .business-detail-table td:has(.fi-ta-actions) {
        position: static !important;
        left: auto !important;
        right: auto !important;
        z-index: auto !important;
        box-shadow: none !important;
    }

    .business-detail-table .business-table-primary-column {
        width: 14rem;
        min-width: 10rem;
        max-width: 18rem;
    }
}

/* container query非対応時の安全側フォールバック。 */
@media (max-width: 1023px) {
    .business-detail-table .business-table-primary-column,
    .business-detail-table .fi-ta-actions-header-cell,
    .business-detail-table .fi-ta-actions-cell,
    .business-detail-table th:has(.fi-ta-actions),
    .business-detail-table td:has(.fi-ta-actions) {
        position: static !important;
        left: auto !important;
        right: auto !important;
        z-index: auto !important;
        box-shadow: none !important;
    }
}

@media (max-width: 767px) {
    .business-table-mobile-guide {
        display: flex;
        align-items: flex-start;
        gap: 0.375rem;
        margin-bottom: 0.5rem;
        padding: 0.5rem 0.75rem;
        border: 1px solid rgb(191 219 254);
        border-radius: 0.5rem;
        background: rgb(239 246 255);
        color: rgb(30 64 175);
        font-size: 0.75rem;
        line-height: 1.35rem;
    }

    .dark .business-table-mobile-guide {
        border-color: rgb(30 64 175);
        background: rgb(23 37 84 / 0.55);
        color: rgb(191 219 254);
    }

    /* スマートフォンは主要項目だけの要約行にする。 */
    .business-detail-table .business-table-secondary-column,
    .business-detail-table .business-table-code-column {
        display: none !important;
    }

    .business-detail-table .fi-ta-cell,
    .business-detail-table .fi-ta-header-cell,
    .business-detail-table th,
    .business-detail-table td {
        min-width: 6.5rem;
        max-width: 13rem;
    }

    .business-detail-table .business-table-primary-column {
        width: 12rem;
        min-width: 9rem;
        max-width: 14rem;
    }

    .business-detail-table .fi-ta-actions-cell,
    .business-detail-table td:has(.fi-ta-actions) {
        width: 6.5rem;
        min-width: 6.5rem;
        max-width: 7.5rem;
    }
}
/* business-detail-table:end */

/* app-table-overlap-guard:start
 * 一覧表を画面幅へ無理に圧縮せず、列の必要幅を維持したまま横スクロールさせる。
 * セル内文字は列外へ描画させず、長い名称列だけを折り返す。
 */
.fi-ta-ctn,
.fi-ta-content-ctn,
.fi-ta-content {
    min-width: 0 !important;
    max-width: 100% !important;
}

.fi-ta-content {
    position: relative;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

/* Filament標準のwidth:100%で列を潰さず、内容に必要な横幅を確保する。 */
.fi-ta-table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0;
}

.fi-ta-header-cell,
.fi-ta-cell {
    box-sizing: border-box;
    width: auto !important;
    min-width: 6.5rem;
    max-width: none;
    overflow: hidden;
    vertical-align: middle;
}

.fi-ta-header-cell > *,
.fi-ta-cell > * {
    min-width: 0 !important;
    max-width: 100%;
}

.fi-ta-header-cell-label,
.fi-ta-header-cell-label span {
    white-space: nowrap !important;
}

/* 通常列は1行を保ち、列幅を確保する。これにより隣のセルへの重なりを防ぐ。 */
.fi-ta-cell .fi-ta-text,
.fi-ta-cell .fi-ta-text-item {
    min-width: max-content;
    max-width: 100%;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
}

.fi-ta-cell .fi-badge {
    max-width: 100%;
    white-space: nowrap;
}

/* 行操作は最終更新列と重ならないよう、必要幅を独立して確保する。 */
.fi-ta-actions-header-cell,
.fi-ta-actions-cell,
th:has(> .fi-ta-actions),
td:has(> .fi-ta-actions) {
    width: 1% !important;
    min-width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.fi-ta-actions {
    display: flex !important;
    min-width: max-content;
    flex-wrap: nowrap !important;
    align-items: center;
    white-space: nowrap;
}

/* 一覧画面の業務列幅。PHP側のextraHeaderAttributes / extraCellAttributesから使用する。 */
.business-list-short-column {
    width: 4.5rem !important;
    min-width: 4.5rem !important;
}

.business-list-key-column {
    width: 9.5rem !important;
    min-width: 8.5rem !important;
}

.business-list-code-column {
    width: 10rem !important;
    min-width: 8.5rem !important;
}

.business-list-title-column {
    width: 18rem !important;
    min-width: 14rem !important;
    max-width: 22rem !important;
}

.business-list-title-column .fi-ta-text,
.business-list-title-column .fi-ta-text-item {
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden !important;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.4;
}

.business-list-number-column {
    width: 8rem !important;
    min-width: 7rem !important;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.business-list-status-column {
    width: 7rem !important;
    min-width: 6.5rem !important;
    text-align: center;
}

.business-list-progress-column {
    width: 9rem !important;
    min-width: 8.5rem !important;
    text-align: center;
}

.business-list-date-short-column {
    width: 7.5rem !important;
    min-width: 7rem !important;
    font-variant-numeric: tabular-nums;
}

.business-list-date-column {
    width: 11rem !important;
    min-width: 10.5rem !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
}

.business-list-number-column .fi-ta-text,
.business-list-number-column .fi-ta-text-item,
.business-list-date-short-column .fi-ta-text,
.business-list-date-short-column .fi-ta-text-item,
.business-list-date-column .fi-ta-text,
.business-list-date-column .fi-ta-text-item {
    white-space: nowrap !important;
}

/* 狭い画面でも列を潰さず横スクロールする。名称列だけ少し小さくする。 */
@media (max-width: 1023px) {
    .business-list-title-column {
        width: 15rem !important;
        min-width: 12rem !important;
        max-width: 18rem !important;
    }

    .fi-ta-actions {
        gap: 0.5rem !important;
    }
}

@media (max-width: 639px) {
    .business-list-title-column {
        width: 13rem !important;
        min-width: 10rem !important;
        max-width: 15rem !important;
    }

    .business-list-key-column,
    .business-list-code-column {
        min-width: 8rem !important;
    }
}
/* app-table-overlap-guard:end */


/* business-primary-action-guard:start */
[data-requires-clean-form="true"].business-workflow-action--blocked {
    cursor: not-allowed !important;
    filter: saturate(0.35);
    opacity: 0.55;
}

[data-requires-clean-form="true"].business-workflow-action--blocked:hover,
[data-requires-clean-form="true"].business-workflow-action--blocked:focus-visible {
    filter: saturate(0.35);
    opacity: 0.55;
}
/* business-primary-action-guard:end */

/* screen-specific-usability:start */
.business-tabs__group-label {
    display: inline-flex;
    min-height: 2.85rem;
    flex: 0 0 auto;
    align-items: center;
    margin-left: 0.45rem;
    padding: 0 0.6rem;
    border-left: 2px solid rgb(203 213 225);
    color: rgb(71 85 105);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.business-tabs__tab {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
}

.business-tabs__tab-main {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.business-tabs__subtotal {
    color: rgb(100 116 139);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1rem;
    font-variant-numeric: tabular-nums;
}

.business-tabs__tab.is-active .business-tabs__subtotal {
    color: rgb(37 99 235);
}

.business-tab-loading {
    display: flex;
    min-height: 5rem;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border: 1px dashed rgb(147 197 253);
    border-radius: 0.75rem;
    background: rgb(239 246 255 / 0.9);
    color: rgb(30 64 175);
    font-size: 0.875rem;
    font-weight: 700;
}

.business-tab-loading__spinner {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid rgb(191 219 254);
    border-top-color: rgb(37 99 235);
    border-radius: 9999px;
    animation: business-tab-spin 0.8s linear infinite;
}

.business-workflow-guide {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.business-workflow-guide__item {
    min-width: 0;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    background: rgb(248 250 252);
    padding: 0.8rem 0.9rem;
}

.business-workflow-guide__item.is-current {
    border-color: rgb(96 165 250);
    background: rgb(239 246 255);
    box-shadow: 0 0 0 2px rgb(59 130 246 / 0.08);
}

.business-workflow-guide__title {
    color: rgb(15 23 42);
    font-size: 0.82rem;
    font-weight: 800;
}

.business-workflow-guide__description {
    margin-top: 0.25rem;
    color: rgb(71 85 105);
    font-size: 0.75rem;
    line-height: 1.35rem;
}

.business-stepper {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.business-stepper__step {
    position: relative;
    min-width: 0;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.8rem;
    background: rgb(255 255 255);
    padding: 0.9rem 0.9rem 0.9rem 3.2rem;
}

.business-stepper__number {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgb(37 99 235);
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
}

.business-stepper__title {
    color: rgb(15 23 42);
    font-size: 0.88rem;
    font-weight: 800;
}

.business-stepper__description {
    margin-top: 0.2rem;
    color: rgb(71 85 105);
    font-size: 0.75rem;
    line-height: 1.3rem;
}

.business-execution-summary {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.business-execution-summary__item {
    min-width: 0;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    background: rgb(248 250 252);
    padding: 0.8rem;
}

.business-execution-summary__label {
    color: rgb(100 116 139);
    font-size: 0.7rem;
    font-weight: 700;
}

.business-execution-summary__value {
    margin-top: 0.2rem;
    color: rgb(15 23 42);
    font-size: 0.95rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.business-save-bar--attention {
    animation: business-save-attention 0.6s ease-in-out 2;
}

.dark .business-tabs__group-label {
    border-left-color: rgb(71 85 105);
    color: rgb(148 163 184);
}

.dark .business-tabs__subtotal,
.dark .business-workflow-guide__description,
.dark .business-stepper__description {
    color: rgb(148 163 184);
}

.dark .business-tabs__tab.is-active .business-tabs__subtotal {
    color: rgb(147 197 253);
}

.dark .business-tab-loading {
    border-color: rgb(30 64 175);
    background: rgb(30 58 138 / 0.18);
    color: rgb(191 219 254);
}

.dark .business-workflow-guide__item,
.dark .business-stepper__step,
.dark .business-execution-summary__item {
    border-color: rgb(255 255 255 / 0.1);
    background: rgb(255 255 255 / 0.035);
}

.dark .business-workflow-guide__item.is-current {
    border-color: rgb(59 130 246);
    background: rgb(30 58 138 / 0.2);
}

.dark .business-workflow-guide__title,
.dark .business-stepper__title,
.dark .business-execution-summary__value {
    color: rgb(241 245 249);
}

.dark .business-execution-summary__label {
    color: rgb(148 163 184);
}

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

@keyframes business-save-attention {
    0%, 100% { box-shadow: 0 8px 24px rgb(0 0 0 / 0.1); }
    50% { box-shadow: 0 0 0 4px rgb(245 158 11 / 0.32), 0 8px 24px rgb(0 0 0 / 0.1); }
}

@media (max-width: 900px) {
    .business-workflow-guide,
    .business-stepper,
    .business-execution-summary {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* screen-specific-usability:end */

/* invoice-step-overlap-hotfix:start */
.business-stepper--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.business-stepper--four .business-stepper__step {
    position: static;
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    align-items: start;
    column-gap: 0.7rem;
    min-width: 0;
    padding: 0.9rem;
}

.business-stepper--four .business-stepper__number {
    position: static;
    flex: none;
    grid-column: 1;
    grid-row: 1;
}

.business-stepper--four .business-stepper__content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.business-stepper--four .business-stepper__title,
.business-stepper--four .business-stepper__description {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 1180px) {
    .business-stepper--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .business-stepper--four {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* invoice-step-overlap-hotfix:end */

/* app-user-interface-settings:start
   ユーザー別配色・共通UI・ユーザーメニュー幅調整。 */
:root {
        --app-user-sidebar-color: #334155;
        --app-user-sidebar-text: rgb(255 255 255 / 0.94);
        --app-user-sidebar-hover: rgb(255 255 255 / 0.16);
        --app-user-sidebar-hover-subtle: rgb(255 255 255 / 0.12);
        --app-user-sidebar-focus: rgb(255 255 255 / 0.8);
        --app-user-topbar-color: #1d4ed8;
        --app-user-topbar-text: rgb(255 255 255 / 0.96);
        --app-user-topbar-hover: rgb(255 255 255 / 0.14);
    }

    .fi-sidebar,
    .fi-sidebar-header,
    .fi-sidebar-nav {
        background-color: var(--app-user-sidebar-color) !important;
    }

    .fi-sidebar .fi-logo,
    .fi-sidebar .fi-sidebar-group-label,
    .fi-sidebar .fi-sidebar-item-label,
    .fi-sidebar .fi-sidebar-item-icon,
    .fi-sidebar .fi-icon-btn,
    .fi-sidebar .fi-sidebar-header button,
    .fi-sidebar .fi-sidebar-header svg {
        color: var(--app-user-sidebar-text, rgb(255 255 255 / 0.94)) !important;
    }

    .fi-sidebar .fi-sidebar-item > a:hover,
    .fi-sidebar .fi-sidebar-item-active > a,
    .fi-sidebar .fi-sidebar-item.fi-active > a {
        background-color: var(--app-user-sidebar-hover, rgb(255 255 255 / 0.16)) !important;
    }

    .fi-sidebar .fi-sidebar-item > a:focus-visible,
    .fi-sidebar .fi-icon-btn:focus-visible {
        outline-color: var(--app-user-sidebar-focus, rgb(255 255 255 / 0.8)) !important;
    }

    .fi-sidebar .fi-sidebar-group-button:hover,
    .fi-sidebar .fi-sidebar-header button:hover {
        background-color: var(--app-user-sidebar-hover-subtle, rgb(255 255 255 / 0.12)) !important;
    }

    .fi-topbar > nav,
    .fi-topbar nav {
        background-color: var(--app-user-topbar-color) !important;
    }

    .fi-topbar .fi-logo,
    .fi-topbar .fi-icon-btn,
    .fi-topbar .fi-icon-btn svg,
    .fi-topbar button,
    .fi-topbar button svg {
        color: var(--app-user-topbar-text, rgb(255 255 255 / 0.96)) !important;
    }

    .fi-topbar .fi-icon-btn:hover,
    .fi-topbar button:hover {
        background-color: var(--app-user-topbar-hover, rgb(255 255 255 / 0.14)) !important;
    }

    .app-topbar-title {
        order: 20;
        display: flex;
        align-items: center;
        min-width: 0;
        max-width: min(52vw, 42rem);
        margin-inline: 0.35rem auto;
        overflow: hidden;
        color: var(--app-user-topbar-text, #fff);
        font-size: 0.93rem;
        font-weight: 700;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fi-topbar > nav > .ms-auto {
        order: 30;
    }

    .fi-topbar .fi-topbar-open-sidebar-btn,
    .fi-topbar .fi-topbar-close-sidebar-btn,
    .fi-topbar [data-sidebar-open-button],
    .fi-topbar [data-sidebar-close-button] {
        order: 10;
    }

    /* ユーザーメニューは標準14remより広げ、画面端ではビューポート内に収める。 */
    .app-user-menu-panel,
    .fi-dropdown-panel:has(.app-user-menu-company) {
        width: min(18rem, calc(100vw - 1rem)) !important;
        max-width: min(18rem, calc(100vw - 1rem)) !important;
        overflow-x: hidden !important;
    }

    .app-user-menu-company {
        display: grid;
        min-width: 0;
        max-width: 100%;
        gap: 0.2rem;
        margin: 0.35rem 0.5rem 0.55rem;
        padding: 0.65rem 0.75rem;
        overflow: hidden;
        border-radius: 0.55rem;
        background: rgb(241 245 249);
        color: rgb(30 41 59);
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .app-user-menu-company-label {
        display: block;
        min-width: 0;
        color: rgb(100 116 139);
        font-size: 0.68rem;
        font-weight: 600;
        line-height: 1.2;
    }

    .app-user-menu-company-name {
        display: block;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
        line-break: strict;
        white-space: normal;
    }

    .app-user-menu-panel .fi-dropdown-list-item-label,
    .fi-dropdown-panel:has(.app-user-menu-company) .fi-dropdown-list-item-label {
        min-width: 0;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .dark .app-user-menu-company {
        background: rgb(51 65 85 / 0.65);
        color: rgb(241 245 249);
    }

    .dark .app-user-menu-company-label {
        color: rgb(203 213 225);
    }

    .app-system-footer {
        width: 100%;
        padding: 1.25rem 1rem 1.5rem;
        color: rgb(100 116 139);
        font-size: 0.75rem;
        text-align: center;
    }

    .dark .app-system-footer {
        color: rgb(148 163 184);
    }

    .app-user-list-avatar-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-user-list-avatar {
        width: 1.75rem;
        height: 1.75rem;
        border: 1px solid rgb(203 213 225);
        border-radius: 9999px;
        background: rgb(226 232 240);
        object-fit: cover;
    }

    @media (max-width: 767px) {
        .app-topbar-title {
            max-width: 58vw;
            font-size: 0.82rem;
        }

        .app-user-menu-panel,
        .fi-dropdown-panel:has(.app-user-menu-company) {
            width: min(17rem, calc(100vw - 0.75rem)) !important;
            max-width: min(17rem, calc(100vw - 0.75rem)) !important;
        }
    }
/* app-user-interface-settings:end */
/* app-user-avatar-white-circle:start */
.fi-user-avatar {
    box-sizing: border-box;
    border: 1px solid rgb(203 213 225) !important;
    border-radius: 9999px !important;
    background-color: rgb(255 255 255) !important;
    padding: 2px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.10);
}

.app-user-list-avatar {
    box-sizing: border-box;
    background-color: rgb(255 255 255) !important;
    padding: 1px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}
/* app-user-avatar-white-circle:end */

/* PUBFLOW_AUTH_THEME_START */
/*
 * PubFlow authentication theme
 * 対象: Filament simple auth pages only (work / master / admin)
 * 通常のログイン後画面には影響させない。
 */

.fi-simple-layout {
    --pubflow-navy: #0d3b66;
    --pubflow-navy-deep: #082f5f;
    --pubflow-teal: #0f9b9d;
    --pubflow-teal-soft: #e9f7f7;
    --pubflow-text: #18324c;
    --pubflow-muted: #64748b;
    --pubflow-border: #dbe4ec;
    --pubflow-surface: #ffffff;
    --pubflow-canvas: #f5f7fa;

    position: relative !important;
    min-height: 100vh !important;
    background: var(--pubflow-canvas) !important;
    color: var(--pubflow-text) !important;
}

/* ログインカード側 */
.fi-simple-layout > .fi-simple-main-ctn {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    padding: 3rem clamp(2rem, 4vw, 5rem) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background:
        radial-gradient(circle at 95% 5%, rgba(15, 155, 157, .065), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, #f4f7fa 100%) !important;
}

.fi-simple-layout .fi-simple-main {
    position: relative !important;
    width: min(100%, 540px) !important;
    max-width: 540px !important;
    margin: 0 !important;
    padding: clamp(2rem, 3.4vw, 3.25rem) !important;
    border: 1px solid var(--pubflow-border) !important;
    border-radius: 14px !important;
    background: var(--pubflow-surface) !important;
    box-shadow: 0 22px 55px rgba(13, 59, 102, .10), 0 3px 12px rgba(15, 23, 42, .05) !important;
    overflow: hidden !important;
}

.fi-simple-layout .fi-simple-main::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pubflow-navy) 0 58%, var(--pubflow-teal) 58% 100%);
    pointer-events: none;
}

/*
 * PubFlowはロゴ内の1回だけ表示する。
 * Filament側のbrandName文字列はログイン画面では非表示。
 */
.fi-simple-layout .fi-simple-header .fi-logo {
    display: none !important;
}

.fi-simple-layout .fi-simple-header::before {
    content: "";
    display: block;
    width: min(100%, 270px);
    height: 156px;
    margin: 0 auto 1.25rem;
    background: url('/images/pubflow-logo.png') center / contain no-repeat;
}

.fi-simple-layout .fi-simple-header {
    gap: .35rem !important;
    margin-bottom: 2rem !important;
    text-align: center !important;
}

.fi-simple-layout .fi-simple-header-heading {
    color: var(--pubflow-navy-deep) !important;
    font-size: 1.6rem !important;
    font-weight: 760 !important;
    letter-spacing: .01em !important;
}

.fi-simple-layout .fi-simple-header-subheading {
    color: var(--pubflow-muted) !important;
    line-height: 1.7 !important;
}

/* 3パネルの識別。ブランド名ではなく機能区分だけを表示。 */
.fi-panel-work .fi-simple-layout .fi-simple-main::before,
.fi-panel-master .fi-simple-layout .fi-simple-main::before,
.fi-panel-admin .fi-simple-layout .fi-simple-main::before {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: .3rem .65rem;
    border: 1px solid #d8e3ec;
    border-radius: 999px;
    background: #f8fafc;
    color: #52687d;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.2;
}

.fi-panel-work .fi-simple-layout .fi-simple-main::before { content: "業務処理"; }
.fi-panel-master .fi-simple-layout .fi-simple-main::before { content: "業務マスタ管理"; }
.fi-panel-admin .fi-simple-layout .fi-simple-main::before { content: "システム管理"; }

/* 入力欄 */
.fi-simple-layout .fi-fo-field-wrp-label span,
.fi-simple-layout .fi-input-wrp-label {
    color: #243f58 !important;
    font-weight: 700 !important;
}

.fi-simple-layout .fi-input-wrp {
    min-height: 46px !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 0 0 1px var(--pubflow-border) !important;
    transition: box-shadow .16s ease, border-color .16s ease !important;
}

.fi-simple-layout .fi-input-wrp:focus-within {
    box-shadow: 0 0 0 2px rgba(15, 155, 157, .35), 0 0 0 1px var(--pubflow-teal) !important;
}

.fi-simple-layout .fi-input,
.fi-simple-layout input[type="email"],
.fi-simple-layout input[type="password"],
.fi-simple-layout input[type="text"] {
    color: #142f49 !important;
}

/* アクションボタンは3パネルでPubFlow色へ統一 */
.fi-simple-layout .fi-btn.fi-color-primary,
.fi-simple-layout button[type="submit"].fi-btn {
    min-height: 46px !important;
    border-radius: 8px !important;
    background: linear-gradient(90deg, var(--pubflow-navy-deep), #0e437c) !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 7px 16px rgba(8, 47, 95, .16) !important;
}

.fi-simple-layout .fi-btn.fi-color-primary:hover,
.fi-simple-layout button[type="submit"].fi-btn:hover {
    filter: brightness(1.07) !important;
}

.fi-simple-layout a:not(.fi-btn) {
    color: #1766a6 !important;
    text-decoration-color: rgba(23, 102, 166, .32) !important;
    text-underline-offset: 3px;
}

.fi-simple-layout .fi-checkbox-input:checked {
    background-color: var(--pubflow-teal) !important;
    border-color: var(--pubflow-teal) !important;
}

.fi-simple-layout .fi-form-actions {
    margin-top: .3rem !important;
}

.fi-simple-layout .fi-form-actions .fi-btn {
    width: 100% !important;
    justify-content: center !important;
}

.fi-simple-layout .fi-alert {
    border-radius: 8px !important;
}

/* 左側ブランドパネル */
@media (min-width: 1024px) {
    .fi-simple-layout {
        display: grid !important;
        grid-template-columns: minmax(520px, 1.08fr) minmax(480px, .92fr) !important;
        align-items: stretch !important;
        overflow: hidden !important;
    }

    .fi-simple-layout::before {
        content: "ITを通じて書店と出版の未来をつなぐ";
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        min-height: 100vh;
        box-sizing: border-box;
        padding: clamp(4.5rem, 7vw, 7rem) clamp(3.5rem, 7vw, 7rem);
        white-space: normal;
        color: var(--pubflow-navy-deep);
        font-size: clamp(2rem, 3vw, 3.25rem);
        font-weight: 800;
        line-height: 1.42;
        letter-spacing: .025em;
        background-image:
            linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.18)),
            url('/images/pubflow-auth-flow.svg'),
            radial-gradient(circle at 18% 20%, rgba(15,155,157,.10), transparent 30%),
            linear-gradient(135deg, #f8fbfd 0%, #eef5f8 100%);
        background-repeat: no-repeat;
        background-size: auto, min(92%, 1000px) auto, auto, auto;
        background-position: center, center calc(100% - 1.3rem), center, center;
        border-right: 1px solid #dce6ee;
    }

    .fi-simple-layout::after {
        content: "企画・編集・制作・進行・販売まで、出版業務を一元管理。";
        position: absolute;
        left: clamp(3.5rem, 7vw, 7rem);
        top: clamp(13.3rem, 22vw, 18.5rem);
        width: min(38vw, 560px);
        color: #526d84;
        font-size: clamp(.92rem, 1.12vw, 1.08rem);
        font-weight: 500;
        line-height: 1.8;
        letter-spacing: .02em;
        pointer-events: none;
    }

    .fi-simple-layout > .fi-simple-main-ctn {
        grid-column: 2;
        grid-row: 1;
    }
}



/* 右下の光和コンピューターロゴ */
.fi-simple-layout > .fi-simple-main-ctn::after {
    content: "";
    position: fixed;
    right: clamp(1rem, 2vw, 1.75rem);
    bottom: clamp(1rem, 2vw, 1.25rem);
    width: clamp(82px, 7.5vw, 112px);
    height: clamp(30px, 2.9vw, 42px);
    background: url('/images/kowa-computer-logo.png') right bottom / contain no-repeat;
    opacity: .92;
    pointer-events: none;
    z-index: 1;
}

/* タブレット・スマートフォンはシンプルな1カラム */
@media (max-width: 1023px) {
    .fi-simple-layout::before,
    .fi-simple-layout::after {
        display: none !important;
        content: none !important;
    }

    .fi-simple-layout > .fi-simple-main-ctn::after {
        position: fixed;
        right: .85rem;
        bottom: .85rem;
        width: 74px;
        height: 26px;
    }

    .fi-simple-layout > .fi-simple-main-ctn {
        min-height: 100vh !important;
        padding: 2rem 1.25rem !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(100%, 520px) !important;
        padding: 2rem 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .fi-simple-layout > .fi-simple-main-ctn {
        padding: 1rem !important;
    }

    .fi-simple-layout .fi-simple-main {
        border-radius: 10px !important;
        padding: 1.75rem 1.15rem !important;
    }

    .fi-simple-layout .fi-simple-header::before {
        width: 230px;
        height: 133px;
        margin-bottom: 1rem;
    }

    .fi-panel-work .fi-simple-layout .fi-simple-main::before,
    .fi-panel-master .fi-simple-layout .fi-simple-main::before,
    .fi-panel-admin .fi-simple-layout .fi-simple-main::before {
        top: .65rem;
        right: .65rem;
        font-size: .64rem;
    }
}



/*
 * ログイン後のPubFlowロゴ
 *
 * brandLogo画像には依存せず、Filament標準のbrandName表示枠(.fi-logo)を
 * 正式な透過PubFlowロゴの表示枠として使う。
 * これにより、メニュー折畳時・スマホで「PubFlow」という単色文字へ戻らない。
 *
 *  - デスクトップ・メニュー展開時: 左サイドバー左上
 *  - デスクトップ・メニュー折畳時: 上部バー（ハンバーガーの右側）
 *  - スマートフォン: 上部バー（ハンバーガーの右側）
 */
.fi-sidebar-header .fi-logo,
.fi-topbar .fi-logo {
    flex: 0 0 auto !important;
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
    background-size: contain !important;

    /* brandName文字は表示しない。正式ロゴ画像だけを見せる。 */
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    letter-spacing: 0 !important;
    text-indent: -9999px !important;
    white-space: nowrap !important;
}

/* メニュー展開時：サイドバーの選択色に合わせる。 */
.fi-sidebar-header .fi-logo {
    background-image: var(
        --app-pubflow-sidebar-logo-image,
        url('/images/pubflow-menu-logo.png')
    ) !important;
}

/* メニュー折畳時・スマホ：トップバーの選択色に合わせる。 */
.fi-topbar .fi-logo {
    background-image: var(
        --app-pubflow-topbar-logo-image,
        url('/images/pubflow-menu-logo.png')
    ) !important;
}

/* brandLogoのimgが過去キャッシュ等で残っていても二重に出さない。 */
.fi-sidebar-header .fi-logo > img,
.fi-topbar .fi-logo > img {
    display: none !important;
}

/* 旧パッチのサイドバー背景ロゴは無効化。 */
.fi-sidebar-nav {
    background-image: none !important;
    padding-top: .5rem !important;
}

/* スマホでも小さくし過ぎない。ハンバーガー右横に元ロゴ比率のまま表示。 */
@media (max-width: 768px) {
    .fi-topbar .fi-logo {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
    }
}

/* ダークモード設定でも認証画面だけはブランド基準の明るい配色に統一 */
.dark .fi-simple-layout,
.dark .fi-simple-layout > .fi-simple-main-ctn,
.dark .fi-simple-layout .fi-simple-main {
    color-scheme: light;
}

.dark .fi-simple-layout .fi-simple-main {
    background: #fff !important;
    color: var(--pubflow-text) !important;
}
/* PUBFLOW_AUTH_THEME_END */

/* APP_TABLE_HEADER_THEME_START */
:root {
    --app-user-table-header-color: #e2e8f0;
    --app-user-table-header-text-color: #111827;
}

.fi-ta-table > thead,
.fi-ta-table > thead > tr,
.fi-ta-table > thead > tr > th,
.fi-ta-header-cell,
.fi-ta-actions-header-cell,
table > thead,
table > thead > tr,
table > thead > tr > th,
table > thead > tr > td,
.business-detail-table thead .business-table-primary-column,
.business-detail-table thead .fi-ta-actions-header-cell,
.business-detail-table thead th:has(.fi-ta-actions) {
    background-color: var(--app-user-table-header-color) !important;
    color: var(--app-user-table-header-text-color) !important;
}

.fi-ta-table > thead > tr > th *,
.fi-ta-header-cell *,
.fi-ta-actions-header-cell *,
.fi-ta-header-cell-label,
.fi-ta-header-cell-label span,
table > thead > tr > th *,
table > thead > tr > td * {
    color: var(--app-user-table-header-text-color) !important;
}

.dark .fi-ta-table > thead,
.dark .fi-ta-table > thead > tr,
.dark .fi-ta-table > thead > tr > th,
.dark .fi-ta-header-cell,
.dark table > thead,
.dark table > thead > tr,
.dark table > thead > tr > th,
.dark table > thead > tr > td {
    background-color: var(--app-user-table-header-color) !important;
    color: var(--app-user-table-header-text-color) !important;
}
/* APP_TABLE_HEADER_THEME_END */
