/*
 * Sukud design system - account and admin
 * Notifications (row, feed, top bar bell), profile switcher, contact
 * cards, settings and permission rows, quick actions and filter bars.
 */

/* ======================================================================
 * Notifications
 * ====================================================================== */
.sk-notif {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--sk-fg);
  text-decoration: none;
  transition: background-color var(--sk-dur-fast);
}
a.sk-notif:hover { background: var(--sk-surface-hover); }
a.sk-notif:focus-visible { outline: none; box-shadow: var(--sk-focus-ring); }
.sk-notif__lead { position: relative; flex-shrink: 0; display: inline-flex; }
.sk-notif__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--t-soft); color: var(--t-text); }
.sk-notif__badge { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--t-solid); color: var(--t-on); box-shadow: 0 0 0 2px var(--sk-surface-raised); }
.sk-notif__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.sk-notif__title { font-size: var(--sk-text-sm); font-weight: var(--sk-weight-medium); color: var(--sk-fg-muted); }
.sk-notif.is-unread .sk-notif__title { font-weight: var(--sk-weight-semibold); color: var(--sk-fg); }
.sk-notif__body { font-size: var(--sk-text-sm); color: var(--sk-fg-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sk-notif__time { font-size: var(--sk-text-xs); color: var(--sk-fg-subtle); margin-top: 2px; }
.sk-notif.is-unread .sk-notif__time { color: var(--sk-brand-11); font-weight: var(--sk-weight-medium); }
.sk-notif__dot { flex-shrink: 0; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--sk-brand-9); box-shadow: 0 0 0 3px rgb(var(--sk-brand-rgb) / 0.16); }

.sk-notif-feed { display: flex; flex-direction: column; gap: 14px; }
.sk-notif-feed__group { display: flex; flex-direction: column; gap: 2px; }
.sk-notif-feed__label { padding: 0 12px 4px; font-size: var(--sk-text-2xs); font-weight: var(--sk-weight-bold); letter-spacing: var(--sk-tracking-caps); text-transform: uppercase; color: var(--sk-fg-subtle); }

.sk-bell__panel.sk-popover { width: 380px; max-height: min(520px, var(--avail, 520px)); padding: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; }
.sk-bell__panel.is-sheet { max-height: min(82dvh, 640px); padding: 8px 0 calc(8px + var(--sk-safe-bottom)); border-radius: 22px 22px 0 0; }
.sk-bell__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 8px 16px; }
.sk-bell__title { font-family: var(--sk-font-display); font-size: var(--sk-text-md); font-weight: var(--sk-weight-bold); }
.sk-bell__items { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 6px; }
.sk-bell__all { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; border-top: 1px solid var(--sk-border-subtle); color: var(--sk-brand-11); font-size: var(--sk-text-sm); font-weight: var(--sk-weight-semibold); text-decoration: none; transition: background-color var(--sk-dur-fast); }
.sk-bell__all:hover { background: var(--sk-surface-hover); }
.sk-bell__all .sk-icon { transition: transform var(--sk-dur-base) var(--sk-ease-spring); }
.sk-bell__all:hover .sk-icon { transform: translateX(3px); }

/* ======================================================================
 * Profile switcher
 * ====================================================================== */
.sk-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sk-profile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 22px 12px 18px;
  border: 1.5px solid var(--sk-border-subtle);
  border-radius: 22px;
  background: var(--sk-surface);
  color: var(--sk-fg);
  text-align: center;
  text-decoration: none;
  box-shadow: var(--sk-shadow-xs);
  transition: transform var(--sk-dur-base) var(--sk-ease-spring), border-color var(--sk-dur-fast), box-shadow var(--sk-dur-base);
}
[data-theme="dark"] .sk-profile { border-color: var(--sk-border); }
.sk-profile:hover { transform: translateY(-3px); border-color: var(--t-border-strong, var(--sk-border-strong)); box-shadow: var(--sk-shadow-md); }
.sk-profile:active { transform: scale(0.97); }
.sk-profile:focus-visible { outline: none; box-shadow: var(--sk-focus-ring); }
.sk-profile__avatar { position: relative; display: inline-flex; margin-bottom: 8px; transition: transform var(--sk-dur-slow) var(--sk-ease-spring); }
.sk-profile:hover .sk-profile__avatar { transform: scale(1.05); }
.sk-profile__role { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--t-solid); color: var(--t-on); box-shadow: 0 0 0 3px var(--sk-surface); }
.sk-profile__name { font-weight: var(--sk-weight-semibold); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-profile__meta { font-size: var(--sk-text-xs); color: var(--sk-fg-subtle); }
.sk-profile__active { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--t-solid); color: var(--t-on); animation: sk-pop var(--sk-dur-slow) var(--sk-ease-spring); }
.sk-profile__active .sk-icon { stroke-width: 3; }
.sk-profile.is-active { border-color: var(--t-solid); background: linear-gradient(180deg, var(--t-subtle), var(--sk-surface) 70%); }
.sk-profile--add, [data-theme="dark"] .sk-profile--add { border-style: dashed; border-color: var(--sk-border-strong); background: transparent; box-shadow: none; color: var(--sk-fg-muted); }
.sk-profile--add:hover { border-color: var(--sk-brand-8); color: var(--sk-brand-11); }
.sk-profile__add { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 50%; background: var(--sk-surface-sunken); transition: transform var(--sk-dur-slow) var(--sk-ease-spring), background-color var(--sk-dur-fast); }
.sk-profile--add:hover .sk-profile__add { transform: rotate(90deg); background: var(--sk-brand-3); }
button.sk-profile { width: 100%; font: inherit; cursor: pointer; }
.sk-profile-form { display: contents; }
.sk-profile--soon, .sk-profile--soon:hover { cursor: not-allowed; transform: none; border-color: var(--sk-border); color: var(--sk-fg-subtle); }
.sk-profile--soon:hover .sk-profile__add { transform: none; background: var(--sk-surface-sunken); }

