/* style.css - NFCボトルタグ・タッチ預かり台帳 UIデザインシステム */

/* --- 基本リセット・トークン設定 --- */
:root {
    --bg-color: #121212;
    --card-bg: #1a1a1a;
    --card-bg-light: #242424;
    --gold: #D4AF37;
    --gold-hover: #AA8B2C;
    --text-main: #f5f5f5;
    --text-muted: #a0a0a0;
    --border-color: #2d2d2d;
    --danger: #e74c3c;
    --success: #2ecc71;
    --font-family: 'Outfit', 'Noto Sans JP', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
}

/* --- ボタン基本スタイル --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px; /* 片手タップに最適なサイズ */
    padding: 0 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--gold);
    color: #121212;
}

.btn-primary:hover {
    background-color: var(--gold-hover);
}

.btn-gold {
    background: linear-gradient(135deg, #D4AF37 0%, #AA8B2C 100%);
    color: #121212;
}

.btn-secondary {
    background-color: var(--card-bg-light);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #303030;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 6px;
}

/* --- フォームコントロール --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--gold);
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    height: 48px;
    background-color: #0b0b0b;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    padding: 0 16px;
    font-size: 15px;
    transition: border-color 0.2s;
    font-family: var(--font-family);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold);
}

textarea {
    height: auto;
    min-height: 100px;
    padding: 12px 16px;
    resize: none;
}

/* --- ログイン画面のスタイル --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo-area {
    margin-bottom: 30px;
}

.merci-logo-title {
    font-family: 'Outfit', sans-serif;
    font-size: 42px;
    font-weight: 300;
    color: var(--text-main);
    letter-spacing: 0.1em;
    line-height: 1;
}

.merci-logo-title.large {
    font-size: 56px;
}

.merci-sub {
    font-size: 11px;
    color: var(--gold);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-top: 4px;
    padding-left: 0.4em; /* 中央揃え調整 */
}

.login-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px 24px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.login-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.login-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.error-text {
    color: var(--danger);
    font-size: 13px;
    margin-top: 15px;
    text-align: center;
}

.login-footer, .welcome-footer {
    margin-top: 30px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* --- ウェルカム画面のスタイル --- */
.welcome-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.welcome-container {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.welcome-header {
    margin-bottom: 24px;
}

.welcome-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px 24px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.welcome-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 12px;
}

.welcome-message {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 24px;
    line-height: 1.8;
}

.gold-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), var(--gold), var(--border-color), transparent);
    margin: 20px 0;
}

.shop-info-list {
    text-align: left;
    margin: 20px 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 14px;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--gold);
    font-weight: 500;
}

.info-value {
    text-align: right;
    color: var(--text-main);
}

.gold-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

.action-area {
    margin-top: 24px;
}

.action-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* --- メインSPA画面のレイアウト (index.html) --- */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px; /* スマホ表示の幅制限 */
    margin: 0 auto;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background-color: #0d0d0d;
}

.app-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-logo-area {
    display: flex;
    flex-direction: column;
}

.app-logo-area h1 {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1;
}

.app-logo-area span {
    font-size: 9px;
    color: var(--gold);
    letter-spacing: 0.2em;
    margin-top: 2px;
}

/* --- デモ用NFCシミュレーター --- */
.nfc-simulator-panel {
    background-color: #1a1505;
    border-bottom: 1px solid #3d3000;
    padding: 12px 16px;
}

.sim-title {
    font-size: 11px;
    color: var(--gold);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sim-buttons {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.btn-sim {
    background-color: #2b2308;
    color: var(--gold);
    border: 1px solid #57450a;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-sim.active {
    background-color: var(--gold);
    color: #121212;
    border-color: var(--gold);
    font-weight: 600;
}

/* --- コンテンツエリア --- */
.app-main {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px; /* ナビ用のフッタースペース */
}

/* カード共通 */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-title-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
}

/* 顧客カルテ基本情報 */
.customer-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.customer-avatar {
    width: 60px;
    height: 60px;
    background-color: var(--card-bg-light);
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.customer-names {
    display: flex;
    flex-direction: column;
}

.cust-name {
    font-size: 20px;
    font-weight: 700;
}

.cust-nickname {
    font-size: 13px;
    color: var(--text-muted);
}

/* 複数ボトル表示 */
.bottle-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bottle-item {
    background-color: var(--card-bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s;
}

.bottle-item.selected {
    border-color: var(--gold);
    background-color: #211c0f;
}

.bottle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bottle-name {
    font-size: 16px;
    font-weight: 600;
}

.bottle-tag-badge {
    background-color: #333;
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
}

.bottle-item.selected .bottle-tag-badge {
    background-color: var(--gold);
    color: #121212;
    font-weight: 600;
}

/* ボトル残量調節 (スライダー) */
.bottle-remaining-control {
    margin-top: 16px;
}

.pct-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 8px;
}

.pct-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
}

.pct-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    height: 12px;
    border-radius: 6px;
    background: #111;
    outline: none;
    border: 1px solid var(--border-color);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
}

