/* Shared staff UI. Customer quote pages and document branding stay independent. */
.crm-shell,.crm-auth {
  --ink:#1b2b3f; --muted:#586a7e; --line:#dce4ed; --paper:#fff;
  --canvas:#f3f6fa; --purple:#2068a6; --purple-2:#185486; --lilac:#eaf3fc;
  --coral:#c51678; --green:#16724f; --red:#b43142;
  --shadow:0 2px 8px #19345106,0 12px 30px #19345104; --radius:14px;
  --brand-pink:#c51678; --brand-blue:#2068a6;
  font-size:14px; line-height:1.5; background:var(--canvas); color:var(--ink);
}
.crm-shell .sidebar {
  width:236px; padding:24px 16px 16px; background:#fff; color:var(--ink);
  border-right:1px solid var(--line); z-index:40;
}
.crm-shell .sidebar .brand {display:flex;flex:0 0 auto;height:auto;flex-direction:column;gap:10px;align-items:flex-start;padding:0 16px 23px;margin:0;color:var(--muted)}
.workspace-logo {display:block;width:137px;height:auto;object-fit:contain}
.crm-shell .sidebar .brand .workspace-label {font:600 10px 'DM Sans',sans-serif;letter-spacing:1.8px;text-transform:uppercase;width:auto}
.crm-shell .workspace-nav {gap:4px;overflow-y:auto;overflow-x:hidden;padding:0 1px 16px;scrollbar-width:thin}
.crm-shell .sidebar nav .nav-caption {margin:8px 12px 10px;font-size:10px;letter-spacing:1.6px;color:#778597}
.crm-shell .sidebar nav a,.crm-shell .nav-group>summary {
  display:flex;align-items:center;gap:11px;min-height:44px;padding:10px 12px;
  border-radius:9px;border:1px solid transparent;color:#4a5e74;font-size:13px;font-weight:600;
  transition:background-color .15s,color .15s,border-color .15s;
}
.crm-shell .sidebar nav a .nav-label {font-size:13px;width:auto;text-align:left;line-height:1.45}
.crm-shell .sidebar nav a:hover,.crm-shell .nav-group>summary:hover {background:#f3f6fa;color:var(--ink)}
.crm-shell .sidebar nav a.active {background:var(--lilac);color:#185b96;border-color:#d5e6f6;box-shadow:inset 3px 0 0 var(--brand-blue)}
.crm-shell .sidebar nav a.active .nav-icon {color:var(--brand-blue)}
.crm-shell .sidebar nav a b {background:var(--lilac);color:#185b96;border:1px solid #d5e6f6;font-size:10px;min-width:21px;height:21px;margin-left:auto}
.crm-shell .sidebar nav a b[hidden] {display:none}
.nav-divider {height:1px;flex-shrink:0;background:var(--line);margin:19px 12px 12px}
.nav-group>summary {list-style:none;cursor:pointer;user-select:none}
.nav-group>summary::-webkit-details-marker {display:none}
.nav-group>summary .nav-chevron {margin-left:auto;transition:transform .15s}
.nav-group[open]>summary .nav-chevron {transform:rotate(90deg)}
.crm-shell .nav-group.has-active>summary {color:var(--brand-blue)}
.nav-group-items {margin:4px 0 10px 21px;padding-left:10px;border-left:1px solid var(--line)}
.crm-shell .sidebar .nav-group-items a {font-size:12px;min-height:38px;padding:8px 10px;gap:7px}
.crm-shell .sidebar .nav-group-items .nav-label {font-size:12px}
.nav-external {margin-left:auto;flex-shrink:0;opacity:.65}
.crm-shell .user-card {border-top:1px solid var(--line);padding-top:17px;gap:10px;align-items:center}
.crm-shell .user-card strong {font-size:12px;color:var(--ink)}
.crm-shell .user-card small {font-size:10px;color:var(--muted)}
.crm-shell .user-card>span:nth-child(2) {display:flex;flex-direction:column;min-width:0;flex:1}
.crm-shell .user-card strong,.crm-shell .user-card small {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-shell .user-card form {margin:0;flex-shrink:0}
.crm-shell .user-card .avatar {width:34px;height:34px;border-radius:10px;background:#fceaf4;color:#a51466;font-size:13px}
.crm-shell .user-card button {border:1px solid var(--line);border-radius:8px;background:#fff;color:#51657b;min-width:32px;min-height:32px;display:grid;place-items:center}
.crm-shell .user-card button:hover {background:var(--canvas);color:var(--ink)}
.crm-shell .topbar {left:236px;height:76px;padding:0 30px;gap:24px;background:#ffffffed;border-bottom:1px solid var(--line);z-index:20}
.crm-shell .global-search {width:min(520px,45vw);height:42px;background:#f5f7fa;border:1px solid #e3e9f0;border-radius:10px;color:#74849a}
.crm-shell .global-search:focus-within {background:#fff;border-color:var(--brand-blue);box-shadow:0 0 0 3px #2068a618}
.crm-shell .global-search input {font-size:13px;color:var(--ink);background:transparent}
.crm-shell .global-search kbd {background:#fff;border:1px solid var(--line);border-radius:5px;color:var(--muted)}
.crm-shell .top-actions {display:flex;align-items:center;gap:10px;flex-shrink:0}
.crm-shell .topbar .communication-link {position:relative;min-height:40px;gap:7px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:#fff;color:#435b74;font-size:12px;font-weight:600}
.crm-shell .topbar .communication-link:hover {color:var(--brand-blue);background:var(--lilac);border-color:#b4cfe7}
.crm-shell .communication-link b {background:var(--brand-pink);color:#fff;font-size:10px}
.crm-shell .account-menu>summary {list-style:none;display:flex;align-items:center;gap:8px;min-height:40px;padding:5px 9px;border:1px solid var(--line);border-radius:9px;background:#fff;color:#435b74;font-size:12px;font-weight:600}
.account-menu>summary::-webkit-details-marker {display:none}
.account-initial {display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:var(--lilac);color:var(--brand-blue);font-size:12px}
.crm-shell .account-menu[open]>summary {border-color:#9ebdd8;background:#f5f9fd}
.crm-shell .account-menu>div {top:calc(100% + 10px);width:226px;padding:8px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px #18344d20;z-index:50}
.crm-shell .account-menu a {padding:10px;border-radius:7px;font-size:13px;color:#435b74}
.crm-shell .account-menu a:hover {background:var(--canvas);color:var(--brand-blue)}
.crm-shell .account-menu form {border-top:1px solid var(--line);padding:8px 4px 4px;margin:6px 0 0}
.crm-shell .account-menu .button {width:100%}
.crm-shell .app-main {margin-left:236px;padding:108px 30px 40px}
.crm-shell .page-head {gap:20px;margin-bottom:26px}
.crm-shell .page-head>div {min-width:0}
.crm-shell .page-head h1 {color:#172d43;font-size:29px;letter-spacing:-.9px;line-height:1.25;overflow-wrap:anywhere}
.crm-shell .page-head p {color:var(--muted);font-size:13px;line-height:1.6}
.crm-shell .eyebrow {font-size:10px;font-weight:700;letter-spacing:1.5px;color:var(--brand-blue)}
.crm-shell .panel,.crm-shell .stat-card,.crm-shell .metrics-strip {border-color:var(--line);box-shadow:var(--shadow);border-radius:var(--radius)}
.crm-shell .panel h2 {color:#22384e}
.crm-shell .stat-card.accent {background:linear-gradient(130deg,#17568e,#2779bf);border:1px solid #1f6da9;color:#fff}
.crm-shell .stat-card.accent p,.crm-shell .stat-card.accent small {color:#e5f1fc}
.crm-shell .stat-card:not(.accent) small {color:#61758a}
.crm-shell .avatar.hero {background:linear-gradient(135deg,#2068a6,#2779bf)}
.crm-shell .progress span {background:linear-gradient(90deg,#2068a6,#2779bf)}
.crm-shell .statement-head {background:linear-gradient(130deg,#193b59,#245d8c)}
.crm-shell .panel-head {padding-bottom:14px}
.crm-shell th {background:#f7f9fc;color:#5a6f85;font-size:11px;letter-spacing:.3px}
.crm-shell td {color:#344b62;font-size:13px;border-color:#e9eef4}
.crm-shell tbody tr:hover {background:#f8fbfe}
.crm-shell .tabs {gap:5px;border-bottom:1px solid var(--line);padding-bottom:6px}
.crm-shell .tabs a {border:1px solid transparent;border-radius:8px;padding:8px 13px;font-size:13px;color:#556a80}
.crm-shell .tabs a:hover {background:#edf2f8}
.crm-shell .tabs a.active {background:#fff;border-color:#cdddea;color:var(--brand-blue);box-shadow:0 1px 3px #17355208}
/* An explicit default surface also covers links carrying only class="button". */
.crm-shell .button,.crm-auth .button,.crm-shell .app-main button:not([class]):not([data-choice-value]) {
  min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:9px 15px;border:1px solid #bdccdb;border-radius:8px;background:#fff;color:#29445e;
  box-shadow:0 1px 2px #15355006;font-size:13px;font-weight:600;line-height:1.35;
  text-decoration:none;cursor:pointer;transition:background-color .15s,border-color .15s,box-shadow .15s;
}
.crm-shell .button:hover,.crm-auth .button:hover,.crm-shell .app-main button:not([class]):not([data-choice-value]):hover {background:#edf4fa;border-color:#829fb9;color:#183e60}
.crm-shell .button.primary,.crm-auth .button.primary {background:var(--brand-blue);border-color:var(--brand-blue);color:#fff;box-shadow:0 2px 3px #15456c16}
.crm-shell .button.primary:hover,.crm-auth .button.primary:hover {background:#185486;border-color:#185486;color:#fff}
.crm-shell .button.secondary,.crm-auth .button.secondary {background:#fff;color:#29445e;border-color:#bdccdb}
.crm-shell .button.secondary:hover,.crm-auth .button.secondary:hover {background:#edf4fa;border-color:#829fb9}
.crm-shell .button.quiet {background:#f4f7fb;border-color:#d6e1eb;color:#39536e;box-shadow:none}
.crm-shell .button.quiet:hover {background:#e7eff7;border-color:#9ab3c9;color:#173e60}
.crm-shell .button.danger,.crm-shell .button.error {background:#fff1f2;color:#a32336;border-color:#edb1ba}
.crm-shell .button.danger:hover,.crm-shell .button.error:hover {background:#ffe2e6;border-color:#d27b88}
.crm-shell .button.small {min-height:32px;padding:6px 10px;font-size:12px}
.crm-shell .button:disabled,.crm-auth .button:disabled,.crm-shell .button[aria-disabled=true] {background:#edf1f5;color:#66758a;border-color:#d4dde6;box-shadow:none;cursor:not-allowed;opacity:.65}
.crm-shell :is(a,button,summary,input,select,textarea):focus-visible,.crm-auth :is(a,button,input):focus-visible {outline:3px solid #2779bf;outline-offset:3px}
.crm-shell .form-card label {font-size:12px;color:#354c63;font-weight:600}
.crm-shell .app-main :is(.form-card,.compact-fields) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {border:1px solid #bbcbd9;border-radius:8px;background:#fff;color:#1b2b3f;box-shadow:0 1px 2px #19345103;min-height:39px}
.crm-shell .app-main :is(input,select,textarea):focus {border-color:var(--brand-blue)}
.crm-shell .helptext {font-size:11px;color:#5c7086;line-height:1.6}
.crm-shell .form-actions {gap:9px;flex-wrap:wrap}
.crm-shell .status {font-size:11px;border-radius:6px;padding:4px 8px}
.crm-shell .communication-row.is-unread .communication-copy {border-left-color:var(--brand-pink)}
.crm-shell .message-bubble {background:#f3f6fa;border:1px solid #e5ebf2}
.crm-shell .message-bubble.message-own {background:#edf5fd;border-color:#d7e7f6}
.sidebar-close,.sidebar-backdrop {display:none}
.crm-auth .login-art {background:linear-gradient(145deg,#f6faff,#edf4fa 65%,#fceef6);color:var(--ink);border-right:1px solid var(--line)}
.crm-auth .login-art:after {border-color:#2779bf07}
.crm-auth .login-art h1 {font-size:44px;color:#1c3954;line-height:1.15;letter-spacing:-1.6px}
.crm-auth .login-art p:not(.eyebrow),.crm-auth .login-art>small {color:#536b82}
.crm-auth .login-art .eyebrow {color:var(--brand-pink)}
.login-brand {display:flex;align-items:center;gap:22px}
.login-brand img {width:155px;height:auto}
.login-brand span {border-left:1px solid #c7d7e5;padding-left:22px;color:#526c82;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.6px}
.login-mobile-logo {display:none}
.crm-auth .auth-form input {border-color:#bbccdc;border-radius:8px;background:#fff}
.crm-auth .auth-form>p>a {color:var(--brand-blue);text-decoration:underline;text-underline-offset:3px}
@media(max-width:1250px) {.crm-shell .communication-link .header-link-label{display:none}.crm-shell .topbar{gap:18px}}
@media(min-width:1101px) {.crm-shell .sidebar{transform:none}.crm-shell .mobile-menu{display:none}}
@media(max-width:1100px) {
  .crm-shell .sidebar {transform:translateX(-100%);width:250px;padding:20px 16px 16px;transition:transform .18s ease;z-index:40}
  .crm-shell.sidebar-open .sidebar {transform:translateX(0);padding-top:20px}
  .crm-shell.sidebar-open .sidebar .brand {display:flex}
  .crm-shell .sidebar nav a {justify-content:flex-start;font-size:13px}
  .crm-shell .sidebar nav a b {position:static;transform:none}
  .crm-shell .sidebar .workspace-label {display:block;font-size:10px}
  .crm-shell .sidebar .user-card>span:nth-child(2) {display:flex;flex-direction:column}
  .crm-shell .sidebar .user-card form {display:block}
  .crm-shell .topbar,.crm-shell.sidebar-open .topbar {left:0;padding:0 16px;gap:12px;z-index:20}
  .crm-shell .top-actions {gap:7px}
  .crm-shell .app-main {margin-left:0;padding:100px 20px 32px}
  .crm-shell .global-search {flex:1;width:auto;min-width:0}
  .crm-shell .global-search kbd {display:none}
  .crm-shell .mobile-menu {display:inline-flex;min-width:42px;min-height:40px;padding:8px}
  .sidebar-close {position:absolute;top:14px;right:12px;display:grid;place-items:center;width:32px;height:32px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#526c82;cursor:pointer}
  .sidebar-backdrop:not([hidden]) {display:block;position:fixed;inset:0;z-index:30;border:0;background:#152c4960;backdrop-filter:blur(2px);cursor:pointer}
  .crm-shell.sidebar-open {overflow:hidden}
}
@media(max-width:760px) {
  .crm-shell .account-label {display:none}
  .crm-shell .page-head h1 {font-size:26px}
  .login-mobile-logo {display:block;margin-bottom:28px;width:125px;height:auto}
}
@media(max-width:600px) {
  .crm-shell .topbar {height:68px;padding:0 10px;gap:8px}
  .crm-shell .app-main {padding:88px 12px 28px}
  .crm-shell .top-actions {gap:5px}
  .crm-shell .topbar .communication-link {min-width:38px;min-height:38px;padding:8px;gap:2px}
  .crm-shell .topbar .communication-link b {position:absolute;right:-4px;top:-5px;border:2px solid #fff;min-width:18px;padding:0 3px;text-align:center}
  .crm-shell .account-menu>summary {min-height:38px;padding:4px 6px;gap:3px}
  .crm-shell .account-menu>summary>svg {display:none}
  .crm-shell .global-search {height:38px}
  .crm-shell .global-search input {font-size:12px;padding-left:0}
  .crm-shell .global-search>svg {display:none}
  .crm-shell .page-head {gap:14px;margin-bottom:20px}
  .crm-shell .button {min-height:40px;padding:9px 12px}
  .crm-shell .button.small {min-height:34px;padding:7px 10px}
  .crm-shell .tabs a {padding:8px 10px}
  .crm-shell .communication-row {padding:20px 0}
  .crm-shell .sidebar nav .nav-caption {display:block}
}
@media(prefers-reduced-motion:reduce) {.crm-shell * {transition:none!important;scroll-behavior:auto!important}}

.crm-shell [hidden],.crm-auth [hidden] {display:none!important}
