/* 360 Degree M Dashboard v83 attendance, CRUD and brand safety */

/* Hard safety bounds prevent a stale stylesheet from ever rendering the logo full-screen. */
img.sidebar-brand-image {
  display: block !important;
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  max-height: 54px !important;
  object-fit: contain !important;
  position: static !important;
  transform: none !important;
}
img.header-brand-image {
  display: block !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  object-fit: contain !important;
  position: static !important;
  transform: none !important;
}
.boot-brand-image { width: 104px !important; height: 104px !important; max-width: 104px !important; max-height: 104px !important; }

.btn-danger-soft {
  border: 1px solid rgba(239,68,68,.35);
  background: rgba(239,68,68,.08);
  color: var(--red);
}
.btn-danger-soft:hover { background: rgba(239,68,68,.14); }
.modal-header-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.field-help { margin-top:5px; color:var(--text3); font-size:11px; }

.attendance-page-actions,
.attendance-manager-actions,
.attendance-quick-actions,
.attendance-sheet-filters,
.member-attendance-toolbar {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.attendance-page-actions { justify-content:flex-end; }
.attendance-action-intro {
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px;
  border:1px solid var(--border);
  background:var(--border2);
  border-radius:12px;
  margin-bottom:16px;
}
.attendance-action-icon {
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:12px;
  color:var(--purple);
  background:var(--purple-light);
  flex:0 0 42px;
}
.attendance-action-intro strong { display:block; font-size:14px; }
.attendance-action-intro span { display:block; color:var(--text2); font-size:12px; margin-top:2px; }

.attendance-sheet-card { padding:0; overflow:hidden; margin-top:16px; }
.attendance-sheet-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:16px;
  border-bottom:1px solid var(--border);
}
.attendance-sheet-head h3 { font-size:15px; margin:0 0 3px; }
.attendance-sheet-head p { margin:0; color:var(--text2); font-size:12px; }
.attendance-sheet-wrap {
  width:100%;
  overflow:auto;
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
  border-bottom:1px solid var(--border);
}
.attendance-sheet-wrap.compact { max-height:420px; border:1px solid var(--border); border-radius:12px; }
.attendance-sheet {
  width:max-content;
  min-width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:11px;
}
.attendance-sheet th,
.attendance-sheet td {
  height:44px;
  min-width:38px;
  padding:3px;
  text-align:center;
  border-right:1px solid var(--border2);
  border-bottom:1px solid var(--border2);
  background:var(--card);
}
.attendance-sheet thead th {
  position:sticky;
  top:0;
  z-index:4;
  background:var(--card-hover);
  color:var(--text2);
  font-weight:700;
}
.attendance-sheet-person-col,
.attendance-sheet-person {
  position:sticky !important;
  left:0;
  z-index:5 !important;
  min-width:180px !important;
  max-width:180px;
  text-align:left !important;
  box-shadow:1px 0 0 var(--border);
}
.attendance-sheet thead .attendance-sheet-person-col { z-index:7 !important; }
.attendance-sheet-person button {
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  display:flex;
  align-items:center;
  gap:8px;
  text-align:left;
  cursor:pointer;
}
.attendance-sheet-person button > span:last-child { min-width:0; }
.attendance-sheet-person strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.attendance-sheet-person small { display:block; color:var(--text3); margin-top:1px; font-weight:500; }
.avatar-xs { width:26px; height:26px; font-size:9px; flex:0 0 26px; }
.attendance-sheet-day span { display:block; color:var(--text); }
.attendance-sheet-day small { display:block; font-size:9px; color:var(--text3); }
.attendance-sheet-day.is-holiday { background:rgba(123,97,255,.07); }
.attendance-sheet-cell {
  width:30px;
  height:30px;
  border:0;
  border-radius:8px;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
  transition:transform .12s ease, filter .12s ease;
}
.attendance-sheet-cell:hover { transform:scale(1.08); filter:brightness(.97); }
.status-present { color:#15803d; background:rgba(34,197,94,.14); }
.status-work-from-home { color:#6d28d9; background:rgba(123,97,255,.14); }
.status-half-day,
.status-leave { color:#b45309; background:rgba(245,158,11,.15); }
.status-absent { color:#b91c1c; background:rgba(239,68,68,.14); }
.status-holiday { color:#6d28d9; background:rgba(123,97,255,.1); }
.status-missing { color:#b91c1c; background:rgba(239,68,68,.08); border:1px dashed rgba(239,68,68,.35); }
.status-future { color:var(--text3); background:transparent; }
.attendance-sheet-summary { min-width:34px !important; }
.summary-number { font-weight:800; }
.summary-number.office { color:#15803d; }
.summary-number.wfh { color:#6d28d9; }
.summary-number.leave { color:#b45309; }
.summary-number.absent,
.summary-number.missing { color:#b91c1c; }
.attendance-sheet-legend {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  padding:10px 14px 14px;
  color:var(--text2);
  font-size:11px;
}
.attendance-sheet-legend span { display:flex; align-items:center; gap:5px; }
.attendance-sheet-legend i {
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border-radius:6px;
  font-style:normal;
  font-weight:800;
  font-size:9px;
}
.legend-office { color:#15803d; background:rgba(34,197,94,.14); }
.legend-wfh { color:#6d28d9; background:rgba(123,97,255,.14); }
.legend-leave { color:#b45309; background:rgba(245,158,11,.15); }
.legend-absent,.legend-missing { color:#b91c1c; background:rgba(239,68,68,.12); }
.legend-holiday { color:#6d28d9; background:rgba(123,97,255,.1); }

.attendance-row-v83 { grid-template-columns:minmax(180px,1.5fr) minmax(110px,.9fr) minmax(90px,.7fr) minmax(90px,.7fr) minmax(130px,.9fr) auto; }
.attendance-row-v83 .attendance-status { display:flex; gap:5px; flex-wrap:wrap; }
.attendance-row-v83 .attendance-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.attendance-own-card.is-pending { border-color:rgba(245,158,11,.35); }

.member-detail-header h3 { white-space:nowrap; }
.member-detail-body { padding-top:14px; }
.member-profile-hero { display:flex; align-items:center; gap:13px; margin-bottom:14px; }
.member-profile-hero .avatar { width:52px; height:52px; font-size:18px; }
.member-profile-hero h2 { font-size:18px; margin:0 0 5px; }
.member-profile-hero .tag + .tag { margin-left:5px; }
.member-detail-tabs { display:flex; gap:4px; padding:4px; background:var(--border2); border-radius:10px; margin-bottom:14px; }
.member-detail-tabs button { flex:1; border:0; background:transparent; color:var(--text2); padding:9px 12px; border-radius:8px; font-weight:700; cursor:pointer; }
.member-detail-tabs button.active { background:var(--card); color:var(--purple); box-shadow:var(--shadow); }
.member-work-summary,
.member-attendance-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:14px; }
.member-work-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
.member-work-summary > div,
.member-attendance-kpis > div { padding:10px; border:1px solid var(--border); border-radius:10px; background:var(--card-hover); text-align:center; }
.member-work-summary strong,
.member-attendance-kpis strong { display:block; font-size:17px; }
.member-work-summary span,
.member-attendance-kpis span { display:block; color:var(--text3); font-size:10px; margin-top:2px; }
.member-section-title { font-size:13px; margin:16px 0 8px; }
.member-attendance-toolbar { justify-content:space-between; margin-bottom:10px; }
.team-card-actions { flex-wrap:wrap; }
.attendance-empty { padding:22px; text-align:center; color:var(--text2); }

@media (max-width: 900px) {
  .attendance-row-v83 { grid-template-columns:1fr 1fr; gap:12px; }
  .attendance-row-v83 .attendance-person { grid-column:1 / -1; }
  .attendance-row-v83 .attendance-status,
  .attendance-row-v83 .attendance-actions,
  .attendance-row-v83 .attendance-lock { grid-column:1 / -1; justify-content:flex-start; }
}

@media (max-width: 640px) {
  img.sidebar-brand-image { width:48px !important; height:48px !important; min-width:48px !important; max-width:48px !important; max-height:48px !important; }
  img.header-brand-image { width:27px !important; height:27px !important; min-width:27px !important; max-width:27px !important; max-height:27px !important; }
  .page-header-top { align-items:flex-start; }
  .attendance-page-actions { width:100%; justify-content:flex-start; }
  .attendance-page-actions > *,
  .attendance-quick-actions,
  .attendance-manager-actions { width:100%; }
  .attendance-quick-actions .btn,
  .attendance-manager-actions .btn { flex:1 1 140px; justify-content:center; }
  .attendance-sheet-head { flex-direction:column; }
  .attendance-sheet-filters { width:100%; }
  .attendance-sheet-filters .field-input { flex:1 1 150px; width:auto; }
  .attendance-sheet-person-col,
  .attendance-sheet-person { min-width:145px !important; max-width:145px; }
  .attendance-sheet th,.attendance-sheet td { min-width:34px; }
  .attendance-sheet-cell { width:27px; height:27px; border-radius:7px; }
  .attendance-row-v83 { grid-template-columns:1fr; }
  .attendance-row-v83 .attendance-person,
  .attendance-row-v83 .attendance-status,
  .attendance-row-v83 .attendance-actions,
  .attendance-row-v83 .attendance-lock { grid-column:auto; }
  .attendance-row-v83 .attendance-actions .btn { flex:1; justify-content:center; }
  .modal-header { gap:7px; }
  .modal-header-actions { gap:5px; }
  .modal-header-actions .btn { padding-inline:9px; }
  .member-work-summary,
  .member-attendance-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .member-work-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .member-attendance-toolbar { align-items:stretch; }
  .member-attendance-toolbar > * { flex:1; }
}

/* Working-hour totals were intentionally removed from the attendance experience. */
.attendance-hours,
.attendance-working-hours,
.cumulative-hours,
[data-attendance-hours] { display:none !important; }
