/* ==========================================
   受付システム - スタイルシート（改善版）
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;600;700&family=Shippori+Mincho:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: inherit;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}
/* ボタン内アイコン（customer.html） */
.btn-icon .material-symbols-outlined {
    font-size: 2.2rem;
    font-variation-settings: 'FILL' 0, 'wght' 300;
}
/* タブ内アイコン */
.admin-tab-btn .material-symbols-outlined {
    font-size: 1rem;
    font-variation-settings: 'FILL' 0, 'wght' 400;
    vertical-align: -2px;
}
/* カウンター・フォーム内アイコン */
.form-icon {
    font-size: 1.3rem;
    font-variation-settings: 'FILL' 0, 'wght' 300;
    vertical-align: -4px;
    margin-right: 2px;
}
/* ステータスバッジ内アイコン */
.status-icon {
    font-size: 1.2rem;
    font-variation-settings: 'FILL' 1, 'wght' 400;
    vertical-align: -3px;
    margin-right: 4px;
}

:root {
    --primary:      #1a2a3a;
    --accent:       #c5a059;
    --accent-light: #f0e4c8;
    --danger:       #c0392b;
    --bg:           #f5f2ec;
    --white:        #ffffff;
    --border:       #ddd;
    --text:         #2c2c2c;
    --text-muted:   #888;
    --shadow:       0 4px 24px rgba(0,0,0,0.10);
    --radius:       10px;
}

.hidden { display: none !important; }

* { box-sizing: border-box; }

body {
    font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
    background: var(--bg);
    margin: 0;
    padding: 20px 16px 60px;
    color: var(--text);
    min-height: 100vh;
}

/* =========================================
   共通セクション
   ========================================= */
.customer-section,
.admin-section {
    max-width: 960px;
    margin: 0 auto 30px;
    padding: 36px 32px;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 14px;
    border-top: 4px solid var(--accent);
}

/* =========================================
   お客様画面 - ヘッダー
   ========================================= */
header h1 {
    text-align: center;
    font-size: 1.9rem;
    color: var(--primary);
    margin: 0 0 24px;
    font-family: 'Shippori Mincho', serif;
    letter-spacing: 0.1em;
}

/* 呼び出し番号カード */
.now-calling-card {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 22px 20px 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    border: 2px solid var(--accent);
    position: relative;
    overflow: hidden;
}
.now-calling-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: rgba(197,160,89,0.08);
    border-radius: 50%;
}
.calling-label {
    font-size: 0.95rem;
    color: var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.calling-number {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
}

/* 待ち情報カード */
.wait-info-card {
    display: flex;
    justify-content: space-around;
    background: #fffbf3;
    padding: 18px 20px;
    border: 2px solid var(--accent-light);
    border-radius: var(--radius);
    margin-bottom: 28px;
    font-size: 1rem;
}
.wait-info-card strong {
    font-size: 2.2rem;
    color: var(--danger);
    display: block;
    margin-top: 4px;
}

/* =========================================
   入力フォーム
   ========================================= */
.entry-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.name-input {
    width: 100%;
    padding: 18px 16px;
    font-size: 1.4rem;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}
.name-input:focus { border-color: var(--accent); }

.counter-container {
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.counter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 1.3rem;
    border-bottom: 1px solid #eee;
}
.counter-item:last-child { border-bottom: none; }

.controls {
    display: flex;
    align-items: center;
    gap: 16px;
}
.controls button {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.controls button:hover {
    background: var(--primary);
    color: var(--white);
}
.controls span {
    font-size: 1.8rem;
    font-weight: 700;
    min-width: 36px;
    text-align: center;
}

.submit-btn {
    width: 100%;
    padding: 22px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.08em;
    transition: background 0.2s, transform 0.1s;
}
.submit-btn:hover  { background: #263d52; }
.submit-btn:active { transform: scale(0.99); }

/* =========================================
   受付票
   ========================================= */
.ticket {
    text-align: center;
    padding: 40px 30px;
    border: 3px dashed var(--accent);
    border-radius: 10px;
    background: #fffbf3;
}
.ticket p { font-size: 1.3rem; color: var(--primary); margin: 8px 0; }
.number-box {
    font-size: 5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 16px 0;
    line-height: 1;
}

/* =========================================
   管理画面
   ========================================= */
.admin-section h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0 0 20px;
    font-family: 'Shippori Mincho', serif;
    letter-spacing: 0.06em;
}

.admin-tools {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn-reset {
    padding: 12px 22px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-reset:hover { background: #263d52; }

.btn-csv {
    padding: 12px 22px;
    background: #2d6a4f;
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-csv:hover { background: #1b4332; }

/* テーブル横スクロール対応 */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* テーブル */
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 14px 12px; border: 1px solid #e0e0e0; text-align: center; vertical-align: middle; }
th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

.num-cell { font-size: 1.3rem; font-weight: 700; color: var(--accent); }

tr.status-waiting  { background: var(--white); }
tr.status-absent   { background: #fafafa; color: #aaa; }
tr.status-completed { background: #fffbf0; }

.status-cell {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap; /* ボタンを折り返さない */
}

.btn-waiting,
.btn-absent,
.btn-guide {
    padding: 9px 14px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: var(--white);
    font-size: 0.85rem;
    transition: all 0.15s;
    white-space: nowrap; /* ボタンテキストを折り返さない */
    flex-shrink: 0;
}
.btn-waiting.active { background: #1565c0; color: white; border-color: #1565c0; }
.btn-absent.active  { background: #616161; color: white; border-color: #616161; }
.btn-guide.active   { background: var(--accent); color: white; border-color: var(--accent); }

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* バッジ */
.timer-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    margin-left: 6px;
    animation: pulse 1.5s ease-in-out infinite;
}
.absent-badge {
    display: inline-block;
    background: #9e9e9e;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    margin-left: 6px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* 同期インジケーター */
.sync-indicator {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: rgba(26,42,58,0.85);
    color: #c5a059;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}
.sync-indicator.show { opacity: 1; }

/* =========================================
   レスポンシブ
   ========================================= */
@media (max-width: 600px) {
    .customer-section,
    .admin-section { padding: 24px 16px; }
    .calling-number { font-size: 3.5rem; }
    .number-box { font-size: 4rem; }
    .status-cell { white-space: normal; }
    .btn-waiting, .btn-absent, .btn-guide { display: block; width: 100%; margin-bottom: 4px; }
}
