/**
 * =============================================
 * T-予約管理システム - メインスタイルシート
 * フロント画面・管理画面の両方に適用される
 * =============================================
 */

/* =============================================
   CSS変数（色の設定）
   --t-res-color はJavaScriptで動的に書き換えられる
   ============================================= */
:root {
    --t-res-color:        #7BC2E6;    /* メインカラー（水色） */
    --t-res-color-dark:   #5a9fc4;    /* メインカラーの濃いバージョン */
    --t-res-color-light:  #d6eef8;    /* メインカラーの薄いバージョン */
    --t-res-text:         #333;       /* 通常テキストの色 */
    --t-res-text-light:   #666;       /* 薄いテキストの色 */
    --t-res-bg:           #fff;       /* 背景色 */
    --t-res-border:       #e0e0e0;    /* ボーダーの色 */
    --t-res-radius:       12px;       /* 角丸のサイズ */
    --t-res-shadow:       0 2px 12px rgba(0,0,0,0.08); /* 影 */

    /* ステータスカラー */
    --t-res-available: #27ae60;  /* 空きあり：緑 */
    --t-res-few:       #f39c12;  /* 残り少：オレンジ */
    --t-res-full:      #e74c3c;  /* 満席：赤 */

    /* 管理画面ステータスカラー */
    --t-res-confirmed:  #27ae60;
    --t-res-pending:    #f39c12;
    --t-res-cancelled:  #95a5a6;
}

/* =============================================
   フロント画面：全体のラッパー
   ============================================= */
.t-res-wrap {
    font-family: 'Hiragino Sans', 'ヒラギノ角ゴ Pro W3', 'Meiryo', sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: var(--t-res-text);
    box-sizing: border-box;
}

.t-res-wrap * {
    box-sizing: border-box;
}

/* =============================================
   ヘッダー（店舗名・説明文エリア）
   ============================================= */
.t-res-header {
    margin-bottom: 16px;
}

