/* 見積作成・編集画面専用UI */
.estimate-header-area {
    display: grid;
    gap: 1rem;
}

.estimate-overview-grid {
    display: grid;
    grid-template-columns: minmax(9rem, 0.8fr) minmax(18rem, 2fr) minmax(8rem, 0.8fr) minmax(11rem, 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);
}

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

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

.estimate-overview-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

.estimate-status-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.estimate-status-badge.is-success {
    background: rgb(220 252 231);
    color: rgb(22 101 52);
}

.estimate-status-badge.is-primary {
    background: rgb(219 234 254);
    color: rgb(30 64 175);
}

.estimate-status-badge.is-warning {
    background: rgb(254 249 195);
    color: rgb(133 77 14);
}

.estimate-status-badge.is-gray {
    background: rgb(243 244 246);
    color: rgb(55 65 81);
}

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

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

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

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

.estimate-new-guide {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid rgb(191 219 254);
    border-radius: 0.75rem;
    background: rgb(239 246 255);
    color: rgb(30 64 175);
    font-size: 0.875rem;
}

.dark .estimate-new-guide {
    border-color: rgb(30 64 175);
    background: rgb(23 37 84 / 0.6);
    color: rgb(191 219 254);
}

.estimate-save-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    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);
}

.dark .estimate-save-bar {
    border-color: rgb(55 65 81);
    background: rgb(17 24 39 / 0.96);
}

.estimate-save-hint {
    margin-right: auto;
    color: rgb(107 114 128);
    font-size: 0.8125rem;
}

.dark .estimate-save-hint {
    color: rgb(156 163 175);
}

.estimate-tabs {
    scrollbar-width: thin;
    scrollbar-color: rgb(156 163 175) transparent;
}

.estimate-tabs::-webkit-scrollbar {
    height: 0.4rem;
}

.estimate-tabs::-webkit-scrollbar-thumb {
    border-radius: 9999px;
    background: rgb(156 163 175);
}

@media (max-width: 1100px) {
    .estimate-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .estimate-save-bar {
        bottom: 0.5rem;
        align-items: stretch;
        flex-direction: column;
    }

    .estimate-save-hint {
        margin-right: 0;
    }

    .estimate-save-bar .fi-btn {
        width: 100%;
        justify-content: center;
    }
}
