/* Aviveil Components: AvatarGroup, Tasks, Modals, Timeline, Overlays */

/* Avatar Group (reimplementation of MUI AvatarGroup) */
.ag {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  vertical-align: middle;
}

.av {
  position: relative;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  border: 2px solid var(--bg);
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  font-size: calc(var(--s) * .38);
  color: #25252b;
  flex: none;
  box-sizing: border-box;
  margin: 0;
}

.ag > * {
  margin-left: calc(var(--s, 34px) * -.3);
}

.ag > *:last-child {
  margin-left: 0;
}

.av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.av.ov2 {
  background: var(--p2);
  color: var(--tx);
}

/* Task cards */
.tk {
  background: var(--p2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.tk select {
  padding: 3px 6px;
  font-size: 12px;
  margin-top: 6px;
}

/* Progress bar */
.bar {
  height: 5px;
  background: var(--p2);
  border-radius: 5px;
  margin: 8px 0 2px;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--g);
  border-radius: 5px;
}

/* Modal overlay & Dialogs */
.ov {
  position: fixed;
  inset: 0;
  background: #000a;
  display: grid;
  place-items: center;
  z-index: 1050;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.md {
  background: var(--p);
  border: 1px solid var(--ln);
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-sizing: border-box;
}

.md label {
  display: block;
  margin-bottom: 10px;
  color: var(--mu);
  font-size: 12px;
}

.md input:not([type=checkbox]),
.md select,
.md textarea {
  width: 100%;
  margin-top: 4px;
}

.in {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--tx) !important;
  font-size: 14px !important;
}

.bt {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 600px) {
  .md {
    padding: 16px;
    max-height: calc(100dvh - 32px);
    border-radius: 12px;
  }
  .bt button {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 13.5px;
    touch-action: manipulation;
  }
  .in {
    min-height: 38px;
  }
  .in input[type=checkbox] {
    width: 18px;
    height: 18px;
  }
}

/* Event-day Run Sheet Timeline */
.tl {
  margin-top: 8px;
}

.ti {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 10px 18px;
  border-left: 2px solid var(--ln);
  position: relative;
  margin-left: 6px;
}

.ti > i {
  position: absolute;
  left: -7px;
  top: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--mu);
}

.ti.done > i {
  background: var(--g);
  border-color: var(--g);
}

.ti.done {
  opacity: .7;
}

.ti.doing > i {
  background: var(--y);
  border-color: var(--y);
}

.ti.late > i {
  border-color: var(--r);
  background: var(--r);
}

.ti.late .mu {
  color: var(--r);
}

/* Event Day Timeline Table */
.rt{border:1px solid var(--ln);border-radius:12px;overflow:hidden;background:var(--p)}
.rh,.rr{display:grid;grid-template-columns:66px 66px 74px 1fr 76px;gap:0 6px;padding:0 10px;align-items:start}
.rr{grid-template-areas:"s e d a x";border-top:1px solid var(--ln);padding-top:5px;padding-bottom:5px;border-left:3px solid transparent}
.rh{background:var(--p2);color:var(--mu);font-size:12px;padding-top:8px;padding-bottom:8px;align-items:center}
.rh span{padding:0 6px}
.rr.now{background:var(--p2);border-left-color:var(--g)}
.c-s{grid-area:s}.c-e{grid-area:e}.c-d{grid-area:d}.c-a{grid-area:a}.c-x{grid-area:x}

.rr .tm{padding:5px 6px;text-align:center;font-variant-numeric:tabular-nums}
.rr .ta{padding:5px 6px;white-space:pre-wrap;line-height:1.5}

.rr.rep .tm.s,.rr.rep .tm:not(.s):not(.mu){opacity:.3}
.rr.rep .tm.mu{opacity:1}
.rr.hl .ta{font-weight:600}
.rr.hl .tm.s{color:var(--a);font-weight:600}
.rr.late .tm.s{color:var(--r)}
.rr.done .c-s,.rr.done .c-e,.rr.done .c-d,.rr.done .ta{opacity:.45}
.rdb{padding:0 6px}

