/* =========================================================
   application.css (Light Theme: White + Green)
   - Replace your current application.css entirely with this.
   - Keeps existing class names used in your app.
   - Includes Shift Patterns (Admin) Gantt Editor + List Preview.
   ========================================================= */

/* ========== Base ========== */
:root{
  --bg: #f6f7fb;
  --panel: #ffffff;
  --card: #ffffff;

  --line: rgba(17,24,39,.12);
  --line-strong: rgba(17,24,39,.16);

  --muted: rgba(17,24,39,.62);
  --text: rgba(17,24,39,.92);

  --primary: #2ea44f;          /* green */
  --primary-strong: #238a41;
  --primary-soft: rgba(46,164,79,.12);

  --danger: #ef4444;
  --success: #22c55e;

  --shadow: 0 14px 36px rgba(17,24,39,.10);
  --shadow-soft: 0 10px 22px rgba(17,24,39,.08);

  --radius-lg: 18px;
  --radius-md: 14px;
  --control-h: 40px;

  --focus: rgba(46,164,79,.22);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP",
               "Hiragino Kaku Gothic ProN", "Meiryo", Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 18% 12%, rgba(46,164,79,.10), transparent 55%),
    radial-gradient(900px 600px at 90% 18%, rgba(46,164,79,.06), transparent 55%),
    var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }
.muted{ color: var(--muted); }
.ta-r{ text-align:right; }
.ta-c{ text-align:center; }

/* ========== Admin Header ========== */
.adminHeader{
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.adminHeader__inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.adminHeader__brand{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}

.adminHeader__title{
  font-weight: 900;
  letter-spacing: .02em;
}

.adminHeader__sub{
  font-size: 12px;
  color: var(--muted);
}

.adminNav{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.adminNav__link{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.14);
  background: rgba(255,255,255,.96);
  color: rgba(17,24,39,.86);
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, transform .06s ease, box-shadow .12s ease;
}

.adminNav__link:hover{
  background: #fff;
  border-color: rgba(17,24,39,.22);
  box-shadow: 0 0 0 3px rgba(46,164,79,.10);
  text-decoration: none;
}

.adminNav__link:active{ transform: translateY(1px); }

.adminNav__link.is-active{
  background: var(--primary-soft);
  border-color: rgba(46,164,79,.45);
}

.adminHeader__right{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========== Auth (Devise sessions) ========== */
.auth{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding: 28px 16px;
  position: relative;
}

.auth__bg{
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,247,251,.96));
  z-index:-1;
}

.auth__wrap{ width: min(520px, 100%); }

.authCard{
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.authCard__head{ padding: 18px 18px 0; }

.authCard__title{
  margin: 0;
  font-size: 18px;
  letter-spacing: .02em;
  font-weight: 900;
}

.auth__foot{
  margin: 10px 0 0;
  text-align:center;
  color: var(--muted);
  font-size: 12px;
}

/* ========== Form ========== */
.form{ padding: 16px 18px 18px; display:grid; gap: 12px; }

.form__row{ display:grid; gap:6px; }

.label{
  font-size: 12px;
  color: rgba(17,24,39,.78);
  font-weight: 800;
}

.hint{
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(17,24,39,.60);
}

.input, .select, .textarea{
  width:100%;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(17,24,39,.14);
  background: #fff;
  color: var(--text);
  outline: none;
}

.input::placeholder, .textarea::placeholder{ color: rgba(17,24,39,.40); }

.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(46,164,79,.55);
  box-shadow: 0 0 0 4px rgba(46,164,79,.16);
}

.input[type="date"]::-webkit-calendar-picker-indicator{
  opacity: .85;
  cursor: pointer;
}
.input[type="date"]::-webkit-calendar-picker-indicator:hover{ opacity: 1; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px){
  .grid2{ grid-template-columns: 1fr; }
}

/* checkbox */
.check{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  color: rgba(17,24,39,.80);
}
.check input{ transform: translateY(-1px); }