/* ======================================================================
 * Contact card
 * ====================================================================== */
.sk-contact-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--sk-border-subtle);
  border-radius: 18px;
  background: var(--sk-surface);
  box-shadow: var(--sk-shadow-xs);
}
[data-theme="dark"] .sk-contact-card { border-color: var(--sk-border); }
.sk-contact-card__text { flex: 1 1 140px; min-width: 0; line-height: 1.3; }
.sk-contact-card__name { font-weight: var(--sk-weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-contact-card__role { font-size: var(--sk-text-sm); color: var(--sk-fg-muted); }
.sk-contact-card__meta { font-size: var(--sk-text-xs); color: var(--sk-fg-subtle); }
.sk-contact-card__actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }

/* ======================================================================
 * Settings rows
 * ====================================================================== */
.sk-settings {
  display: flex; flex-direction: column;
  border: 1px solid var(--sk-border-subtle);
  border-radius: var(--sk-radius-card);
  background: var(--sk-surface);
  box-shadow: var(--sk-shadow-xs);
}
[data-theme="dark"] .sk-settings { border-color: var(--sk-border); }
.sk-settings__head { padding: 16px 18px 6px; }
.sk-settings__title { font-family: var(--sk-font-display); font-size: var(--sk-text-md); font-weight: var(--sk-weight-bold); }
.sk-settings__desc { font-size: var(--sk-text-sm); color: var(--sk-fg-muted); margin-top: 2px; }
.sk-settings__rows { display: flex; flex-direction: column; padding: 0 18px; }
.sk-setting { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 0; }
.sk-setting + .sk-setting { border-top: 1px solid var(--sk-border-subtle); }
.sk-setting__icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--t-soft); color: var(--t-text); }
.sk-setting__text { flex: 1 1 0; min-width: 0; }
.sk-setting__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--sk-text-sm); font-weight: var(--sk-weight-semibold); }
.sk-setting__desc { font-size: var(--sk-text-sm); color: var(--sk-fg-muted); margin-top: 1px; text-wrap: pretty; }
.sk-setting__control { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.sk-setting__control:empty { display: none; }
@media (max-width: 479px) {
  .sk-setting { flex-wrap: wrap; }
  .sk-setting__control:has(.sk-select, .sk-segmented, .sk-input, .sk-btn:not(.sk-btn--icon)) { width: 100%; }
  .sk-setting__control:has(.sk-select, .sk-segmented, .sk-input) > * { flex: 1 1 auto; }
}

/* ======================================================================
 * Quick actions
 * ====================================================================== */
.sk-quicks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sk-quick {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--sk-border-subtle);
  border-radius: 20px;
  background: var(--sk-surface);
  color: var(--sk-fg);
  text-decoration: none;
  box-shadow: var(--sk-shadow-xs);
  transition: transform var(--sk-dur-base) var(--sk-ease-spring), box-shadow var(--sk-dur-base), border-color var(--sk-dur-fast);
}
[data-theme="dark"] .sk-quick { border-color: var(--sk-border); }
.sk-quick:hover { transform: translateY(-2px); border-color: var(--t-border); box-shadow: var(--sk-shadow-md); }
.sk-quick:active { transform: scale(0.97); }
.sk-quick:focus-visible { outline: none; box-shadow: var(--sk-focus-ring); }
.sk-quick__icon { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--t-soft); color: var(--t-text); transition: background-color var(--sk-dur-fast), color var(--sk-dur-fast); }
.sk-quick:hover .sk-quick__icon { background: var(--t-solid); color: var(--t-on); }
.sk-quick__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sk-quick__label { font-size: var(--sk-text-sm); font-weight: var(--sk-weight-semibold); }
.sk-quick__meta { font-size: var(--sk-text-xs); color: var(--sk-fg-subtle); }
.sk-quick > .sk-count { flex-shrink: 0; }

