:root {
    --primary-color: #2196f3;
    /* ドン（青） */
    --secondary-color: #00bcd4;
    /* カッ（水色寄り） */
    --bg-color: #f0f4f8;
    --text-color: #333333;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --perfect-color: #ff9800;
    /* 特良（オレンジ系） */
    --great-color: #f44336;
    /* 良（赤） */
    --good-color: #8bc34a;
    /* 可（緑系） */
    --bad-color: #9e9e9e;
    /* 不可（グレー） */
    --shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    padding: 10px;
}

/* ヘッダー */
.app-header {
    text-align: center;
    padding: 10px 0;
    margin-bottom: 10px;
}

.app-header h1 {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-color);
}

.app-header p {
    font-size: 0.8rem;
    color: #666;
}

/* コンテナ */
.app-container {
    max-width: 600px;
    margin: 0 auto;
}

/* 新規作成ボタン */
.btn-new-record {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3);
    margin-bottom: 15px;
    transition: transform 0.1s, background 0.2s;
}

.btn-new-record:active {
    transform: scale(0.98);
}

/* フォームの折りたたみ */
.form-section {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 2px solid var(--primary-color);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* フォーム */
.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

input[type="text"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background-color: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-wrapper {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: #eee;
    border: none;
    border-radius: 8px;
    width: 44px;
    font-size: 1.1rem;
    cursor: pointer;
}

.status-text {
    font-size: 0.8rem;
    color: #666;
}

.status-text.error {
    color: var(--primary-color);
}

.sensor-group {
    display: flex;
    gap: 10px;
}

.sensor-item {
    flex: 1;
}

.radio-group {
    display: flex;
    gap: 4px;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-label {
    flex: 1;
    text-align: center;
    padding: 8px 2px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
}

.face-group input[type="radio"]:checked+.radio-label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.rim-group input[type="radio"]:checked+.radio-label {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* コンパクトリスト */
.record-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compact-item {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-left: 5px solid var(--primary-color);
    font-size: 0.9rem;
    gap: 6px;
    position: relative;
}

.compact-item.rim-focused {
    border-left-color: var(--secondary-color);
}

.date-label {
    font-size: 0.7rem;
    color: #999;
    width: 100%;
    margin-bottom: -2px;
}

.loc-cab {
    font-weight: 800;
    color: #444;
}

.tag {
    padding: 1px 6px;
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
}

.tag-perfect {
    background: var(--perfect-color);
}

.tag-great {
    background: var(--great-color);
}

.tag-good {
    background: var(--good-color);
}

.tag-bad {
    background: var(--bad-color);
}

.note-text {
    color: #666;
    background: #f1f1f1;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    flex-grow: 1;
    min-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-delete {
    background: none;
    border: none;
    color: #ccc;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0 4px;
}

.record-delete:hover {
    color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #999;
    background: none;
    border: 2px dashed #ddd;
    border-radius: var(--border-radius);
    box-shadow: none;
}

/* データセクション */
.data-section {
    background: #fff;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 30px;
    border-top: 4px dashed var(--border-color);
}

/* ログイン画面 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-card {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.login-card h2 {
    margin-bottom: 20px;
}

.login-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 15px;
    letter-spacing: 5px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}