* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}
.header {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 12px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}
.header p {
    color: #64748b;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
}
.reload-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}
.reload-button:hover {
    background-color: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}
.reload-button:active {
    transform: translateY(0);
}
.reload-button svg {
    transition: transform 0.6s ease;
}
.reload-button:hover svg {
    transform: rotate(180deg);
}
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #8b5cf6;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* カード全体の背景色フェードアウトアニメーション */
@keyframes cardFadeGreen {
    0% {
        background-color: #bbf7d0;
        box-shadow: 0 4px 20px rgba(34, 197, 94, 0.5), inset 0 0 0 3px #22c55e;
        transform: scale(1.02);
    }
    30% {
        background-color: #dcfce7;
        box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4), inset 0 0 0 2px #22c55e;
        transform: scale(1.01);
    }
    100% {
        background-color: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), inset 0 0 0 0px transparent;
        transform: scale(1);
    }
}
@keyframes cardFadeRed {
    0% {
        background-color: #fecaca;
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5), inset 0 0 0 3px #ef4444;
        transform: scale(1.02);
    }
    30% {
        background-color: #fee2e2;
        box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4), inset 0 0 0 2px #ef4444;
        transform: scale(1.01);
    }
    100% {
        background-color: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), inset 0 0 0 0px transparent;
        transform: scale(1);
    }
}
.process-card.card-flash-green {
    animation: cardFadeGreen 2.5s ease-out forwards !important;
}
.process-card.card-flash-red {
    animation: cardFadeRed 2.5s ease-out forwards !important;
}
.stats-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 10px 20px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.stat-card {
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    background: #f8fafc;
}
.stat-card.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}
.stat-card.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #f1f5f9;
}
.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 2px;
}
.stat-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}
.jump-links-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.quick-filters-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.quick-filter-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.quick-filter-btn {
    padding: 8px 16px;
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}
.quick-filter-btn:hover {
    background-color: #8b5cf6;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}
.quick-filter-btn.active {
    background-color: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}
.quick-filter-reset-btn {
    padding: 8px 16px;
    background-color: #fef2f2;
    color: #dc2626;
    border-radius: 20px;
    border: 2px solid #fecaca;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-left: 16px;
}
.quick-filter-reset-btn:hover {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}
.quick-filter-btn.active {
    background-color: #8b5cf6;
    color: white;
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}
.dashboard-search-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.dashboard-search-input {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}
.dashboard-search-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
.dashboard-search-reset-btn {
    padding: 10px 20px;
    background-color: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    border: 2px solid #fecaca;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}
.dashboard-search-reset-btn:hover {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

/* コンパクトフィルターエリア（常時表示） */
.compact-filter-area {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    margin-bottom: 24px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-dropdown-wrapper {
    flex-shrink: 0;
}

.filter-dropdown {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.filter-dropdown:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.filter-dropdown:hover {
    border-color: #cbd5e1;
}

.filter-dropdown.active {
    border-color: #8b5cf6;
    background-color: #f5f3ff;
    color: #7c3aed;
}

.multi-search-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.multi-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9ca3af;
    pointer-events: none;
}

.multi-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.multi-search-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.multi-search-input::placeholder {
    color: #9ca3af;
}

.compact-reset-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.compact-reset-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.compact-reset-btn:hover svg {
    animation: rotate 0.6s ease-in-out;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* カテゴリ見出し（廃止済み、互換性のため残す） */
.main-category {
    display: none;
}
.sub-category {
    display: none;
}

/* 6列グリッドレイアウト */
.cards-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* レスポンシブ対応 */
@media (max-width: 1400px) {
    .cards-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1000px) {
    .cards-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cards-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 500px) {
    .cards-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
.process-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-top: 4px solid #e5e7eb;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.process-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.color-blue { border-top-color: #3b82f6; }
.color-green { border-top-color: #22c55e; }
.color-red { border-top-color: #ef4444; }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.card-title {
    font-size: 15px;
    font-weight: bold;
    color: #1e293b;
}
.card-count {
    font-size: 26px;
    font-weight: bold;
    color: #1e293b;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
.card-stats {
    display: flex;
    gap: 10px;
}
.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}
.stat-value {
    font-weight: 500;
}
.stat.priority .stat-value {
    color: #d97706;
}
.stat.urgent .stat-value {
    color: #dc2626;
}
.load-icon {
    font-size: 16px;
}
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 24px;
}
.table-header {
    padding: 16px 24px 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 4px;
}
.table-title {
    font-size: 24px;
    font-weight: bold;
    color: #8b5cf6;
    margin: 0;
    line-height: 1.2;
}
.table-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin: 0;
}
.search-container {
    position: relative;
    width: 300px;
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
}
.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}
.search-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}
.filter-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
.filter-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    min-width: 110px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    text-align: left;
    background-color: #f1f5f9;
    color: #475569;
    border: 2px solid transparent;
    justify-content: center;
}
.filter-btn:hover {
    background-color: #8b5cf6;
    color: white;
}
.filter-btn.filtered {
    background-color: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}
.filter-btn.filtered:hover {
    background-color: #7c3aed;
}
.filter-btn > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reset-button {
    padding: 10px;
    background-color: #64748b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reset-button:hover {
    background-color: #475569;
}
.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.back-button:hover {
    background-color: #7c3aed;
}
.table-scroll-wrapper {
    overflow: auto;
    /* 画面サイズに応じて動的に最適化: 100vh - (containerのpadding + table-headerの高さ + テーブルヘッダー行 + 余裕) */
    max-height: calc(100vh - 140px);
}
.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}
.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.scroll-to-top:hover {
    background-color: #7c3aed;
    transform: translateY(-2px);
}
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
th {
    padding-top: 8px;
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 11px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: 80px;
}
th.col-customer { width: 150px; }
th.col-part-name { width: 180px; }
th.col-order-number { width: 120px; }
th.col-receipt-number { width: 120px; }
th.col-part-number { width: 140px; }
th.col-production-qty { width: 70px; }
th.col-due-date { width: 110px; }
th.col-latest-process { width: 135px; }
th.col-latest-work-date { width: 180px; }
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}
.sortable:hover {
    background-color: #e2e8f0;
}
.sortable.sorted-asc,
.sortable.sorted-desc {
    background-color: #e0f2fe;
    color: #0369a1;
}
.sort-indicator {
    margin-left: 8px;
    font-size: 10px;
    opacity: 0.5;
}
.sortable.sorted-asc .sort-indicator,
.sortable.sorted-desc .sort-indicator {
    opacity: 1;
    color: #0369a1;
}
tbody tr:hover {
    background-color: #f8fafc;
}
.urgent-date {
    color: #dc2626;
    font-weight: bold;
}
.overdue {
    color: #dc2626;
    font-weight: bold;
}
.due-today {
    color: #ea580c;
    font-weight: bold;
}
.due-soon {
    color: #f59e0b;
    font-weight: bold;
}
.drawing-link {
    color: #8b5cf6;
    cursor: pointer;
    text-decoration: underline;
}
.drawing-disabled {
    color: #9ca3af;
    cursor: not-allowed;
}
.hidden {
    display: none;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    transition: opacity 0.3s ease;
}
.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}
.modal-overlay.hidden .modal-content {
     transform: translateY(-20px);
}
.modal-overlay:not(.hidden) .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 16px;
}
.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}
.modal-close-button {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
}
.modal-close-button:hover {
    color: #334155;
}
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#notificationModal .modal-body {
    gap: 16px;
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
}
.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-top: 8px;
}
.date-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}
.date-input-group .filter-select:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
}
.modal-body .filter-select {
    width: 100%;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}