/* ========== Buttons ========== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.14);
  background: rgba(255,255,255,.96);
  color: rgba(17,24,39,.88);
  cursor:pointer;
  font-weight: 800;
  letter-spacing: .01em;
  transition: transform .06s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.btn:hover{
  background: #fff;
  border-color: rgba(17,24,39,.22);
  box-shadow: 0 0 0 3px rgba(46,164,79,.10);
  text-decoration: none;
}

.btn:active{ transform: translateY(1px); }

.btn--primary{
  background: rgba(46,164,79,.92);
  border-color: rgba(46,164,79,.95);
  color: #fff;
  box-shadow: 0 12px 26px rgba(46,164,79,.18);
}
.btn--primary:hover{
  background: rgba(46,164,79,1);
  border-color: rgba(46,164,79,1);
}

.btn--ghost{
  background: transparent;
  border-color: rgba(17,24,39,.14);
}
.btn--ghost:hover{
  background: rgba(17,24,39,.04);
  box-shadow: none;
}

.btn--danger{
  background: rgba(239,68,68,.92);
  border-color: rgba(239,68,68,.95);
  color: #fff;
}
.btn--danger:hover{ background: rgba(239,68,68,1); }

.btn--sm{ padding: 7px 10px; font-size: 12px; }
.btn--compact{ height: var(--control-h); padding: 0 14px; font-size: 13px; }

/* Shift Pattern: Eraser ON state */
.btn.is-on{
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.25);
  color: rgba(185,28,28,.92);
  box-shadow: 0 0 0 3px rgba(239,68,68,.10);
}

/* ========== Alerts ========== */
.alert{
  margin: 0 18px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(17,24,39,.03);
  font-size: 13px;
  color: rgba(17,24,39,.88);
}

.alert--error{
  border-color: rgba(239,68,68,.30);
  background: rgba(239,68,68,.10);
}

.alert--success{
  border-color: rgba(34,197,94,.28);
  background: rgba(34,197,94,.10);
}

/* ========== Page layout ========== */
.page{
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 16px;
}

.pageHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pageHead__title{
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.pageHead__actions{ display:flex; gap: 10px; flex-wrap: wrap; }

.card{
  margin-top: 20px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card__body{ padding: 16px; }
.card__body--flush{ padding: 0; }

.table{
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td{
  padding: 12px 14px;
  border-top: 1px solid rgba(17,24,39,.08);
  vertical-align: top;
}

.table thead th{
  border-top: none;
  background: rgba(46,164,79,.06);
  font-weight: 900;
  color: rgba(17,24,39,.78);
}

.tag{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(46,164,79,.08);
  font-size: 12px;
  font-weight: 800;
  color: rgba(17,24,39,.82);
}

/* ========== Punch (TimeRecords) ========== */
.punchHead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(17,24,39,.10);
  margin-bottom: 12px;
}

.punchHead__who{
  font-size: 16px;
  font-weight: 900;
}

.punchHead__date{
  font-size: 12px;
  color: var(--muted);
}

.clock{ text-align:right; }
.clock__time{
  font-size: 40px;
  letter-spacing: .06em;
  font-weight: 900;
}
.clock__sub{ font-size: 12px; color: var(--muted); }

.punchGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.punchBtn{ width:100%; padding: 14px 12px; }

button[disabled]{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========== Admin filters ========== */
.filter{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter__label{
  font-size: 12px;
  color: rgba(17,24,39,.78);
  font-weight: 800;
}

.select--sm{
  padding: 9px 12px;
  border-radius: 12px;
  min-width: 220px;
}

/* ========== TimeBlocks color picker ========== */
.colorRow{
  display:flex;
  align-items:center;
  gap: 10px;
}

.colorChip{
  --c:#2ea44f;
  display:inline-block;
  width: 14px;
  height: 14px;
  border-radius: 6px;
  background: var(--c);
  border: 1px solid rgba(17,24,39,.18);
  box-shadow: 0 10px 22px rgba(17,24,39,.10);
  margin-right: 8px;
  vertical-align: -2px;
}

.colorChip--lg{
  width: 20px;
  height: 20px;
  border-radius: 7px;
}

.colorPick__head{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}

.colorPick{
  display:grid;
  grid-template-columns: repeat(10, 22px);
  gap: 8px;
  align-items:center;
}

.swatch{
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(17,24,39,.14);
  background: var(--c);
  box-shadow: 0 10px 22px rgba(17,24,39,.10);
  cursor: pointer;
  padding: 0;
  transition: transform .08s ease, border-color .12s ease;
}

.swatch:hover{
  border-color: rgba(17,24,39,.26);
  transform: translateY(-1px);
}

.swatch.is-selected{
  outline: 2px solid rgba(46,164,79,.85);
  outline-offset: 2px;
  border-color: rgba(17,24,39,.30);
}

.colorPick__custom{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 6px;
}

.colorPicker{
  width: 52px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(17,24,39,.14);
  background: #fff;
}

/* =========================================================
   Shift Patterns (Admin) - Form + Gantt Editor + Mini Preview
   - (今回の修正を統合済み：グループで編集可 + ガントだけ横スクロール)
   ========================================================= */

/* ---- Form layout ---- */
.spForm{ min-width: 0; } /* Grid配下のはみ出し防止 */

.spTopGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-width: 0;
}
@media (max-width: 860px){
  .spTopGrid{ grid-template-columns: 1fr; }
}

.spBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  min-width: 0;
}

/* Legend (時間ブロック) */
.spLegend{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
  min-width: 0;
}

.spLegend__item{
  appearance:none;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.14);
  background: #fff;
  cursor:pointer;
  font-weight: 900;
  font-size: 12px;
  color: rgba(17,24,39,.86);
  transition: box-shadow .12s ease, border-color .12s ease, background .12s ease, transform .06s ease;
}

.spLegend__item:hover{
  border-color: rgba(17,24,39,.22);
  box-shadow: 0 0 0 3px rgba(46,164,79,.10);
}
.spLegend__item:active{ transform: translateY(1px); }

.spLegend__item.is-active{
  background: rgba(46,164,79,.10);
  border-color: rgba(46,164,79,.45);
  box-shadow: 0 0 0 3px rgba(46,164,79,.12);
}

.spLegend__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--c);
  border: 1px solid rgba(17,24,39,.14);
}

