/* ===========================
   Shift Manager Public CSS
   =========================== */

.sm-public-wrap {
    max-width: 720px;
    margin: 0 auto;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', Meiryo, sans-serif;
    /* ===== Theme palette (default = blue). Theme classes below override these. ===== */
    --pp: #2271b1; --pp-d: #1a5a9a;
    --sel-tx: #1d4ed8; --sel-bg: #dbeafe;
    --hint-bg: #e8f4fc; --mine-bg: #eef6ff; --row-bg: #f9fbff; --grp-bg: #f0f6fc;
    --slotmine-bg: #ddeeff; --member-bd: #b8d9f5; --timecell-bg: #fafcff; --todayshift-bg: #e8f5e9;
    --apprv-bg: #d4edda; --apprv-tx: #155724;
    --btn: #2271b1; --btn-h: #1a5a9a;
    --pend-bg: #fff3cd; --pend-tx: #856404;
}

/* ヘッダー */
.sm-pub-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.sm-pub-title { margin: 0; font-size: 1.4em; }
.sm-pub-user  { margin: 0; color: #666; font-size: 0.9em; }

/* 月ナビ */
.sm-pub-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}
.sm-nav-btn {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f0f0f0;
    text-decoration: none;
    color: #333;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}
.sm-nav-btn:hover { background: #e0e0e0; }
.sm-nav-disabled { opacity: 0.4; cursor: default; pointer-events: none; }
/* Inline Font Awesome icons (nav arrows etc.) — follow the button text color */
.sm-public-wrap .ypss-icon { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.125em; }
.sm-nav-label { font-size: 1.2em; font-weight: bold; min-width: 120px; text-align: center; }

/* 凡例 */
.sm-deadline-banner {
    background: #fff8e1;
    border: 1px solid #ffcc80;
    border-left: 4px solid #f57c00;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: .95em;
    color: #5d4037;
}

.sm-pub-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.82em;
}
.sm-legend { display: flex; align-items: center; gap: 4px; }
.sm-legend::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}
.sm-legend-selected::before  { background: var(--pp); }
.sm-legend-pending::before   { background: #f0ad4e; }
.sm-legend-approved::before  { background: #5cb85c; }

/* カレンダー */
.sm-pub-calendar {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.sm-pub-cal-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--pp);
    color: #fff;
}
.sm-pub-cal-dow {
    text-align: center;
    padding: 8px 0;
    font-size: 0.85em;
    font-weight: bold;
}
.sm-dow-sun { color: #ffb3b3; }
.sm-dow-sat { color: #b3d4ff; }

.sm-pub-cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.sm-pub-cal-cell {
    min-height: 60px;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 6px 4px 4px;
    position: relative;
    text-align: center;
    font-size: 0.9em;
    transition: background 0.15s;
}
.sm-pub-cal-cell:nth-child(7n) { border-right: none; }

.sm-cell-selectable {
    cursor: pointer;
    touch-action: manipulation;
}
@media (hover: hover) {
    .sm-cell-selectable:hover { background: #f0f7ff; }
}

.sm-cell-day {
    display: block;
    font-size: 1em;
    margin-bottom: 2px;
}
.sm-cell-sun .sm-cell-day { color: #c0392b; }
.sm-cell-sat .sm-cell-day { color: var(--pp); }

.sm-cell-today { background: #fffde7; }
.sm-cell-today .sm-cell-day { font-weight: bold; }

.sm-cell-empty  { background: #fafafa; }
.sm-cell-past   { background: #f5f5f5; color: #bbb; cursor: default; }
.sm-cell-past .sm-cell-day { color: #bbb; }

/* 選択済み */
.sm-cell-selected {
    background: var(--sel-bg) !important;
    border: 2px solid var(--pp);
}
.sm-cell-selected .sm-cell-day { color: var(--sel-tx); font-weight: bold; }
.sm-cell-selected::after {
    content: '✔';
    display: block;
    font-size: 0.8em;
    color: var(--pp);
}

/* 申請済み */
.sm-cell-pending  { background: #fff8e1; border: 2px solid #f0ad4e; cursor: pointer; }
.sm-cell-pending .sm-cell-day { color: #b8860b; }

/* 承認済み */
.sm-cell-approved { background: #f0fff4; border: 2px solid #5cb85c; cursor: default; }
.sm-cell-approved .sm-cell-day { color: #276228; }

.sm-cell-tag {
    display: block;
    font-size: 0.68em;
    line-height: 1.2;
    color: #555;
    margin-top: 6px;
}

/* エントリーフォーム */
.sm-pub-entries {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.sm-pub-entries h3 { margin-top: 0; }
.sm-pub-hint { font-size: 0.88em; color: #666; margin-bottom: 16px; }

.sm-entry-row {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--row-bg);
    position: relative;
}
.sm-entry-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.sm-entry-date-label {
    font-weight: bold;
    font-size: 1em;
}
.sm-entry-remove {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 4px;
    line-height: 1;
}
.sm-entry-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
@media (max-width: 540px) {
    .sm-entry-fields { grid-template-columns: 1fr 1fr; }
}
.sm-entry-fields label { font-size: 0.82em; color: #555; display: block; }
.sm-entry-fields input[type="time"],
.sm-entry-fields input[type="text"],
.sm-entry-fields textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    margin-top: 2px;
}
.sm-entry-note { grid-column: 1 / -1; }
.sm-entry-note textarea { resize: vertical; min-height: 44px; }

/* ボタン */
.sm-pub-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.sm-btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 5px;
    font-size: 0.95em;
    cursor: pointer;
    transition: opacity 0.2s;
}
.sm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sm-btn-primary   { background: var(--btn); color: #fff; }
.sm-btn-primary:hover   { background: var(--btn-h); }
.sm-btn-secondary { background: #f0f0f0; color: #333; border: 1px solid #ccc; }
.sm-btn-secondary:hover { background: #e0e0e0; }
.sm-btn-cancel    { background: none; border: 1px solid #c0392b; color: #c0392b; padding: 4px 12px; font-size: 0.82em; border-radius: 4px; }
.sm-btn-cancel:hover { background: #fdf0ee; }

/* 通知 */
.sm-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.95em;
    line-height: 1.6;
}
.sm-notice-success { background: var(--apprv-bg); border: 1px solid #5cb85c; color: var(--apprv-tx); }
.sm-notice-error   { background: #f8d7da; border: 1px solid #e74c3c; color: #721c24; }
.sm-notice-warning { background: #fff3cd; border: 1px solid #f0ad4e; color: #856404; }
.sm-notice a { color: inherit; font-weight: bold; }

/* 複数枠 取り消しパネル */
#sm-cancel-panel {
    background: #fff8e1;
    border: 2px solid #f0ad4e;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 14px 0;
}
.sm-cancel-panel-date-label { font-weight: 700; margin-bottom: 10px; font-size: 1.0em; }
.sm-cancel-section-title { font-weight: 600; font-size: 0.88em; color: #666; margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .03em; }
.sm-cancel-slot-list { list-style: none; margin: 0 0 14px; padding: 0; }
.sm-cancel-slot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0e0b0;
}
.sm-cancel-slot-row:last-child { border-bottom: none; }
.sm-cancel-slot-time { font-size: 0.95em; font-weight: 600; }

/* 申請履歴 */
.sm-my-requests-wrap { margin-top: 8px; }
.sm-pub-section-title { font-size: 1.15em; margin-bottom: 12px; }
.sm-no-data { color: #888; font-style: italic; }

.sm-req-list { display: flex; flex-direction: column; gap: 10px; }
.sm-req-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.sm-req-date  { font-weight: bold; margin-bottom: 4px; }
.sm-req-time  { font-size: 0.9em; color: #444; margin-bottom: 4px; }
.sm-req-type-dot {
    display: inline-block; width: 9px; height: 9px;
    border-radius: 50%; margin-right: 4px; vertical-align: middle;
}
.sm-req-note  { font-size: 0.85em; color: #666; margin-bottom: 6px; }
.sm-req-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.sm-req-date-created { font-size: 0.8em; color: #999; }

.sm-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
}
.sm-status-pending  { background: var(--pend-bg); color: var(--pend-tx); }
.sm-status-approved { background: var(--apprv-bg); color: var(--apprv-tx); }
.sm-status-rejected { background: #f8d7da; color: #721c24; }
.sm-status-lottery-lost { background: #fde2c0; color: #8a5a00; }

/* 受付なし（休業日） */
.sm-cell-closed {
    background: #f0f0f0;
    color: #aaa;
    cursor: not-allowed;
}
.sm-cell-closed .sm-cell-day { color: #bbb; }
.sm-cell-closed .sm-cell-tag { color: #999; font-size: 0.68em; }

/* エントリー行の受付時間ヒント */
.sm-entry-time-hint {
    font-size: 0.8em;
    color: var(--pp);
    background: var(--hint-bg);
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: auto;
    margin-left: 8px;
}

/* 凡例に休業日を追加 */
.sm-legend-closed::before { background: #d0d0d0; }

/* シフト種別説明バッジ */
.sm-type-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.sm-type-badge {
    display: flex;
    flex-direction: column;
    padding: 6px 12px;
    border-left: 4px solid var(--pp);
    background: var(--row-bg);
    border-radius: 0 4px 4px 0;
    font-size: 0.85em;
    line-height: 1.4;
}
.sm-type-badge strong { font-size: 1em; }
.sm-type-badge span   { color: #555; }

/* シフト種別セレクト行 */
.sm-entry-fields-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
/* 時間枠セレクトがある場合: slot | type を並べ、備考を全幅に */
.sm-entry-fields-type.sm-has-slot-select {
    grid-template-columns: 1fr 1fr;
}
.sm-entry-fields-type.sm-has-slot-select .sm-entry-note {
    grid-column: 1 / -1;
}
@media (max-width: 540px) {
    .sm-entry-fields-type { grid-template-columns: 1fr; }
    .sm-entry-fields-type.sm-has-slot-select { grid-template-columns: 1fr; }
}
.sm-entry-type-col { display: flex; flex-direction: column; gap: 6px; }
.sm-entry-type-col label { font-size: 0.85em; color: #555; }
.sm-entry-type-col select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    margin-top: 2px;
}
/* 時間枠セレクト列 */
.sm-entry-slot-col { display: flex; flex-direction: column; gap: 6px; }
.sm-entry-slot-col label { font-size: 0.85em; color: #555; }
.sm-entry-slot-col select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--pp);
    border-radius: 4px;
    font-size: 0.95em;
    margin-top: 2px;
    background: var(--grp-bg);
}
/* 無効状態のシフト種別セレクト */
.sm-type-select:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* 時間プレビュー */
.sm-time-preview {
    display: inline-block;
    padding: 3px 10px;
    border-left: 3px solid var(--pp);
    background: var(--hint-bg);
    border-radius: 0 4px 4px 0;
    font-size: 0.85em;
    color: var(--pp-d);
}

/* 複数申請可能な日のセル */
.sm-cell-multi::after {
    content: '＋';
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.75em;
    color: var(--pp);
    opacity: 0.6;
    line-height: 1;
}
.sm-cell-multi:hover::after { opacity: 1; }


/* ===== moved from public/views/schedule.php (inline <style>) ===== */
/* ── カレンダー ── */
.sm-sch-calendar     { overflow-x: auto; }
.sm-sch-head         { display: grid; grid-template-columns: repeat(7, 1fr);
                        border-bottom: 2px solid #ddd; margin-bottom: 2px; }
.sm-sch-dow          { text-align: center; padding: 6px 2px; font-weight: 700;
                        font-size: .85em; color: #555; }
.sm-sch-body         { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.sm-sch-cell         { min-height: 80px; padding: 4px 5px; border: 1px solid #eee;
                        background: #fff; vertical-align: top; font-size: .82em;
                        position: relative; }
.sm-sch-empty        { background: #fafafa; border-color: transparent; }
.sm-sch-sun .sm-sch-day, .sm-dow-sun { color: #c0392b; }
.sm-sch-sat .sm-sch-day, .sm-dow-sat { color: var(--pp); }
.sm-sch-holiday      { background: #fff5f5 !important; }
.sm-sch-holiday-label { display: block; font-size: .7em; color: #c0392b;
                         font-weight: 700; line-height: 1.2; margin-bottom: 1px;
                         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-sch-today        { background: #fffde7; border-color: #f9a825 !important; }
.sm-sch-mine         { background: var(--mine-bg); }
.sm-sch-clickable    { cursor: pointer; }
.sm-sch-clickable:hover { box-shadow: 0 0 0 2px var(--pp) inset; }
.sm-sch-day          { display: block; font-weight: 700; font-size: 1.05em;
                        margin-bottom: 3px; line-height: 1.2; }
.sm-sch-slots        { display: flex; flex-direction: column; gap: 3px; }
.sm-sch-slot         { background: #f5f5f5; border-left: 3px solid #bbb;
                        border-radius: 2px; padding: 2px 4px; line-height: 1.3; }
.sm-sch-slot-mine    { background: var(--slotmine-bg); border-left-color: var(--pp); }
.sm-sch-slot-leader  { background: #fff3cd !important;
                        border-left: 4px solid #d4a017 !important;
                        box-shadow: 0 0 0 1px #f9a825 inset; }
.sm-modal-leader     { background: #fff3cd !important; border: 1px solid #d4a017 !important;
                        color: #5a3d00 !important; font-weight: 700; }

/* 時間枠別カラー（カレンダーセル・モーダル共通） */
.sm-sch-slot.sm-slot-color-0,
.sm-modal-slot-row.sm-slot-color-0,
.sm-modal-grp-header.sm-slot-color-0 { background:#e3f2fd; border-left:3px solid #1976d2; }
.sm-sch-slot.sm-slot-color-1,
.sm-modal-slot-row.sm-slot-color-1,
.sm-modal-grp-header.sm-slot-color-1 { background:var(--todayshift-bg); border-left:3px solid #388e3c; }
.sm-sch-slot.sm-slot-color-2,
.sm-modal-slot-row.sm-slot-color-2,
.sm-modal-grp-header.sm-slot-color-2 { background:#fff3e0; border-left:3px solid #f57c00; }
.sm-sch-slot.sm-slot-color-3,
.sm-modal-slot-row.sm-slot-color-3,
.sm-modal-grp-header.sm-slot-color-3 { background:#fce4ec; border-left:3px solid #c2185b; }
.sm-sch-slot.sm-slot-color-4,
.sm-modal-slot-row.sm-slot-color-4,
.sm-modal-grp-header.sm-slot-color-4 { background:#f3e5f5; border-left:3px solid #7b1fa2; }
.sm-sch-slot.sm-slot-color-5,
.sm-modal-slot-row.sm-slot-color-5,
.sm-modal-grp-header.sm-slot-color-5 { background:#e0f7fa; border-left:3px solid #00838f; }
.sm-sch-slot.sm-slot-color-6,
.sm-modal-slot-row.sm-slot-color-6,
.sm-modal-grp-header.sm-slot-color-6 { background:#fff8e1; border-left:3px solid #f9a825; }
.sm-sch-slot.sm-slot-color-7,
.sm-modal-slot-row.sm-slot-color-7,
.sm-modal-grp-header.sm-slot-color-7 { background:#efebe9; border-left:3px solid #5d4037; }
.sm-sch-slot.sm-slot-color-8,
.sm-modal-slot-row.sm-slot-color-8,
.sm-modal-grp-header.sm-slot-color-8 { background:#ffebee; border-left:3px solid #c62828; }
.sm-sch-slot.sm-slot-color-9,
.sm-modal-slot-row.sm-slot-color-9,
.sm-modal-grp-header.sm-slot-color-9 { background:#ede7f6; border-left:3px solid #512da8; }
.sm-sch-time         { display: block; font-size: .78em; color: #666; }
.sm-sch-names        { display: block; font-size: .82em; color: #333; }
.sm-sch-group-badge  { position: absolute; bottom: 4px; right: 5px;
                        font-size: .85em; opacity: .7; }
.sm-sch-legend-mine  { background: var(--slotmine-bg); border: 1px solid #a3c8f0;
                        padding: 2px 8px; border-radius: 3px; font-size: .85em; }
.sm-sch-legend-click { background: #f5f5f5; border: 1px solid #ddd;
                        padding: 2px 8px; border-radius: 3px; font-size: .85em; color: #555; }

/* ── モーダル ── */
#sm-sch-overlay      { position: fixed; inset: 0; background: rgba(0,0,0,.5);
                        z-index: 99999; display: flex; align-items: center; justify-content: center;
                        padding: 16px; box-sizing: border-box; }
#sm-sch-modal        { background: #fff; border-radius: 8px; max-width: 640px; width: 100%;
                        max-height: 90vh; overflow-y: auto; padding: 24px;
                        position: relative; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
#sm-sch-modal-close  { position: absolute; top: 12px; right: 14px; background: none;
                        border: none; font-size: 1.4em; cursor: pointer; color: #999;
                        line-height: 1; padding: 4px; }
#sm-sch-modal-close:hover { color: #333; }
.sm-modal-date       { font-size: 1.15em; font-weight: 700; margin-bottom: 16px;
                        padding-bottom: 10px; border-bottom: 2px solid #eee; }
.sm-modal-section    { margin-bottom: 18px; }
.sm-modal-sec-title  { font-weight: 700; color: #444; margin-bottom: 8px; font-size: .95em; }
.sm-modal-slot-row   { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px;
                        padding: 6px 8px; background: #f9f9f9; border-radius: 3px; }
.sm-modal-slot-time  { font-size: .85em; color: var(--pp); font-weight: 600; white-space: nowrap; }
.sm-modal-slot-names { font-size: .9em; color: #333; }

.sm-modal-grp-slot   { margin-bottom: 14px; }
.sm-modal-grp-header { font-size: .9em; font-weight: 600; color: #555; margin-bottom: 6px;
                        padding: 4px 8px; background: var(--grp-bg);
                        border-left: 3px solid var(--pp); border-radius: 0 2px 2px 0; }
.sm-modal-grp-table  { border-collapse: collapse; width: 100%; font-size: .88em; }
.sm-modal-grp-table th,
.sm-modal-grp-table td { border: 1px solid #e0e0e0; padding: 5px 8px; }
.sm-modal-grp-table th { background: #f5f5f5; text-align: center; white-space: nowrap; }
.sm-modal-grp-table .sm-modal-time-cell { font-weight: 600; color: var(--pp);
                        white-space: nowrap; text-align: center; background: var(--timecell-bg); }
.sm-modal-member     { display: inline-block; background: #e8f4fd; border: 1px solid var(--member-bd);
                        border-radius: 3px; padding: 1px 6px; margin: 1px 2px; font-size: .85em; }
.sm-modal-empty-slot { display: inline-block; color: #c0392b; font-weight: 700;
                        background: #fff5f5; border: 1px dashed #fc8181;
                        border-radius: 3px; padding: 1px 6px; margin: 1px 2px; font-size: .85em; }
.sm-modal-leader-link {
    display: inline-block; padding: 8px 16px; margin-bottom: 14px;
    background: #fff3cd; color: #5a3d00 !important;
    border: 2px solid #d4a017; border-radius: 4px;
    text-decoration: none; font-weight: 700;
    transition: background .15s;
}
.sm-modal-leader-link:hover { background: #ffe48a; }
.sm-modal-no-grp     { color: #aaa; font-size: .88em; }

@media (max-width: 600px) {
    .sm-sch-cell  { min-height: 58px; padding: 3px; }
    .sm-sch-time  { display: none; }
    .sm-sch-names { font-size: .75em; }
    #sm-sch-modal { padding: 16px; }
}

/* ===== moved from public/views/week-schedule.php (inline <style>) ===== */
.sm-week-list        { border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; }
.sm-week-row         { display: flex; align-items: center; gap: 12px;
                        padding: 10px 14px; border-bottom: 1px solid #eee;
                        background: #fff; }
.sm-week-row:last-child { border-bottom: none; }
.sm-week-today       { background: #fffde7; }
.sm-week-has-shift   { background: var(--mine-bg); }
.sm-week-today.sm-week-has-shift { background: var(--todayshift-bg); }
.sm-week-sun .sm-week-date  { color: #c0392b; }
.sm-week-sat .sm-week-date  { color: var(--pp); }
.sm-week-holiday            { background: #fff5f5 !important; }
.sm-week-holiday .sm-week-date { color: #c0392b; }
.sm-week-holiday-badge      { display: inline-block; font-size: .72em; color: #c0392b;
                               font-weight: 700; margin-left: 6px; vertical-align: middle; }
.sm-week-date        { min-width: 110px; font-weight: 600; font-size: .95em; white-space: nowrap; }
.sm-week-today-badge { display: inline-block; background: #f9a825; color: #fff;
                        font-size: .7em; padding: 1px 6px; border-radius: 3px;
                        margin-right: 5px; vertical-align: middle; font-weight: 700; }
.sm-week-slots       { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-week-badge       { display: inline-block; background: var(--pp); color: #fff;
                        border-radius: 3px; padding: 3px 10px; font-size: .88em; }
.sm-week-empty       { color: #ccc; font-size: .9em; }
@media (max-width: 480px) {
    .sm-week-row   { flex-direction: column; align-items: flex-start; gap: 4px; }
    .sm-week-date  { min-width: unset; }
}
/* ===================== Frontend theme palettes ===================== */
/* Selected via the admin "Frontend Theme" setting; class added to .sm-public-wrap. */

/* Cocoon (green + dark-brown buttons) */
.sm-public-wrap.sm-theme-cocoon {
    --pp:#628d3d; --pp-d:#3d6626; --sel-tx:#3a5a1e; --sel-bg:#dfeaa6;
    --hint-bg:#dfeaa6; --mine-bg:#eef5d8; --row-bg:#f7faea; --grp-bg:#eef5d8;
    --slotmine-bg:#dfeaa6; --member-bd:#b5cc6a; --timecell-bg:#f7faea; --todayshift-bg:#dfeaa6;
    --apprv-bg:#dfeaa6; --apprv-tx:#3a5a1e; --btn:#665048; --btn-h:#4d3a35;
    --pend-bg:#f2cedd; --pend-tx:#665048;
}
/* Sakura (pink) */
.sm-public-wrap.sm-theme-sakura {
    --pp:#d6608f; --pp-d:#b34a73; --sel-tx:#b34a73; --sel-bg:#fbdce8;
    --hint-bg:#fbdce8; --mine-bg:#fdeef4; --row-bg:#fdf4f8; --grp-bg:#fbe6ef;
    --slotmine-bg:#fbdce8; --member-bd:#ecb3cb; --timecell-bg:#fdf4f8; --todayshift-bg:#fbdce8;
    --btn:#b34a73; --btn-h:#8f3a5c;
}
/* Ocean (teal) */
.sm-public-wrap.sm-theme-ocean {
    --pp:#1f8a8a; --pp-d:#156b6b; --sel-tx:#156b6b; --sel-bg:#c9eeee;
    --hint-bg:#c9eeee; --mine-bg:#e3f6f6; --row-bg:#f0fbfb; --grp-bg:#ddf3f3;
    --slotmine-bg:#c9eeee; --member-bd:#8fd6d6; --timecell-bg:#f0fbfb; --todayshift-bg:#c9eeee;
    --btn:#1f8a8a; --btn-h:#156b6b;
}
/* Midnight (dark): palette overrides + dark surfaces */
.sm-public-wrap.sm-theme-midnight {
    --pp:#4f86c6; --pp-d:#3a6ea5; --sel-tx:#cfe3ff; --sel-bg:#2a3a4d;
    --hint-bg:#33485f; --mine-bg:#34506b; --row-bg:#2c323b; --grp-bg:#3a4656;
    --slotmine-bg:#37506a; --member-bd:#4a6a8e; --timecell-bg:#2c323b; --todayshift-bg:#3d4c3d;
    --apprv-bg:#33491f; --apprv-tx:#cde9b3; --btn:#4f86c6; --btn-h:#3a6ea5;
    --pend-bg:#4a3f23; --pend-tx:#f0dca6;
    color:#e9eaec;
}
.sm-theme-midnight .sm-pub-user, .sm-theme-midnight .sm-pub-hint,
.sm-theme-midnight .sm-cell-tag, .sm-theme-midnight .sm-req-time,
.sm-theme-midnight .sm-req-note, .sm-theme-midnight .sm-cancel-section-title,
.sm-theme-midnight .sm-sch-dow, .sm-theme-midnight .sm-no-data { color:#c3c6c9; }
.sm-theme-midnight .sm-pub-calendar { background:#22272b; border-color:#3c434a; }
.sm-theme-midnight .sm-pub-cal-cell { border-color:#3c434a; }
.sm-theme-midnight .sm-cell-empty { background:#1e2329; }
.sm-theme-midnight .sm-cell-past, .sm-theme-midnight .sm-cell-past .sm-cell-day { background:#1a1f24; color:#6b7177; }
.sm-theme-midnight .sm-cell-today { background:#3a3520; }
.sm-theme-midnight .sm-pub-entries, .sm-theme-midnight .sm-req-card, .sm-theme-midnight #sm-sch-modal {
    background:#2b313a; border-color:#465059; color:#e9eaec;
}
.sm-theme-midnight .sm-entry-row { border-color:#3c434a; }
.sm-theme-midnight .sm-nav-btn, .sm-theme-midnight .sm-btn-secondary {
    background:#2c3338; color:#e2e4e6; border-color:#4f5559;
}
.sm-theme-midnight .sm-nav-btn:hover, .sm-theme-midnight .sm-btn-secondary:hover { background:#3a4148; }
.sm-theme-midnight .sm-entry-fields input, .sm-theme-midnight .sm-entry-fields textarea,
.sm-theme-midnight .sm-entry-type-col select, .sm-theme-midnight .sm-entry-slot-col select {
    background:#2c3338; color:#e2e4e6; border-color:#4f5559;
}
.sm-theme-midnight .sm-entry-fields label, .sm-theme-midnight .sm-entry-type-col label,
.sm-theme-midnight .sm-entry-slot-col label, .sm-theme-midnight .sm-type-badge span { color:#c3c6c9; }
.sm-theme-midnight .sm-sch-cell { background:#22272b; border-color:#3c434a; }
.sm-theme-midnight .sm-sch-empty { background:#1e2329; }
.sm-theme-midnight .sm-sch-slot { background:#3a424b; }
/* Midnight: 暗背景に残る暗い文字色を明るくして視認性を確保 */
.sm-theme-midnight .sm-sch-names, .sm-theme-midnight .sm-modal-slot-names { color:#e9eaec; }
.sm-theme-midnight .sm-sch-time, .sm-theme-midnight .sm-modal-sec-title,
.sm-theme-midnight .sm-modal-grp-header, .sm-theme-midnight #sm-sch-modal-close { color:#c3c6c9; }
.sm-theme-midnight .sm-cell-sun .sm-cell-day { color:#ff8a80; }
.sm-theme-midnight .sm-cell-pending .sm-cell-day { color:#e6cf9a; }
.sm-theme-midnight .sm-cell-approved .sm-cell-day { color:#b6d99a; }
.sm-theme-midnight .sm-week-row { background:#22272b; border-color:#3c434a; }
.sm-theme-midnight .sm-week-list { border-color:#3c434a; }
.sm-theme-midnight .sm-modal-grp-table th, .sm-theme-midnight .sm-modal-grp-table td { border-color:#3c434a; }

/* ===== Schedule view: tabs / week list / day timeline ===== */
.sm-sch-toolbar { position: relative; margin-bottom: 12px; }
.sm-sch-toolbar .sm-pub-nav { margin-bottom: 0; }
.sm-view-tabs { display: flex; gap: 4px; flex-wrap: wrap; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
    .sm-sch-toolbar { display: flex; flex-direction: column; gap: 8px; }
    .sm-view-tabs { position: static; transform: none; justify-content: center; }
}
.sm-view-tab { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 6px 14px; border: 1px solid #ccc; border-radius: 4px; background: #f0f0f0; color: #333; text-decoration: none; font-size: 1em; line-height: 1.2; }
.sm-view-tab, .sm-view-tab:link, .sm-view-tab:visited, .sm-view-tab:hover, .sm-view-tab:focus, .sm-view-tab:active, .sm-view-tab.is-active { text-decoration: none !important; }
.sm-view-tab:hover { background: #e6e6e6; }
.sm-view-tab.is-active { background: var(--pp); color: #fff; border-color: var(--pp); }

.sm-sch-week { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.sm-sch-wk-day { display: flex; gap: 12px; border: 1px solid #ddd; border-radius: 6px; padding: 8px 12px; background: #fff; }
.sm-sch-wk-today { background: var(--todayshift-bg); }
.sm-sch-wk-date { min-width: 104px; font-weight: 600; line-height: 1.4; }
.sm-sch-wk-dnum { font-size: 1.05em; }
.sm-sch-wk-dow { color: #888; font-size: .85em; margin-left: 3px; }
.sm-sch-wk-slots { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.sm-sch-wk-slot { border-radius: 3px; padding: 3px 8px; font-size: .9em; color: #1a1a1a; }
.sm-sch-wk-time { font-weight: 600; margin-right: 8px; }

.sm-sch-timeline { position: relative; border: 1px solid #ddd; border-radius: 8px; background: #fff; margin-bottom: 24px; overflow: hidden; }
.sm-tl-ruler { position: absolute; left: 0; top: 0; width: 52px; height: 100%; border-right: 1px solid #eee; }
.sm-tl-hour { position: absolute; left: 0; width: 52px; border-top: 1px dashed #e3e3e3; }
.sm-tl-hour span { position: relative; top: -0.65em; left: 4px; font-size: .7em; color: #999; background: #fff; padding: 0 2px; }
.sm-tl-slots { position: absolute; left: 52px; right: 6px; top: 0; height: 100%; }
.sm-tl-slot { position: absolute; box-sizing: border-box; border-radius: 4px; padding: 3px 6px; font-size: .8em; overflow: hidden; color: #1a1a1a; }
.sm-tl-time { display: block; font-weight: 700; font-size: .85em; line-height: 1.2; }
.sm-tl-names { display: block; font-size: .82em; line-height: 1.25; }

/* Midnight: non-slot surfaces (slot chips keep the pastel time-slot colors) */
.sm-theme-midnight .sm-view-tab { background: #2c3338; color: #e2e4e6; border-color: #4f5559; }
.sm-theme-midnight .sm-sch-wk-day { background: #22272b; border-color: #3c434a; }
.sm-theme-midnight .sm-sch-wk-dow { color: #8a8d90; }
.sm-theme-midnight .sm-sch-timeline { background: #22272b; border-color: #3c434a; }
.sm-theme-midnight .sm-tl-ruler { border-color: #3c434a; }
.sm-theme-midnight .sm-tl-hour { border-color: #33393f; }
.sm-theme-midnight .sm-tl-hour span { background: #22272b; color: #8a8d90; }

/* Calendar header weekday labels sit on the colored header bar — keep them legible */
.sm-pub-cal-dow.sm-dow-sun, .sm-sch-dow.sm-dow-sun { color: #ffcccc; }
.sm-pub-cal-dow.sm-dow-sat, .sm-sch-dow.sm-dow-sat { color: #e0e0e0; }

/* Confirm modal (replaces browser confirm()) */
.sm-confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100000; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.sm-confirm-box { background: #fff; border-radius: 8px; max-width: 360px; width: 100%; padding: 22px 24px; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.sm-confirm-msg { margin: 0 0 18px; font-size: 1.02em; line-height: 1.5; }
.sm-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.sm-confirm-yes { background: #c0392b; color: #fff; }
.sm-confirm-yes:hover { background: #a93226; }
.sm-theme-midnight .sm-confirm-box { background: #22272b; color: #e2e4e6; }
