/* Availability Management — follows the shared CRM settings theme. */
.am-settings{min-width:0}
.am-main{min-width:0;padding:0px;overflow:visible}
.am-heading{margin:0 0 18px}
.am-heading h1{font-size:24px;line-height:1.3;font-weight:600;color:var(--text);margin:0 0 5px}
.am-heading p{font-size:13px;line-height:1.55;color:var(--text);margin:0}
.am-heading a{color:var(--brand-ink);font-weight:650;text-decoration:none;white-space:nowrap}
.am-heading a:hover{text-decoration:underline}
.am-heading a svg{width:12px;height:12px;vertical-align:-1px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.am-filters{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:18px 0 22px;min-width:0}
.am-filter{padding: 7px 20px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 15px;
    border: 1px solid var(--border);}
.am-filter__label,.am-filter__trigger{font-size:13px;color:var(--text);white-space:nowrap; font-weight: 400;}
.am-filter__trigger{display:inline-flex;align-items:center;gap:4px;padding:3px 1px;border:0;background:transparent;font-weight:650;cursor:pointer}
.am-filter__trigger:hover,.am-filter__trigger[aria-expanded=true]{color:var(--brand-ink)}
.am-filter__trigger svg{width:9px;height:7px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.am-menu{position:absolute;z-index:120;top:calc(100% + 9px);left:50%;transform:translateX(-50%);min-width:190px;background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:0 10px 28px rgba(16,24,40,.16);padding:7px 0;color:var(--text)}
.am-menu:before{content:"";position:absolute;top:-7px;left:calc(50% - 7px);width:13px;height:13px;background:var(--surface);border-left:1px solid var(--border);border-top:1px solid var(--border);transform:rotate(45deg)}
.am-menu[hidden],.am-status-menu[hidden]{display:none}
.am-menu--users{width:176px;min-width:176px;padding-top:8px}
.am-menu--status{width:228px;min-width:228px}
.am-menu--teams{width:220px;min-width:220px}
.am-menu--inboxes{width:160px;min-width:160px}
.am-search{position:relative;display:block;margin:0 10px 7px;z-index:1}
.am-search input{width:100%;height:34px;border:1.5px solid var(--brand);border-radius:18px;padding:0 34px 0 13px;background:var(--surface);color:var(--text);font:inherit;font-size:12px;outline:none}
.am-search svg{position:absolute;right:11px;top:9px;width:16px;height:16px;fill:none;stroke:var(--text-muted);stroke-width:1.5;pointer-events:none}
.am-menu__scroll{position:relative;z-index:1;max-height:238px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.am-menu__scroll::-webkit-scrollbar{width:7px}
.am-menu__scroll::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:8px}
.am-menu__option{display:flex;align-items:center;width:100%;min-height:34px;padding:7px 14px;border:0;background:transparent;color:var(--text);font:inherit;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.am-menu__option:hover,.am-menu__option.is-selected{background:var(--surface-hover)}
.am-menu__divider{height:1px;background:var(--border);margin:7px 0}
.am-menu__check{position:relative;z-index:1;display:flex;align-items:center;gap:10px;min-height:43px;padding:8px 14px;font-size:12px;color:var(--text);cursor:pointer}
.am-menu__check:hover{background:var(--surface-hover)}
.am-menu__check input{position:absolute;opacity:0;pointer-events:none}
.am-checkmark{width:17px;height:17px;flex:0 0 17px;border:1px solid var(--text-subtle);border-radius:4px;background:var(--surface);position:relative}
.am-menu__check input:checked+.am-checkmark{background:var(--brand);border-color:var(--brand)}
.am-menu__check input:checked+.am-checkmark:after{content:"";position:absolute;left:5px;top:2px;width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}
.am-team-option{min-height:38px;padding:7px 12px}
.am-team-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.am-table-wrap{width:100%;overflow-x:auto;overscroll-behavior-x:contain;border:0}
.am-table{width:100%;min-width:560px;border-collapse:collapse;table-layout:fixed;color:var(--text);font-size:12px}
.am-table thead th{height:39px;padding:0 20px;border-bottom:1px solid var(--text);text-align:left;font-size:11px;letter-spacing:.02em;font-weight:700;color:var(--text-muted);background:transparent}
.am-table thead th:first-child{width:48%}
.am-table tbody tr{height:62px;border-bottom:1px solid var(--border-strong);transition:background .12s ease}
.am-table tbody tr:hover{background:var(--surface-hover)}
.am-table tbody td{padding:0 20px;vertical-align:middle}
.am-user-cell{display:flex;align-items:center;gap:11px;font-weight:500}
.am-avatar{width:29px;height:29px;flex:0 0 29px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--surface-3);color:var(--text-muted);font-size:10px;font-weight:600}
.am-info{display:inline-flex;align-items:center;justify-content:center;margin-left:3px;color:var(--text-subtle);font-size:12px;vertical-align:1px}
.am-status-wrap{position:relative;display:inline-flex;align-items:center}
.am-status-trigger{display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:4px 2px;border:0;background:transparent;color:var(--text);font:inherit;font-size:12px;font-weight:650;cursor:pointer}
.am-status-trigger:hover{color:var(--brand-ink)}
.am-status-trigger>svg{width:8px;height:6px;fill:none;stroke:currentColor;stroke-width:1.5}
.am-status-dot{width:9px;height:9px;border-radius:50%;background:#008a4b;flex:0 0 9px}
.am-status-dot.is-away{background:#f5c242}
.am-status-dot.is-out{background:#98a2b3}
.am-status-menu{position:absolute;z-index:100;top:calc(100% + 2px);left:0;width:126px;padding:5px 0;background:var(--surface);border:1px solid var(--border);border-radius:13px;box-shadow:0 8px 24px rgba(16,24,40,.16)}
.am-status-menu:before{content:"";position:absolute;top:-6px;left:22px;width:11px;height:11px;background:var(--surface);border-left:1px solid var(--border);border-top:1px solid var(--border);transform:rotate(45deg)}
.am-status-menu button{position:relative;display:block;width:100%;padding:9px 14px;border:0;background:transparent;text-align:left;color:var(--text);font:inherit;font-size:12px;cursor:pointer}
.am-status-menu button:hover{background:var(--surface-hover)}
.am-empty{padding:28px 14px;text-align:center;color:var(--text-muted);font-size:13px;border-bottom:1px solid var(--border)}
.am-pagination{display:flex;align-items:center;justify-content:center;gap:9px;margin:27px 0 0;color:var(--text-muted);font-size:12px}
.am-page-control{display:inline-flex;align-items:center;gap:5px;padding:4px 2px;border:0;background:transparent;color:var(--text);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.am-page-control:disabled{color:var(--text-subtle);cursor:default}
.am-page-control svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.am-page-numbers{display:flex;align-items:center;gap:8px}
.am-page-number{width:25px;height:25px;border:1px solid transparent;border-radius:50%;background:transparent;color:var(--text);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.am-page-number.is-active{border-color:var(--border-strong);background:var(--surface-2);color:var(--text)}
@media(max-width:1100px){.am-main{padding:0px}.am-filters{gap:18px}}
@media(max-width:767px){.am-main{padding:0px}.am-heading h1{font-size:21px}.am-filters{gap:12px 18px;margin:16px 0 18px}.am-filter{gap:4px}.am-menu{left:0;transform:none}.am-menu:before{left:18px}.am-menu--users{left:-10px}.am-menu--status{left:-55px}.am-menu--teams{left:-60px}.am-menu--inboxes{left:-65px}.am-table thead th,.am-table tbody td{padding-left:12px;padding-right:12px}.am-table thead th:first-child{width:55%}.am-pagination{margin-top:20px}}
@media(prefers-reduced-motion:reduce){.am-table tbody tr{transition:none}}


/* Header and table alignment with the shared Audit Log page treatment. */
.am-page-head{align-items:flex-start;margin:0 0 22px}
.am-page-head .set-head__title{font-size:26px;line-height:1.25;font-weight:700;margin:0}
.am-page-head .set-head__sub{margin:5px 0 0;color:var(--text-muted,#667085);font-size:14px;line-height:1.5}
.am-page-head .set-head__sub a{display:inline;color:var(--brand-ink,#2456e6);font-weight:650;text-decoration:none;white-space:normal}
.am-page-head .set-head__sub a:hover{text-decoration:underline}
.am-page-head .set-head__sub a svg{width:12px;height:12px;display:inline-block;vertical-align:-1px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.am-table-card{background:var(--surface,#fff);border:1px solid var(--border,#e4e7ec);border-radius:9px;box-shadow:0 1px 2px rgba(16,24,40,.06);overflow-x:auto;overflow-y:visible}
.am-table-card .am-table{min-width:540px;font-size:13px}
.am-table-card .am-table thead th{height:48px;padding:0 20px;background:var(--surface-2,#f9fafb);border-bottom:1px solid var(--border,#e4e7ec);color:var(--text-subtle,#8a94a6);font-size:12px;font-weight:650;letter-spacing:0}
.am-table-card .am-table tbody tr{height:64px;background:var(--surface,#fff);border-bottom:1px solid var(--border,#e4e7ec)}
.am-table-card .am-table tbody tr:last-child{border-bottom:0}
.am-table-card .am-table tbody tr:hover{background:var(--surface-2,#f9fafb)}
.am-table-card .am-table tbody td{padding:15px}
.am-table-card .am-table thead th:first-child{width:48%}
.am-table-card .am-user-cell{font-size:13px;font-weight:550}
.am-table-card .am-avatar{width:34px;height:34px;flex-basis:34px;font-size:12px;background:var(--surface-3,#eef1f5);color:var(--text-muted,#475467)}
.am-table-card .am-status-trigger{font-size:13px}
.am-table-card .am-status-dot{width:9px;height:9px;flex-basis:9px}
.am-menu.is-up{top:auto;bottom:calc(100% + 9px)}
.am-menu.is-up:before{top:auto;bottom:-7px;transform:rotate(225deg)}
.am-menu.is-align-end{left:auto;right:0;transform:none}
.am-menu.is-align-end:before{left:auto;right:18px}
.am-status-menu.is-up{top:auto;bottom:calc(100% + 4px)}
.am-status-menu.is-up:before{top:auto;bottom:-6px;transform:rotate(225deg)}
.am-status-menu.is-align-end{left:auto;right:0}
.am-status-menu.is-align-end:before{left:auto;right:20px}
@media(max-width:767px){
 .am-page-head{margin-bottom:18px}
 .am-page-head .set-head__title{font-size:22px}
 .am-page-head .set-head__sub{font-size:13px}
 .am-table-card .am-table{min-width:520px}
 .am-table-card .am-table thead th,.am-table-card .am-table tbody td{padding-left:13px;padding-right:13px}
}

/* Availability table: left-aligned cell content and 8px pagination controls. */
.am-table thead th,
.am-table tbody td{ text-align:left; }
.am-table tbody td{vertical-align:middle}
.am-user-cell{justify-content:flex-start;text-align:left}
.am-status-wrap{justify-content:flex-start;text-align:left}
.am-status-trigger{justify-content:flex-start;text-align:left}
.am-page-number{border-radius:8px}
.am-info-tip{position:relative;display:inline-flex;align-items:center;vertical-align:middle;margin-left:3px;cursor:help;outline:none}
.am-info-tip .am-info{display:block;width:14px;height:14px;margin:0;color:var(--text-subtle,#8a94a6);fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.am-info-tip:focus-visible .am-info{color:var(--brand-ink,#2456e6)}
.am-info-popover{position:absolute;left:50%;bottom:calc(100% + 10px);z-index:250;display:block;width:230px;padding:10px 12px;border:1px solid var(--border,#e4e7ec);border-radius:8px;background:var(--surface,#fff);box-shadow:0 8px 24px rgba(16,24,40,.16);color:var(--text,#101828);font-size:12px;font-weight:400;line-height:1.45;white-space:normal;text-align:left;opacity:0;visibility:hidden;transform:translate(-50%,4px);pointer-events:none;transition:opacity .12s ease,transform .12s ease}
.am-info-popover:after{content:"";position:absolute;left:calc(50% - 6px);bottom:-6px;width:10px;height:10px;background:var(--surface,#fff);border-right:1px solid var(--border,#e4e7ec);border-bottom:1px solid var(--border,#e4e7ec);transform:rotate(45deg)}
.am-info-tip:hover .am-info-popover,.am-info-tip:focus .am-info-popover,.am-info-tip:focus-within .am-info-popover{opacity:1;visibility:visible;transform:translate(-50%,0)}
/* Dropdowns use viewport positioning so no parent panel or mobile edge clips them. */
.am-menu,.am-status-menu{max-width:calc(100vw - 16px);max-height:min(65vh,420px);overflow:hidden}
.am-menu.is-up:before,.am-status-menu.is-up:before{top:auto;bottom:-7px;transform:rotate(225deg)}
.am-menu.is-align-end:before,.am-status-menu.is-align-end:before{left:auto;right:18px}
.am-menu__scroll{max-height:min(48vh,300px);overflow-y:auto;overscroll-behavior:contain}
@media(max-width:767px){
 .am-filters{position:relative;z-index:30;display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;overflow:visible}
 .am-filter{position:relative;min-width:0}
 .am-menu--users,.am-menu--status,.am-menu--teams,.am-menu--inboxes{width:min(248px,calc(100vw - 24px));min-width:0}
 .am-menu__scroll{max-height:45vh}
 .am-status-menu{width:126px;min-width:126px}
 .am-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .am-table{min-width:560px}
 .am-page-number{width:30px;height:30px}
 .am-info-popover{left:0;transform:translate(0,4px);width:min(230px,calc(100vw - 32px))}
 .am-info-popover:after{left:8px}
 .am-info-tip:hover .am-info-popover,.am-info-tip:focus .am-info-popover,.am-info-tip:focus-within .am-info-popover{transform:translate(0,0)}
}

.am-info-popover.is-floating{z-index:99999;display:block;max-width:calc(100vw - 16px);pointer-events:none}

/* Portal-opened filter dropdowns are positioned against the viewport, not the settings layout. */
body > .am-menu[data-am-menu]{position:fixed;z-index:10050;transform:none;max-height:min(65vh,420px);overflow:visible;isolation:isolate}
body > .am-menu[data-am-menu].is-up{top:auto}
body > .am-menu[data-am-menu]:before{z-index:0}
body > .am-menu[data-am-menu] .am-menu__scroll{position:relative;z-index:1;max-height:min(48vh,300px);overflow-y:auto;overscroll-behavior:contain}


/* Filter pills: the complete label/value/chevron surface is one trigger. */
.am-filter{
  padding:0!important;
  min-height:40px;
  border:1px solid var(--border,#e4e7ec)!important;
  border-radius:8px!important;
  background:transparent;
  overflow:visible;
}
.am-filter__trigger{
  display:flex!important;
  align-items:center;
  justify-content:flex-start;
  gap:5px!important;
  width:100%;
  min-height:39px;
  padding:0 14px!important;
  border:0!important;
  border-radius:7px!important;
  background:transparent!important;
  color:var(--text,#101828)!important;
  font-size:13px!important;
  font-weight:400!important;
  text-align:left;
  cursor:pointer;
}
.am-filter__trigger:hover,
.am-filter__trigger[aria-expanded="true"]{
  background:var(--surface-hover,#f2f4f7)!important;
  color:var(--text,#101828)!important;
}
.am-filter__label{font-size:13px;color:var(--text,#101828);font-weight:400}
.am-filter__value{font-size:13px;color:var(--text,#101828);font-weight:650}
.am-filter__trigger>svg{margin-left:1px;flex:0 0 9px}

/* Reference dropdown surface, pointer and option treatment. */
body>.am-menu[data-am-menu]{
  border:1px solid var(--border-strong,#d0d5dd);
  border-radius:15px;
  background:var(--surface,#fff);
  box-shadow:0 10px 26px rgba(16,24,40,.15);
  padding:7px 0;
}
body>.am-menu[data-am-menu]:before{
  content:"";
  position:absolute;
  z-index:0;
  left:calc(50% - 7px);
  top:-8px;
  width:14px;height:14px;
  background:var(--surface,#fff);
  border-left:1px solid var(--border-strong,#d0d5dd);
  border-top:1px solid var(--border-strong,#d0d5dd);
  transform:rotate(45deg);
  pointer-events:none;
}
body>.am-menu[data-am-menu].is-up:before{top:auto;bottom:-8px}
.am-menu__option{
  min-height:35px;
  padding:8px 14px;
  font-size:12px;
  line-height:1.35;
  color:var(--text,#101828);
}
.am-menu__option:hover,
.am-menu__option.is-selected{background:var(--surface-hover,#f2f4f7)}
.am-menu--users{width:176px;min-width:176px}
.am-menu--status{width:228px;min-width:228px}
.am-menu--teams{width:220px;min-width:220px}
.am-menu--inboxes{width:160px;min-width:160px}
.am-status-menu{
  border:1px solid var(--border-strong,#d0d5dd);
  border-radius:14px;
  background:var(--surface,#fff);
  box-shadow:0 8px 22px rgba(16,24,40,.15);
  padding:5px 0;
}
.am-status-menu button{
  min-height:34px;
  padding:8px 14px;
  font-size:12px;
}
.am-status-menu button:hover{background:var(--surface-hover,#f2f4f7)}
@media(max-width:767px){
  .am-filter{max-width:100%}
  .am-filter__trigger{padding:0 12px!important}
  body>.am-menu[data-am-menu]{width:min(248px,calc(100vw - 24px));min-width:0}
}


/* Final dropdown positioning: pointer follows the triggering control, not panel center. */
body > .am-menu[data-am-menu]::before{
  left:var(--am-arrow-left, calc(50% - 7px))!important;
}
.am-status-menu::before{
  left:var(--am-arrow-left, 22px)!important;
}
.am-menu,
.am-status-menu{
  box-sizing:border-box;
}
body > .am-menu[data-am-menu]{
  max-width:calc(100vw - 16px);
}
body > .am-menu[data-am-menu] .am-menu__scroll{
  min-height:0;
  max-height:min(48vh,300px);
}
.am-menu--users .am-search{
  margin:0 10px 7px;
}
.am-menu--users .am-menu__option{
  min-height:35px;
}
@media(max-width:767px){
  .am-filters{
    gap:10px 12px;
    align-items:flex-start;
  }
  .am-filter{
    flex:0 0 auto;
    max-width:100%;
  }
  .am-filter__trigger{
    min-height:39px;
    padding:0 12px!important;
    white-space:nowrap;
  }
  body > .am-menu[data-am-menu]{
    width:min(248px,calc(100vw - 16px))!important;
    min-width:0!important;
    max-width:calc(100vw - 16px)!important;
    border-radius:15px;
  }
  body > .am-menu[data-am-menu] .am-menu__scroll{
    max-height:min(42vh,300px);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  body > .am-menu[data-am-menu] .am-search{
    margin:0 10px 7px;
  }
  .am-status-menu{
    width:126px;
    min-width:126px;
    max-width:calc(100vw - 16px);
  }
  .am-table-wrap{
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .am-table-card .am-table{
    min-width:520px;
  }
  .am-pagination{
    flex-wrap:wrap;
    gap:7px;
  }
}

/* Keep the small status popup pointer visible outside its rounded panel. */
.am-status-menu{overflow:visible!important}