.spTools{
  display:flex;
  gap: 10px;
  align-items:center;
}

.spGanttRow{
  margin-top: 10px;
  min-width: 0; /* ここ重要：ガントだけスクロールにするためのはみ出し止め */
}

.spSubmitRow{
  display:flex;
  justify-content:flex-end;
  margin-top: 12px;
}

/* ---- Gantt scroll container：ガントのみ横スクロール ---- */
.timelineWrap{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

/* 中身幅で止める（中身が長いときだけ timelineWrap にスクロールが出る） */
.timeline{
  display: inline-block;
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

/* ---- Hours ---- */
.spHours{
  display:flex;
  align-items:stretch;
  border-bottom: 1px solid rgba(17,24,39,.10);
  background: #fff;
}

.spHoursRow{
  display:flex; /* grid禁止：要素がある分だけ表示 */
  align-items:stretch;
}

.spHourCell{
  flex: 0 0 calc(var(--slot-w, 18px) * 4); /* 1時間=15分×4 */
  padding: 8px 10px;
  font-weight: 900;
  font-size: 12px;
  color: rgba(17,24,39,.74);
  border-right: 1px solid rgba(17,24,39,.12);
  white-space: nowrap;
}

.spHoursEnd{
  padding: 8px 10px;
  font-weight: 900;
  font-size: 12px;
  color: rgba(17,24,39,.74);
  border-left: 1px solid rgba(17,24,39,.12);
  white-space: nowrap;
}

/* ---- Lane ---- */
.spLane{
  position: relative;
  height: 52px;
  cursor: crosshair;
  /* 1時間線 + 15分線 */
  background:
    linear-gradient(to right, rgba(17,24,39,.10) 1px, transparent 1px) 0 0 / calc(var(--slot-w, 18px) * 4) 100%,
    linear-gradient(to right, rgba(17,24,39,.06) 1px, transparent 1px) 0 0 / var(--slot-w, 18px) 100%;
}

.spLane.is-disabled{
  opacity: .55;
  pointer-events: none;
}

/* ヒントは disabled のときだけ表示 */
.spLane__hint{
  position:absolute;
  inset: 0;
  display:none;
  place-items:center;
  font-size: 12px;
  font-weight: 800;
  color: rgba(17,24,39,.55);
  pointer-events:none;
}
.spLane.is-disabled .spLane__hint{
  display:grid;
}

/* hover */
.spHover{
  position:absolute;
  top:0;
  bottom:0;
  width: var(--slot-w, 18px);
  background: rgba(46,164,79,.10);
  outline: 1px solid rgba(46,164,79,.18);
  opacity: 0;
  pointer-events:none;
}
.spLane.is-hovering .spHover{ opacity: 1; }

/* painted blocks */
.spBlock{
  --c:#2ea44f;
  position:absolute;
  top: 12px;
  bottom: 12px;
  left: calc(var(--start) * var(--slot-w, 18px));
  width: calc((var(--end) - var(--start)) * var(--slot-w, 18px));
  display:flex;
  align-items:center;
  padding: 0 6px;
  border-radius: 0;
  background: color-mix(in srgb, var(--c) 70%, white 30%);
  border: 1px solid color-mix(in srgb, var(--c) 70%, black 10%);
  opacity: .92;
  pointer-events:none;
  overflow:hidden;
}

.spBlock__label{
  font-size: 11px;
  font-weight: 900;
  color: rgba(17,24,39,.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Index mini preview (必要なら使用) ---- */
.spMiniScroll{
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
}

.spMini{
  --slot-w: 10px;
  --slots: 0;
  display:inline-block;
  width: calc(var(--slot-w) * var(--slots));
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 12px;
  overflow:hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.spMini__hours{
  position: relative;
  height: 26px;
  background: #fff;
  border-bottom: 1px solid rgba(17,24,39,.10);
}

.spMini__label{
  position:absolute;
  top: 5px;
  left: calc(var(--x) * var(--slot-w));
  transform: translateX(6px);
  font-size: 11px;
  font-weight: 900;
  color: rgba(17,24,39,.72);
  white-space: nowrap;
  z-index: 10;
}

.spMini__end{
  position:absolute;
  right: 6px;
  top: 5px;
  font-size: 11px;
  font-weight: 900;
  color: rgba(17,24,39,.70);
  background: linear-gradient(to right, rgba(255,255,255,0), #fff 45%);
  padding: 0 2px 0 10px;
  white-space: nowrap;
  z-index: 12;
}

.spMini__lane{
  position: relative;
  height: 34px;
  background: #fff;
}

.spMini__lane::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index: 20;
  background:
    /* 15min */
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--slot-w) - 1px),
      rgba(17,24,39,0.06) calc(var(--slot-w) - 1px),
      rgba(17,24,39,0.06) var(--slot-w)
    ),
    /* 1hour */
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc((var(--slot-w) * 4) - 2px),
      rgba(17,24,39,0.14) calc((var(--slot-w) * 4) - 2px),
      rgba(17,24,39,0.14) calc(var(--slot-w) * 4)
    );
}

/* mini内のブロックは高さを小さくする（spBlock共用の上書き） */
.spMini .spBlock{
  top: 7px;
  bottom: auto;
  height: 20px;
  border-radius: 0;
  opacity: .80;
}

.spMini .spBlock__label{
  display:none;
}

/* =========================================================
   Shift Patterns (Admin) - Index meta (time block usage pills)
   ========================================================= */

.spCell{
  display:grid;
  gap: 8px;
}

.spCell__titleRow{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.spCell__title{
  font-weight: 900;
  font-size: 15px;
  line-height: 1.3;
}

.spMeta{ min-width: 0; }

.spMeta__empty{
  font-size: 12px;
}

/* “編集画面の時間ブロック表示” っぽい pills */
.spPills{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items:center;
}

.spPill{
  display:inline-flex;
  align-items:center;
  gap: 8px;

  padding: 7px 10px;
  border-radius: 999px;

  border: 1px solid rgba(17,24,39,.14);
  background: #fff;

  font-size: 12px;
  font-weight: 900;
  color: rgba(17,24,39,.86);

  max-width: 100%;
}

.spPill__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--c);
  border: 1px solid rgba(17,24,39,.14);
  flex: 0 0 auto;
}

