.filter-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-item label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.filter-item input,
.filter-item select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-value.stat-positive {
    color: #28a745;
}

.stat-value.stat-negative {
    color: #dc3545;
}

.stat-value.stat-small {
    font-size: 14px;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.section-header h2 {
    margin: 0;
    font-size: 18px;
}

.section-caption {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.daily-summary-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.daily-summary-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.daily-summary-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f1f3f5;
    border-radius: 20px;
    font-size: 12px;
    color: #555;
}

.daily-summary-chip strong {
    font-size: 14px;
    color: #333;
}

.daily-summary-chip-positive {
    background: #e8f5e9;
    color: #2e7d32;
}

.daily-summary-chip-positive strong {
    color: #1b5e20;
}

.daily-summary-chip-negative {
    background: #fdecea;
    color: #c62828;
}

.daily-summary-chip-negative strong {
    color: #8e0000;
}

.daily-summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.daily-summary-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.daily-summary-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.daily-summary-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.daily-summary-date {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.daily-summary-counts {
    font-size: 12px;
    color: #777;
}

.daily-summary-aggregates {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.daily-summary-net {
    font-size: 16px;
    font-weight: bold;
}

.daily-summary-net.positive {
    color: #28a745;
}

.daily-summary-net.negative {
    color: #dc3545;
}

.daily-summary-increase {
    color: #28a745;
    font-weight: 600;
}

.daily-summary-decrease {
    color: #dc3545;
    font-weight: 600;
}

.daily-summary-toggle {
    border: 1px solid #ced4da;
    background: white;
    color: #495057;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.daily-summary-toggle:hover {
    background: #e9ecef;
}

.daily-summary-details {
    display: none;
    padding: 15px;
    background: #fff;
}

.daily-summary-details table {
    width: 100%;
    border-collapse: collapse;
}

.daily-summary-details th,
.daily-summary-details td {
    border-bottom: 1px solid #e9ecef;
    padding: 8px 10px;
    font-size: 12px;
}

.daily-summary-details th {
    background: #f1f3f5;
    text-align: left;
    font-weight: 600;
}

.daily-summary-empty {
    text-align: center;
    color: #888;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.daily-summary-empty strong {
    color: #333;
}

/* 商品検索関連 */
#productSearchResults {
    width: 100%;
    max-width: 300px;
}

.product-search-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.product-search-item:hover {
    background-color: #f0f0f0;
}

.product-search-item.selected {
    background-color: #e3f2fd;
}

.product-search-item-code {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.product-search-item-name {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.product-result-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-result-item:hover {
    background-color: #f5f5f5;
}

.product-result-info {
    flex: 1;
}

.product-result-code {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.product-result-name {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.product-result-stock {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

.chart-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
}

.history-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
}

.history-actions {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
    color: #2d3436;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
}

.history-select {
    text-align: center;
    width: 40px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.change-positive {
    color: #28a745;
    font-weight: bold;
}

.change-negative {
    color: #dc3545;
    font-weight: bold;
}

.change-zero {
    color: #666;
}

.text-center {
    text-align: center;
}

.calculated-stock-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calculated-stock-info {
    margin-top: 15px;
}

.calculated-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item.highlight {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.info-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.info-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.changes-list {
    margin-top: 20px;
}

.changes-list h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