/* 松：組織情報・人間関係 */
.org-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.org-tag {
    background-color: #211d08;
    border: 1px solid #4a3e0f;
    color: var(--gold);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 4px;
}

.org-tag .role {
    color: var(--text-main);
    font-weight: 600;
    margin-left: 6px;
}

.relation-item {
    background-color: var(--card-bg-light);
    border-left: 3px solid var(--gold);
    padding: 12px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 10px;
    font-size: 13px;
}

.relation-item .rel-target {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}

.relation-item .rel-type {
    background-color: var(--gold);
    color: #121212;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    margin-left: 6px;
}

.relation-item .rel-note {
    color: var(--text-muted);
    margin-top: 4px;
}

/* 音声メモ入力エリア */
.memo-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.memo-writer-area {
    display: flex;
    gap: 10px;
}

.btn-mic {
    background-color: #1f1f1f;
    border: 1px solid var(--border-color);
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.btn-mic.listening {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.memo-history-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.memo-log-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.memo-log-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.memo-log-author {
    color: var(--gold);
    font-weight: 500;
}

.memo-log-body {
    font-size: 14px;
    color: var(--text-main);
    word-break: break-all;
}

.input-type-badge {
    background-color: #333;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

/* 竹・松：在庫一覧表示 */
.inv-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.inv-row {
    display: contents;
}

.inv-name {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.inv-qty-box {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    font-size: 14px;
}

.inv-qty {
    font-weight: 700;
    color: var(--gold);
    font-size: 16px;
}

/* モーダル (新規ボトル登録など) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.cust-search-results {
    background-color: #0b0b0b;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 150px;
    overflow-y: auto;
    display: none;
}

.cust-search-item {
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #1c1c1c;
}

.cust-search-item:hover {
    background-color: #1a1a1a;
    color: var(--gold);
}

/* スマホフッターナビ */
.app-footer-nav {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    height: 60px;
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
}

.nav-item.active {
    color: var(--gold);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

/* インライン編集およびモーダル内の編集リスト用の追加スタイル */
.inline-edit-area textarea {
    font-family: var(--font-family);
}

.edit-list-item {
    transition: background-color 0.2s;
}

.edit-list-item:hover {
    background-color: #222 !important;
}

/* メイン画面の検索バーとサジェストドロップダウン */
.main-search-container {
    width: 100%;
}

.main-search-container input::placeholder {
    color: var(--text-muted);
}

#main-search-results .cust-search-item {
    transition: background-color 0.2s;
}

#main-search-results .cust-search-item:hover {
    background-color: #262112 !important;
    color: var(--gold);
}

/* --- 来店打刻・ボトル期限バッジ追加スタイル --- */
#visit-record-btn {
    background-color: var(--gold) !important;
    color: #121212 !important;
    border: none !important;
    font-weight: 600 !important;
}

#visit-record-btn:hover {
    background-color: var(--gold-hover) !important;
}

#visit-status-badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
    background-color: rgba(212, 175, 55, 0.15) !important;
    border: 1px solid var(--gold) !important;
    color: var(--gold) !important;
    letter-spacing: 0.05em;
    animation: fadeIn 0.3s ease;
}

.badge-alert {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 8px;
    letter-spacing: 0.02em;
}

.badge-expired {
    background-color: rgba(231, 76, 60, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.badge-warning {
    background-color: rgba(230, 126, 34, 0.15);
    border: 1px solid #e67e22;
    color: #e67e22;
}

.badge-normal {
    background-color: rgba(46, 204, 113, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}

