/* TopCloud Room Booking - 紫色グラデーションテーマ（週表示版） */

.tc-rb-app {
    max-width: 1560px;
    margin: 20px auto;
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    color: #333;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.tc-rb-login-notice {
    padding: 16px;
    background: #f0eeff;
    border-radius: 8px;
    text-align: center;
}

/* ===== サイドバー ===== */
.tc-rb-sidebar {
    width: 290px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #f0eeff, #ede8f8, #e8e4f5);
    border: 1px solid #ddd6f5;
    border-radius: 10px;
    padding: 16px;
    box-sizing: border-box;
}

.tc-rb-room-list-header {
    font-size: 13px;
    font-weight: 700;
    color: #6c5ce7;
    margin-bottom: 8px;
    letter-spacing: .02em;
}

.tc-rb-room-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tc-rb-room-item {
    background: #fff;
    border: 1px solid #ddd6f5;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.tc-rb-room-load-error {
    background: #fadbd8;
    color: #c0392b;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
}
.tc-rb-room-item:hover {
    border-color: #a99ae8;
}
.tc-rb-room-item.is-active {
    background: linear-gradient(135deg, #7d6ff0, #6c5ce7);
    border-color: #6c5ce7;
}
.tc-rb-room-item.is-active .tc-rb-room-name,
.tc-rb-room-item.is-active .tc-rb-room-meta {
    color: #fff;
}

.tc-rb-room-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}
.tc-rb-room-meta {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.tc-rb-btn-admin {
    width: 100%;
    background: #fff;
    border: 1px dashed #a99ae8;
    color: #6c5ce7;
    font-weight: 700;
    font-size: 12px;
    padding: 8px;
    margin-bottom: 16px;
}
.tc-rb-btn-admin:hover {
    background: #f0eeff;
}

/* ミニカレンダー */
.tc-rb-mini-cal {
    background: #fff;
    border: 1px solid #ddd6f5;
    border-radius: 8px;
    padding: 10px 12px;
}
.tc-rb-mini-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.tc-rb-mini-cal-title {
    font-size: 13px;
    font-weight: 700;
    color: #4a3f9b;
}
.tc-rb-mini-cal-nav {
    display: flex;
    gap: 4px;
}
.tc-rb-mini-nav-btn {
    border: none;
    background: #f0eeff;
    color: #6c5ce7;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}
.tc-rb-mini-nav-btn:hover { background: #e0dbf8; }

.tc-rb-mini-cal-weekdays,
.tc-rb-mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.tc-rb-mini-cal-weekdays span {
    font-size: 10px;
    color: #999;
    padding-bottom: 4px;
}
.tc-rb-mini-cal-day {
    font-size: 12px;
    padding: 5px 0;
    border-radius: 50%;
    cursor: pointer;
    color: #444;
}
.tc-rb-mini-cal-day:hover {
    background: #f0eeff;
}
.tc-rb-mini-cal-day.is-muted {
    color: #ccc;
}
.tc-rb-mini-cal-day.is-today {
    font-weight: 700;
    color: #6c5ce7;
}
.tc-rb-mini-cal-day.is-selected-week {
    background: #ede8f8;
}
.tc-rb-mini-cal-day.is-selected {
    background: #6c5ce7;
    color: #fff;
    font-weight: 700;
}

/* ===== メインエリア ===== */
.tc-rb-main {
    flex: 1;
    min-width: 0;
}

.tc-rb-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    background: linear-gradient(160deg, #f0eeff, #ede8f8, #e8e4f5);
    border-radius: 10px 10px 0 0;
    border: 1px solid #ddd6f5;
    border-bottom: none;
}

.tc-rb-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tc-rb-current-room {
    font-size: 17px;
    font-weight: 700;
    color: #4a3f9b;
}
.tc-rb-current-range {
    font-size: 14px;
    color: #777;
    margin-left: auto;
}

.tc-rb-btn {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    padding: 8px 14px;
    transition: opacity .15s ease, transform .1s ease;
}
.tc-rb-btn:hover { opacity: .85; }
.tc-rb-btn:active { transform: scale(0.97); }

.tc-rb-btn-nav {
    background: #ffffff;
    border: 1px solid #ccc0f0;
    color: #6c5ce7;
    font-weight: 700;
    padding: 8px 12px;
}
.tc-rb-btn-today {
    background: #ffffff;
    border: 1px solid #ccc0f0;
    color: #4a3f9b;
    font-weight: 600;
}
.tc-rb-btn-primary {
    background: linear-gradient(135deg, #7d6ff0, #6c5ce7);
    color: #fff;
    font-weight: 700;
    padding: 10px 20px;
}
.tc-rb-btn-change {
    background: #f5a623;
    color: #fff;
    font-weight: 700;
    padding: 10px 16px;
}
.tc-rb-btn-cancel {
    background: #e9e9ee;
    color: #555;
    padding: 10px 18px;
}
.tc-rb-btn-danger {
    background: #e74c3c;
    color: #fff;
    padding: 10px 16px;
    margin-right: auto;
}

/* ===== グリッド（週表示・24時間） ===== */
.tc-rb-grid-wrapper {
    position: relative;
    border: 1px solid #ddd6f5;
    border-radius: 0 0 10px 10px;
    overflow: auto;
    background: #fff;
    max-height: 760px;
}

.tc-rb-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.7);
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6c5ce7;
    z-index: 5;
}
.tc-rb-loading.is-active { display: flex; }

.tc-rb-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.tc-rb-grid thead th {
    background: #5b4fcf;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 4px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 3;
}
.tc-rb-grid thead th.is-today {
    background: #4a3f9b;
}
.tc-rb-day-name {
    display: block;
    font-size: 12px;
    opacity: .85;
}
.tc-rb-day-num {
    display: block;
    font-size: 17px;
}

.tc-rb-time-col {
    width: 70px;
    z-index: 4 !important;
}

.tc-rb-grid td {
    border: 1px solid #eee;
    height: 30px;
    vertical-align: top;
    padding: 0;
}

.tc-rb-time-label {
    background: #f7f6fc;
    font-size: 12px;
    color: #888;
    text-align: center;
    vertical-align: middle;
    border-right: 2px solid #ddd6f5;
    position: sticky;
    left: 0;
    z-index: 2;
}
.tc-rb-time-label.is-hour {
    color: #555;
    font-weight: 700;
}

.tc-rb-slot-empty {
    cursor: pointer;
    transition: background .1s ease;
}
.tc-rb-slot-empty:hover {
    background: #fff3cd;
}

/* 予約済み＝赤系 */
.tc-rb-booking-block {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, #f0776b, #e0483a);
    color: #fff;
    font-size: 13px;
    line-height: 1.3;
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 5px;
    overflow: hidden;
}
.tc-rb-booking-block:hover {
    filter: brightness(1.08);
}
.tc-rb-booking-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-rb-booking-time {
    opacity: .9;
}

/* ===== モーダル ===== */
.tc-rb-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 60, .45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.tc-rb-modal-overlay.is-active {
    display: flex;
}

.tc-rb-modal {
    background: #fff;
    width: 92%;
    max-width: 440px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.tc-rb-modal-wide {
    max-width: 640px;
}

.tc-rb-modal-header {
    background: linear-gradient(135deg, #6c5ce7, #5b4fcf);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 20px;
}

.tc-rb-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
}

.tc-rb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    background: #faf9fd;
    border-top: 1px solid #eee;
}

.tc-rb-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    margin: 12px 0 4px;
}
.tc-rb-label:first-child { margin-top: 0; }

.tc-rb-required {
    color: #e74c3c;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

.tc-rb-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid #ddd6f5;
    border-radius: 6px;
    font-size: 16px; /* 16px未満だとiOS/一部Android端末で入力時に自動ズームが発生するため固定 */
    background: #fff;
}
.tc-rb-input:focus {
    outline: none;
    border-color: #6c5ce7;
}

.tc-rb-textarea {
    resize: vertical;
}

.tc-rb-row {
    display: flex;
    gap: 12px;
}
.tc-rb-col {
    flex: 1;
    min-width: 0;
}

.tc-rb-field-error {
    display: none;
    background: #fadbd8;
    color: #c0392b;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.tc-rb-field-error.is-active {
    display: block;
}

/* 予約詳細 */
.tc-rb-detail-row {
    display: flex;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0eeff;
}
.tc-rb-detail-row:last-child { border-bottom: none; }
.tc-rb-detail-label {
    width: 90px;
    flex-shrink: 0;
    color: #888;
    font-weight: 700;
}
.tc-rb-detail-value {
    flex: 1;
    word-break: break-word;
}

/* 会議室管理テーブル */
.tc-rb-admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}
.tc-rb-admin-table th {
    font-size: 11px;
    color: #888;
    text-align: left;
    padding: 6px 4px;
    border-bottom: 2px solid #f0eeff;
}
.tc-rb-admin-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #f5f5f5;
}
.tc-rb-admin-table input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ddd6f5;
    border-radius: 5px;
    font-size: 16px; /* 16px未満だと自動ズームが発生するため固定 */
}
.tc-rb-admin-row-delete {
    background: #fadbd8;
    color: #c0392b;
    border: none;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.tc-rb-admin-row-delete:hover { opacity: .8; }

/* ===== モバイル対応 ===== */
@media (max-width: 900px) {
    .tc-rb-app {
        flex-direction: column;
    }
    .tc-rb-sidebar {
        width: 100%;
    }
    .tc-rb-room-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .tc-rb-room-item {
        flex: 1 1 auto;
    }
}

@media (max-width: 640px) {
    .tc-rb-app { margin: 10px; gap: 10px; }

    /* 会議室選択：ドロップダウンではなく、横スクロールできるカード一覧にする */
    .tc-rb-room-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .tc-rb-room-item {
        flex: 0 0 auto;
        min-width: 120px;
        padding: 8px 10px;
    }
    .tc-rb-room-name { font-size: 13px; }
    .tc-rb-room-meta { font-size: 10px; }

    .tc-rb-time-col { width: 32px; }
    .tc-rb-time-label { font-size: 9px; }
    .tc-rb-grid thead th { font-size: 9px; padding: 5px 1px; }
    .tc-rb-day-name { font-size: 9px; }
    .tc-rb-day-num { font-size: 11px; }
    .tc-rb-current-room { font-size: 13px; }
    .tc-rb-current-range { font-size: 10px; }
    .tc-rb-row { flex-direction: column; gap: 0; }
    .tc-rb-booking-block { font-size: 8px; padding: 1px 2px; line-height: 1.15; }
    .tc-rb-grid td { height: 17px; }
    .tc-rb-grid-wrapper { max-height: 480px; }

    .tc-rb-toolbar { padding: 10px 12px; gap: 8px; }
    .tc-rb-current-range { margin-left: 0; width: 100%; order: 3; }
}