.t-res-title {
    font-size: 1.6em !important;
    font-weight: bold !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: none !important;
    border-left: none !important;
    border-bottom: none !important;
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.t-res-title::before,
.t-res-title::after {
    display: none !important;
    content: none !important;
}

/* =============================================
   テーマ別の装飾リセット
   SWELL / Cocoon / Lightning / Snow Monkey / AFFINGER /
   JIN / JIN:R / SANGO / THE THOR / Flavor / Twenty Twenty-Four
   ============================================= */

/* 全テーマ共通：見出し h1〜h4 の装飾リセット */
.t-res-wrap h1,
.t-res-wrap h2,
.t-res-wrap h3,
.t-res-wrap h4 {
    border: none !important;
    border-left: none !important;
    border-bottom: none !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
.t-res-wrap h1::before,
.t-res-wrap h1::after,
.t-res-wrap h2::before,
.t-res-wrap h2::after,
.t-res-wrap h3::before,
.t-res-wrap h3::after,
.t-res-wrap h4::before,
.t-res-wrap h4::after {
    display: none !important;
    content: none !important;
    background: none !important;
    background-image: none !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Cocoon：.entry-content 内の装飾リセット */
.entry-content .t-res-wrap,
.entry-content .t-res-wrap * {
    line-height: inherit;
}
.entry-content .t-res-wrap h3 {
    padding: 0 !important;
    border: none !important;
}

/* Lightning / VK Blocks：見出しの左線・背景リセット */
.t-res-wrap .has-border-color,
.t-res-wrap [class*="vk-heading"] {
    border: none !important;
    background: none !important;
}

/* AFFINGER：見出しの装飾リセット */
.t-res-wrap .st-heading,
.t-res-wrap [class*="st-"] h3 {
    border: none !important;
    background: none !important;
    padding: 0 !important;
}

/* JIN / JIN:R：見出し・ボックスの装飾リセット */
.t-res-wrap [class*="jin-"] {
    border: none !important;
    background: none !important;
}

/* SANGO：見出しの装飾リセット */
.t-res-wrap [class*="sng-"],
.t-res-wrap .dfont {
    border: none !important;
    background: none !important;
}

/* THE THOR：見出し・ボタンの装飾リセット */
.t-res-wrap [class*="ep-"],
.t-res-wrap [class*="the-thor"] {
    border: none !important;
    background: none !important;
}

/* Snow Monkey：見出しリセット */
.t-res-wrap [class*="smb-"],
.t-res-wrap .snow-monkey-heading {
    border: none !important;
    background: none !important;
}

/* TCD系（NANO / RUMBLE / Muum / REHUB / ANTHEM / OOPS! 等）：装飾リセット */
.t-res-wrap [class*="tcd-"],
.t-res-wrap [class*="p-headline"],
.t-res-wrap [class*="p-entry"] h1,
.t-res-wrap [class*="p-entry"] h2,
.t-res-wrap [class*="p-entry"] h3,
.t-res-wrap [class*="p-entry"] h4,
.t-res-wrap .post_content h1,
.t-res-wrap .post_content h2,
.t-res-wrap .post_content h3,
.t-res-wrap .post_content h4 {
    border: none !important;
    border-left: none !important;
    border-bottom: none !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    padding: 0 !important;
    margin-left: 0 !important;
    box-shadow: none !important;
}
.t-res-wrap .post_content h1::before,
.t-res-wrap .post_content h1::after,
.t-res-wrap .post_content h2::before,
.t-res-wrap .post_content h2::after,
.t-res-wrap .post_content h3::before,
.t-res-wrap .post_content h3::after,
.t-res-wrap .post_content h4::before,
.t-res-wrap .post_content h4::after,
.t-res-wrap [class*="p-entry"] h1::before,
.t-res-wrap [class*="p-entry"] h1::after,
.t-res-wrap [class*="p-entry"] h2::before,
.t-res-wrap [class*="p-entry"] h2::after,
.t-res-wrap [class*="p-entry"] h3::before,
.t-res-wrap [class*="p-entry"] h3::after,
.t-res-wrap [class*="p-entry"] h4::before,
.t-res-wrap [class*="p-entry"] h4::after {
    display: none !important;
    content: none !important;
    background: none !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
}
/* TCD系：ボタン・フォームの装飾リセット */
.t-res-wrap [class*="p-btn"],
.t-res-wrap [class*="tcd-btn"] {
    all: unset !important;
}
.t-res-wrap .post_content input,
.t-res-wrap .post_content select,
.t-res-wrap .post_content textarea {
    box-shadow: none !important;
}

/* 全テーマ共通：ボタンのリセット（テーマのボタンスタイルを上書きしない） */
.t-res-wrap .t-res-btn {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1.5 !important;
}

/* 全テーマ共通：input/select/textareaのリセット */
.t-res-wrap .t-res-input,
.t-res-wrap .t-res-select,
.t-res-wrap textarea {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: auto !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

/* 全テーマ共通：テーブル・リストのリセット */
.t-res-wrap table {
    border-collapse: collapse !important;
    border: none !important;
}
.t-res-wrap td,
.t-res-wrap th {
    border: none !important;
    background: none !important;
}
.t-res-wrap ul,
.t-res-wrap ol {
    list-style-position: inside !important;
}

/* 全テーマ共通：リンクの装飾リセット */
.t-res-wrap a {
    text-decoration: none !important;
}

/* Twenty Twenty-Four / ブロックテーマ対策 */
.t-res-wrap .wp-block-group,
.t-res-wrap .wp-block-columns {
    padding: 0 !important;
    margin: 0 !important;
}

.t-res-description {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}
.t-res-description *:not([style]) {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}
.t-res-description [style] {
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.t-res-description {
    line-height: 1.8;
    margin-bottom: 16px;
    padding: 0 !important;
}

/* 配置はエディタが生成するインラインスタイルを優先させる */
.t-res-description p[style*="text-align"],
.t-res-description div[style*="text-align"] {
    text-align: inherit;
}

/* フロント表示の説明文内リスト */
.t-res-description ul,
.t-res-description ol {
    padding-left: 1.8em !important;
    margin: 0.5em 0 !important;
}
.t-res-description ul { list-style: disc !important; }
.t-res-description ol { list-style: decimal !important; }
.t-res-description li { margin: 0.25em 0 !important; display: list-item !important; }

/* =============================================
   カレンダーエリア
   ============================================= */
.t-res-calendar-section {
    background: var(--t-res-bg);
    border-radius: var(--t-res-radius);
    box-shadow: var(--t-res-shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

/* カレンダーヘッダー（月ナビゲーション） */
.t-res-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--t-res-color);
    color: #fff;
    padding: 16px 20px;
}

.t-res-month-title {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0;
}

/* 前月・次月ボタン */
.t-res-nav-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.t-res-nav-btn:hover {
    background: rgba(255,255,255,0.35);
}

/* 曜日ヘッダー */
.t-res-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.t-res-weekdays {
    background: #f8f9fa;
    border-bottom: 1px solid var(--t-res-border);
}

.t-res-weekday {
    text-align: center;
    padding: 10px 0;
    font-size: 0.85em;
    font-weight: bold;
    color: var(--t-res-text-light);
}

.t-res-weekday.t-res-sunday { color: #e74c3c; }
.t-res-weekday.t-res-saturday { color: #3498db; }

/* カレンダーの日セル */
.t-res-calendar-days {
    padding: 8px;
    gap: 4px;
}

.t-res-cal-cell {
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.t-res-cal-cell:hover {
    background: var(--t-res-color-light);
    transform: scale(1.03);
}

.t-res-cal-cell.t-res-empty {
    cursor: default;
}
.t-res-cal-cell.t-res-empty:hover {
    background: none;
    transform: none;
}

.t-res-cal-cell.t-res-today {
    background: var(--t-res-color-light);
    border: 2px solid var(--t-res-color);
}

/* 日付の数字 */
.t-res-cal-day-num {
    font-size: 1em;
    font-weight: bold;
    line-height: 1.8;
}

.t-res-cal-cell.t-res-sunday .t-res-cal-day-num { color: #e74c3c; }
.t-res-cal-cell.t-res-saturday .t-res-cal-day-num { color: #3498db; }
.t-res-cal-cell.t-res-past { opacity: 0.4; cursor: not-allowed; }
.t-res-cal-cell.t-res-past:hover { background: none; transform: none; }

/* 空き状況バッジ（○△×） */
.t-res-cal-badge {
    font-size: 0.85em;
    font-weight: bold;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto 0;
}

.t-res-cal-badge.available {
    background: #eafaf1;
    color: var(--t-res-available);
    border: 1.5px solid var(--t-res-available);
}

.t-res-cal-badge.few {
    background: #fef9e7;
    color: var(--t-res-few);
    border: 1.5px solid var(--t-res-few);
}

.t-res-cal-badge.full {
    background: #fdedec;
    color: var(--t-res-full);
    border: 1.5px solid var(--t-res-full);
    cursor: not-allowed;
}

/* 定休日（事前予約可能） */
.t-res-cal-cell.t-res-closed {
    background: #fdedec !important;
    cursor: pointer;
}
.t-res-cal-cell.t-res-closed:hover {
    background: #f8d7da !important;
}
.t-res-cal-badge.closed {
    background: #e74c3c;
    color: #fff;
    border: 1.5px solid #c0392b;
    cursor: not-allowed;
    font-size: 0.75em;
}

/* 凡例 */
.t-res-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 12px;
    border-top: 1px solid var(--t-res-border);
    font-size: 0.9em;
    background: #fafafa;
}

.t-res-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.t-res-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8em;
    font-weight: bold;
}

.t-res-badge-available { background: #eafaf1; color: var(--t-res-available); border: 1.5px solid var(--t-res-available); }
.t-res-badge-few       { background: #fef9e7; color: var(--t-res-few);       border: 1.5px solid var(--t-res-few); }
.t-res-badge-full      { background: #fdedec; color: var(--t-res-full);      border: 1.5px solid var(--t-res-full); }

/* =============================================
   予約フォームエリア
   ============================================= */
.t-res-form-section {
    background: var(--t-res-bg);
    border-radius: var(--t-res-radius);
    box-shadow: var(--t-res-shadow);
    padding: 24px;
    margin-bottom: 24px;
    animation: t-res-slide-in 0.3s ease;
}

@keyframes t-res-slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.t-res-form-title {
    color: var(--t-res-color);
    font-size: 1.2em;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--t-res-color-light);
}

.t-res-selected-date {
    font-size: 0.85em;
    background: var(--t-res-color);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 10px;
}

/* フォームのフィールドグループ */
.t-res-field-group {
    margin-bottom: 18px;
}

.t-res-label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 0.95em;
    color: #000;
}

/* 必須マーク */
.t-res-required {
    color: #e74c3c;
    font-weight: bold;
}

/* フィールド直下エラーメッセージ */
.t-res-field-error {
    display: block;
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 4px;
}

/* 入力フィールドの共通スタイル */
.t-res-input,
.t-res-select,
.t-res-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--t-res-border);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    color: var(--t-res-text);
    transition: border-color 0.2s;
    background: #fff;
}

.t-res-input:focus,
.t-res-select:focus,
.t-res-textarea:focus {
    outline: none;
    border-color: var(--t-res-color);
    box-shadow: 0 0 0 3px rgba(123, 194, 230, 0.2);
}

.t-res-textarea { resize: vertical; }

.t-res-help {
    font-size: 0.82em;
    color: var(--t-res-text-light);
    margin: 4px 0 0;
}

/* フォームボタンエリア */
.t-res-btn-area {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

/* ボタンの共通スタイル */
.t-res-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    font-size: 1em;
    font-family: inherit;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    flex: 1;
}

/* 送信ボタン（目立つ色） */
.t-res-btn-submit {
    background: var(--t-res-color);
    color: #fff;
    justify-content: center;
}

.t-res-btn-submit:hover { background: var(--t-res-color-dark); transform: translateY(-1px); }
.t-res-btn-submit:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* キャンセルボタン */
.t-res-btn-cancel {
    background: #f5f5f5;
    color: var(--t-res-text-light);
    border: 2px solid var(--t-res-border);
}

.t-res-btn-cancel:hover { background: #e0e0e0; }

/* お知らせボックス */
.t-res-notice {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: bold;
}

.t-res-success { background: #eafaf1; color: #27ae60; border: 1px solid #a9dfbf; }
.t-res-error   { background: #fdedec; color: #e74c3c; border: 1px solid #f1948a; }

/* ローディング表示 */
.t-res-loading {
    text-align: center;
    padding: 30px;
    color: var(--t-res-text-light);
    font-size: 1.1em;
}

/* =============================================
   予約完了エリア
   ============================================= */
.t-res-complete-section {
    position: relative;
    text-align: center;
    background: var(--t-res-bg);
    border-radius: var(--t-res-radius);
    box-shadow: var(--t-res-shadow);
    padding: 40px 24px;
    animation: t-res-slide-in 0.3s ease;
}

/* 閉じるボタン */
.t-res-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.t-res-close-btn:hover {
    background: #f0f0f0;
    color: #333;
    border-color: #999;
}

.t-res-complete-icon { font-size: 64px; margin-bottom: 12px; }
.t-res-complete-title { font-size: 1.5em; color: var(--t-res-available); margin: 0 0 12px; }
.t-res-complete-text { color: var(--t-res-text-light); margin-bottom: 24px; }

/* QRコードエリア */
.t-res-qr-area { margin: 24px auto; }
.t-res-qr-label { font-weight: bold; margin-bottom: 12px; }
.t-res-qr-img {
    max-width: 200px;
    border: 4px solid var(--t-res-color-light);
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

/* =============================================
   管理画面スタイル
   ============================================= */
.t-res-admin-wrap {
    font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
}

/* カード（各セクション） */
.t-res-admin-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.t-res-admin-card-title {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #333;
}

/* 管理カレンダー */
.t-res-admin-cal-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.t-res-admin-month-title { font-size: 1.15em; font-weight: bold; }

.t-res-admin-nav-btn {
    padding: 6px 14px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    color: #333;
    display: inline-block;
}

.t-res-admin-nav-btn:hover { background: #e0e0e0; }

/* 管理カレンダーグリッド */
.t-res-admin-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #ddd;
    border-bottom: none;
}

.t-res-admin-weekday {
    text-align: center;
    padding: 8px;
    font-size: 0.85em;
    background: #f8f9fa;
    font-weight: bold;
    color: #666;
    border-right: 1px solid #ddd;
}
.t-res-admin-weekday:last-child { border-right: none; }
.t-res-admin-weekday.sunday { color: #e74c3c; }
.t-res-admin-weekday.saturday { color: #3498db; }

.t-res-admin-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #ddd;
}

.t-res-admin-cal-cell {
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 8px 6px;
    min-height: 60px;
    vertical-align: top;
    position: relative;
}

.t-res-admin-cal-cell:nth-child(7n) { border-right: none; }

.t-res-admin-cal-cell.t-res-today { background: #fff3cd; }
.t-res-admin-cal-cell.t-res-sunday .t-res-admin-day-num  { color: #e74c3c; }
.t-res-admin-cal-cell.t-res-saturday .t-res-admin-day-num { color: #3498db; }

.t-res-admin-day-num {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.t-res-admin-count-badge {
    display: inline-block;
    background: #7BC2E6;
    color: #fff;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.75em;
    font-weight: bold;
    text-decoration: none;
}

.t-res-admin-count-badge:hover { background: #5a9fc4; }

/* フィルター */
.t-res-admin-filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.t-res-admin-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.t-res-admin-filter-field label { font-size: 0.85em; font-weight: bold; color: #555; }

.t-res-admin-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* テーブル */
.t-res-admin-table-wrap { overflow-x: auto; }

.t-res-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.t-res-admin-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

.t-res-admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.t-res-admin-row:hover td { background: #f8f9fa; }
.t-res-admin-row.t-res-status-cancelled td { color: #999; }

/* ステータスバッジ */
.t-res-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: bold;
    white-space: nowrap;
}

.t-res-status-confirmed { background: #eafaf1; color: var(--t-res-confirmed); }
.t-res-status-pending   { background: #fef9e7; color: var(--t-res-pending); }
.t-res-status-cancelled { background: #f2f3f4; color: var(--t-res-cancelled); }

/* 操作ボタン */
.t-res-admin-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.t-res-admin-note {
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
    max-width: 200px;
}

/* 管理画面ボタン */
.t-res-admin-btn {
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.82em;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.15s;
}

.t-res-admin-btn-primary   { background: #7BC2E6; color: #fff; }
.t-res-admin-btn-primary:hover { background: #5a9fc4; }
.t-res-admin-btn-secondary { background: #f8f9fa; color: #555; border-color: #ddd; }
.t-res-admin-btn-secondary:hover { background: #e9ecef; }
.t-res-admin-btn-confirm   { background: #eafaf1; color: #27ae60; border-color: #a9dfbf; }
.t-res-admin-btn-confirm:hover { background: #27ae60; color: #fff; }
.t-res-admin-btn-cancel    { background: #fdedec; color: #e74c3c; border-color: #f1948a; }
.t-res-admin-btn-cancel:hover { background: #e74c3c; color: #fff; }
.t-res-admin-btn-delete    { background: #f5f5f5; color: #999; border-color: #ddd; }
.t-res-admin-btn-delete:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.t-res-admin-btn-qr        { background: #f0f4ff; color: #5a7fc4; border-color: #c0d0f0; }

/* 保存ボタン（大きくて目立つ） */
.t-res-admin-btn-save {
    background: #27ae60;
    color: #fff;
    padding: 14px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s;
}

.t-res-admin-btn-save:hover { background: #219a52; transform: translateY(-1px); }

.t-res-save-area { text-align: center; margin: 24px 0; }

/* 設定フォーム */
.t-res-settings-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 設定画面 2カラムレイアウト */
.t-res-admin-wrap .t-res-two-col-wrap {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}
.t-res-admin-wrap .t-res-col-main {
    flex: 1 1 0 !important;
    min-width: 0;
}
.t-res-admin-wrap .t-res-col-side {
    width: 340px !important;
    flex: 0 0 340px !important;
    min-width: 0;
}
@media (max-width: 960px) {
    .t-res-admin-wrap .t-res-two-col-wrap {
        flex-wrap: wrap !important;
    }
    .t-res-admin-wrap .t-res-col-side {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* 設定グリッド */
.t-res-settings-grid { display: flex; flex-direction: column; gap: 16px; }

.t-res-setting-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.t-res-setting-row:last-child { border-bottom: none; }

.t-res-setting-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.t-res-setting-stack:last-child { border-bottom: none; }

/* 公開ボックス（WordPress postbox 標準スタイル補助） */
#t-res-submitdiv .hndle {
    font-size: 1.1em;
    padding: 8px 12px;
}
#t-res-submitdiv .misc-pub-section {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
    color: #50575e;
    display: flex;
    align-items: center;
}
#t-res-submitdiv .misc-pub-section:last-child {
    border-bottom: none;
}
#t-res-submitdiv .misc-pub-section strong {
    color: #1d2327;
    margin-left: 2px;
}
.t-res-publish-misc {
    padding: 6px 0;
}
.t-res-publish-actions {
    background: #f6f7f7;
    border-top: 1px solid #c3c4c7;
    padding: 10px 10px;
    text-align: right;
    margin: 0 -12px -12px;
}
.t-res-publish-actions .button-primary {
    min-width: 80px;
}

/* カードタイトル + 移動ボタン */
.t-res-card-title-with-sort {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ソートボタン */
.t-res-sort-btns {
    display: flex;
    gap: 2px;
}
.t-res-sort-btn {
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    color: #50575e;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 2px;
    transition: background 0.15s;
}
.t-res-sort-btn:hover {
    background: #dcdcde;
    color: #1d2327;
}

/* 移動アニメーション */
.t-res-sortable-card {
    transition: transform 0.25s ease;
}

.t-res-setting-label {
    font-weight: bold;
    font-size: 0.9em;
    color: #444;
    padding-top: 10px;
}

/* 管理画面入力フィールド */
.t-res-admin-input,
.t-res-admin-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95em;
    color: #333;
    appearance: auto;
}

.t-res-admin-input:focus,
.t-res-admin-select:focus {
    outline: none;
    border-color: #7BC2E6;
    box-shadow: 0 0 0 2px rgba(123,194,230,0.2);
}

.t-res-admin-input.large-text { width: 100%; max-width: 500px; }
.t-res-admin-input.small-text { width: 80px; }

/* カラーピッカー */
.t-res-color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.t-res-color-picker {
    width: 48px;
    height: 36px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

.t-res-color-preview {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: inline-block;
}

/* リッチテキストエディタツールバー */
.t-res-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.t-res-toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
    border-right: 1px solid #ddd;
    padding-right: 8px;
}

.t-res-toolbar-group:last-child { border-right: none; }

.t-res-toolbar-btn {
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85em;
    transition: all 0.15s;
}

.t-res-toolbar-btn:hover { background: #e9ecef; }
.t-res-btn-bold { font-weight: bold; }
.t-res-btn-clear { color: #e74c3c; }

/* リッチテキストエディタ本体 */
.t-res-editor-area {
    min-height: 150px;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.95em;
    line-height: 1.8;
    outline: none;
    background: #fff;
}

.t-res-editor-area:focus { border-color: #7BC2E6; box-shadow: 0 0 0 2px rgba(123,194,230,0.2); }

/* エディタ内のリスト表示 */
.t-res-editor-area ul,
.t-res-editor-area ol {
    padding-left: 1.8em;
    margin: 0.5em 0;
}
.t-res-editor-area ul { list-style: disc; }
.t-res-editor-area ol { list-style: decimal; }
.t-res-editor-area li { margin: 0.25em 0; }

/* エディタ内の装飾 */
.t-res-editor-area em,
.t-res-editor-area i,
.t-res-editor-area span[style*="italic"] { font-style: italic !important; }
.t-res-editor-area strong,
.t-res-editor-area b  { font-weight: bold !important; }

/* ショートコードボックス */
.t-res-shortcode-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 8px 0 16px;
}

.t-res-shortcode-box code {
    font-size: 0.95em;
    color: #e83e8c;
    flex: 1;
    word-break: break-all;
}

/* ダイアログ */
.t-res-admin-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100002;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    padding: 30px;
    min-width: 300px;
    max-width: 400px;
    text-align: center;
}

.t-res-admin-dialog p { font-size: 1.05em; margin-bottom: 20px; }

.t-res-admin-dialog-btns { display: flex; gap: 12px; justify-content: center; }

.t-res-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100001;
}

/* 通知ボックス（管理画面内） */
.t-res-admin-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9em;
}

.t-res-notice-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* 件数カウント */
.t-res-admin-count { font-size: 0.85em; color: #888; font-weight: normal; }

/* 空の状態 */
.t-res-admin-empty { text-align: center; padding: 40px; color: #999; font-size: 1.1em; }

/* レスポンシブ対応（スマートフォン） */
@media (max-width: 600px) {
    .t-res-wrap { padding: 12px; }

    .t-res-calendar-header { padding: 12px; }
    .t-res-month-title { font-size: 1em; }
    .t-res-nav-btn { padding: 6px 10px; font-size: 0.85em; }

    .t-res-cal-cell { min-height: 48px; }
    .t-res-cal-badge { width: 22px; height: 22px; font-size: 0.75em; }

    .t-res-btn-area { flex-direction: column; }
    .t-res-btn { flex: none; width: 100%; }

    .t-res-setting-row { grid-template-columns: 1fr; }
    .t-res-admin-filter-row { flex-direction: column; }
    .t-res-qr-img { max-width: 160px; }
}
