/* ===== TEAM SCHEDULE APP STYLES ===== */
:root {
  --brand: #14532d;
  --brand-mid: #166534;
  --brand-light: #d1fae5;
  --brand-soft: #ecfdf5;
  --avail: #16a34a;
  --orange: #f97316;
  --red: #dc2626;
  --border: #e5e7eb;
  --bg2: #f9fafb;
  --bg3: #f3f4f6;
  --text: #111827;
  --text2: #6b7280;
}
#page-team-schedule * { box-sizing: border-box; }
#page-team-schedule { font-family: 'Poppins', sans-serif; color: var(--text); font-size: 13px; }
#page-team-schedule td, .ts-report-scope .cell { -webkit-user-select: none; user-select: none; }

/* LOGO */
.ts-report-scope .logo-wrap { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.ts-report-scope .logo-icon { font-size: 22px; }
.ts-report-scope .logo-title { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.ts-report-scope .logo-sub { font-size: 11px; color: rgba(255,255,255,.75); margin-top: 1px; }

/* TABS */
.ts-report-scope .tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 10px; }
.ts-report-scope .tab-btn { padding: 6px 14px; font-size: 12px; font-weight: 500; background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; color: var(--text2); transition: all 0.15s; border-radius: 6px 6px 0 0; font-family: 'Poppins', sans-serif; }
.ts-report-scope .tab-btn:hover { color: var(--brand); background: var(--brand-soft); }
.ts-report-scope .tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.ts-report-scope .tab-panel { display: none; }
.ts-report-scope .tab-panel.active { display: block; }

/* WEEK BAR */
.ts-report-scope .week-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 10px; background: var(--brand-soft); border: 1px solid var(--brand-light); border-radius: 7px; margin-bottom: 6px; }
.ts-report-scope .week-bar label { font-size: 11px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.ts-report-scope .week-bar input[type=date] { font-size: 11px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--brand-light); background: #fff; color: var(--text); cursor: pointer; font-family: 'Poppins', sans-serif; }
.ts-report-scope .week-preview { font-size: 11px; color: var(--brand); font-weight: 500; flex: 1; }
.ts-report-scope .btn-reset { font-size: 12px; padding: 6px 13px; border-radius: 8px; border: 1.5px solid var(--brand); background: #fff; color: var(--brand); cursor: pointer; font-weight: 600; font-family: 'Poppins', sans-serif; white-space: nowrap; display:inline-flex;align-items:center;gap:5px;transition:all .15s; }
.ts-report-scope .btn-reset:hover { background: var(--brand-soft); }

/* INFO BOX */
.ts-report-scope .info-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 7px 12px; margin-bottom: 8px; font-size: 11px; color: #92400e; display: flex; gap: 8px; }
.ts-report-scope .info-box strong { display: block; font-size: 12px; margin-bottom: 1px; }

/* LEGEND */
/* LEGEND ROW */
.ts-report-scope .legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--text2); padding: 6px 12px; background: var(--brand-soft); border-radius: 7px 7px 0 0; border: 1px solid var(--brand-light); border-bottom: none; }
.ts-report-scope .legend-item { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.ts-report-scope .dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.ts-report-scope .legend-tip { margin-left: auto; font-style: italic; color: var(--brand); }
/* BULK ACTION BAR */
.ts-report-scope .bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 14px; background: #fff; border: 1.5px solid #fde68a; border-radius: 0 0 10px 10px; margin-bottom: 6px; box-shadow:0 1px 4px rgba(0,0,0,.04); }
.ts-report-scope .bulk-bar-left { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.ts-report-scope .bulk-count-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 20px; white-space: nowrap; }
.ts-report-scope .bulk-count-badge.empty { background: var(--bg3); color: var(--text2); }
.ts-report-scope .bulk-label { font-size: 11.5px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.ts-report-scope .bulk-select { font-size: 12px; padding: 6px 10px; border-radius: 7px; border: 1.5px solid var(--border); background: #fff; color: var(--text); cursor: pointer; font-family: 'Poppins', sans-serif; font-weight:500; outline:none; transition:border-color .12s; }
.ts-report-scope .bulk-select:focus { border-color:var(--brand); }
.ts-report-scope .bulk-apply-btn { display: inline-flex; align-items: center; gap: 5px; background: var(--brand); color: #fff; border: none; border-radius: 7px; padding: 7px 16px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: 'Poppins', sans-serif; transition: background 0.15s; white-space: nowrap; letter-spacing:.1px; }
.ts-report-scope .bulk-apply-btn:hover { background: var(--brand-mid); }
.ts-report-scope .bulk-clear-btn { display: inline-flex; align-items: center; gap: 4px; background: #fff; color: var(--text2); border: 1.5px solid var(--border); border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'Poppins', sans-serif; transition: all 0.15s; white-space: nowrap; }
.ts-report-scope .bulk-clear-btn:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.ts-report-scope .bulk-log-btn { display: inline-flex; align-items: center; gap: 5px; background: #fff; color: var(--brand); border: 1.5px solid var(--brand-light); border-radius: 7px; padding: 6px 13px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'Poppins', sans-serif; transition: all 0.15s; white-space: nowrap; margin-left: auto; }
.ts-report-scope .bulk-log-btn:hover { background: var(--brand-soft); }
/* CHANGE LOG PANEL */
.ts-report-scope .changelog-wrap { display: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.ts-report-scope .changelog-wrap.open { display: block; }
.ts-report-scope .changelog-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ts-report-scope .changelog-title { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.ts-report-scope .changelog-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--text2); padding: 0 2px; line-height: 1; }
.ts-report-scope .changelog-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.ts-report-scope .cl-entry { display: grid; grid-template-columns: 80px 120px 1fr; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 11px; align-items: start; }
.ts-report-scope .cl-entry:nth-child(odd) { background: var(--bg2); }
.ts-report-scope .cl-who { font-weight: 700; color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-report-scope .cl-when { color: var(--text2); white-space: nowrap; }
.ts-report-scope .cl-what { color: var(--text); line-height: 1.4; }
.ts-report-scope .cl-empty { font-size: 12px; color: var(--text2); text-align: center; padding: 16px; font-style: italic; }
/* KEYBOARD SHORTCUT KEY */
.ts-report-scope .kbd { display: inline-flex; align-items: center; background: #fff; border: 1px solid #d1d5db; border-bottom: 2px solid #9ca3af; border-radius: 4px; font-size: 9px; font-weight: 700; padding: 1px 5px; color: var(--text2); font-family: monospace; margin: 0 1px; }
/* SCORE TOOLTIP */
.ts-report-scope .score-tip { position: relative; cursor: help; }
.ts-report-scope .score-tip::after { content: attr(data-tip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #1f2937; color: #fff; font-size: 10px; padding: 8px 12px; border-radius: 8px; white-space: pre-line; pointer-events: none; opacity: 0; transition: opacity 0.15s; z-index: 9999; line-height: 1.7; text-align: left; min-width: 180px; }
.ts-report-scope .score-tip::before { content: ''; position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1f2937; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.ts-report-scope .score-tip:hover::after, .ts-report-scope .score-tip:hover::before { opacity: 1; }
@keyframes kbFlash { 0%,100%{opacity:1} 50%{opacity:0.3} }
.ts-report-scope .kb-flash td { animation: kbFlash 0.25s ease; }
/* When Notified / Form Received buttons in cell modal */
.rc-notif-btn{padding:7px 14px;border:1.5px solid var(--s200);border-radius:20px;background:#fff;font-size:12.5px;font-weight:600;cursor:pointer;font-family:var(--font);color:var(--s600);transition:var(--tr);}
.rc-notif-btn:hover{background:var(--s50);border-color:var(--s300);}
.rc-notif-btn.active{background:#dcfce7;border-color:#16a34a;color:#15803d;}
.rc-notif-tag{display:inline-block;padding:2px 7px;border-radius:10px;font-size:10.5px;font-weight:700;margin:1px 2px;white-space:nowrap;}
.rc-notif-tag.call{background:#dbeafe;color:#1e40af;}
.rc-notif-tag.sms{background:#fef9c3;color:#854d0e;}
.rc-notif-tag.email{background:#f3e8ff;color:#7e22ce;}
.sc-notif-btn, .sc-form-btn {
  background:#f3f4f6;border:1.5px solid #e5e7eb;border-radius:8px;padding:7px 12px;
  font-size:12.5px;font-family:'Poppins',sans-serif;font-weight:500;cursor:pointer;
  color:#374151;text-align:left;transition:all .12s;
}
.sc-notif-btn:hover, .sc-form-btn:hover { background:#e0f2fe;border-color:#93c5fd;color:#1e40af; }
.sc-notif-btn.active { background:#dbeafe;border-color:#3b82f6;color:#1d4ed8;font-weight:700; }
.sc-form-btn.active { background:#d1fae5;border-color:#10b981;color:#065f46;font-weight:700; }

/* TOOLBAR */
.ts-report-scope .toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; align-items: center; }
.ts-report-scope .toolbar input[type=text] { flex: 1; min-width: 140px; font-size: 12px; padding: 7px 10px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; color: var(--text); font-family: 'Poppins', sans-serif; outline:none;transition:border-color .12s; }
.ts-report-scope .toolbar input[type=text]:focus { border-color: var(--brand-mid); }
.ts-report-scope .toolbar select { font-size: 12px; padding: 7px 8px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; color: var(--text); cursor: pointer; font-family: 'Poppins', sans-serif; outline:none;transition:border-color .12s; }
.ts-report-scope .toolbar select:focus { border-color:var(--brand-mid); }
.ts-report-scope .toolbar button { font-size: 12px; padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; color: var(--text2); cursor: pointer; font-weight: 600; transition: all 0.15s; font-family: 'Poppins', sans-serif; white-space: nowrap; }
.ts-report-scope .toolbar button:hover { background: var(--brand-soft); border-color: var(--brand-mid); color: var(--brand); }
.ts-report-scope .btn-roll { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; font-weight: 700 !important; letter-spacing:.1px; box-shadow:0 2px 6px rgba(6,78,59,.2); }
.ts-report-scope .btn-roll:hover { background: var(--brand-mid) !important; box-shadow:0 3px 10px rgba(6,78,59,.3) !important; }

/* STATS */
.ts-report-scope .stats { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.ts-report-scope .stat { background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 4px 10px; display: flex; align-items: center; gap: 8px; }
.ts-report-scope .stat-label { font-size: 10px; color: var(--text2); font-weight: 500; white-space: nowrap; }
.ts-report-scope .stat-val { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.ts-report-scope .c-green { color: var(--avail); } .c-red { color: var(--red); } .c-orange { color: var(--orange); } .c-brand { color: var(--brand); }

/* TABLE */
.ts-report-scope .tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; max-height: 70vh; overflow-y: auto; }
#page-team-schedule table { width: auto; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; table-layout: auto; }

/* ===== InlineEditableCell — reusable inline-edit state styling ==========
   Not scoped to #page-team-schedule: this is the reference implementation
   for inline-editable cells portal-wide (KPIs, staff metrics, client
   records, etc. should reuse these same classes). States are applied
   directly to the <input> by window.InlineEditableCell; the optional
   .iec-spinner sibling is toggled by the same helper. */
.iec-wrap { position: relative; display: inline-flex; align-items: center; }
.iec-dirty { background: #fef9c3 !important; transition: background 0.15s ease; }
.iec-saving { opacity: 0.65; transition: background 0.15s ease, opacity 0.15s ease; }
.iec-success { background: #dcfce7 !important; transition: background 0.15s ease; }
.iec-error { outline: 1.5px solid #dc2626; outline-offset: -1px; transition: outline 0.15s ease; }
.iec-spinner { display: none; width: 10px; height: 10px; margin-left: 4px; border: 1.5px solid #d1d5db; border-top-color: #6b7280; border-radius: 50%; animation: iec-spin 0.6s linear infinite; flex: 0 0 auto; }
.iec-spinner.show { display: inline-block; }
@keyframes iec-spin { to { transform: rotate(360deg); } }

/* MOBILE RESPONSIVE */
@media (max-width: 640px) {
  #page-team-schedule body { padding: 10px; }
  .ts-report-scope .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .ts-report-scope .tab-btn { font-size: 11px; padding: 7px 12px; white-space: nowrap; }
  .ts-report-scope .stats { grid-template-columns: repeat(2,1fr); }
  .ts-report-scope .logo-title { font-size: 16px; }
  .ts-report-scope .logo-sub { font-size: 10px; }
  .ts-report-scope .week-bar { gap: 6px; }
  .ts-report-scope .toolbar { gap: 6px; }
  .ts-report-scope .toolbar input[type=text] { min-width: 120px; }
  .ts-report-scope .header-admin { display: none; } /* hide admin buttons on mobile, use menu */
  /* Card view for mobile — hide table, show cards */
  .ts-report-scope .tbl-wrap { max-height: none; overflow-x: auto; }
  .ts-report-scope .mobile-cards { display: block; }
  .ts-report-scope .desktop-table { display: none; }
  .ts-report-scope .card { background:#fff; border:1px solid var(--border); border-radius:10px; padding:12px; margin-bottom:8px; }
  .ts-report-scope .card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
  .ts-report-scope .card-name { font-weight:600; font-size:13px; }
  .ts-report-scope .card-days { display:grid; grid-template-columns:repeat(5,1fr); gap:4px; }
  .ts-report-scope .card-day { text-align:center; }
  .ts-report-scope .card-day-label { font-size:9px; color:var(--text2); margin-bottom:3px; font-weight:600; }
}
@media (min-width: 641px) {
  .ts-report-scope .mobile-cards { display: none; }
  .ts-report-scope .desktop-table { display: block; }
}
#page-team-schedule thead { background: var(--bg3); position: sticky; top: 0; z-index: 10; }
#page-team-schedule th { padding: 5px 8px; text-align: left; font-weight: 500; font-size: 11px; color: var(--text2); white-space: nowrap; border-bottom: 1px solid var(--border); }
#page-team-schedule th.dh { text-align: center; border-left: 1px solid var(--border); padding: 4px 6px; }
#page-team-schedule th.dh.today { background: var(--brand-light); border-left: 2px solid var(--brand); border-right: 2px solid var(--brand); }
#page-team-schedule th.dh.today .dn { color: var(--brand-text); font-size: 13px; }
#page-team-schedule th.dh.today .dd { color: var(--brand-mid); font-weight: 600; }
#page-team-schedule td.dc.today { background: #f0fdf4; border-left: 2px solid var(--brand) !important; border-right: 2px solid var(--brand) !important; }
.ts-report-scope .dn { font-size: 11px; font-weight: 600; color: var(--text); display: block; white-space: nowrap; }
.ts-report-scope .dd { display: none; }
#page-team-schedule th.sticky, #page-team-schedule td.sticky { position: sticky; left: 0; z-index: 3; white-space: nowrap; width: 60px; min-width: 60px; background: #fff; }
#page-team-schedule th.cb-cell, #page-team-schedule td.cb-cell { position: sticky; left: 0; z-index: 3; background: #fff; }
#page-team-schedule thead th.cb-cell { background: var(--bg3); z-index: 12; }
#page-team-schedule tbody tr:nth-child(even):not(.sec) td.cb-cell { background: var(--bg2); }
#page-team-schedule tbody tr:hover:not(.sec) td.cb-cell { background: var(--brand-soft) !important; }
#page-team-schedule thead th.sticky { background: var(--bg3); z-index: 12; }
/* Name column — sticky after role col (role is ~60px wide) */
#page-team-schedule th.name-sticky, #page-team-schedule td.name-sticky { position: sticky; left: 60px; z-index: 3; white-space: nowrap; min-width: 140px; background: #fff; }
#page-team-schedule thead th.name-sticky { background: var(--bg3); z-index: 12; }
/* Shadow on the name sticky col to mark the frozen boundary */
#page-team-schedule td.name-sticky, #page-team-schedule thead th.name-sticky { box-shadow: 3px 0 8px -2px rgba(0,0,0,0.13); }
#page-team-schedule tbody tr:nth-child(even):not(.sec) td.name-sticky { background: var(--bg2); }
#page-team-schedule tbody tr:nth-child(odd) td.name-sticky { background: #fff; }
#page-team-schedule tbody tr:hover:not(.sec) td.name-sticky { background: var(--brand-soft) !important; }
#page-team-schedule td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
#page-team-schedule tbody tr { background: #fff; }
#page-team-schedule tbody tr:nth-child(even):not(.sec) { background: var(--bg2); }
#page-team-schedule tbody tr:nth-child(even) td.sticky { background: var(--bg2); }
#page-team-schedule tbody tr:nth-child(odd) td.sticky { background: #fff; }
#page-team-schedule tbody tr:hover:not(.sec) { background: var(--brand-soft) !important; }
#page-team-schedule tbody tr:hover td.sticky { background: var(--brand-soft) !important; }
#page-team-schedule tr:last-child td { border-bottom: none; }
#page-team-schedule td.dc.sc-chg .cell { outline: 2px solid #f59e0b; outline-offset: 1px; }
#page-team-schedule td.dc { border-left: 1px solid var(--border); cursor: pointer; text-align: center; padding: 6px 8px; transition: background 0.1s; }
#page-team-schedule td.dc:hover { background: var(--brand-light) !important; }
#page-team-schedule td.dc.today { background: #f0fdf4; }
#page-team-schedule tr.sec td { background: linear-gradient(to right,var(--brand),var(--brand-mid)); padding: 10px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #fff; border: none; }
.ts-report-scope .count { background: rgba(255,255,255,0.22); border-radius: 999px; padding: 2px 9px; font-size: 10px; margin-left: 8px; color: #fff; text-transform: none; letter-spacing: 0; font-weight: 600; }
.ts-report-scope .cov-row { background: var(--bg2); }
.ts-report-scope .cov-cell { font-size: 10px; color: var(--text2); text-align: center; border-left: 1px solid var(--border); padding: 4px 8px; }
.ts-report-scope .num { text-align: center; font-size: 12px; font-weight: 500; }

/* ROLE TAGS */
.ts-report-scope .role { display: inline-block; font-size: 9px; padding: 2px 6px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.ts-report-scope .r-tlit { background:#fce7f3; color:#be185d; }
.ts-report-scope .role-edit { cursor: pointer; transition: opacity 0.15s; }
.ts-report-scope .role-edit:hover { opacity: 0.75; outline: 2px solid #7c3aed; outline-offset: 2px; }
.ts-report-scope .r-mgr { background: #d1fae5; color: #064e3b; }
.ts-report-scope .r-tl { background: #ecfdf5; color: var(--brand); border: 1px solid #a7f3d0; }
.ts-report-scope .r-stl { background: #fef3c7; color: #92400e; }
.ts-report-scope .r-ac { background: #dbeafe; color: #1e40af; }
.ts-report-scope .r-rca { background: #fce7f3; color: #9f1239; }
.ts-report-scope .r-new { background: #ede9fe; color: #5b21b6; }

/* CELLS */
.ts-report-scope .cell { border-radius: 6px; padding: 4px 9px; font-size: 11px; font-weight: 500; white-space: nowrap; display: inline-block; min-width: 82px; text-align: center; }
.ts-report-scope .c-avail { background: var(--avail); color: #fff; }
/* 24 Sep: SHIFT = given work that day (Available = available only). */
.ts-report-scope .c-shift { background: #14532d; color: #fff; font-weight: 700; box-shadow: inset 0 0 0 2px #86efac; }
/* A shift on part-day hours stays orange, like the availability it was given on (2 Oct 2026). */
.ts-report-scope .c-shift.c-shift-short { background: #c2410c; box-shadow: inset 0 0 0 2px #fdba74; }
.ts-report-scope .odot.shift { background: #14532d; }
.ts-report-scope .c-short { background: var(--orange); color: #fff; }
.ts-report-scope .c-sick { background: var(--red); color: #fff; }
.ts-report-scope .c-off { background: #e5e7eb; color: #4b5563; }
.ts-report-scope .c-na { background: #9ca3af; color: #fff; }
.ts-report-scope .c-holiday { background: #7c3aed; color: #fff; }
.ts-report-scope .c-backup { background: #1d4ed8; color: #fff; }
/* DA = didn't accept by the deadline; the shift went to the Relief Pool (7 Oct 2026). */
.ts-report-scope .c-da { background: #fef3c7; color: #92400e; box-shadow: inset 0 0 0 1.5px #f59e0b; font-weight: 700; }
.ts-report-scope .odot.da { background: #f59e0b; }
#page-team-schedule th.dh.holiday { background: #ede9fe; }
#page-team-schedule th.dh.holiday .dn, #page-team-schedule th.dh.holiday .dd { color: #5b21b6; }
#page-team-schedule th.dh.today.holiday { background: #ddd6fe; }
.ts-report-scope .sort-btn { background:none;border:none;cursor:pointer;font-size:11px;font-weight:500;color:var(--text2);padding:0;font-family:'Poppins',sans-serif;display:flex;align-items:center;gap:4px;white-space:nowrap; }
.ts-report-scope .sort-btn:hover { color:var(--brand); }
.ts-report-scope .sort-btn.active { color:var(--brand);font-weight:700; }
.ts-report-scope .hol-btn { display: block; margin: 2px auto 0; font-size: 11px; padding: 1px 4px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: #a78bfa; cursor: pointer; font-family: 'Poppins', sans-serif; line-height: 1; opacity: 0.5; transition: opacity 0.15s; }
.ts-report-scope .hol-btn:hover { opacity: 1; background: #ede9fe; border-color: #c4b5fd; }
.ts-report-scope .hol-btn.active { background: #7c3aed; color: #fff; border-color: #7c3aed; opacity: 1; }

/* LOGIN */
#page-team-schedule td.dc.sc-sel { outline: 2px solid #7c3aed; outline-offset: -2px; background: #f5f3ff !important; }
#page-team-schedule td.dc.sc-sel .cell { opacity: 0.9; }
#sc-cell-sel-bar { display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1e1b4b; color: #fff; border-radius: 12px; padding: 10px 16px; gap: 8px; align-items: center; z-index: 500; box-shadow: 0 8px 32px rgba(0,0,0,0.28); flex-wrap: wrap; max-width: 92vw; }
#sc-cell-sel-bar .csel-count { font-size: 12px; font-weight: 700; color: #c4b5fd; white-space: nowrap; margin-right: 4px; }
#sc-cell-sel-bar .csel-btn { font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 7px; border: none; cursor: pointer; font-family: 'Poppins', sans-serif; white-space: nowrap; transition: opacity 0.15s; }
#sc-cell-sel-bar .csel-btn:hover { opacity: 0.85; }
#sc-cell-sel-bar .csel-div { width: 1px; height: 18px; background: rgba(255,255,255,0.2); flex-shrink: 0; }
#sc-cell-sel-bar .csel-clear { background: transparent; color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.2); font-size: 11px; padding: 4px 10px; border-radius: 7px; cursor: pointer; font-family: 'Poppins', sans-serif; }
#sc-cell-sel-bar .csel-clear:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
#sc-cell-sel-bar .csel-tip { font-size: 10px; color: rgba(255,255,255,0.35); white-space: nowrap; }
.ts-report-scope .login-box { background:#fff; border-radius:16px; padding:32px; width:100%; max-width:360px; box-shadow:0 24px 80px rgba(0,0,0,0.3); border-top:5px solid var(--brand); text-align:center; }
.ts-report-scope .login-box h2 { font-size:20px; font-weight:700; color:var(--brand); margin-bottom:4px; }
.ts-report-scope .login-box p { font-size:12px; color:var(--text2); margin-bottom:20px; }
.ts-report-scope .login-box input { width:100%; font-size:13px; padding:10px 12px; border-radius:8px; border:1px solid var(--border); font-family:'Poppins',sans-serif; margin-bottom:10px; color:var(--text); }
.ts-report-scope .login-box input:focus { outline:none; border-color:var(--brand); }
.ts-report-scope .login-box .login-btn { width:100%; background:var(--brand); color:#fff; border:none; padding:11px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; font-family:'Poppins',sans-serif; }
.ts-report-scope .login-box .login-btn:hover { background:var(--brand-mid); }
.ts-report-scope .names-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:10px; max-height:200px; overflow-y:auto; }
.ts-report-scope .name-btn { background:var(--brand-soft); border:1px solid var(--brand-light); color:var(--brand); padding:8px; border-radius:8px; font-size:11px; font-weight:500; cursor:pointer; font-family:'Poppins',sans-serif; text-align:left; }
.ts-report-scope .name-btn:hover { background:var(--brand); color:#fff; }
.ts-report-scope .user-badge { display:inline-flex; align-items:center; gap:5px; font-size:11px; background:var(--brand-soft); border:1px solid var(--brand-light); color:var(--brand); padding:3px 10px; border-radius:999px; font-weight:500; cursor:pointer; margin-left:auto; }
.ts-report-scope .user-badge:hover { background:var(--brand-light); }

/* TIER BADGES */
.ts-report-scope .t1 { background:#d1fae5; color:#064e3b; font-size:9px; font-weight:700; padding:1px 5px; border-radius:999px; margin-left:4px; }
.ts-report-scope .t2 { background:#fee2e2; color:#991b1b; font-size:9px; font-weight:700; padding:1px 5px; border-radius:999px; margin-left:4px; }

/* TOP/BOTTOM PERFORMERS */
.ts-report-scope .top-row td { background:#fefce8 !important; }
.ts-report-scope .bot-row td { background:#fff1f2 !important; }
.ts-report-scope .top-row td.sticky { background:#fefce8 !important; }
.ts-report-scope .bot-row td.sticky { background:#fff1f2 !important; }
.ts-report-scope .pt-row td, .ts-report-scope .pt-row td.sticky { background:#eff6ff !important; }
.ts-report-scope .ws-row td, .ts-report-scope .ws-row td.sticky { background:#f0fdfa !important; }
.tcl-kind { font-size:9.5px;font-weight:800;padding:1px 6px;border-radius:20px;white-space:nowrap;vertical-align:middle; }
.tcl-kind.pt { background:#dbeafe;color:#1d4ed8;border:1px solid #bfdbfe; }
.tcl-kind.ws { background:#ccfbf1;color:#0f766e;border:1px solid #99f6e4; }
.sd2-staff-card.sd2-kind-pt, .sd2-staff-row.sd2-kind-pt { background:#eff6ff;border-left:4px solid #2563eb; }
.sd2-staff-card.sd2-kind-ws, .sd2-staff-row.sd2-kind-ws { background:#f0fdfa;border-left:4px solid #0d9488; }
.ts-report-scope .pt-tag { font-size:10px;font-weight:700;padding:1px 6px;border-radius:20px;background:#dbeafe;color:#1d4ed8;border:1px solid #bfdbfe;white-space:nowrap; }

/* BULK SELECT */
.ts-report-scope .bulk-bar { display:none; align-items:center; gap:8px; padding:9px 14px; background:#fff; border:1.5px solid #fde68a; border-radius:10px; margin-bottom:8px; flex-wrap:wrap; font-size:12px; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.ts-report-scope .bulk-bar.show { display:flex; }
.ts-report-scope .bulk-bar strong { color:#92400e; }
.ts-report-scope .bulk-bar select { font-size:12px; padding:6px 10px; border-radius:7px; border:1.5px solid var(--border); background:#fff; cursor:pointer; font-family:'Poppins',sans-serif; color:var(--text); font-weight:500; outline:none; transition:border-color .12s; }
.ts-report-scope .bulk-bar select:focus { border-color:var(--brand); }
.ts-report-scope .bulk-apply-btn { display:inline-flex;align-items:center;gap:5px;background:var(--brand);color:#fff;border:none;border-radius:7px;padding:7px 16px;font-size:12px;font-weight:700;cursor:pointer;font-family:'Poppins',sans-serif;transition:background .15s;white-space:nowrap;letter-spacing:.1px; }
.ts-report-scope .bulk-apply-btn:hover { background:var(--brand-mid); }
.ts-report-scope .bulk-clear-btn { display:inline-flex;align-items:center;gap:4px;background:#fff;color:var(--text2);border:1.5px solid var(--border);border-radius:7px;padding:6px 12px;font-size:12px;font-weight:600;cursor:pointer;font-family:'Poppins',sans-serif;transition:all .15s;white-space:nowrap; }
.ts-report-scope .bulk-clear-btn:hover { background:#fee2e2;border-color:#fca5a5;color:#dc2626; }
.ts-report-scope .bulk-log-btn { display:inline-flex;align-items:center;gap:5px;background:#fff;color:var(--brand);border:1.5px solid var(--brand-light);border-radius:7px;padding:6px 12px;font-size:12px;font-weight:600;cursor:pointer;font-family:'Poppins',sans-serif;transition:all .15s;white-space:nowrap;margin-left:auto; }
.ts-report-scope .bulk-log-btn:hover { background:var(--brand-soft); }
.ts-report-scope .btn-reset { font-size:12px;padding:6px 14px;border-radius:8px;border:1.5px solid var(--brand);background:#fff;color:var(--brand);cursor:pointer;font-weight:600;font-family:'Poppins',sans-serif;white-space:nowrap;transition:all .15s;display:inline-flex;align-items:center;gap:5px; }
.ts-report-scope .btn-reset:hover { background:var(--brand-soft); }
.ts-report-scope .cb-cell { width:30px; text-align:center; padding:4px 0 !important; }
.ts-report-scope .cb-cell input[type=checkbox] { cursor:pointer; width:14px; height:14px; accent-color:var(--brand); }

/* AUDIT LOG */
.ts-report-scope .audit-wrap { max-height:400px; overflow-y:auto; }
.ts-report-scope .audit-entry { display:grid; grid-template-columns:110px 140px 1fr; gap:8px; padding:8px 12px; border-bottom:1px solid var(--border); font-size:11px; align-items:start; }
.ts-report-scope .audit-entry:last-child { border-bottom:none; }
.ts-report-scope .audit-who { font-weight:600; color:var(--brand); }
.ts-report-scope .audit-time { color:var(--text2); }
.ts-report-scope .audit-what { color:var(--text); }

/* WEEK DELETE LIST */
.ts-report-scope .week-list { display:flex; flex-direction:column; gap:6px; max-height:280px; overflow-y:auto; margin-bottom:14px; }
.ts-report-scope .week-item { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; border:1px solid var(--border); border-radius:8px; font-size:12px; }
.ts-report-scope .week-item .del-btn { font-size:11px; padding:3px 10px; border-radius:6px; border:1px solid #dc2626; color:#dc2626; background:#fff; cursor:pointer; }
.ts-report-scope .week-item .del-btn:hover { background:#fee2e2; }
.ts-report-scope .week-item .restore-btn { font-size:11px; padding:3px 10px; border-radius:6px; border:1px solid var(--brand); color:var(--brand); background:#fff; cursor:pointer; margin-right:6px; }
.ts-report-scope .week-item .restore-btn:hover { background:var(--brand-soft); }

.ts-report-scope .name-col { font-weight: 500; padding-left: 10px; white-space: nowrap; }
.ts-report-scope .no-res { text-align: center; padding: 40px; color: var(--text2); }

/* MODAL */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 9999; align-items: center; justify-content: center; padding: 20px; }
.overlay.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 400px; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,0.2); border-top: 4px solid var(--brand); }
.modal h3 { font-size: 17px; font-weight: 700; color: var(--brand); margin-bottom: 2px; }
.modal .msub { font-size: 12px; color: var(--text2); margin-bottom: 18px; }
.modal label { font-size: 11px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 8px; }
.ts-report-scope .opts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.ts-report-scope .opt { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 12px; color: var(--text); font-weight: 500; transition: all 0.15s; font-family: 'Poppins', sans-serif; }
.ts-report-scope .opt:hover { border-color: var(--brand-mid); background: var(--brand-soft); }
.ts-report-scope .opt.sel { border: 2px solid var(--brand); padding: 9px 11px; background: var(--brand-soft); }
.ts-report-scope .odot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ts-report-scope .odot.avail { background: var(--avail); }
.ts-report-scope .odot.backup { background: #1d4ed8; }
.ts-report-scope .odot.sick { background: var(--red); }
.ts-report-scope .odot.off { background: #6b7280; }
.ts-report-scope .odot.na { background: #9ca3af; }
.ts-report-scope .odot.holiday { background: #7c3aed; }
.modal input[type=text] { width: 100%; font-size: 13px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); margin-bottom: 8px; font-family: 'Poppins', sans-serif; }
.modal input[type=text]:focus { outline: none; border-color: var(--brand); }
.ts-report-scope .qfills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.ts-report-scope .qf { font-size: 10px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: #f9fafb; color: var(--text2); cursor: pointer; font-family: 'Poppins', sans-serif; }
.ts-report-scope .qf:hover { background: var(--brand-soft); color: var(--brand); }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; }
.ts-report-scope .btn-cancel { background: transparent; border: 1px solid var(--border); padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); font-family: 'Poppins', sans-serif; }
.ts-report-scope .btn-save { background: var(--brand); color: #fff; border: none; padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: 'Poppins', sans-serif; }
.ts-report-scope .btn-save:hover { background: var(--brand-mid); }

/* TOAST */
.ts-report-scope .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--brand); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 12px; font-weight: 500; z-index: 99999; transition: transform 0.25s; pointer-events: none; white-space: nowrap; }
.ts-report-scope .toast.show { transform: translateX(-50%) translateY(0); }

/* INBOX */
.ts-report-scope .inbox-thread-item {padding:12px 14px;border-bottom:1px solid var(--s100);cursor:pointer;transition:background .15s;}
.ts-report-scope .inbox-thread-item:hover {background:var(--s50);}
.ts-report-scope .inbox-thread-item.active {background:var(--gl);border-left:3px solid var(--g);}
.ts-report-scope .inbox-thread-item.unread .it-subject {font-weight:700;color:var(--s900);}
.ts-report-scope .inbox-thread-item.unread .it-preview {color:var(--s600);}
.ts-report-scope .it-subject {font-size:13px;font-weight:500;color:var(--s700);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ts-report-scope .it-meta {font-size:11px;color:var(--s400);margin-top:2px;display:flex;justify-content:space-between;}
.ts-report-scope .it-preview {font-size:12px;color:var(--s400);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ts-report-scope .it-unread-dot {width:8px;height:8px;background:var(--g);border-radius:50%;flex-shrink:0;}
.ts-report-scope .msg-bubble {padding:10px 14px;border-radius:12px;max-width:78%;font-size:13.5px;line-height:1.55;position:relative;}
.ts-report-scope .msg-mine {background:var(--g);color:#fff;align-self:flex-end;border-bottom-right-radius:4px;}
.ts-report-scope .msg-theirs {background:var(--s100);color:var(--s900);align-self:flex-start;border-bottom-left-radius:4px;}
.ts-report-scope .msg-meta {font-size:10.5px;margin-top:4px;opacity:.7;}
.ts-report-scope .msg-read-receipt {font-size:10px;color:rgba(255,255,255,.7);margin-top:2px;text-align:right;}
.ts-report-scope .mention {color:var(--g);font-weight:600;background:var(--gl);padding:1px 4px;border-radius:4px;}
.ts-report-scope .msg-theirs .mention {color:var(--gd);}

/* Legacy team schedule notices (keep scoped) */
.ts-report-scope .notice-card {background:#fff;border:var(--bdr);border-radius:var(--rlg);overflow:hidden;box-shadow:var(--xs);}
.ts-report-scope .notice-card.priority-urgent {border-left:4px solid var(--rd);}
.ts-report-scope .notice-card.priority-important {border-left:4px solid var(--am);}
.ts-report-scope .notice-card.priority-normal {border-left:4px solid var(--g);}
.ts-report-scope .notice-header {padding:14px 18px;border-bottom:1px solid var(--s100);display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.ts-report-scope .notice-title {font-size:14.5px;font-weight:700;color:var(--s900);}
.ts-report-scope .notice-meta {font-size:11.5px;color:var(--s400);margin-top:3px;}
.ts-report-scope .notice-body {padding:14px 18px;font-size:13.5px;color:var(--s700);line-height:1.65;white-space:pre-wrap;}
.ts-report-scope .notice-footer {padding:12px 18px;border-top:1px solid var(--s100);background:var(--s50);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;}
.ts-report-scope .notice-ack-btn {background:var(--g);color:#fff;border:none;padding:8px 16px;border-radius:var(--rmd);font-size:12.5px;font-weight:600;cursor:pointer;font-family:var(--font);transition:var(--tr);}
.ts-report-scope .notice-ack-btn:hover {background:var(--gd);}
.ts-report-scope .notice-ack-btn.done {background:var(--s100);color:var(--s500);cursor:default;}
.ts-report-scope .notice-ack-list {display:flex;flex-wrap:wrap;gap:6px;}
.ts-report-scope .notice-ack-tag {background:var(--gl);color:var(--g);padding:3px 10px;border-radius:20px;font-size:11px;font-weight:600;}
.ts-report-scope .priority-badge {padding:3px 10px;border-radius:20px;font-size:11px;font-weight:700;}
.ts-report-scope .pb-urgent {background:var(--rl);color:var(--rd);}
.ts-report-scope .pb-important {background:var(--al);color:var(--am);}
.ts-report-scope .pb-normal {background:var(--gl);color:var(--g);}

/* CHECK-IN */
.ts-report-scope .checkin-card {background:#fff;border:var(--bdr);border-radius:var(--rlg);padding:14px 18px;display:flex;align-items:center;gap:14px;box-shadow:var(--xs);}
.ts-report-scope .checkin-avatar {width:38px;height:38px;border-radius:50%;background:var(--g);display:flex;align-items:center;justify-content:center;font-size:16px;color:#fff;font-weight:700;flex-shrink:0;}
.ts-report-scope .checkin-info {flex:1;}
.ts-report-scope .checkin-name {font-size:14px;font-weight:600;color:var(--s900);}
.ts-report-scope .checkin-time {font-size:12px;color:var(--s400);margin-top:2px;}
.ts-report-scope .checkin-badge {padding:4px 12px;border-radius:20px;font-size:12px;font-weight:600;}
.ts-report-scope .cb-in {background:var(--gl);color:var(--g);}
.ts-report-scope .cb-out {background:var(--s100);color:var(--s600);}