.spPill__name{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px; /* ここは好みで調整 */
}

/* 右側の合計時間（不要ならERB側で消してOK） */
.spPill__time{
  margin-left: 2px;
  font-weight: 900;
  color: rgba(17,24,39,.60);
  font-size: 11px;
  white-space: nowrap;
}

/* タイトル列が狭い時に “時間” を落としても崩れないように */
@media (max-width: 920px){
  .spPill__name{ max-width: 160px; }
}

/* =========================================================
   Shift Management (Admin)
   - month grid + day gantt
   ========================================================= */

.shiftToolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.shiftToolbar__form{
  display:flex;
  align-items:center;
  gap: 10px;
}

.shiftToolbar__label{
  font-size: 12px;
  color: rgba(17,24,39,.78);
  font-weight: 800;
}

.shiftToolbar__month,
.shiftToolbar__date{
  width: 180px;
}

.shiftMonthScroll{
  overflow-x: auto;
  overflow-y: hidden;
}

.shiftMonthTable{
  min-width: 980px;
}

.shiftMonthTable__name{
  width: 220px;
}

.shiftMonthTable__day{
  width: 64px;
  text-align: center;
}

.shiftMonthTable__nameCell{
  white-space: nowrap;
}

.shiftUser{
  display:grid;
  gap: 2px;
}

