/* 全体 */
body {
    font-family: "Segoe UI", sans-serif;
    background: #f4f4f7;
    margin: 0;
    padding: 20px;
    color: #333;
}

/* コンテナ */
.container {
    max-width: 900px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* タイトル */
h1, h2 {
    text-align: center;
    margin-top: 0;
}

/* テーブルラップ（スマホ横スクロール） */
.table-wrap {
    overflow-x: auto;
}

/* テーブル */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

table th, table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
}

table th {
    background: #fafafa;
}

/* ボタン */
button, .btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: block;
    margin: 0 auto;
    width: 30%;
}

button:hover, .btn:hover {
    background: #2980b9;
}

/* ログイン */
.login_parts{
    text-align: center;
}

.login_user, .login_password{
    width: 30%;
}

.login_button{
    margin-top: 20px;
}


/* ログアウト */
.logout {
    text-align: right;
    margin-bottom: 15px;
}

.logout a {
    background: #e74c3c;
    padding: 6px 12px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
}

.logout a:hover {
    background: #c0392b;
}

/* 賞味期限の色付け */
tr.expired {
    background: #ffcccc;
}

tr.danger {
    background: #ffe0b2;
}

tr.warning {
    background: #fff8b3;
}

/* 入力フォーム */
input[type="text"], input[type="date"], input[type="number"] {
    width: 100%;
    padding: 8px;
    margin: 6px 0 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* スマホ向け最適化 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 12px;
    }

    button, .btn {
        width: 100%;
        box-sizing: border-box;
        margin-top: 8px;
    }
}

/* 期限切れ（赤） */
.expired {
    background-color: #ffcccc !important;
}

/* 3日以内（オレンジ） */
.danger {
    background-color: #ffe0b3 !important;
}

/* 1週間以内（黄色） */
.warning {
    background-color: #fff6b3 !important;
}

.category-お菓子 { background-color: #ffe4e1; }
.category-野菜 { background-color: #e0ffe0; }
.category-冷凍食品 { background-color: #e0f0ff; }
.category-飲料 { background-color: #fff0e0; }

/* モーダル全体 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
}

/* モーダル内コンテンツ */
.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    width: 80%;
    max-width: 300px;
    text-align: center;
    border-radius: 8px;
}

.modal-content button {
    margin: 5px;
    padding: 8px 16px;
}

/* 検索フォーム */
form input[type="text"], form select, form button {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

form button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
}

form button:hover {
    background-color: #2980b9;
}

/* planned_date 表示の小さなノート */
.small-note {
    font-size: 12px;
    color: #666;
    margin-top:6px;
}

/* 消費予定日列 */
td { vertical-align: middle; }

/* 期限強化のクラス */
.expired-today { background-color: #ff6666 !important; color:#fff; }
.expired-tomorrow { background-color: #ff9966 !important; color:#fff; }
.expiring-3 { background-color: #ffe680 !important; }
.expiring-week { background-color: #fff7cc !important; }

/* カテゴリの左帯（既存に合わせて） */
tr td:first-child { border-left: 6px solid transparent; }
.category-お菓子 td:first-child { border-left-color: #ff6f91; }
.category-野菜 td:first-child { border-left-color: #44cc44; }
.category-冷凍食品 td:first-child { border-left-color: #66b3ff; }
.category-飲料 td:first-child { border-left-color: #ffb366; }

/* モーダルは既存のスタイルがあれば合わせて使ってください */

/* メモ欄 */
textarea {
    width: 100%;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    resize: vertical;
    font-size: 14px;
}

/* 廃棄モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background: #fff;
    margin: 15% auto;
    padding: 20px;
    width: 85%;
    max-width: 400px;
    border-radius: 8px;
}

.modal-content button {
    padding: 8px 15px;
    margin-top: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#confirmDelete {
    background-color: #ff5555;
    color: #fff;
}

#cancelDelete {
    background-color: #aaa;
    color: #fff;
}