/* ======================================================================
 * Filters
 * ====================================================================== */
/* Filters: search and the key toggle, the Filters button on the right, the
   other filters on the page below (no box). */
.sk-filters { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sk-filters__bar { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; }
.sk-filters__search { flex: 1 1 260px; min-width: 0; max-width: 440px; }
.sk-filters__quick { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.sk-filters__quick::-webkit-scrollbar { display: none; }
.sk-filters__toggle { margin-inline-start: auto; flex-shrink: 0; }
.sk-filters__more { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; animation: sk-rise var(--sk-dur-base) var(--sk-ease-out) backwards; }
.sk-filters__more > :is(.sk-select, .sk-input, .sk-field, .sk-date) { flex: 1 1 180px; min-width: 0; max-width: 260px; }
.sk-filters__summary { margin: 0; font-size: var(--sk-text-sm); color: var(--sk-fg-muted); }
.sk-filters__summary b { color: var(--sk-fg); }
@media (max-width: 559.98px) {
  .sk-filters__search { flex-basis: 100%; max-width: none; }
  .sk-filters__more > :is(.sk-select, .sk-input, .sk-field, .sk-date) { flex-basis: calc(50% - 4px); max-width: none; }
}

/* Dashboard while an application is in review (shared/pending_approval_content.html) */
.sk-review { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 520px; margin: 0 auto; }
.sk-review__facts { padding: 4px 18px; border-radius: 18px; background: var(--sk-surface); border: 1px solid var(--sk-border-subtle); box-shadow: var(--sk-shadow-xs); }

/* In-page filter chips (ui.filter_chips) */
.sk-filter-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; -webkit-overflow-scrolling: touch; }
.sk-filter-chips::-webkit-scrollbar { display: none; }
.sk-filter-chips > .sk-chip { flex-shrink: 0; }

/* A notification with an action at its end (the notifications page) */
.sk-notif-row { position: relative; display: flex; align-items: center; gap: 4px; border-radius: 16px; transition: opacity var(--sk-dur-base), transform var(--sk-dur-base) var(--sk-ease-out); }
.sk-notif-row > .sk-notif { flex: 1 1 auto; min-width: 0; }
.sk-notif-row__action { flex-shrink: 0; padding-inline-end: 6px; opacity: 0.55; transition: opacity var(--sk-dur-fast); }
.sk-notif-row:hover .sk-notif-row__action, .sk-notif-row:focus-within .sk-notif-row__action { opacity: 1; }
@media (hover: none) { .sk-notif-row__action { opacity: 1; } }
.sk-notif-row.htmx-swapping { opacity: 0; transform: translateX(24px); }

/* Profile photo picker (ui.avatar_upload) */
.sk-avatar-upload__row { display: flex; align-items: center; gap: 18px; }
.sk-avatar-upload__preview { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 88px; height: 88px; border-radius: 50%; overflow: hidden; background: var(--sk-surface-sunken); box-shadow: 0 0 0 4px var(--sk-surface), 0 0 0 5px var(--sk-border-subtle); }
.sk-avatar-upload__preview img { width: 100%; height: 100%; object-fit: cover; animation: sk-pop var(--sk-dur-slow) var(--sk-ease-spring); }
.sk-avatar-upload__preview .sk-avatar { --size: 88px; }

/* Profile page header (ui.profile_header) */
.sk-profile-head { display: flex; align-items: center; gap: 22px; padding: 22px; border-radius: 24px; background: radial-gradient(120% 140% at 0% 0%, var(--sk-brand-3), var(--sk-surface) 55%); border: 1px solid var(--sk-border-subtle); box-shadow: var(--sk-shadow-xs); container-type: inline-size; flex-wrap: wrap; }
.sk-profile-head__text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sk-profile-head__name { font-family: var(--sk-font-display); font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.1rem); font-weight: var(--sk-weight-black); letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.sk-profile-head__handle { color: var(--sk-fg-muted); }
.sk-profile-head__id { display: inline-flex; align-items: center; gap: 8px; font-size: var(--sk-text-xs); color: var(--sk-fg-subtle); }
.sk-profile-head__id code { font-family: var(--sk-font-mono); font-size: var(--sk-text-xs); padding: 2px 8px; border-radius: 8px; background: var(--sk-surface-sunken); color: var(--sk-fg); }
.sk-profile-head__copy { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--sk-fg-muted); cursor: pointer; }
.sk-profile-head__copy:hover { background: var(--sk-surface-hover); color: var(--sk-fg); }
.sk-profile-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .sk-profile-head { flex-direction: column; text-align: center; } .sk-profile-head__text { align-items: center; flex-basis: auto; } .sk-profile-head .sk-cluster, .sk-profile-head__actions { justify-content: center; } }
