/* Left application navigation. Overlays remain viewport-relative. */
#crm-screen{padding-left:190px;min-height:100vh;min-width:0}
.topbar{position:fixed;inset:0 auto 0 0;width:190px;height:100dvh;background:#203e4b;color:#eef6f8;border:0;padding:20px 10px 14px;flex-direction:column;align-items:stretch;gap:20px;z-index:5;overflow-y:auto}
.topbar>div:first-child{display:flex;flex-direction:column;align-items:stretch;gap:22px}
.topbar .topbar-logo{width:148px;height:53px;object-fit:contain;margin:0 auto;background:#fff;border-radius:6px;padding:4px}
.topbar-divider{display:none}
.topbar .topnav{display:flex;flex-direction:column;align-items:stretch;height:auto;gap:7px}
.topbar .topnav-button{width:100%;min-height:46px;height:auto;display:flex;align-items:center;flex-wrap:wrap;gap:5px;padding:12px 10px;text-align:left;border:0;border-left:3px solid transparent;border-radius:7px;color:#c5d7df;font-size:14px;line-height:1.3;background:transparent}
.topbar .topnav-button:hover{background:#ffffff0d;color:#fff}
.topbar .topnav-button.active{background:#315664;border-left-color:#f99500;color:#fff}
.topbar .topnav-button:focus-visible,.communications-nav button:focus-visible{outline:2px solid #f99500;outline-offset:2px}
.topbar .topbar-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin-top:auto;padding-top:16px;border-top:1px solid #ffffff20}
.topbar-actions .ghost{color:#edf5f8;background:transparent;border-color:#66818d}
.communications-nav{display:flex;gap:8px;align-items:center;padding:14px 28px 0;border-bottom:1px solid #dce6e9;background:#fff;min-height:62px}
.communications-nav .topnav-button{height:48px;min-width:90px;padding:0 16px;font-size:14px;display:flex;align-items:center;justify-content:center;gap:6px}
.communications-nav #nav-calls{font-size:14px;width:auto;padding:0 16px}
.communications-nav #nav-calls::before{content:none}
.communications-nav .nav-count{position:static;margin:0}
@media(max-width:900px){
  #crm-screen{padding-left:150px}
  .topbar{width:150px;padding:16px 7px}
  .topbar .topbar-logo{width:126px;height:48px}
  .topbar .topnav-button{font-size:12px;padding:12px 7px}
}
@media(max-width:600px){
  #crm-screen{padding-left:100px}
  .topbar{width:100px;padding:12px 5px}
  .topbar .topbar-logo{width:86px;height:38px}
  .topbar .topnav-button{font-size:11px;padding:12px 4px;overflow-wrap:anywhere}
  .topbar .topbar-actions{flex-direction:column;gap:8px}
  .communications-nav{padding:8px 8px 0;gap:0;flex-wrap:wrap}
  .communications-nav .topnav-button,.communications-nav #nav-calls{min-width:0;padding:0 9px;font-size:12px}
  .max-heading{flex-wrap:wrap}
}

/* Compact, icon-led navigation inspired by the amoCRM sidebar. */
#crm-screen{padding-left:82px}
.topbar{width:82px;padding:0 0 8px;gap:0;overflow-x:hidden;z-index:50;scrollbar-width:thin}
.topbar .topbar-main{display:flex;flex-direction:column;align-items:stretch;gap:0;min-width:0}
.topbar>div:first-child{gap:0}
.topbar .topbar-logo{box-sizing:content-box;display:block;width:46px;height:46px;object-fit:contain;margin:12px auto 16px;padding:5px;background:#fff;border-radius:10px}
.topbar .topnav{gap:1px}
.topbar .topnav-button{position:relative;box-sizing:border-box;width:100%;min-height:78px;height:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;margin:0;padding:9px 4px;border:0;border-left:3px solid transparent;border-radius:0;background:transparent;color:#b8d0dd;font-size:11px;font-weight:500;line-height:1.1;text-align:center;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
.topbar .topnav-button[hidden]{display:none}
.topbar .topnav-button svg{display:block;width:31px;height:31px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none}
.topbar .topnav-button .nav-label{display:block;max-width:72px}
.topbar .topnav-button:hover{color:#fff;background:#ffffff12}
.topbar .topnav-button.active{color:#fff;background:#315a70;border-left-color:#63c4f5;font-weight:700}
.topbar .topnav-button:focus-visible,.communications-nav button:focus-visible,.topbar-actions button:focus-visible{outline:2px solid #f99500;outline-offset:-3px}
.topbar .topnav-button .nav-count{position:absolute;top:8px;right:5px;min-width:18px;height:18px;padding:0 3px;margin:0;font-size:10px;line-height:1}
.topbar .topnav-button .nav-count.overdue{top:27px}
.topbar .topbar-actions{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;margin-top:auto;padding:10px 3px 0;border-top:1px solid #ffffff24}
.topbar-actions #user-name{margin:0}
.topbar-actions .ghost{max-width:76px;min-height:32px;padding:4px 8px;color:#d6e5eb;background:transparent;border:0;font-size:11px}
.topbar-actions .ghost:hover{background:#ffffff12;color:#fff}
.communications-nav[hidden]{display:none}
@media(max-width:600px){
  #crm-screen{padding-left:64px}
  .topbar{width:64px}
  .topbar .topbar-logo{width:38px;height:38px;margin:10px auto;padding:3px}
  .topbar .topnav-button{min-height:68px;font-size:10px;padding:7px 2px}
  .topbar .topnav-button svg{width:26px;height:26px}
  .topbar .topnav-button .nav-count{right:1px;top:3px}
}

.topbar-actions .notifications-button{position:relative;max-width:78px;min-height:42px;line-height:1.1;overflow-wrap:anywhere}
.notifications-button .nav-count{position:absolute;top:-5px;right:-5px;min-width:18px;padding:2px 4px;border-radius:12px;color:#fff;background:#d94459;font-size:10px}
.notifications-panel{position:fixed;z-index:110;left:82px;bottom:12px;width:min(390px,calc(100vw - 94px));max-height:min(560px,calc(100dvh - 24px));display:flex;flex-direction:column;background:#fff;border:1px solid #cbd9de;border-radius:10px;box-shadow:0 14px 38px #17364238;color:#203e4b}
.notifications-panel[hidden],.notification-toast[hidden]{display:none}
.notifications-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 15px;border-bottom:1px solid #e2e9ec}
.notifications-heading .ghost{font-size:12px;padding:6px 8px}
.notifications-list{overflow-y:auto;padding:8px}
.notification-item{display:block;width:100%;padding:11px 12px;margin:0 0 5px;border:0;border-radius:7px;background:#fff;color:#25424f;text-align:left;cursor:pointer}
.notification-item:hover{background:#eff6f8}
.notification-item.unread{background:#eaf6f7;border-left:3px solid #168792}
.notification-item strong,.notification-item span,.notification-item time{display:block}
.notification-item strong{font-size:13px;line-height:1.3}
.notification-item span,.notification-item time{margin-top:4px;color:#6b8190;font-size:12px}
.notification-toast{position:fixed;z-index:111;right:20px;top:20px;max-width:min(390px,calc(100vw - 40px));padding:14px 18px;border:1px solid #92cdd1;border-left:5px solid #168792;border-radius:8px;background:#fff;color:#203e4b;box-shadow:0 10px 30px #17364238;cursor:pointer}
@media(max-width:600px){.notifications-panel{left:64px;width:calc(100vw - 76px)}}