.c-x{display:flex;justify-content:flex-end;opacity:.55}
.rr:hover .c-x,.rr:focus-within .c-x{opacity:1}
.c-x button{background:none;border:0;width:28px;height:28px;padding:0;display:grid;place-items:center;color:var(--mu);border-radius:6px;cursor:pointer}
.c-x button:hover{color:var(--tx);background:var(--p2)}
.c-x svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Row edit mode */
.rr.ed{background:var(--p2)}
.rr.ed input,.rr.ed textarea{background:var(--bg);border:1px solid var(--ln);border-radius:6px;padding:4px 6px;width:100%;box-sizing:border-box;font:inherit;line-height:1.5;resize:none;overflow:hidden;color:var(--tx)}
.rr.ed input{text-align:center;font-variant-numeric:tabular-nums}
.rr.ed input:focus,.rr.ed textarea:focus{outline:none;border-color:var(--a)}
.rr.ed .er{border-color:var(--r)}
.red{display:flex;align-items:center;gap:8px;margin-top:6px}
.red .rer{margin-left:auto;font-size:12px;color:var(--r)}

/* Input sheet (Bảng nhập) & Legacy stubs */
.sgw{border:1px solid var(--ln);border-radius:12px;overflow:auto;max-height:65vh;background:var(--p);width:100%;max-width:100%;box-sizing:border-box}
.sgw table.sg, table.sg{border-collapse:collapse;width:100%;min-width:560px}
div.sg{min-width:0;max-width:100%;width:100%}
.sg th,.sg td{border:1px solid var(--ln);padding:0;vertical-align:top}
.sg thead th{position:sticky;top:0;background:var(--p2);color:var(--mu);font-weight:500;font-size:12px;padding:4px 6px;z-index:2}
.sg thead tr.rl th{top:26px;padding:2px 4px}
.sg th.rn0{position:sticky;left:0;z-index:1;background:var(--p2);color:var(--mu);font-weight:400;font-size:12px;width:36px;min-width:36px;text-align:center;padding:6px 0}
.sg td:nth-child(2),.sg td:nth-child(3),.sg td:nth-child(4){min-width:92px}
.sg td:nth-child(n+5){min-width:120px}
.sg td:last-child{min-width:260px}
.sg textarea{display:block;width:100%;box-sizing:border-box;border:0;background:transparent;font:inherit;line-height:1.5;padding:5px 7px;resize:none;overflow:hidden;color:var(--tx)}
.sg textarea:focus{outline:2px solid var(--a);outline-offset:-2px;background:var(--bg)}
.sg tr.sk td{opacity:.5}
.sg tr.nt td{background:var(--p2)}
.sg select{width:100%;font-size:12px;background:transparent;border:1px solid transparent;border-radius:4px;color:var(--mu);cursor:pointer}
.sg select:hover{border-color:var(--ln)}
.sg select.mn{color:var(--a);font-weight:600}

/* Segmented view switcher (legacy support) */
.seg{display:inline-flex;border:1px solid var(--ln);border-radius:6px;overflow:hidden}
.seg button{background:none;border:0;padding:5px 10px;font-size:12px;color:var(--mu);cursor:pointer}
.seg button.on{background:var(--p2);color:var(--tx);font-weight:600}

.rs-add{padding:8px 10px;border-top:1px solid var(--ln)}
textarea.rn{width:100%;box-sizing:border-box;min-height:96px;resize:none;line-height:1.7;margin-top:6px;overflow:hidden}

/* ====================================================================
 * Event Day Timeline Spreadsheet Grid & Present View
 * ==================================================================== */

.tl-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tl-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tl-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-title-input {
  font-size: 16px;
  font-weight: 600;
  color: var(--tx);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  transition: border-color 0.15s ease;
}

.tl-title-input:hover {
  border-color: var(--ln);
}

.tl-title-input:focus {
  outline: none;
  background: var(--p);
  border-color: var(--a);
}

.tl-date-input {
  background: var(--p);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--tx);
  transition: border-color 0.15s ease;
}

