/* リセット & ベース */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* 商品ページ ヘッダー */
.product-header {
    background: #fff;
    padding: 16px;
    text-align: center;
}

.product-header h1 {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.unit-info {
    font-size: 0.85rem;
    color: #666;
}

/* カード */
.card {
    background: #fff;
    margin: 8px 12px;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 0.95rem;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* 在庫表示 */
.inventory-display {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.inventory-item {
    text-align: center;
    flex: 1;
    padding: 8px;
    background: #fafafa;
    border-radius: 8px;
}

.inventory-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 2px;
}

.inventory-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.inventory-unit {
    font-size: 0.8rem;
    color: #666;
}

.updated-at {
    text-align: right;
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 6px;
}

/* コンパクトフォーム（横並び） */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.form-row-label {
    font-size: 0.9rem;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
}

.form-row-input {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.form-row-input select {
    width: 70px;
    padding: 8px;
    font-size: 1.1rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f8f8;
    cursor: pointer;
}

.form-row-input select:focus {
    outline: none;
    border-color: #999;
    background: #fff;
}

.form-row-unit {
    font-size: 0.9rem;
    color: #555;
    min-width: 1.5em;
}

.form-note {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* ボタン */
.btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s;
}

.btn:active {
    opacity: 0.8;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #666;
}

.btn-secondary {
    background: #555;
}

/* 結果メッセージ */
.result-message {
    margin-top: 8px;
    padding: 0;
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2em;
}

.result-message.success {
    color: #2e7d32;
}

.result-message.error {
    color: #c62828;
}

/* ナビ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    text-align: center;
    padding: 10px;
}

.bottom-nav a {
    color: #555;
    text-decoration: none;
    font-size: 0.85rem;
}

/* ============ ダッシュボード ============ */

/* フィルター */
.filter-bar {
    background: #fff;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-size: 0.75rem;
    color: #888;
    min-width: 2.5em;
    flex-shrink: 0;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #666;
    cursor: pointer;
}

.filter-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.dashboard-header {
    background: #fff;
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.dashboard-header h1 {
    font-size: 1.2rem;
}

.dashboard-content {
    padding: 12px 16px;
}

.empty-message {
    text-align: center;
    color: #999;
    margin-top: 40px;
}

/* 商品カード（ダッシュボード） */
.product-card {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.product-card-body {
    display: flex;
    padding: 14px;
    gap: 14px;
    align-items: center;
}

.product-info {
    flex: 1;
}

.product-info h2 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.product-info h2 a {
    color: #333;
    text-decoration: none;
}

.product-detail {
    font-size: 0.8rem;
    color: #888;
}

.product-stock {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 0.9rem;
}

.product-updated {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 4px;
}

/* QR */
.product-qr {
    text-align: center;
    flex-shrink: 0;
}

.qr-image {
    width: 80px;
    height: 80px;
}

.qr-download {
    display: block;
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
    text-decoration: none;
}
