* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* フォーム */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

/* ボタン */
button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a5ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-close {
    background: transparent;
    color: #999;
    font-size: 24px;
    padding: 5px 10px;
}

.btn-close:hover {
    color: #666;
}

/* フィルターコントロール */
.filter-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-controls select {
    flex: 1;
}

/* 商品グリッド */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.item-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.item-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.item-name {
    font-weight: 600;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.item-category {
    display: inline-block;
    padding: 4px 12px;
    background: #e0e7ff;
    color: #667eea;
    border-radius: 20px;
    font-size: 0.85em;
    margin-bottom: 10px;
}

.item-price-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.current-price {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
}

.price-change {
    font-size: 0.9em;
    font-weight: 500;
}

.price-change.up {
    color: #f56565;
}

.price-change.down {
    color: #48bb78;
}

/* 詳細セクション */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.price-input-group {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr auto;
    gap: 10px;
    align-items: end;
}

/* 統計 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 600;
    color: #333;
}

/* チャート */
.chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.period-btn {
    padding: 8px 16px;
    background: #e0e7ff;
    color: #667eea;
    border-radius: 6px;
    font-size: 0.9em;
}

.period-btn.active {
    background: #667eea;
    color: white;
}

#priceChart {
    max-height: 400px;
}

/* 履歴リスト */
.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    color: #666;
    font-size: 0.9em;
}

.history-price {
    font-weight: 600;
}

.history-store {
    color: #888;
    font-size: 0.85em;
}

/* アクションセクション */
.actions-section {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* フッター */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .price-input-group {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-section {
        flex-direction: column;
    }
    
    .chart-controls {
        flex-wrap: wrap;
    }
}