.shiftUser__name{
  font-weight: 900;
}

.shiftUser__meta{
  font-size: 12px;
}

.shiftCell{
  display: table-cell;
}

.shiftCell__select{
  padding: 9px 10px;
  border-radius: 12px;
  font-size: 12px;
  flex: 1 1 auto;
}

.shiftCell__status{
  font-size: 11px;
  line-height: 1;
  min-height: 12px;
  color: rgba(17,24,39,.55);
}

.shiftCell__status.is-saving{ color: rgba(17,24,39,.65); }
.shiftCell__status.is-saved{ color: rgba(34,197,94,.85); }
.shiftCell__status.is-error{ color: rgba(239,68,68,.90); }

/* ----- day view layout (names | gantt(scroll only) | pattern) ----- */
.shiftDay{
  display:grid;
  grid-template-columns: 220px 1fr 220px;
  border-top: 1px solid rgba(17,24,39,.08);
}

.shiftDay__names,
.shiftDay__patterns{
  display:grid;
  grid-template-rows: 44px;
  grid-auto-rows: 52px;
  background: rgba(255,255,255,.96);
}

.shiftDay__names{
  border-right: 1px solid rgba(17,24,39,.10);
}

.shiftDay__patterns{
  border-left: 1px solid rgba(17,24,39,.10);
}

.shiftDay__gantt{
  display:grid;
  grid-template-rows: 44px auto;
  background: rgba(255,255,255,.96);
}

.shiftDay__head{
  display:flex;
  align-items:center;
  padding: 0 12px;
  font-weight: 900;
  font-size: 12px;
  color: rgba(17,24,39,.74);
  background: rgba(46,164,79,.06);
  border-bottom: 1px solid rgba(17,24,39,.10);
}

.shiftDay__name,
.shiftDay__pattern{
  display:flex;
  align-items:center;
  padding: 0 12px;
  border-bottom: 1px solid rgba(17,24,39,.08);
}

.shiftDayScroll{
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}

.shiftDayInner{
  --slot-w: 18px;
  width: calc(var(--slots) * var(--slot-w));
  min-width: 640px;
  display:grid;
  grid-template-rows: 44px;
  grid-auto-rows: 52px;
}

/* axis */
.shiftHours{
  position: relative;
  border-bottom: 2px solid rgba(17,24,39,.18);
  background: #fff;
}

.shiftHours::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index: 5;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc((var(--slot-w) * 4) - 2px),
      rgba(17,24,39,0.18) calc((var(--slot-w) * 4) - 2px),
      rgba(17,24,39,0.18) calc(var(--slot-w) * 4)
    );
}

.shiftHoursRow{
  position: relative;
  z-index: 10;
  display:flex;
  height: 44px;
}

.shiftHourCell{
  flex: 0 0 calc(var(--slot-w) * 4);
  padding: 10px 0 0 8px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(17,24,39,.74);
  white-space: nowrap;
}

.shiftHoursEnd{
  position:absolute;
  right: 8px;
  top: 10px;
  z-index: 12;
  font-size: 12px;
  font-weight: 900;
  color: rgba(17,24,39,.74);
  background: linear-gradient(to right, rgba(255,255,255,0), #fff 45%);
  padding: 0 2px 0 10px;
  white-space: nowrap;
}

/* lane */
.shiftLane{
  position: relative;
  height: 52px;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--slot-w) - 1px),
      rgba(17,24,39,0.06) calc(var(--slot-w) - 1px),
      rgba(17,24,39,0.06) var(--slot-w)
    ),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc((var(--slot-w) * 4) - 2px),
      rgba(17,24,39,0.14) calc((var(--slot-w) * 4) - 2px),
      rgba(17,24,39,0.14) calc(var(--slot-w) * 4)
    );
  border-bottom: 1px solid rgba(17,24,39,.08);
  background-color: #fff;
}

