/* ダイアログ内コンテンツ共通 */
.sd-content {
    width: min(520px, 88vw);
    display: flex;
    flex-direction: column;
}

.dialog-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--ig-gray-300, #bdbdbd);
    border-radius: 4px;
    background: var(--ig-surface-500, #fff);
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.dialog-search:focus-within {
    border-color: var(--ig-primary-500, #33997B);
    box-shadow: 0 0 0 2px rgba(51, 153, 123, 0.15);
}

.dialog-search .search-icon {
    color: var(--ig-gray-400, #bdbdbd);
    font-size: 20px;
    flex-shrink: 0;
}

.dialog-search:focus-within .search-icon {
    color: var(--ig-primary-500, #33997B);
}

.sd-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-family: inherit;
    background: transparent;
    color: var(--ig-gray-900, #333);
}

.sd-input::placeholder {
    color: var(--ig-gray-400, #bdbdbd);
}

.dialog-body {
    height: 360px;
    min-height: 160px;
    overflow-y: auto;
    padding: 4px 0;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--ig-gray-100, #f5f5f5);
}

.list-row:hover  { background: var(--ig-primary-50,  #f0faf6); }
.list-row:active { background: var(--ig-primary-100, #d9f0e8); }

.list-row.selected          { background: var(--ig-primary-50,  #e8f5f0); }
.list-row.selected:hover    { background: var(--ig-primary-100, #d5ede6); }

.item-code {
    font-size: 0.8rem;
    color: var(--ig-gray-600, #666);
    min-width: 60px;
    font-family: monospace;
}

.item-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--ig-gray-900, #1a1a2e);
    font-weight: 500;
}

.item-sub {
    font-size: 0.78rem;
    color: var(--ig-gray-500, #999);
}

.loading-row, .empty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--ig-gray-500, #999);
    font-size: 0.875rem;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--ig-gray-200, #e0e0e0);
    border-top-color: var(--ig-primary-500, #33997B);
    border-radius: 50%;
    animation: sd-spin 0.8s linear infinite;
}

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

.dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.record-count {
    font-size: 0.8rem;
    color: var(--ig-gray-500, #999);
}

.footer-buttons {
    display: flex;
    gap: 8px;
}

.list-check-icon {
    font-size: 20px;
    color: var(--ig-primary-500, #33997B);
    flex-shrink: 0;
}

/* レスポンシブ（iPad縦・スマホ） */
@media (max-width: 600px) {
    .sd-content { width: 94vw; }
    .dialog-body { height: 280px; }
}
