﻿/* --- 全体のスタイル --- */
body {
    font-family: sans-serif;
    margin: 0;
    padding: env(safe-area-inset-top) 24px 24px 24px;
    background-color: #f0f7ff;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 32px 40px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 80, 150, 0.08);
}

h1 {
    color: #004a9e;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

h2 {
    font-size: 18px;
    color: #004a9e;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef5ff;
    margin-top: 50px;
    margin-bottom: 20px;
}

/* --- フォームのスタイル --- */
.customer-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    background: #fcfdff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #eef5ff;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #345;
    font-size: 14px;
}

input[type="text"],
textarea {
    padding: 12px;
    border: 1px solid #dce4f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.15);
}

.form-buttons {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

/* --- 操作ツールバー --- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8faff;
    border-radius: 12px;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    padding-left: 35px;
    border: 1px solid #dce4f0;
    border-radius: 25px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-box::before {
    content: "??";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #888;
}

/* --- ボタン --- */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-submit { background-color: #007bff; }
.btn-update { background-color: #28a745; }
.btn-clear { background-color: #6c757d; }
.btn-edit { background-color: #007bff; }
.btn-delete { background-color: #dc3545; }

.btn-tool {
    background-color: #ffffff;
    color: #004a9e;
    border: 1px solid #dce4f0;
    padding: 8px 16px;
}
.btn-tool:hover {
    background-color: #f0f7ff;
    border-color: #007bff;
}
.btn-csv { background-color: #1d6f42; color: white; }

button:hover { opacity: 0.85; transform: translateY(-1px); }

/* --- テーブルのスタイル --- */
.customer-list-container {
    overflow-x: auto;
    border: 1px solid #eef5ff;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th {
    background-color: #f0f4f8;
    color: #004a9e;
    padding: 16px 14px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    border-bottom: 2px solid #eef5ff;
    white-space: nowrap;
}

th.active-sort {
    background-color: #e2ebf5;
    color: #007bff;
}

td {
    padding: 14px;
    border-bottom: 1px solid #eef5ff;
    font-size: 14px;
    background-color: #fff;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

tr:hover td {
    background-color: #fcfdff;
}

.actions {
    display: flex;
    gap: 6px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

#fileInput {
    display: none;
}

/* スマホ対応の調整 */
@media (max-width: 600px) {
    .container { padding: 20px; margin: 0; border-radius: 0; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .form-buttons { flex-direction: column; }
    .btn-tool, .btn-csv { width: 100%; }
}