.shiftBlock{
  position:absolute;
  top: 12px;
  bottom: 12px;
  left: calc(var(--start) * var(--slot-w));
  width: calc((var(--end) - var(--start)) * var(--slot-w));
  border-radius: 10px;
  border: 1px solid rgba(17,24,39,.10);
  background: var(--c);
  opacity: .78;
  pointer-events:none;
}
/* =========================================================
   Shift Management (Admin) - Month / Day
   ========================================================= */

.shiftToolbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.shiftToggle{
  display:flex;
  gap: 8px;
  align-items:center;
}

.shiftToggle__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.14);
  background: rgba(255,255,255,.96);
  font-weight: 900;
  font-size: 13px;
  text-decoration:none;
  color: rgba(17,24,39,.86);
}

.shiftToggle__btn:hover{
  border-color: rgba(17,24,39,.22);
  box-shadow: 0 0 0 3px rgba(46,164,79,.10);
  text-decoration:none;
}

.shiftToggle__btn.is-active{
  background: var(--primary-soft);
  border-color: rgba(46,164,79,.45);
}

.shiftMonthHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(17,24,39,.08);
}

.shiftMonthScroll{
  overflow-x:auto;
}

.shiftMonthTable{
  min-width: 980px;
}

.shiftMonthTable__thName{
  position: sticky;
  left: 0;
  z-index: 3;
  background: rgba(46,164,79,.06);
}

.shiftMonthTable__nameCell{
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(255,255,255,.96);
  border-right: 1px solid rgba(17,24,39,.08);
}

.shiftMonthTable__thDay{
  text-align:center;
  white-space: nowrap;
}

.shiftDayHeadNum{ font-weight: 900; }
.shiftDayHeadWday{ font-size: 12px; color: rgba(17,24,39,.62); }

.staffShiftTable{
  width: 100%;
}

.staffShiftDate{
  font-weight: 800;
  line-height: 1.2;
}

.staffShiftDate.is-weekend{
  background: rgba(17,24,39,.02);
}

.staffShiftDate__day{
  font-size: 14px;
}

.staffShiftDate__wday{
  font-size: 12px;
}

.staffShiftPattern{
  display: grid;
  gap: 8px;
}

.staffShiftPattern__name{
  font-weight: 900;
}