.tl-date-input:focus {
  outline: none;
  border-color: var(--a);
}

.tl-save-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.tl-save-badge.saved {
  color: var(--g);
  background: rgba(34, 197, 94, 0.08);
}

.tl-save-badge.saving {
  color: var(--a);
  background: rgba(168, 85, 247, 0.08);
  animation: pulse 1s infinite alternate;
}

.tl-btn-present {
  background: var(--a) !important;
  color: #fff !important;
  font-weight: 600;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tl-btn-present:hover {
  filter: brightness(1.1);
}

.tl-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tl-overflow-wrap {
  position: relative;
  display: inline-block;
}

.tl-overflow-btn {
  font-size: 16px;
  padding: 4px 10px !important;
  line-height: 1;
}

.tl-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--p2);
  border: 1px solid var(--ln);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 60;
  display: none;
  min-width: 180px;
  padding: 4px 0;
}

.tl-dropdown.open {
  display: block;
}

.tl-dropdown button,
.tl-ctx-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--tx);
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease;
}

.tl-dropdown button:hover,
.tl-ctx-menu button:hover {
  background: var(--p);
}

.tl-dropdown button svg,
.tl-ctx-menu button svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.tl-divider {
  height: 1px;
  background: var(--ln);
  margin: 4px 0;
}

.tl-item-danger {
  color: var(--r) !important;
}

.tl-item-danger:hover {
  background: rgba(244, 63, 94, 0.12) !important;
}

.tl-grid-wrap {
  border: 1px solid var(--ln);
  border-radius: 12px;
  overflow: auto;
  max-height: 68vh;
  background: var(--p);
  position: relative;
  outline: none;
}

.tl-grid-wrap:focus-visible {
  border-color: var(--a);
}

.tl-grid {
  border-collapse: collapse;
  width: 100%;
  min-width: 580px;
}

.tl-grid th,
.tl-grid td {
  border: 1px solid var(--ln);
  padding: 0;
  vertical-align: middle;
}

.tl-grid thead th {
  position: sticky;
  top: 0;
  background: var(--p2);
  color: var(--mu);
  font-weight: 500;
  font-size: 12px;
  padding: 6px 8px;
  z-index: 3;
  text-align: left;
  user-select: none;
}

.tl-th-idx {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center !important;
}

.tl-th-start,
.tl-th-end {
  width: 76px;
  min-width: 76px;
  text-align: center !important;
}

.tl-th-dur {
  width: 80px;
  min-width: 80px;
  text-align: center !important;
}

.tl-th-act {
  min-width: 280px;
}

.tl-tr {
  background: transparent;
  transition: background 0.1s ease;
}

.tl-tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tl-tr-tail {
  opacity: 0.75;
}

.tl-tr-tail:hover {
  opacity: 1;
}

.tl-td-idx {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--p2);
  color: var(--mu);
  font-size: 11px;
  text-align: center;
  width: 44px;
  min-width: 44px;
  user-select: none;
  cursor: grab;
  padding: 4px 2px;
}

.tl-td-idx:hover .tl-drag-handle {
  opacity: 1;
}

.tl-drag-handle {
  margin-left: 2px;
  opacity: 0.35;
  font-size: 10px;
  cursor: grab;
  vertical-align: middle;
  transition: opacity 0.15s ease;
}

.tl-td-cell {
  position: relative;
  padding: 0;
  height: 34px;
  cursor: cell;
}

.tl-td-cell.active,
.tl-td-note.active {
  outline: 2px solid var(--a) !important;
  outline-offset: -2px;
  z-index: 2;
  position: relative;
  background: rgba(168, 85, 247, 0.08);
}

.tl-td-cell.in-range,
.tl-td-note.in-range {
  background: rgba(168, 85, 247, 0.14) !important;
}

.tl-cell-val {
  display: block;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre-wrap;
  word-break: break-word;
}