.modal-apply-button, .modal-cancel-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.modal-apply-button {
    background-color: #8b5cf6;
    color: white;
}
.modal-apply-button:hover {
     background-color: #7c3aed;
}
.modal-cancel-button {
    background-color: #f1f5f9;
    color: #475569;
}
.modal-cancel-button:hover {
    background-color: #e2e8f0;
}
#notificationModal .modal-footer {
    justify-content: center;
}
.customer-list-container {
    max-height: 300px;
    overflow-y: auto;
}
.modal-list-category {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-top: 12px;
    margin-bottom: 4px;
    padding-left: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}
.modal-list-category:first-of-type {
    margin-top: 0;
}
.customer-item, .radio-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
}
.customer-item:hover, .radio-item:hover {
    background-color: #f8fafc;
}
.customer-item input[type="checkbox"], .radio-item input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    cursor: pointer;
}
.customer-item label, .radio-item label {
    font-size: 14px;
    flex-grow: 1;
    cursor: pointer;
}
.modal-link-button {
    background: none;
    border: none;
    color: #8b5cf6;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.modal-link-button:hover {
    text-decoration: underline;
}
.copied-feedback {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #334155;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.copied-feedback.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* 工程履歴モーダル用のスタイル */
.process-history-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.product-info-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.product-info-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.product-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.customer-name {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-red {
    background: #fee2e2;
    color: #991b1b;
}

.status-green {
    background: #dcfce7;
    color: #166534;
}

.status-blue {
    background: #dbeafe;
    color: #1e40af;
}

.status-gray {
    background: #f1f5f9;
    color: #475569;
}

.product-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.process-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.process-history-table th {
    background: #f8fafc;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e5e7eb;
}

.process-history-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.process-history-table tbody tr:hover {
    background: #f8fafc;
}

.receipt-number-link {
    color: #8b5cf6;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.receipt-number-link:hover {
    text-decoration: underline;
}

/* 部品番号コピーボタン */
.copy-part-number-btn {
    margin-left: 6px;
    padding: 2px 6px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.copy-part-number-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    transform: scale(1.1);
}

.copy-part-number-btn:active {
    transform: scale(0.95);
    background: #e0e0e0;
}

/* 品番列の幅を広げる */
.col-part-number {
    min-width: 180px !important;
}
/* ダッシュボード区切り線 */
.dashboard-divider {
    border-top: 2px solid #e2e8f0;
    margin: 24px 0 20px 0;
}

/* メーターリンクコンテナ */
.meter-links-container {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

/* 曲げメーターリンク */
.mage-meter-link {
    display: inline-block;
    padding: 10px 20px;
    background: white;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mage-meter-link:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.mage-meter-link:active {
    transform: translateY(0);
}

/* ========================================
   リアルタイム更新ステータス
   ======================================== */
.realtime-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.1);
}

.realtime-text {
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    letter-spacing: 0.3px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.pulse-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-color: #22c55e;
    border-radius: 50%;
    opacity: 0.7;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        opacity: 0.3;
        transform: scale(0.85);
        box-shadow: 0 0 8px 3px rgba(34, 197, 94, 0.4);
    }
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* 最終更新フラッシュエフェクト */
#lastUpdated {
    transition: color 0.3s ease;
}

#lastUpdated.flash-update {
    animation: flash-color 1.5s ease-out;
}

@keyframes flash-color {
    0% {
        color: #8b5cf6;
        font-weight: 700;
        text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    }
    50% {
        color: #7c3aed;
        font-weight: 700;
    }
    100% {
        color: #94a3b8;
        font-weight: 400;
        text-shadow: none;
    }
}

/* ========================================
   カスタムドロップダウン
   ======================================== */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.custom-dropdown-toggle:hover {
    border-color: #cbd5e1;
}

.custom-dropdown-toggle:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.custom-dropdown.active .custom-dropdown-toggle {
    border-color: #8b5cf6;
    background-color: #f5f3ff;
    color: #7c3aed;
}

.custom-dropdown.open .custom-dropdown-toggle {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 100%;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.custom-dropdown.open .custom-dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.dropdown-item:hover {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.dropdown-item.selected {
    background-color: #ede9fe;
    color: #7c3aed;
    font-weight: 500;
}