.staffShiftPattern__time{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.staffShiftPattern__timeItem{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.staffShiftPattern__timeLabel{
  color: rgba(17,24,39,.65);
}

.staffShiftPattern__timeValue{
  font-weight: 700;
}

.staffShiftRecords{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.staffShiftRecord{
  display: flex;
  align-items: center;
  gap: 8px;
}

.staffShiftRecord__time{
  font-weight: 700;
}

.shiftCell{
  vertical-align: middle;
}

.shiftCell.is-weekend{
  background: rgba(17,24,39,.02);
}

.shiftCell.is-today{
  outline: 2px solid rgba(46,164,79,.18);
  outline-offset: -2px;
}

.select--xs{
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.shiftCell__select{
  width: 100%;
  min-width: 120px;
}

.shiftCell__select.is-loading{
  opacity: .65;
}

.shiftUserCell{
  display:grid;
  gap: 2px;
}

.shiftUserCell__name{
  font-weight: 900;
  font-size: 14px;
}

.shiftUserCell__sub{
  font-size: 12px;
}

/* ===== Day View ===== */

.shiftDayHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(17,24,39,.08);
}

.shiftDayTools{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(17,24,39,.08);
  flex-wrap: wrap;
}

.shiftDayGrid{
  display:grid;
  grid-template-columns: 220px 180px 1fr;
  align-items:start;
  --shift-day-row-h: 44px;
  --shift-day-block-h: 30px;  
}

.shiftDayGrid__nameCol{
  border-right: 1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.96);
  min-width: 0;
}

.shiftDayGrid__patternCol{
  border-right: 1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.96);
  min-width: 0;
}

.shiftDayGrid__nameHead{
  height: var(--shift-day-row-h);  
  display:flex;
  align-items:center;
  padding: 0 14px;
  font-weight: 900;
  border-bottom: 1px solid rgba(17,24,39,.08);
}

.shiftDayGrid__patternHead{
  height: var(--shift-day-row-h);
  display:flex;
  align-items:center;
  padding: 0 14px;
  font-weight: 900;
  border-bottom: 1px solid rgba(17,24,39,.08);
}

.shiftDayGrid__nameCell{
  height: var(--shift-day-row-h);
  display:flex;
  align-items:center;
  padding: 0 14px;
  border-bottom: 1px solid rgba(17,24,39,.06);
}

.shiftDayGrid__patternCell{
  height: var(--shift-day-row-h);
  display:flex;
  align-items:center;
  padding: 0 14px;
  border-bottom: 1px solid rgba(17,24,39,.06);
}

.shiftDayPatternSelect{
  width: 100%;
  min-width: 0;
}

.shiftDayGrid__ganttCol{
  background: rgba(255,255,255,.96);
  min-width: 0;
}

.shiftDayScroll{
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom: 8px;
}

.shiftDayCanvas{
  width: calc(var(--slots) * var(--slot-w));
  min-width: calc(var(--slots) * var(--slot-w));
}

.shiftDayHours{
  height: var(--shift-day-row-h);
  position: relative;
  border-bottom: 2px solid rgba(17,24,39,.18);
  background: #fff;
}

.shiftDayHoursRow{
  height: 100%;
  display:flex;
  align-items:stretch;
}

.shiftDayHourCell{
  flex: 0 0 calc(var(--slot-w) * 4);
  padding: 10px 0 0 8px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(17,24,39,.74);
  border-right: 1px solid rgba(17,24,39,.12);
  white-space: nowrap;
}

.shiftDayHoursEnd{
  position:absolute;
  right: 8px;
  top: 10px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(17,24,39,.74);
  background: linear-gradient(to right, rgba(255,255,255,0), #fff 45%);
  padding: 0 2px 0 10px;
  white-space: nowrap;
}

.shiftDayLane{
  height: var(--shift-day-row-h);
  position: relative;
  background:
    linear-gradient(to right, rgba(17,24,39,.18) 1px, transparent 1px) 0 0 / calc(var(--slot-w) * 4) 100%,
    linear-gradient(to right, rgba(17,24,39,.08) 1px, transparent 1px) 0 0 / var(--slot-w) 100%;
  border-bottom: 1px solid rgba(17,24,39,.06);
}

.shiftDayLane.is-disabled{
  opacity: .5;
  pointer-events: none;
}

.shiftDayLane__hint{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  padding-left: 10px;
  font-size: 12px;
  color: rgba(17,24,39,.55);
  pointer-events:none;
}

.shiftDayBlock{
  --c:#2ea44f;
  position:absolute;
  top: calc((var(--shift-day-row-h) - var(--shift-day-block-h)) / 2);
  height: var(--shift-day-block-h);
  left: calc(var(--start) * var(--slot-w));
  width: calc((var(--end) - var(--start)) * var(--slot-w));
  display:flex;
  align-items:center;
  padding: 0 6px;
  border-radius: 0;
  border: 1px solid rgba(17,24,39,.12);
  background: var(--c);
  opacity: .78;
  overflow:hidden;
}

.shiftDayBlock__label{
  font-size: 11px;
  font-weight: 900;
  color: rgba(17,24,39,.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   Time Off Requests - Staff Calendar
   ========================================================= */

.toCalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.toCalHead__month{
  display:flex;
  align-items:center;
}

.toCalLegend{
  display:flex;
  gap: 16px;
  align-items:center;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(17,24,39,.78);
}

.toCalLegend__item{
  display:inline-flex;
  align-items:center;
  gap: 6px;
}

.toCalLegend__dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.14);
}

.toCalLegend__dot--preferred{ background: rgba(251,191,36,.60); }
.toCalLegend__dot--fixed{ background: rgba(239,68,68,.45); }
.toCalLegend__dot--none{ background: rgba(17,24,39,.06); }

/* Calendar grid */
.toCal__header{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-bottom: 2px solid rgba(17,24,39,.12);
}

.toCal__wday{
  padding: 8px 4px;
  text-align:center;
  font-size: 12px;
  font-weight: 900;
  color: rgba(17,24,39,.62);
}

.toCal__wday.is-sun{ color: rgba(239,68,68,.85); }
.toCal__wday.is-sat{ color: rgba(59,130,246,.85); }

.toCal__body{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}

.toCal__cell{
  position: relative;
  min-height: 72px;
  padding: 6px;
  border: 1px solid rgba(17,24,39,.06);
  transition: background .12s ease, box-shadow .12s ease;
}

.toCal__cell:hover:not(.toCal__cell--blank){
  background: rgba(46,164,79,.04);
  box-shadow: inset 0 0 0 2px rgba(46,164,79,.15);
}

.toCal__cell--blank{
  cursor: default;
}

.toCal__cell.is-preferred{
  background: rgba(251,191,36,.10);
}

.toCal__cell.is-fixed{
  background: rgba(239,68,68,.08);
}

.toCal__cell.is-loading{
  opacity: .55;
  pointer-events: none;
}

.toCal__dayNum{
  font-size: 14px;
  font-weight: 900;
  color: rgba(17,24,39,.82);
}

.toCal__dayNum.is-sun{ color: rgba(239,68,68,.85); }
.toCal__dayNum.is-sat{ color: rgba(59,130,246,.85); }

.toCal__mark{
  margin-top: 4px;
}

.toCal__badge{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.toCal__badge--preferred{
  background: rgba(251,191,36,.25);
  border: 1px solid rgba(251,191,36,.50);
  color: rgba(146,100,0,.92);
}

.toCal__badge--fixed{
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.40);
  color: rgba(185,28,28,.92);
}

/* Type selector popup */
.toPopup{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  display:flex;
  gap: 6px;
  padding: 8px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(17,24,39,.14);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(17,24,39,.16);
  white-space: nowrap;
}

.toPopup__btn{
  appearance: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.14);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  transition: background .1s ease, border-color .1s ease;
}

.toPopup__btn:hover{
  border-color: rgba(17,24,39,.22);
}

.toPopup__btn--preferred:hover{
  background: rgba(251,191,36,.15);
  border-color: rgba(251,191,36,.50);
}

.toPopup__btn--fixed:hover{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.40);
}

