/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Site Responsibility Matrix â€” Custom CSS
   Drop into: Application Settings â†’ Custom CSS/JS â†’ Custom CSS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Base Container â”€â”€ */
#srm-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
  color: #1a1a2e;
  line-height: 1.5;
}

/* â”€â”€ Header â”€â”€ */
.srm-header {
  margin-bottom: 24px;
}
.srm-header h2 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0d1b3e;
}
.srm-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 0.92rem;
}

/* â”€â”€ Controls â”€â”€ */
.srm-controls {
  margin-bottom: 24px;
}
.srm-control-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
#srm-sites {
  flex: 0 0 300px;
  padding: 10px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
#srm-sites:focus {
  outline: none;
  border-color: #5190ef;
  box-shadow: 0 0 0 3px rgba(81, 144, 239, 0.15);
}
#srm-filter {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 0.95rem;
}
#srm-filter:focus {
  outline: none;
  border-color: #5190ef;
  box-shadow: 0 0 0 3px rgba(81, 144, 239, 0.15);
}
#srm-filter:disabled {
  background: #f9fafb;
  cursor: not-allowed;
  color: #aaa;
}
.srm-btn {
  padding: 10px 18px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.srm-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #b0b7c3;
}
.srm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.srm-btn-active {
  background: #eef2ff;
  border-color: #5190ef;
  color: #3b6fd4;
}

/* â”€â”€ Stats Bar â”€â”€ */
.srm-stats {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 16px;
}
.srm-stats strong {
  color: #1a1a2e;
}
.srm-legend {
  display: flex;
  gap: 12px;
  margin-left: auto;
  font-size: 0.78rem;
}
.srm-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.srm-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.srm-legend-dot.owner { background: #1565c0; }
.srm-legend-dot.admin { background: #2e7d32; }
.srm-legend-dot.custodian { background: #e65100; }

/* â”€â”€ Placeholder / Loading / Error States â”€â”€ */
.srm-placeholder, .srm-loading {
  text-align: center;
  padding: 80px 20px;
  color: #9ca3af;
}
.srm-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 16px;
  opacity: 0.6;
}
.srm-placeholder p, .srm-loading p {
  margin: 0;
  font-size: 0.95rem;
}
.srm-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #5190ef;
  border-radius: 50%;
  animation: srm-spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes srm-spin {
  to { transform: rotate(360deg); }
}
.srm-error {
  text-align: center;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0;
}

/* â”€â”€ Card View â”€â”€ */
.srm-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.srm-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s ease;
}
.srm-card:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.srm-card-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  background: #fafbfc;
  transition: background 0.12s ease;
  user-select: none;
}
.srm-card-header:hover {
  background: #f0f4f8;
}
.srm-card-title {
  font-weight: 600;
  flex: 1;
  font-size: 0.95rem;
  color: #1a1a2e;
}
.srm-card-count {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-right: 10px;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
}
.srm-chevron {
  transition: transform 0.2s ease;
  color: #9ca3af;
  font-size: 0.85rem;
}
.srm-card.open .srm-chevron {
  transform: rotate(90deg);
}
.srm-card.open {
  border-color: #c7d2fe;
}
.srm-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.srm-card.open .srm-card-body {
  max-height: 3000px;
}

/* â”€â”€ Activity Rows â”€â”€ */
.srm-activity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  border-top: 1px solid #f3f4f6;
  font-size: 0.87rem;
  gap: 16px;
  transition: background 0.1s;
}
.srm-activity:hover {
  background: #f9fafb;
}
.srm-act-name {
  flex: 1;
  color: #4b5563;
  min-width: 0;
  line-height: 1.4;
}
.srm-act-assign {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.srm-entity-name {
  font-weight: 500;
  color: #1a1a2e;
  font-size: 0.87rem;
}

/* â”€â”€ Role Badges â”€â”€ */
.srm-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.srm-owner {
  background: #dbeafe;
  color: #1e40af;
}
.srm-admin {
  background: #d1fae5;
  color: #065f46;
}
.srm-custodian {
  background: #ffedd5;
  color: #c2410c;
}
.srm-other {
  background: #f3e8ff;
  color: #6b21a8;
}

/* â”€â”€ No Data in Card â”€â”€ */
.srm-no-data {
  padding: 16px 18px;
  color: #9ca3af;
  font-style: italic;
  font-size: 0.85rem;
  margin: 0;
  border-top: 1px solid #f3f4f6;
}

/* â”€â”€ Summary Row (top of card body) â”€â”€ */
.srm-card-summary {
  display: flex;
  gap: 16px;
  padding: 10px 18px 6px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  flex-wrap: wrap;
}
.srm-summary-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}
.srm-summary-label {
  color: #6b7280;
}
.srm-summary-value {
  font-weight: 600;
  color: #1a1a2e;
}

/* â”€â”€ Table View â”€â”€ */
.srm-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  max-height: 70vh;
  overflow-y: auto;
}
.srm-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}
.srm-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
.srm-table th {
  background: #f1f5f9;
  padding: 10px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #374151;
}
.srm-th-sticky, .srm-td-sticky {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 180px;
  max-width: 180px;
  border-right: 2px solid #cbd5e1 !important;
}
.srm-th-sticky {
  background: #e8edf4;
  z-index: 11;
}
.srm-td-sticky {
  background: #fff;
  font-weight: 600;
  color: #1a1a2e;
}
.srm-table tbody tr:hover .srm-td-sticky {
  background: #f8fafc;
}
.srm-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  line-height: 1.35;
}
.srm-table tbody tr:hover td {
  background: #f8fafc;
}
.srm-cell-owner { background: rgba(219, 234, 254, 0.3); }
.srm-cell-admin { background: rgba(209, 250, 229, 0.3); }
.srm-cell-custodian { background: rgba(255, 237, 213, 0.3); }
.srm-cell-empty {
  color: #e5e7eb;
  text-align: center;
  font-size: 0.9rem;
}
.srm-cell small {
  display: block;
  color: #9ca3af;
  font-size: 0.7rem;
  margin-top: 1px;
}
.srm-table-count {
  text-align: right;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 8px;
  padding-right: 4px;
}

/* â”€â”€ Expand All / Collapse All â”€â”€ */
.srm-expand-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}
.srm-expand-btn {
  background: none;
  border: none;
  color: #5190ef;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
}
.srm-expand-btn:hover {
  background: #eef2ff;
}

/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 768px) {
  #srm-app {
    padding: 16px 12px;
  }
  .srm-header h2 {
    font-size: 1.3rem;
  }
  .srm-control-row {
    flex-direction: column;
  }
  #srm-sites {
    flex: 1 1 auto;
    width: 100%;
  }
  .srm-legend {
    display: none;
  }
  .srm-activity {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .srm-act-assign {
    padding-left: 12px;
  }
}

/* â”€â”€ Print Styles â”€â”€ */
@media print {
  .srm-controls, .srm-expand-bar { display: none; }
  .srm-card.open .srm-card-body { max-height: none; }
  .srm-card { break-inside: avoid; }
}