.tl-td-start .tl-cell-val,
.tl-td-end .tl-cell-val,
.tl-td-dur .tl-cell-val {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tl-cell-input {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  background: var(--bg);
  font: inherit;
  font-size: 13px;
  color: var(--tx);
  padding: 6px 8px;
}

input.tl-cell-input {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

textarea.tl-cell-input {
  resize: none;
  overflow: hidden;
  line-height: 1.4;
}

.tl-tr-note {
  background: rgba(244, 63, 94, 0.06);
}

.tl-td-note {
  border-left: 3px solid var(--r) !important;
  padding: 8px 12px;
  cursor: cell;
}

.tl-note-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--tx);
  line-height: 1.5;
  font-style: italic;
}

.tl-cell-note-input {
  background: var(--bg);
  border: 1px solid var(--r);
  border-radius: 4px;
  min-height: 32px;
  font-style: italic;
}

.tl-tr-hl {
  background: rgba(168, 85, 247, 0.04);
}

.tl-tr-hl .hl-time,
.hl-time {
  color: var(--r) !important;
  font-weight: 700;
}

.tl-tr-hl .hl-title,
.hl-title {
  font-weight: 700;
}

.tl-empty-overlay {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tl-empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--mu);
  font-size: 13px;
  background: rgba(22, 23, 27, 0.88);
  backdrop-filter: blur(4px);
  padding: 24px 32px;
  border-radius: 12px;
  border: 1px dashed var(--ln);
  pointer-events: auto;
  text-align: center;
  max-width: 440px;
}

.tl-empty-hint svg {
  color: var(--mu);
  opacity: 0.7;
}

.tl-ctx-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: transparent;
}

.tl-ctx-menu {
  position: fixed;
  z-index: 101;
  background: var(--p2);
  border: 1px solid var(--ln);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: 180px;
  padding: 4px 0;
  animation: fadeIn 0.1s ease;
}

.tl-present-note {
  background: rgba(244, 63, 94, 0.08);
  border-left: 3px solid var(--r);
  border-top: 1px solid var(--ln);
  padding: 8px 14px;
}

.tl-present-note-inner {
  font-size: 13px;
  font-weight: 500;
  color: var(--tx);
  line-height: 1.5;
  font-style: italic;
}

@media(max-width:640px){
  .rh{display:none}
  .rr{grid-template-columns:1fr 1fr 1fr 76px;grid-template-areas:"s e d x" "a a a a"}
  .c-x{opacity:.8}
  .sg textarea{font-size:16px}
  .tl-grid-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
}


/* ====================================================================
 * Presence Indicator Badge (Fluent UI / Material UI variant="dot" overlap="circular")
 * ==================================================================== */

.presence-avatar-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  flex-shrink: 0;
  width: var(--s);
  height: var(--s);
}

.presence-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  transform: translate(10%, 10%);
  width: var(--pb-size, 9px);
  height: var(--pb-size, 9px);
  border-radius: 50%;
  border: 2px solid var(--presence-surface, var(--bg, #16171b));
  background-color: var(--presence-surface, var(--bg, #16171b));
  box-sizing: content-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.presence-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  display: block;
}

.presence-available .presence-core { background-color: var(--g); }
.presence-away .presence-core { background-color: var(--y); }
.presence-busy .presence-core { background-color: var(--r); }
.presence-offline .presence-core { background-color: var(--mu); }

/* Status Pill & Dot for visible text */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--tx);
}

.status-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-pill-dot.available { background-color: var(--g); }
.status-pill-dot.away { background-color: var(--y); }
.status-pill-dot.busy { background-color: var(--r); }
.status-pill-dot.offline { background-color: var(--mu); }

/* Settings Presence Selector Grid */
.presence-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .presence-options-grid {
    grid-template-columns: 1fr;
  }
}

.presence-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--ln);
  background: var(--p2);
  color: var(--tx);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
}

.presence-opt-btn:hover {
  border-color: var(--a);
  background: rgba(255, 255, 255, 0.05);
}

.presence-opt-btn.active {
  border-color: var(--a);
  background: rgba(201, 182, 228, 0.12);
  font-weight: 600;
}