.toPopup__btn--remove:hover{
  background: rgba(17,24,39,.06);
}

.toPopup__btn.is-current{
  background: var(--primary-soft);
  border-color: rgba(46,164,79,.45);
}

/* Lock status badge */
.toLock{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.toLock--locked{
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.30);
  color: rgba(185,28,28,.92);
}

/* =========================================================
   Time Off - Shift Management Integration (Admin Month View)
   ========================================================= */

/* Cell background colors for time-off requests */
.shiftCell--toPreferred{
  background: rgba(251,191,36,.10) !important;
}

.shiftCell--toFixed{
  background: rgba(239,68,68,.08) !important;
}

/* Small dot indicator in shift cells */
.shiftCell__toDot{
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.shiftCell__toDot--preferred{
  background: rgba(251,191,36,.80);
  border: 1px solid rgba(200,150,0,.50);
}

.shiftCell__toDot--fixed{
  background: rgba(239,68,68,.70);
  border: 1px solid rgba(185,28,28,.40);
}

/* Inline tag (dot + text) for time-off in shift cells */
.shiftCell__toTag{
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.shiftCell__toTag--preferred{
  color: rgba(180,130,0,.90);
}

.shiftCell__toTag--fixed{
  color: rgba(185,28,28,.85);
}

/* Lock bar in shift management */
.shiftLockBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 12px;
  background: rgba(46,164,79,.03);
  flex-wrap: wrap;
}

.shiftLockBar__info{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.shiftLockBar__label{
  font-size: 13px;
  font-weight: 900;
  color: rgba(17,24,39,.82);
}

.shiftLockBtn{
  display:inline-flex;
  align-items:center;
  gap: 6px;
}

.shiftLockBtn--locked{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.35);
  color: rgba(185,28,28,.92);
}

.shiftLockBtn--locked:hover{
  background: rgba(239,68,68,.18);
}
