/* ============================================================
   EdwardAI Agent OS — 排期共用樣式
   index.html（🗓️ 排期 view）同 kk.html（死線板）兩邊都載。
   死線雷達 + 月曆嗰兩 block 原封由 kk.html 搬過嚟（class name 一個字都冇改），
   下面「排期板新增」嗰段先係新嘢。
   ============================================================ */

/* index.html 個 :root 冇 --purple（kk.html 有）— 補返，同值 */
:root { --purple: #7c3aed; }

/* ===== 死線雷達（兩行式：r1 = brand + 倒數，r2 = 細節）===== */
.mrow {
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px;
  margin-bottom: 7px; background: linear-gradient(180deg, #ffffff, #fafbfd); font-size: 13px;
  animation: rise .3s var(--ease) backwards;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.mrow.tent { border-style: dashed; border-color: var(--line); }
.mrow.over { border-color: rgba(220,38,38,0.4); background: rgba(220,38,38,0.04); border-left: 3px solid var(--red); }
.mrow.today { border-color: rgba(194,65,12,0.35); background: rgba(194,65,12,0.05); }
.mr1 { display: flex; align-items: center; gap: 8px; }
.mr2 { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding-left: 26px; }
.mbrand { font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlabel { color: var(--text-dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdate { font-size: 11px; color: var(--grey); white-space: nowrap; }
.tchip { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.t-script  { background: rgba(180,83,9,0.10);  color: var(--amber);  border: 1px solid rgba(180,83,9,0.22); }
.t-shoot   { background: rgba(3,105,161,0.09); color: var(--cyan);   border: 1px solid rgba(3,105,161,0.2); }
.t-publish { background: rgba(4,120,87,0.10);  color: var(--green);  border: 1px solid rgba(4,120,87,0.2); }
.t-event   { background: rgba(124,58,237,0.10); color: var(--purple); border: 1px solid rgba(124,58,237,0.2); }
.t-payment { background: rgba(194,65,12,0.10); color: var(--orange); border: 1px solid rgba(194,65,12,0.22); }
.mbadge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 20px; white-space: nowrap; margin-left: auto; position: relative; }
.b-today::after {
  content: ""; position: absolute; inset: -2px; border-radius: 22px;
  border: 2px solid var(--orange);
  animation: ring 2s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
.b-over  { background: linear-gradient(135deg, #ef4444, var(--red)); color: #fff; }
.b-today { background: linear-gradient(135deg, #ea580c, var(--orange)); color: #fff; }
.b-tmr   { background: linear-gradient(135deg, #d97706, var(--amber)); color: #fff; }
.b-soon  { background: rgba(3,105,161,0.12); color: var(--cyan); }
.b-later { background: var(--card-hover); color: var(--text-dim); }
.b-fuzzy { background: var(--card-hover); color: var(--text-dim); border: 1px dashed var(--line); }
.tentmark { font-size: 10px; color: var(--grey); border: 1px dashed var(--grey); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
@media (hover: hover) { .mrow:hover { transform: translateX(3px); border-color: var(--line); } }

/* ===== 月曆（port 自 content-dashboard）===== */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-nav button {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 16px; min-height: 38px; font-size: 18px; cursor: pointer; color: var(--text); line-height: 1;
  transition: background .15s var(--ease), transform .15s var(--ease);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.cal-nav button:active { transform: scale(.9); }
@media (hover: hover) { .cal-nav button:hover { background: var(--card-hover); } }
.cal-month-title { font-size: 15px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; animation: rise .22s var(--ease) backwards; }
.cal-header { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-dim); padding: 5px 0; letter-spacing: 0.5px; }
.cal-cell {
  min-height: 72px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 6px; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cal-cell.cal-empty { background: var(--card-hover); opacity: 0.45; }
.cal-cell.cal-today { border-color: var(--cyan); background: linear-gradient(180deg, rgba(3,105,161,0.10), rgba(3,105,161,0.04)); box-shadow: inset 0 0 0 1px var(--cyan); }
.cal-day-num { font-size: 11px; color: var(--text-dim); font-weight: 600; line-height: 1; margin-bottom: 2px; }
.cal-today .cal-day-num { color: var(--cyan); font-weight: 800; }
.cal-chip {
  font-size: 10px; padding: 2px 5px; border-radius: 4px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.cal-chip.tent { border-style: dashed !important; }

/* ============================================================
   ↓↓↓ 排期板新增（🗓️ index.html #sched）↓↓↓
   ============================================================ */

/* Google Calendar = 唯讀，同 work.js milestone（改得）視覺上要一眼分到。
   ⚠️ 唔准借 .tent 虛線 —— 嗰個已經係「待確認」嘅意思。用灰底 + 紫色左邊。 */
.t-gcal {
  background: var(--card-hover); color: var(--text-dim);
  border: 1px solid var(--line); border-left: 3px solid var(--purple);
}
.mrow.gcal { background: var(--card-hover); border-left: 3px solid var(--purple); }
.mrow.gcal .mbrand { font-weight: 600; color: var(--text-dim); }

/* ── 產能對數橫額 ── */
.cap {
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px;
  animation: rise .3s var(--ease) backwards;
}
.cap.over { background: rgba(220,38,38,0.06); border: 1px solid rgba(220,38,38,0.35); border-left: 4px solid var(--red); }
.cap.ok   { background: rgba(4,120,87,0.05);  border: 1px solid rgba(4,120,87,0.28);  border-left: 4px solid var(--green); }
.cap-hd { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.cap.over .cap-hd { color: var(--red); }
.cap.ok .cap-hd { color: var(--green); }
.cap-sub { color: var(--text-dim); font-size: 12px; line-height: 1.65; }
.cap-sub b { color: var(--text); }

/* ── 撞車提示 ── */
.clash { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; line-height: 1.6; }
.clash b { color: var(--orange); }

/* ── legend ── */
.sched-legend { font-size: 11px; color: var(--grey); margin-top: 10px; line-height: 1.6; }

/* ── 壓力線（未來 28 日）──
   ponytail: CSS Grid 做晒 layout —— 冇 pixel 計算、冇 library、resize 自動啱。
     有 lead 就係 bar（真開始日，唔係老作出嚟），冇就係一格 dot。同一個 element。*/
.tl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.tl-grid { min-width: 640px; }
.tl-row, .tl-head {
  display: grid; grid-template-columns: 128px repeat(28, 1fr);
  align-items: center; gap: 0 2px;
}
.tl-row { height: 26px; border-top: 1px solid var(--line-soft); }
.tl-row:first-of-type { border-top: 0; }
.tl-head { height: 22px; font-size: 10px; color: var(--grey); font-weight: 700; }
.tl-head span { text-align: left; }
.tl-label {
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; padding-right: 8px;
}
.tl-bar { height: 11px; border-radius: 3px; min-width: 4px; }
.tl-dot { border-radius: 50%; height: 9px; width: 9px; justify-self: center; min-width: 0; }
.tl-bar.late { box-shadow: inset 3px 0 0 var(--red); }
.tl-lane-gcal { background: repeating-linear-gradient(90deg, transparent 0 3px, var(--line-soft) 3px 4px); }
.tl-lane-gcal .tl-label { color: var(--text-dim); font-weight: 700; }
.tl-weekend { background: var(--card-hover); border-radius: 2px; height: 22px; }
.tl-today { box-shadow: inset 1px 0 0 var(--cyan); }

@media (max-width: 760px) {
  .cal-cell { min-height: 52px; padding: 4px; }
  .cal-chip { font-size: 9px; padding: 1px 3px; }
  .tl-row, .tl-head { grid-template-columns: 104px repeat(28, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .mrow, .cal-grid, .cap { animation-duration: .01ms !important; animation-delay: 0ms !important; }
  .b-today::after { animation: none; }
}