.presence-badge-preview {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.presence-opt-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.presence-opt-info b {
  font-size: 13px;
  line-height: 1.2;
}

.presence-opt-info .mu {
  font-size: 11px;
  margin-top: 2px;
}

/* ====================================================================
 * Donut Chart Component (SectorMark / Pie innerRadius paddingAngle)
 * ==================================================================== */

.donut-chart-card {
  background: var(--p);
  border: 1px solid var(--ln);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.donut-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.donut-body {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 640px) {
  .donut-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.donut-svg-wrap {
  width: 190px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.donut-slice {
  cursor: pointer;
  outline: none;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
  transform-origin: 110px 110px;
}

.donut-slice:hover,
.donut-slice:focus-visible,
.donut-slice.is-active {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.donut-center-num {
  font-size: 28px;
  font-weight: 700;
  fill: var(--tx);
  letter-spacing: -0.02em;
  transition: fill 0.15s ease;
}

.donut-center-lbl {
  font-size: 11px;
  font-weight: 500;
  fill: var(--mu);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: fill 0.15s ease;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.donut-legend-row:hover,
.donut-legend-row.is-active {
  background: var(--p2);
}

.donut-legend-row.is-empty {
  opacity: 0.55;
}

.donut-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-label {
  font-size: 12px;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-legend-values {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.donut-legend-count {
  font-weight: 600;
  color: var(--tx);
}

.donut-legend-pct {
  font-size: 11px;
  min-width: 32px;
  text-align: right;
}

/* Nav Avatar Button (Bottom-Left) - Sleek Profile Row with Avatar & Account Name */
.nav-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: auto;
  padding: 6px 0;
  width: 100%;
}

.nav-account-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 8px;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
  --presence-surface: var(--p, #1e2025);
}

.nav-account-btn:hover {
  background: var(--p2, rgba(255, 255, 255, 0.05));
  border-color: var(--ln, rgba(255, 255, 255, 0.08));
}

.nav-account-btn:focus-visible {
  outline: 2px solid var(--a);
  outline-offset: 2px;
}

.nav-account-avatar-wrap {
  display: inline-flex;
  flex-shrink: 0;
  position: relative;
}

.nav-account-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.nav-account-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--tx, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.nav-account-role {
  font-size: 11px;
  font-weight: 400;
  color: var(--mu, #8f93a0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.nav-avatar-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  position: relative;
  transition: transform 0.15s ease, filter 0.15s ease;
  --presence-surface: var(--p, #1e2025);
}

.status-preset-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--a);
  display: inline-block;
}

/* Status Popover */
.status-popover {
  position: fixed;
  bottom: 74px;
  left: 14px;
  width: 250px;
  max-width: calc(100vw - 28px);
  background: var(--p);
  border: 1px solid var(--ln);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  padding: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 768px) {
  .status-popover {
    top: 60px;
    bottom: auto;
    left: 14px;
  }
}

.status-popover-header {
  border-bottom: 1px solid var(--ln);
  padding-bottom: 8px;
}

.status-custom-wrap {
  display: flex;
  gap: 6px;
}

.status-custom-wrap input {
  flex: 1;
  font-size: 12px;
  padding: 4px 8px;
}

.status-presets-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-preset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--tx);
  cursor: pointer;
  transition: background 0.12s;
  width: 100%;
}

.status-preset-item:hover, .status-preset-item.active {
  background: var(--p2);
}

.status-clear-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.status-popover-divider {
  height: 1px;
  background: var(--ln);
  margin: 2px 0;
}

.status-popover-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-action-btn {
  background: transparent;
  border: none;
  color: var(--tx);
  font-size: 12px;
  padding: 6px 8px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
}

.status-action-btn:hover {
  background: var(--p2);
}

/* User Card Modal */
.user-card-modal {
  width: 100%;
  max-width: min(320px, calc(100vw - 32px));
  box-sizing: border-box;
}

.user-card-details {
  border-top: 1px solid var(--ln);
  padding-top: 10px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-card-details .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}


