/* Global EkoTerm task notifications, mounted once in shared base.html. */
.crm-task-notify {position:relative;flex:0 0 auto;z-index:300;}
.crm-task-notify-bell {
    position:relative;display:inline-flex;align-items:center;justify-content:center;
    width:41px;height:41px;border:1px solid #BCE3CF;border-radius:12px;
    background:linear-gradient(135deg,#FFFFFF,#EAF8EF);color:#087F6A;
    box-shadow:0 3px 10px rgba(24,103,78,.06);
    cursor:pointer;transition:background .16s,border-color .16s;
}
.crm-task-notify-bell:hover,.crm-task-notify-bell[aria-expanded="true"] {
    background:#DDF6E8;border-color:#81CAA6;
}
.crm-task-notify-bell:focus-visible,
.crm-task-notify-popover button:focus-visible,
.crm-task-notify-toast button:focus-visible {
    outline:2px solid #087F6A;outline-offset:2px;
}
.crm-task-notify-count {
    position:absolute;right:-8px;top:-7px;display:flex;align-items:center;
    justify-content:center;min-width:19px;height:19px;padding:0 4px;
    border-radius:20px;background:#D43E4B;color:white;border:2px solid white;
    font-size:10px;font-weight:800;line-height:1;
}
.crm-task-notify-count[hidden],.crm-task-notify-popover[hidden] {display:none!important;}
.crm-task-notify-popover {
    position:absolute;top:calc(100% + 9px);right:0;z-index:310;
    width:min(390px,calc(100vw - 20px));max-height:min(530px,72vh);
    display:flex;flex-direction:column;overflow:hidden;
    border:1px solid #C8E6D6;border-radius:14px;background:#FFF;
    box-shadow:0 16px 42px rgba(13,76,54,.20);
}
.crm-task-notify-header {
    display:flex;align-items:center;justify-content:space-between;gap:9px;
    flex:0 0 auto;padding:15px;border-bottom:1px solid #DAEEE4;
    background:linear-gradient(115deg,#F0FAF4,#E4F6EB);color:#155F49;font-size:15px;
}
.crm-task-notify-header button {
    border:1px solid #C7E3D4;border-radius:8px;padding:6px 8px;
    background:#FFF;color:#087F6A;font:inherit;font-size:11px;font-weight:700;
    cursor:pointer;
}
.crm-task-notify-header button:disabled {opacity:.45;cursor:default;}
.crm-task-notify-header-actions {display:flex;align-items:center;gap:6px;}
.crm-task-notify-header .crm-task-notify-delete-all {
    border-color:#F0CACA;background:#FFF5F5;color:#C0444F;
}
.crm-task-notify-header .crm-task-notify-delete-all:hover {background:#FCE8E9;}

.crm-task-notify-list {min-height:65px;overflow-y:auto;overscroll-behavior:contain;}
.crm-task-notify-item {
    display:flex;align-items:flex-start;gap:6px;width:100%;padding:4px 8px;
    background:#FFF;border:0;border-bottom:1px solid #E8F0EA;
    color:#315F4E;
    max-height:190px;overflow:hidden;
}
.crm-task-notify-item-open {
    display:flex;flex:1;min-width:0;flex-direction:column;align-items:stretch;gap:6px;
    border:0;border-radius:8px;padding:9px 7px;background:transparent;
    text-align:left;color:#315F4E;font:inherit;cursor:pointer;
}
/* Notification entries use full width; deletion is exclusively bulk via the header. */
.crm-task-notify-item-open {width:100%;}
.crm-task-notify-item:hover {background:#F0FAF4;}
.crm-task-notify-item.is-unread {background:#F1FAF5;border-left:3px solid #15A782;}
.crm-task-notify-item.is-unread:hover {background:#E7F7EC;}
.crm-task-notify-item-top {display:flex;align-items:center;gap:7px;justify-content:space-between;}
.crm-task-notify-item-title {font-size:12px;font-weight:800;color:#155F49;}
.crm-task-notify-item.is-overdue .crm-task-notify-item-title {color:#B84049;}
.crm-task-notify-item-text {font-size:13px;font-weight:650;overflow-wrap:anywhere;}
.crm-task-notify-item-deal,.crm-task-notify-item-date {font-size:11px;color:#809D8D;overflow-wrap:anywhere;}
.crm-task-notify-item-dot {flex:0 0 8px;width:8px;height:8px;border-radius:50%;background:#1AA980;}
.crm-task-notify-empty {padding:25px 15px;text-align:center;color:#78998A;font-size:12px;}
/* Body-level toast surface must sit above the CRM deal/contact overlays
   (z-index 30000+) and their nested settings dialogs on every screen. */
body > .crm-task-notify-toasts {
    position:fixed !important;
    z-index:2147483647 !important;
    right:22px;top:118px;
    display:flex;flex-direction:column;gap:10px;
    pointer-events:none;
}
.crm-task-notify-toast {
    pointer-events:auto;width:min(360px,calc(100vw - 30px));padding:14px 15px;
    border:1px solid #B9E2CB;border-left:4px solid #0D9A76;border-radius:12px;
    background:#FFF;box-shadow:0 10px 32px rgba(18,80,52,.18);
    display:flex;flex-direction:column;gap:8px;color:#285B47;
}
.crm-task-notify-toast.is-overdue {border-left-color:#D64B57;}
.crm-task-notify-toast {
    transition:opacity .42s ease,transform .42s ease;
}
.crm-task-notify-toast.is-disappearing {opacity:0;transform:translateX(16px);}

.crm-task-notify-toast-title {font-size:13px;font-weight:800;}
.crm-task-notify-toast.is-overdue .crm-task-notify-toast-title {color:#B43E49;}
.crm-task-notify-toast-text {font-size:12px;overflow-wrap:anywhere;}
.crm-task-notify-toast-actions {display:flex;justify-content:space-between;align-items:center;gap:8px;}
.crm-task-notify-toast button {cursor:pointer;font:inherit;}
.crm-task-notify-toast-open {padding:7px 10px;border:0;border-radius:8px;background:#087F6A;color:#FFF;font-size:11px;font-weight:750;}
.crm-task-notify-toast-close {padding:6px;border:0;background:transparent;color:#779688;font-size:12px;}
@media(max-width:640px) {
    .crm-task-notify-popover {position:fixed;right:10px;left:10px;top:100px;width:auto;max-height:65vh;}
    body > .crm-task-notify-toasts {top:85px;right:12px;left:12px;align-items:flex-end;}
}


/* Global CRM-styled confirmation replaces browser confirm for deleting alerts. */
.crm-task-notify-confirm[hidden] {display:none!important;}
.crm-task-notify-confirm {
    position:fixed;inset:0;z-index:2147483646;
    display:flex;align-items:center;justify-content:center;
    box-sizing:border-box;padding:18px;
}
.crm-task-notify-confirm-backdrop {
    position:absolute;inset:0;background:rgba(12,38,28,.47);
}
.crm-task-notify-confirm-dialog {
    position:relative;z-index:1;width:min(440px,100%);
    padding:22px;border:1px solid #C9E5D6;border-radius:15px;
    background:#FFF;box-shadow:0 22px 65px rgba(13,63,43,.25);
    color:#285E48;
}
.crm-task-notify-confirm-dialog h2 {
    margin:0 0 10px;font-size:19px;font-weight:850;color:#145B45;
}
.crm-task-notify-confirm-dialog p {
    margin:0 0 20px;font-size:13px;line-height:1.55;color:#547A66;
}
.crm-task-notify-confirm-actions {
    display:flex;gap:9px;justify-content:flex-end;flex-wrap:wrap;
}
.crm-task-notify-confirm-actions button {
    min-height:38px;padding:9px 15px;border:1px solid #CFE5D8;
    border-radius:9px;background:#F8FCF9;color:#28745A;
    font:inherit;font-size:12px;font-weight:800;cursor:pointer;
}
.crm-task-notify-confirm-actions button:hover {
    background:#EAF7EF;border-color:#98D1B4;
}
.crm-task-notify-confirm-actions #crmTaskNotifyConfirmDelete {
    background:#CF4752;border-color:#CF4752;color:#FFF;
}
.crm-task-notify-confirm-actions #crmTaskNotifyConfirmDelete:hover {
    background:#B83A45;
}
.crm-task-notify-confirm-actions button:focus-visible {
    outline:2px solid #087F6A;outline-offset:2px;
}
.crm-task-notify-confirm-actions button:disabled {opacity:.6;cursor:wait;}
@media(max-width:520px) {
    .crm-task-notify-confirm-dialog {padding:17px;}
    .crm-task-notify-confirm-actions button {flex:1 1 auto;}
}

/* E1 unified visual treatment for task notifications; behavior is unchanged. */
body.e1-app-page .e1-home-header .crm-task-notify-bell {
    width:40px;height:40px;
    border:1px solid rgba(255,255,255,.22);
    border-radius:13px;
    background:rgba(255,255,255,.12);
    color:#FFFFFF;
    box-shadow:0 5px 14px rgba(0,77,67,.10);
}
body.e1-app-page .e1-home-header .crm-task-notify-bell:hover,
body.e1-app-page .e1-home-header .crm-task-notify-bell[aria-expanded="true"] {
    background:rgba(255,255,255,.22);
    border-color:rgba(255,255,255,.45);
}
body.e1-app-page .crm-task-notify-count {
    background:#D64B57;border:2px solid #FFFFFF;
    box-shadow:0 3px 8px rgba(93,20,28,.18);
}
body.e1-app-page .crm-task-notify-popover {
    width:min(420px,calc(100vw - 20px));
    border:1px solid #D8EBE2;
    border-radius:22px;
    background:linear-gradient(150deg,#FFFFFF,#F7FDFB);
    box-shadow:0 20px 45px rgba(0,77,67,.19);
}
body.e1-app-page .crm-task-notify-header {
    padding:17px 18px;
    gap:12px;
    background:linear-gradient(125deg,#F8FFFC,#E9F9F2);
    border-color:#DBECE3;
    color:#004D43;
    font-size:16px;font-weight:850;
}
body.e1-app-page .crm-task-notify-header-actions {flex-wrap:wrap;justify-content:flex-end;gap:7px;}
body.e1-app-page .crm-task-notify-header button {
    min-height:34px;padding:7px 11px;
    border:1px solid #CDE7DB;
    border-radius:11px;
    background:#FFFFFF;
    color:#006B55;
    font-size:11px;font-weight:750;
    transition:background .15s,border-color .15s,color .15s;
}
body.e1-app-page .crm-task-notify-header button:hover:not(:disabled) {
    border-color:#86D7BA;background:#E9F9F1;
}
body.e1-app-page .crm-task-notify-header .crm-task-notify-delete-all {
    background:#FFF6F6;border-color:#F0D8D8;color:#B84A54;
}
body.e1-app-page .crm-task-notify-list {
    padding:11px 12px;min-height:95px;
    background:#FFFFFF;
}
body.e1-app-page .crm-task-notify-item {
    max-height:none;margin-bottom:9px;padding:5px;
    border:1px solid #E0EFE7;border-radius:14px;
    background:#FCFEFD;
    color:#254C3F;
    transition:background .15s,border-color .15s;
}
body.e1-app-page .crm-task-notify-item:last-child {margin-bottom:0;}
body.e1-app-page .crm-task-notify-item:hover {background:#F2FCF7;border-color:#BDE6D4;}
body.e1-app-page .crm-task-notify-item.is-unread {
    border:1px solid #B8EAD7;border-left:3px solid #00A67E;
    background:#EFFFF6;
}
body.e1-app-page .crm-task-notify-item-open {padding:10px;gap:7px;border-radius:11px;}
body.e1-app-page .crm-task-notify-item-title {color:#004D43;font-size:12px;}
body.e1-app-page .crm-task-notify-item.is-overdue .crm-task-notify-item-title {color:#BD4350;}
body.e1-app-page .crm-task-notify-item-dot {background:#00A67E;}
body.e1-app-page .crm-task-notify-empty {padding:38px 15px;color:#7C9D90;font-size:13px;}
body.e1-app-page .crm-task-notify-toast {
    border:1px solid #CFE9DE;
    border-left:4px solid #00A67E;
    border-radius:16px;
    color:#164638;
    background:linear-gradient(140deg,#FFFFFF,#F5FCF9);
    box-shadow:0 14px 34px rgba(0,77,67,.18);
}
body.e1-app-page .crm-task-notify-toast.is-overdue {border-left-color:#D64B57;}
body.e1-app-page .crm-task-notify-toast-open {
    border-radius:10px;
    background:linear-gradient(115deg,#004D43,#00A67E);
}
body.e1-app-page .crm-task-notify-confirm-backdrop {background:rgba(8,40,32,.52);}
body.e1-app-page .crm-task-notify-confirm-dialog {
    border:1px solid #D4EDE1;
    border-radius:22px;
    background:linear-gradient(150deg,#FFFFFF,#F6FDF9);
    box-shadow:0 24px 65px rgba(0,64,49,.23);
    color:#184D3E;
}
body.e1-app-page .crm-task-notify-confirm-dialog h2 {color:#004D43;font-size:21px;}
body.e1-app-page .crm-task-notify-confirm-dialog p {color:#5F8073;font-size:13px;}
body.e1-app-page .crm-task-notify-confirm-actions button {
    min-height:41px;
    border-radius:12px;
    border-color:#CDE7DB;
    background:#FFFFFF;color:#006A55;
}
body.e1-app-page .crm-task-notify-confirm-actions #crmTaskNotifyConfirmDelete {
    background:#D64B57;border-color:#D64B57;color:#FFFFFF;
}
body.e1-app-page .crm-task-notify-confirm-actions #crmTaskNotifyConfirmDelete:hover {
    background:#B73B47;
}
@media(max-width:640px) {
    body.e1-app-page .crm-task-notify-popover {
        position:fixed;top:88px;left:10px;right:10px;width:auto;
        max-height:70vh;
    }
    body.e1-app-page .crm-task-notify-header {padding:13px;flex-wrap:wrap;}
}
