/* goals.css - Goals page. Uses base.css tokens/classes (.btn-crm, .input, .check, .link).
   base.css is not modified. Everything scoped to .gl so it cannot leak. */
.gl {
    --gl-green: var(--success, #0b7a43);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    min-height: 100%;
    font-size: 14px;
    line-height: 1.4;
    position: relative
}

.gl svg {
    display: inline-block
}

.gl :where(h1,h2,h3,p) {
    margin: 0
}

.gl-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    white-space: nowrap
}

.gl-pos {
    position: relative;
    display: inline-block
}

.gl-caret {
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-top-color: currentColor;
    border-bottom: 0;
    display: inline-block;
    flex: none
}

/*.gl :is(button,a,input,select,[tabindex]):focus-visible {*/
/*    outline: 2px solid var(--brand);*/
/*    outline-offset: 2px*/
/*}*/

/* header */
.gl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--sp-8);
    border-bottom: 1px solid var(--border);
    border-radius: 12px 12px 0 0
}

.gl-h1 {
    font-size: 22px
}

.gl-head__acts {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap
}

.gl-body {
    padding: var(--sp-6) var(--sp-8) var(--sp-10)
}

/* search + view tabs */
.gl-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: var(--sp-5)
}

.gl-search {
    position: relative;
    width: 232px;
    max-width: 100%
}

.gl-search .input {
    width: 100%;
    height: 40px;
    padding: 0 38px 0 16px;
    border-radius: 8px;
    font-size: 14px
}

.gl-search svg {
    position: absolute;
    right: 14px;
    top: 50%;
    margin-top: -8px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none
}

.gl-seg {
    display: inline-flex;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface)
}

.gl-seg button {
    padding: 9px 22px;
    font-weight: 600
}

.gl-seg button + button {
    border-left: 1px solid var(--border-strong)
}

.gl-seg button.is-on {
    background: var(--surface-3);
    font-weight: 700
}

.gl-seg button:hover {
    background: var(--surface-hover)
}

/* filters */
.gl-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 6px;
    margin-bottom: var(--sp-4)
}

.gl-fb {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap
}

.gl-fb:hover {
    background: var(--surface-hover)
}

.gl-fb.is-on, .gl-fb[aria-expanded="true"] {
    background: var(--surface-3)
}

.gl-fb svg {
    width: 20px;
    height: 20px
}

.gl-fb .gl-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--brand);
    color: var(--brand-contrast);
    font-size: 11px;
    font-weight: 700
}

.gl-range {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500
}

.gl-range button {
    min-width: 32px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    font-size: 26px;
    line-height: 26px;
    font-weight: 100;
    display: flex;
    justify-content: center;
    align-items: normal;
}

.gl-range button:hover:not(:disabled) {
    background: var(--surface-hover)
}

.gl-range button:disabled {
    opacity: .4;
    cursor: not-allowed
}

/* menus */
.gl-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: var(--sp-2) 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    max-height: 340px
}

.gl-menu--r {
    left: auto;
    right: 0
}

.gl-menu--w {
    width: 440px;
    max-width: 90vw
}

.gl-menu--up {
    top: auto;
    bottom: 100%;
    margin: 0 0 8px;
    left: auto;
    right: 0;
    min-width: 180px
}

.gl-menu__s {
    position: relative;
    margin: var(--sp-2) var(--sp-3) var(--sp-2)
}

.gl-menu__s .input {
    width: 100%;
    height: 40px;
    border-radius: 999px;
    padding: 0 38px 0 14px
}

.gl-menu__s svg {
    position: absolute;
    right: 14px;
    top: 50%;
    margin-top: -8px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none
}

.gl-menu__l {
    overflow: auto;
    display: flex;
    flex-direction: column
}

.gl-menu .check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px var(--sp-4);
    color: var(--text);
    cursor: pointer
}

.gl-menu .check:hover, .gl-menu .gl-mi:hover {
    background: var(--surface-hover)
}

.gl-mi {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 10px var(--sp-4);
    white-space: nowrap
}

.gl-mi.is-on {
    font-weight: 700;
    background: var(--surface-hover)
}

.gl-menu__none {
    padding: var(--sp-3) var(--sp-4);
    color: var(--text-muted)
}

.gl-menu hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 6px 0
}

.gl-menu__f {
    padding: 6px var(--sp-4) 2px
}

/* table */
.gl-sel {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm)
}

.gl-sel .link {
    font-weight: 700
}

.gl-tw {
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    overflow-x: auto;
    background: var(--surface)
}

.gl-t {
    width: 100%;
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0
}

.gl-t th, .gl-t td {
    min-width: 180px;
    padding: 16px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--surface)
}

.gl-t th:last-child, .gl-t td:last-child {
    border-right: 0
}

.gl-t tr:last-child td {
    border-bottom: 0
}

.gl-t thead th {
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--text);
    white-space: normal;
    vertical-align: bottom
}

.gl-t th button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: inherit;
    text-align: left
}

.gl-t .gl-c1 {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 48px;
    min-width: 48px;
    padding-left: 14px !important;
    padding-right: 14px !important;
}

.gl-t .gl-c2 {
    position: sticky;
    left: 49px;
    z-index: 3;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    border-right: 3px solid var(--border-strong)
}

.gl-t tbody th {
    font-weight: 400
}

.gl-gn {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.gl-gn .link {
    font-weight: 700;
    text-align: left;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    overflow: hidden !important;
}

.gl-gn small {
    color: var(--text);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px
}

.gl-dash {
    display: block;
    text-align: right;
    color: var(--text)
}

.gl-us {
    display: flex;
    align-items: center;
    gap: 0;
}
.gl-av {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-3);
    border: 3px solid var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: none;
    margin-left: -8px;
}
.gl-av:first-child {margin-left: 0;}
.gl-more {
    font-weight: 700;
    margin-left: 2px
}

.gl-pr {
    min-width: 300px
}

.gl-pr__t {
    display: flex;
    align-items: center;
    gap: 12px
}

.gl-track {
    flex: 1;
    height: 10px;
    border-radius: 5px;
    background: var(--surface-3);
    overflow: hidden
}

.gl-fill {
    display: block;
    height: 100%;
    border-radius: 5px;
    background: var(--gl-green)
}

.gl-fill.is-low {
    background: var(--brand)
}

.gl-pct {
    font-weight: 700;
    min-width: 48px;
    text-align: right
}

.gl-pr__b {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px
}

.gl-pr__b span:first-child {
    color: var(--text)
}

.gl-mpct {
    font-variant-numeric: tabular-nums
}

.gl-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-muted)
}

.gl-empty .link {
    font-weight: 700
}

/* pagination (same design as the forecast page pager) */
.gl-pg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: var(--sp-5) 0 0;
    font-size: 14px
}

.gl-pg__a {
    color: var(--text-muted);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.gl-pg__a:disabled {
    opacity: .5;
    cursor: not-allowed
}

.gl-pg__n {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-weight: 700
}

.gl-pg__n.is-on {
    border-color: var(--text);
    color: var(--text)
}

.gl-pg__e {
    color: var(--text-muted)
}

.gl-pg__sel {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--surface-3)
}

.gl-pg__sel:hover {
    background: var(--surface-hover)
}

/* drawer + dialog */
.gl-ov {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    z-index: 1000
}

.gl-ov--r {
    justify-content: flex-end;
    padding: 0;
    align-items: stretch
}

.gl-drawer {
    background: var(--surface);
    width: 460px;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg)
}

.gl-dlg {
    background: var(--surface);
    width: 640px;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden
}

.gl-mh {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px var(--sp-6);
    border-bottom: 1px solid var(--border);
    font-size: 20px;
    font-weight: 600
}

.gl-x {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    font-size: 24px;
    font-weight: 100;
    line-height: 24px;
    border-radius: 8px;
    background: transparent;
    color: var(--text, #101828);
    cursor: pointer;
}

.gl-x:hover {
    background: var(--surface-hover, #f2f4f7);
}

.gl-mb {
    flex: 1;
    overflow: auto;
    padding: var(--sp-5) var(--sp-6) var(--sp-6)
}

.gl-mf {
    display: flex;
    gap: var(--sp-3);
    padding: 14px var(--sp-6);
    border-top: 1px solid var(--border)
}

.gl-step {
    font-size: 16px;
    margin: 0 0 10px
}

.gl-grp {
    margin-bottom: 28px
}

.gl-cb {
    position: relative
}

.gl-cb__b {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 6px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-align: left
}

.gl-cb__b[aria-expanded="true"] {
    border-color: var(--brand)
}

.gl-cb .gl-menu {
    left: 0;
    right: 0;
    margin-top: 4px;
    min-width: 0
}

.gl-cb .gl-menu__s .input {
    border-color: var(--brand)
}

.gl-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 16px;
    cursor: pointer
}

.gl-vis {
    display: grid;
    gap: 12px
}

.gl-vc {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    padding: 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface)
}

.gl-vc:hover {
    background: var(--surface-hover)
}

.gl-vc.is-on {
    background: var(--surface-3);
    border-color: var(--text)
}

.gl-vc svg {
    width: 36px;
    height: 36px;
    flex: none
}

.gl-vc b {
    display: block;
    font-size: 15px
}

.gl-vc span {
    color: var(--text);
    font-size: 14px
}

.gl-rep {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px
}

.gl-rep svg {
    width: 100%;
    height: auto;
    max-height: 340px
}

.gl-rep text {
    font-size: 11px;
    fill: var(--text-muted)
}

.gl-rep .gl-big {
    font-size: 26px;
    font-weight: 700;
    fill: var(--text)
}

.gl-rep__s {
    color: var(--text-muted);
    text-align: center
}

.gl-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: var(--panel);
    color: var(--panel-text);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    z-index: 1100;
    max-width: 90vw
}

@media (max-width: 760px) {
    .gl-head, .gl-body {
        padding-left: var(--sp-4);
        padding-right: var(--sp-4)
    }

    .gl-range {
        margin-left: 0
    }

    .gl-search {
        width: 100%
    }

    .gl-drawer {
        width: 100%
    }
}

@media (prefers-reduced-motion: reduce) {
    .gl * {
        transition: none !important
    }
}

/* row actions (Edit / Actions) - shown on hover, keyboard focus or when the menu is open */
.gl-t tbody tr:hover > * {
    background: var(--surface-2)
}

.gl-gnw {
    position: relative;
    display: flex;
    align-items: center;
    background: inherit
}

.gl-gn {
    min-width: 0;
    flex: 1
}

.gl-ra {
    display: none;
    gap: 8px;
    padding-left: 10px;
    background: inherit;
    pointer-events: none
}

.gl-ra .btn-crm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border-radius: 999px;
    white-space: nowrap
}

.gl-t tr:hover .gl-ra, .gl-t tr:focus-within .gl-ra, .gl-ra.is-open {
    display: flex;
    pointer-events: auto
}

@media (hover: none) {
    .gl-ra {
        display: flex;
        pointer-events: auto;
        position: static;
        transform: none;
        margin-left: auto
    }
}

.gl-menu--fix {
    position: fixed;
    margin: 0;
    min-width: 300px;
    z-index: 1050
}

.gl-mi--2 {
    display: block;
    white-space: normal
}

.gl-mi--2 small {
    display: block;
    color: var(--text-muted);
    font-size: 13.5px;
    margin-top: 2px
}

/* selection bar: n selected . Clone . Delete . close */
.gl-sel {
    border-radius: var(--radius-lg)
}

.gl-sel__a {
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.gl-sel__x {
    margin-left: auto;
    font-size: 24px;
    line-height: 1;
    padding: 0 6px;
    color: var(--text-muted)
}

.gl-sel__x:hover {
    color: var(--text)
}

/* status badge */
.gl-st {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    white-space: nowrap
}

.gl-st i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    flex: none
}

.gl-st--ok i {
    background: var(--success)
}

.gl-st--warn i {
    background: var(--warning)
}

.gl-st--bad i {
    background: var(--danger)
}

/* disabled contributor radio */
.gl-radio.is-dis {
    color: var(--text-muted);
    cursor: not-allowed
}

/* clone / delete dialogs */
.gl-dlg--s {
    width: 480px
}

.gl-mb--c {
    display: grid;
    gap: var(--sp-4);
    padding-bottom: var(--sp-6)
}

.gl-mf--in {
    border: 0;
    padding: var(--sp-2) 0 0
}

.gl-fld {
    display: grid;
    gap: 8px
}

.gl-dl {
    font-weight: 700
}

.gl-fld .input {
    height: 48px;
    font-size: 16px
}

.gl .btn-crm--danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff
}

.gl .btn-crm--danger:disabled {
    background: var(--surface-3);
    border-color: var(--surface-3);
    color: var(--text-muted);
    cursor: not-allowed
}

/* export dialog */
.gl-dlg--x {
    width: 660px
}

.gl-mb--x {
    display: grid;
    gap: var(--sp-4);
    align-content: start
}

.gl-mb--x hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: var(--sp-1) 0
}

.gl-xrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px
}

.gl-xrow .link, .gl-xmuted .link {
    font-weight: 700
}

.gl-xmuted {
    color: var(--text-muted);
    line-height: 1.8
}

.gl-xmuted .link {
    display: inline
}

.gl-ext {
    margin-left: 4px;
    vertical-align: baseline
}

.gl-xp {
    display: grid;
    gap: 4px
}

.gl-xf {
    display: grid;
    gap: 6px;
    align-content: start
}

.gl-xf .input {
    height: 42px
}

.gl-x2 {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: var(--sp-5)
}

.gl-i {
    display: inline-flex;
    vertical-align: middle;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: help;
    margin-left: 2px
}

.gl-ul {
    list-style: disc;
    padding-left: 20px;
    display: grid;
    gap: 6px
}

.gl-ul .gl-sub {
    list-style: none;
    margin-left: -20px
}

.gl-ul .gl-sub ul {
    list-style: disc;
    padding-left: 40px;
    display: grid;
    gap: 6px
}

.gl-acc {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    text-align: left
}

.gl-chev {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin: 0 4px 0 2px;
    transition: transform .15s
}

.gl-chev.is-open {
    transform: rotate(45deg);
    margin-top: -4px
}

.gl-xc {
    padding-left: var(--sp-6);
    display: grid;
    gap: var(--sp-4)
}

.gl-xc .gl-grp {
    margin: 0;
    display: grid;
    gap: 4px
}

.gl-hint {
    display: block;
    color: var(--text-muted);
    font-size: 13.5px;
    margin-top: 2px
}

.gl-xc .check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 16px;
    padding: 4px 0
}

.gl-xc .check.is-dis {
    color: var(--text-muted)
}

.gl-xc .gl-radio {
    align-items: flex-start
}

.gl-xc .gl-radio input {
    margin-top: 5px
}

.gl-err {
    color: var(--danger);
    font-size: 13px
}

@media (max-width: 640px) {
    .gl-x2 {
        grid-template-columns:1fr
    }
}

/* quick edit drawer (Goal / Notifications tabs) + quick details */
.gl-drawer--q {
    width: 630px
}

.gl-tabs {
    display: grid;
    grid-template-columns:1fr 1fr;
    margin: 0 var(--sp-6);
    border-bottom: 1px solid var(--border-strong)
}

.gl-tab {
    padding: 14px 8px;
    text-align: center;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    color: var(--text)
}

.gl-tab:hover {
    background: var(--surface-hover)
}

.gl-tab.is-on {
    border-bottom-color: var(--text);
    font-weight: 700
}

.gl-mb--q {
    display: grid;
    gap: var(--sp-5);
    align-content: start;
    padding-top: var(--sp-5)
}

.gl-qf {
    display: grid;
    gap: 8px
}

.gl-qin {
    height: 44px;
    font-size: 15px;
    border-color: var(--text)
}

.gl-ro {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2, var(--surface));
    color: var(--text)
}

.gl-qt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px
}

.gl-qt__r {
    display: inline-flex;
    align-items: center;
    gap: 14px
}

.gl-qt__r .link {
    font-weight: 700
}

.gl-range--q {
    margin-left: 0;
    gap: 8px
}

.gl-qg {
    display: grid;
    gap: 12px
}

.gl-qr {
    display: grid;
    grid-template-columns:1fr 1fr 187px;
    align-items: center;
    gap: 12px
}

.gl-qr__m {
    font-weight: 500
}

.gl-qr .input {
    height: 40px;
    width: 100%;
    font-size: 15px
}

.gl-qh {
    font-weight: 700;
    font-size: 16px
}

.gl-qn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 16px;
    padding: 2px 0;
    cursor: pointer
}

.gl-qn__t {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px
}

.gl-qn .gl-hint {
    max-width: 520px
}

.gl-bdg {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    border: 1px solid;
    font-size: 13px;
    line-height: 1.5
}

.gl-bdg--blue {
    color: #0a4fa6;
    background: #e5f0ff;
    border-color: #4a90e2
}

.gl-bdg--green {
    color: #0b6b3a;
    background: #e3f6ec;
    border-color: #4cb78a
}

.gl-bdg--red {
    color: #a1173a;
    background: #fdeaef;
    border-color: #e0607e
}

.gl-qh2 {
    font-size: 16px;
    font-weight: 700
}

.gl-qh2 small {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 6px;
    font-size: 14px
}

.gl-dl2 {
    display: grid;
    gap: 0;
    margin: 0
}

.gl-dr {
    display: grid;
    grid-template-columns:160px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border)
}

.gl-dr dt {
    color: var(--text-muted)
}

.gl-dr dd {
    margin: 0
}

.gl-tg {
    display: grid;
    grid-template-columns:repeat(4, 1fr);
    gap: 10px
}

.gl-tg > div {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm)
}

.gl-tg span {
    color: var(--text-muted);
    font-size: 13px
}

@media (max-width: 760px) {
    .gl-drawer--q {
        width: 100%
    }

    .gl-qr {
        grid-template-columns:1fr 1fr
    }

    .gl-qr .input {
        grid-column: 1/-1
    }

    .gl-tg {
        grid-template-columns:repeat(3, 1fr)
    }
}

/* team / user performance: sticky entity column + goal name column */
.gl-t .gl-c2--n {
    width: 220px;
    min-width: 220px;
    border-right: 1px solid var(--border)
}

.gl-t .gl-c3 {
    position: sticky;
    left: 269px;
    z-index: 3;
    width: 300px;
    min-width: 300px;
    border-right: 3px solid var(--border-strong)
}

.gl-t thead .gl-c3 {
    z-index: 4
}

/* quick details */
.gl-dh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.gl-dh__t {
    font-size: 24px;
    font-weight: 500
}

.gl-dsel {
    height: 44px;
    font-size: 15px;
    border-color: var(--text);
    width: 100%
}

.gl-des {
    display: grid;
    gap: 14px
}

.gl-de {
    display: grid;
    gap: 8px
}

.gl-de__h {
    display: flex;
    align-items: center;
    gap: 10px
}

.gl-de__n {
    flex: 1
}

.gl-av--s {
    min-width: 30px;
    width: 30px;
    height: 30px;
    font-size: 12px
}

.gl-av--s svg {
    width: 14px;
    height: 14px
}

.gl-dupd {
    text-align: right;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px
}

.gl-card {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 16px 18px;
    background: var(--surface);
    position: relative
}

.gl-card__t {
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px
}
.gl-dchart .gl-card__t svg {min-width: 16px !important;width: 16px !important;height: 16px !important;}
.gl-beta {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 0 12px 0 12px
}

.gl-chip {
    display: inline-block;
    background: var(--surface-3);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--text)
}

.gl-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px
}

.gl-leg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin: 10px 0
}

.gl-leg i {
    width: 8px;
    height: 8px;
    background: #00575e;
    transform: rotate(45deg);
    display: inline-block
}

.gl-ytl {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px
}

.gl-dchart svg {
    width: 100%;
    height: auto
}

.gl-dchart text {
    font-size: 10px;
    fill: var(--text-muted)
}

.gl-d2 {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 16px
}

.gl-stat {
    text-align: center;
    display: grid;
    gap: 10px;
    padding: 22px 12px
}

.gl-stat span {
    font-size: 22px;
    font-weight: 600
}

.gl-cur__l {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .02em;
    margin-bottom: 18px
}

.gl-cur__v {
    font-size: 22px;
    font-weight: 500
}

.gl-note {
    font-size: 14px
}

.gl-dd {
    display: grid;
    gap: 0
}

.gl-dr2 {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0
}

.gl-fx {
    color: #0a6fd0
}

.gl-mf--d {
    align-items: center;
    gap: var(--sp-5)
}

.gl-rf {
    font-weight: 700
}

.gl-mb--q hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0
}
/* CRM port: scoped to .gl (the design rule was global) */
.gl input[type="radio"] { accent-color: var(--brand); min-width: 16px; width: 16px; height: 16px; flex: 0 0 16px; }

/* teams / pipelines filter menus */
.gl-menu--t{width:250px;min-width:250px}
.gl-menu__g{font-weight:700;font-size:16px;padding:12px 16px 6px}
.gl-menu__g:first-child{padding-top:6px}
.gl-ot{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.gl-menu .check.is-dis{opacity:.55;cursor:not-allowed}
.gl-menu .check.is-dis:hover{background:transparent}
/* popups: keep scroll inside the popup */
.gl-ov{overscroll-behavior:contain}

/* =====================================================================
   Goal page . goal editor . create wizard . report popup . save as report
   ===================================================================== */
.gl { --gl-orange: var(--brand); }
.gl--sub .gl-head, .gl--edit .gl-head, .gl--edit .gl-body { display: none }
.gl--edit [data-gl-page] { display: block }
[data-gl-page][hidden] { display: none }
.gl-sep { border-right: 3px solid var(--border-strong) !important }
.gl-mhr { border: 0; border-top: 1px solid var(--border); margin: 6px 0 }
.gl-mi--scratch { font-weight: 700 }

/* pagination (reference design): Prev  [1]  Next  [25 per page v] */
.gl-pg .gl-menu--up { left: auto; right: 0; bottom: calc(100% + 8px); min-width: 190px; padding: 6px; border-radius: 12px; box-shadow: 0 6px 24px rgba(20, 30, 50, .16) }
.gl-pg .gl-mi { padding: 9px 12px; border-radius: 6px; font-weight: 400 }
.gl-pg .gl-mi.is-on { font-weight: 700; background: #eef2f6 }

/* ---- goal page */
.gv-bar { display: block !important; padding: 0 }
.gv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap }
.gv-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text); padding: 2px 0 }
.gv-back:hover { text-decoration: underline }
.gv-t { margin: 4px 0 0; font-size: 22px; font-weight: 600 }
.gv-acts { display: flex; align-items: center; gap: var(--sp-4) }
.gv-meta { display: flex; gap: 8px 56px; flex-wrap: wrap; margin: var(--sp-5) 0 var(--sp-5) }
.gv-meta dt { color: var(--text-muted); font-size: 14px }
.gv-meta dd { margin: 2px 0 0; font-weight: 500 }
.gv-tabs { display: flex; gap: var(--sp-2); border-bottom: 1px solid var(--border);max-width: 100%;margin: 0;padding: 0; }
.gv-tab { padding: 12px 24px; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px }
.gv-tab:hover { background: var(--surface-hover) }
.gv-tab.is-on { border-bottom-color: var(--text); font-weight: 700 }
.gv-clear { font-weight: 700; padding: 8px 12px }
.gv-clear:disabled { opacity: .5; cursor: default }
.gv-empty { text-align: center; padding: 40px 16px }
.gv-empty h2 { font-size: 20px; font-weight: 600; margin: 8px 0 }
.gv-empty p { max-width: 900px; margin: 0 auto }
.gx-art { width: 180px; height: auto; display: block; margin: 0 auto }
.gx-art--t { width: 120px;min-width: 120px; margin: 0 }
.gv-grid { display: grid; gap: var(--sp-5); margin-top: var(--sp-5) }
.gv-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px 18px; background: var(--surface); min-width: 0 }
.gv-card__h { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.gv-card__h h3 { margin: 0; font-size: 18px; font-weight: 500 }
.gv-card__t { display: inline-flex; align-items: center; gap: 4px }
.gv-ib { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text) }
.gv-ib:hover { background: var(--surface-hover) }
.gv-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px }
.gv-chip { display: inline-block; background: #e9edf1; border-radius: 999px; padding: 3px 10px; font-size: 12px }
.gv-leg { font-size: 12px; margin: 6px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.gv-leg__l { width: 14px; height: 2px; background: #33475b; display: inline-block }
.gv-leg__d { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 8px }
.gv-ytl { font-weight: 700; font-size: 12px; margin: 8px 0 0 }
.gv-gauge { text-align: center; max-width: 420px; margin: 0 auto; padding: 6px 0 26px }
.gv-gauge svg { width: 100%; height: auto }
.gv-gp { font-size: 22px; margin: -34px 0 0; position: relative }
.gv-gs { font-size: 13px; font-weight: 700; margin: 4px 0 0 }
.gv-chart { position: relative }
.gv-chart svg { width: 100%; height: auto; display: block }
.gv-chart text { font-size: 11px; fill: var(--text) }
.gv-chart .gv-dl { font-size: 10px; font-weight: 700 }
.gv-chart .gv-axt { font-weight: 700; font-size: 11px }
.gv-chart .gv-yl { font-size: 12px }
.gv-tip { position: absolute; z-index: 5; min-width: 230px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); font-size: 12px; pointer-events: none }
.gv-tip__h { background: #eef2f6; padding: 8px 10px; border-radius: 6px 6px 0 0 }
.gv-tip__b { padding: 8px 10px }
.gv-tip__b p { margin: 3px 0; display: flex; gap: 6px; align-items: center }
.gv-tip__b i { width: 8px; height: 8px; border-radius: 50%; display: inline-block }
.gv-tip__t { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 4px }
.gv-tip__v { margin-left: auto }
.gv-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5) }
.gv-cl { margin: 14px 0 0 }
button.gv-cl { display: block; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer }
.gv-cl--go:hover { color: var(--brand); text-decoration: underline }
.gv-cl--go:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px }
.gv-big { font-size: 24px; margin: 8px 0 14px }
@media (max-width: 900px) { .gv-3 { grid-template-columns: 1fr } }

/* ---- shared form pieces */
.gx-f { margin: 0 0 20px }
.gx-lbl { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px }
.gx-req { color: var(--text) }
.gx-i { vertical-align: -2px }
.gx-err { color: var(--danger); font-size: 13px; margin: 6px 0 0 }
.gx-muted, .gx-help { color: var(--text-muted); font-size: 14px;}
.gx-notice { font-size: 14px }
.gx-notice, .gx-help { margin-bottom: 12px }
.gx-none { padding: 10px 14px; color: var(--text-muted); margin: 0 }
.gx-tip { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 14px; margin: 0 }
.gx-ph { color: var(--text-muted) }
.gx-dd { position: relative }
.gx-ddb { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border: 1px solid var(--text); border-radius: 8px; background: #fff; text-align: left; font-size: 14px }
.gx-dd.is-dis .gx-ddb, .gx-ddb.is-dis { background: #f1f1f1; border-color: #e3e3e3; color: #8b8b8b; cursor: not-allowed }
.gx-ddb[aria-expanded="true"] { border-color: #2f7fd0 }
.gx-ddp { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgba(20, 30, 50, .18); padding: 8px 0; min-width: 220px }
.gx-ddp--up { top: auto; bottom: calc(100% + 4px) }
.gx-ddq { display: flex; align-items: center; margin: 0 8px 6px; border: 1.5px solid #2f7fd0; border-radius: 999px; padding: 0 14px; height: 38px }
.gx-ddq input { border: 0; outline: 0; flex: 1; font: inherit; background: none; min-width: 0 }
.gx-ddq svg { width: 16px; height: 16px; color: var(--text-muted) }
.gx-ddl { max-height: 250px; overflow: auto }
.gx-ddi { display: block; width: 100%; text-align: left; padding: 10px 16px; font-size: 14px }
.gx-ddi small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 4px }
.gx-ddi:hover:not(:disabled), .gx-ddi.is-on { background: #eef2f6 }
.gx-ddi.is-lock { color: #8b8b8b; font-weight: 700; cursor: not-allowed }
.gx-ddi--clear { color: var(--brand); font-weight: 700 }
.gx-ddl--d .gx-ddi { padding: 8px 16px }
.gx-ddf { border-top: 1px solid var(--border); padding: 8px 16px 2px; margin-top: 4px }
.gx-opt { display: flex; align-items: center; gap: 10px; padding: 8px 16px; width: 100% }
.gx-opt:hover { background: #eef2f6 }
.gx-opt.is-dis { opacity: .5; cursor: not-allowed }
/* QA #584: a user's email under the name tells apart users with the same name. */
.gx-opt .gl-ot small { display: block; color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis }
.gx-h3 { font-size: 16px; font-weight: 700; margin: 18px 0 8px !important; }
.gx-h3.crm-mt-0 { margin-top: 0 !important; }
.gx-warn { display: flex; gap: 6px; align-items: flex-start }
.gx-ul { margin: 6px 0 12px; padding-left: 22px }
.gx-tpl { display: block; margin: 8px 0 }
.gx-dz { border: 1px dashed var(--border-strong); border-radius: 6px; background: #f2f2f2; padding: 24px 16px; text-align: center; display: grid; gap: 4px; justify-items: center }
.gx-dz p { margin: 0; display: inline-flex; align-items: center; gap: 8px }
.gx-dz small { color: var(--text-muted) }
.gx-dz.has-file { background: #e9e9e9 }
.gx-amt { display: flex; align-items: center; gap: 12px }
.gx-amt .input { flex: 1 }
.gx-btn--danger { background: #b3002f !important; color: #fff; border-color: #b3002f }
.gx-btn--blue { border-color: #2f7fd0; color: var(--text) }
.gx-dlg--s { width: min(460px, 94vw) }
.gx-dlg--l { width: min(600px, 94vw) }
.gx-dlg--xl { width: min(1380px, 94vw); max-height: 92vh; display: flex; flex-direction: column; overflow: visible }
.gx-dlg .gx-mb { max-height: 70vh; overflow: auto }
.gx-mh--big { font-size: 26px; font-weight: 300; padding-top: 22px; padding-bottom: 22px }
.gx-mh--big span { font-size: 20px; font-weight: 600 }
.gx-sel { margin-bottom: 12px }
.gx-tw { margin-top: 0 }
.gx-t th, .gx-t td { white-space: nowrap }
.gx-t .gx-c2 { position: sticky; left: 49px; z-index: 2; background: var(--surface); min-width: 170px; max-width: 220px; border-right: 3px solid var(--border-strong); text-align: left; font-weight: 400 }
.gx-t thead .gx-c2 { z-index: 3; color: var(--text-muted) }
.gx-t tfoot th, .gx-t tfoot td { font-weight: 700; border-top: 1px solid var(--border-strong) }
.gx-ell { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom }
.gx-u { white-space: normal; min-width: 120px }
.gx-n { width: 150px; height: 40px }
.gx-yt { min-width: 140px }
.gx-ym { color: var(--text-muted); font-size: 13px }
.gx-per { white-space: normal; min-width: 220px; font-weight: 400 }
.gx-per span { display: block }
.gx-ni { margin-bottom: 14px }
.gx-ni p { margin: 2px 0 0 30px; color: var(--text-muted); font-size: 14px }
.gx-nt { display: inline-flex; align-items: center; gap: 8px; font-size: 16px }

/* ---- goal editor */
.ge { display: flex; flex-direction: column; min-height: 100vh }
.ge-hd { padding: 0 max(24px, calc((100% - 1300px) / 2)); border-bottom: 1px solid var(--border-strong) }
.ge-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 }
.ge-t { margin: 0; font-size: 20px; font-weight: 600 }
.ge-acts { display: flex; gap: 10px }
.ge-tabs { display: flex; gap: 8px }
.ge-tab { padding: 12px 28px 12px 0; margin-right: 8px; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px }
.ge-tab.is-on { border-bottom-color: var(--text); font-weight: 700 }
.ge-b { flex: 1; padding: 28px max(24px, calc((100% - 1300px) / 2)) 36px }
.ge-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; margin: 0 auto }
.ge-h2 { font-size: 16px; font-weight: 700; margin: 0 0 16px }
.ge-defh { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px }
.ge-defh .ge-h2 { margin: 0 }
.ge-chk { display: flex; margin: -8px 0 20px; color: var(--text-muted) }
.ge-prev { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px 32px; min-height: 200px; box-shadow: 0 1px 6px rgba(0, 0, 0, .08); cursor: pointer; background: #fff }
.ge-prev:hover { border-color: var(--border-strong) }
.ge-prev__l { font-weight: 700; font-size: 12px; letter-spacing: .04em; margin-top: 8px }
.ge-prev__v { font-size: 22px; font-weight: 500 }
.ge-hint { margin: 16px 0 }
.ge-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap }
.ge-tools__r { display: flex; align-items: center; gap: 10px }
.ge-nt { max-width: 650px; margin: 0 auto }
.ge-nt hr { border: 0; border-top: 1px solid var(--border-strong); margin: 20px 0 }
.ge-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 32px; background: #eceff1; border-top: 1px solid var(--border) }
.ge-bar[hidden] { display: none }
@media (max-width: 900px) { .ge-two { grid-template-columns: 1fr } }

/* ---- create-a-goal wizard */
.cw { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: var(--surface); color: var(--text) }
.cw :where(h2, h3, h4, p) { margin: 0 }
.cw-top { display: grid; grid-template-columns: 140px minmax(0, 1fr) 140px; align-items: start; padding: 14px 40px 10px; flex: none }
.cw-ttl { font-weight: 700; font-size: 14px; padding-top: 6px }
.cw-cnt { justify-self: end; font-size: 14px; padding-top: 6px; white-space: nowrap }
.cw-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none }
.cw-s { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: 14px }
.cw-s:not(:first-child)::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--text) }
.cw-s.is-on:not(:first-child)::before, .cw-s.is-done:not(:first-child)::before { background: var(--gl-orange) }
.cw-dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--text); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: #fff }
.cw-s.is-on .cw-dot { border-color: var(--gl-orange) }
.cw-s.is-done .cw-dot { border-color: var(--gl-orange); background: var(--gl-orange) }
.cw-b { flex: 1; overflow: auto; border-bottom: 1px solid var(--border-strong); padding: 0 24px }
.cw-c { max-width: 600px; margin: 0 auto; padding: 36px 0 24px }
.cw-c--w { max-width: 1240px }
.cw-c--t { max-width: none; padding: 36px 16px 80px }
.cw-c--n { max-width: 650px }
.cw-h2 { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 38px !important }
.cw-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px;margin: 0 auto }
.cw-prev { margin: 20px 0;border: 1px solid var(--border); border-radius: 14px; min-height: 220px; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; justify-content: center }
.cw-prev > p { align-self: center; font-weight: 700; text-align: center }
.cw-prev .gx-art { margin: 0 auto }
.cw-side p.ge-hint {margin-bottom: 20px;text-align: left;}
.cw-side p .link {margin-bottom: 8px;text-align: left;}
.cw-rd { margin-bottom: 14px }
.cw-radio { display: inline-flex; align-items: center; gap: 10px; font-size: 16px }
.cw-rb { border-radius: 50% }
.cw-ind { margin: 10px 0 0 30px }
.cw-hint { font-size: 14px; margin: 6px 0 0 }
.cw-fy { display: flex; margin-top: 8px }
.cw-msb { cursor: pointer }
.cw-msv { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0 }
.cw-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f6; border-radius: 8px; padding: 4px 4px 4px 6px; font-size: 13px }
.cw-chip button { width: 18px; height: 18px; border-radius: 50%; line-height: 1 }
.cw-rn { display: inline-flex; align-items: center; gap: 8px }
.cw-tpl { display: flex; gap: 20px; align-items: center; border: 1px solid var(--border); border-radius: 14px; padding: 20px }
.cw-tpl h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px }
.cw-tpl p { color: var(--text-muted); margin-bottom: 12px }
.cw-sn { margin-top: 28px !important }
.cw-nt { margin: 8px 0 }
.cw-hr { border: 0; border-top: 1px solid var(--border-strong); margin: 20px 0 }
.cw-ft { display: flex; align-items: center; justify-content: space-between; padding: 14px 36px; flex: none }
.cw-fl { display: flex; align-items: center; gap: 18px }
.cw-cn { font-weight: 700 }
.cw > .gl-ov { z-index: 1100 }
@media (max-width: 900px) { .cw-two { grid-template-columns: 1fr } .cw-top { padding: 12px 16px } }

/* ---- report popup */
.rp-bar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; flex: none; position: relative }
.rp-count { font-size: 15px }
.rp-sep { width: 1px; height: 30px; background: var(--border) }
.rp-gb { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 14px; font-weight: 500 }
.rp-gb[aria-expanded="true"] { background: #e5f5f8; border-color: #00a4bd }
.rp-more { margin-left: auto }
.rp-gp { width: 300px; right: auto; top: calc(100% + 6px) }
.rp-grid { flex: 1; overflow: auto; margin: 0 16px; min-height: 120px }
.rp-t { width: 100%; border-collapse: collapse; font-size: 14px }
.rp-t th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 400; color: var(--text-muted); padding: 12px 8px; border-bottom: 1px solid var(--text) }
.rp-t th:not(:first-child), .rp-t td:not(:first-child) { padding-left: 24px }
.rp-sort { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; color: var(--text-muted) }
.rp-t td { padding: 14px 8px; border-bottom: 1px solid var(--border); white-space: nowrap }
.rp-t tbody tr:hover td { background: #eef2f6 }
.rp-none { text-align: center; color: var(--text-muted) }
.rp-foot { flex: none; padding: 4px 24px 14px }
.rp-pg { padding-top: 10px }

/* ---- save as report drawer */
.sv-intro { margin: 0 0 18px }
.sv-tags { cursor: pointer }
.sv-tag { display: inline-flex; align-items: center; gap: 4px; background: #eef2f6; border-radius: 4px; padding: 4px 4px 4px 10px; font-size: 13px; }
.sv-tag button { width: 18px; height: 18px; line-height: 1 }
.sv-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c) }
.sv-ta { height: auto; padding: 10px 12px; width: 100%; resize: vertical; font: inherit }
.sv-cnt { display: block; text-align: right; font-size: 12px; color: var(--text-muted) }
.sv-dash { border: 0; padding: 0; margin: 0 }
.sv-dash legend { font-weight: 700; margin-bottom: 10px; padding: 0 }
.sv-dash .check { display: flex; margin-bottom: 10px }
.gx-ddq input:focus, .gx-ddq input:focus-visible { outline: 0; box-shadow: none }

/* ---- separate pages: full-screen (no side menu / top bar), Create goal menu, template picker */
.gl-bare-body { margin: 0; background: var(--surface) }
.gl--bare { border: 0; border-radius: 0; min-height: 100vh }
.gl--bare .gl-head, .gl--bare .gl-body { display: none }
.gl--bare [data-gl-page] { display: block }
.gl--bare [data-gl-page][hidden] { display: none }
.gl-menu--cg { width: 340px; min-width: 340px }
.gl-menu--cg .gl-mi { padding: 12px var(--sp-4) }
.gl-menu--cg .gl-mi small { font-weight: 400 }
.gl-barbtn { display: block; width: 100%; text-align: left; cursor: pointer; border-radius: 6px }
.gl-barbtn:hover { background: var(--surface-hover) }
.gx-tplq { margin: 0 0 12px }
.gx-tpl-l { display: grid; gap: 8px; max-height: 52vh; overflow: auto }
.gx-tpl-i { display: block; text-align: left; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px }
.gx-tpl-i:hover, .gx-tpl-i:focus-visible { border-color: var(--brand); background: var(--surface-hover) }
.gx-tpl-i small { display: block; color: var(--text-muted); font-size: 13px; margin-top: 2px }
.check input + .check__box.cw-rb,
.check input:checked + .check__box.cw-rb {border-radius: 4px;}
.gl-dlg.gx-dlg.gx-dlg--s {overflow: visible;}
.gl-dlg.gx-dlg.gx-dlg--s .gx-mb{overflow: visible;max-height: 100%;}
.gx-tip .gx-i {min-width: 16px;width: 16px;height: 16px;}
.ge-side .link {text-align: left;}
.gl-drawer.gl-drawer--q.gx-dlg[aria-label="Save as report"] .gx-mb{max-height: unset !important;}
.gl-drawer.gl-drawer--q.gx-dlg[aria-label="Save as report"] .cw-ind {margin: 10px 0 12px 30px;}

@media (max-width: 1024px) {
    .gx-t .gx-c3,
    .gl-t .gl-c3{position: unset !important;}
}
@media (max-width: 991px) {
    .cw-sl {font-size: 12px}
    .cw-c--t { padding: 36px 0 36px;}
    .cw .cw-b .cw-c, .cw .cw-b .cw-c--n {max-width: 100%;}
    .cw-two, .ge-two {gap: 8px;}
    .gl-t .gl-c1, .gx-t .gx-c2, .gx-t .gx-c3,
    .gl-t .gl-c1, .gl-t .gl-c2, .gl-t .gl-c3{position: unset !important;}
}
@media (max-width: 767px) {
    .gl-pg, .gv-acts {flex-wrap: wrap;}
    .gl-sel {flex-wrap: wrap;row-gap: 2px;column-gap: 8px;}
    .ge-tabs {gap: 8px;}
    .ge-tabs, .gl-seg, .gv-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .gl.gl--bare .ge-hd {padding: 0 12px;}
    .ge-tab, .gl-seg button, .gv-tabs .gv-tab {padding: 12px 6px;min-width: fit-content;}
    .ge-tools__r {flex-wrap: wrap;}
    .cw-ft, .ge-bar {padding: 12px;}
    .ge-bar {flex-wrap: wrap;}
    .cw-c.cw-c--n .cw-tpl {flex-direction: column;gap: 12px;}
    .gx-art--t {width: 88px;min-width: 88px;}
    .ge-h {flex-direction: column;justify-content: left;gap: 12px;align-items: flex-start;}
}
@media (max-width: 720px) {
    .cw-top {
        grid-template-columns: 1fr auto;
        padding: 12px 16px;
    }
    .cw-steps {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 8px;
    }
    .cw-sl {font-size: 10px;}
}

/* Create-template dialog and centered goal-definition dialog */
.gl .gx-template-dlg {
    width: min(560px, 94vw);
    border-radius: 12px;
}
.gl .gx-template-dlg .gl-mh {
    padding: 16px 22px;
    font-size: 16px;
    font-weight: 600;
}
.gl .gx-template-dlg .gx-template-body {
    padding: 20px 24px 8px;
}
.gl .gx-template-dlg .gl-fld { margin-bottom: 18px; }
.gl .gx-template-dlg .gx-lbl {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
}
.gl .gx-template-dlg input.input {min-height: 40px;}
.gl .gx-template-dlg input.input,
.gl .gx-template-dlg textarea.input {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    padding: 9px 12px;
    font: inherit;
}
.gl .gx-template-dlg textarea.input, textarea#cwTplDesc {min-height: 80px;height: 80px;padding-top: 8px;}
/* CRM port: scoped to .gl (the design rule was global) */
.gl textarea {resize: none !important;}
.gl .gx-template-dlg .gx-template-foot {
    padding: 8px 24px 20px;
    border-top: 0;
}
.gl .gx-template-dlg [data-cw-tplsave]:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.gl .gx-template-dlg .gx-info {
    color: var(--text-muted);
    font-size: 12px;
    cursor: help;
}
.gl .gl-goal-definition {
    width: min(550px, 94vw);
    max-height: min(82vh, 720px);
    border-radius: 16px;
}
.gl .gl-goal-definition .gl-mh {
    padding: 22px 32px;
    font-size: 22px;
    font-weight: 700;
}
.gl .gl-goal-definition__body {
    padding: 24px 32px 28px;
}
.gl .gl-goal-definition__body h2 {
    margin: 0 0 16px;
    font-size: 20px;
}
.gl .gl-definition-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 0 0 12px;
    font-size: 15px;
}
.gl .gl-definition-row b { min-width: 105px;font-weight: 600 !important; }
.gl .gl-goal-definition__body h3 {font-weight: 600 !important; }
.gl .gl-goal-definition__body h3 {
    margin: 16px 0 8px;
    font-size: 16px;
}
.gl .gl-goal-definition__body p {
    margin: 0;
    font-size: 15px;
}
.gl .gl-definition-filters { margin: 16px 0 20px; }
.gl .gl-definition-filters summary {
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}
.gl .gl-definition-filters p { margin-top: 12px; color: var(--text-muted); }
.gl .gl-definition-done {
    min-width: 100px;
    border-radius: 24px;
}
.gl-definition-svg-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}
.gl-dlg select.input {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.create-template-h1 {text-align: center;width: 100%;display: block !important;}

@media (max-width: 767px) {
    .gl-definition-svg-area svg.gx-art.gx-art--t {display: none;}
    .gl-menu--r {left: 0;right: auto;}
    .refresh-goal-progress-link {min-width: 100%;}
}
@media (max-width: 600px) {
    .gl .gl-goal-definition .gl-mh { padding: 18px 20px; }
    .gl .gl-goal-definition__body { padding: 20px; }
    .gl .gl-definition-row, .rp-bar { flex-wrap: wrap; gap: 5px 10px; }
    .rp-bar .rp-more {margin-left: 0;}
}

/* chip hover / focus tooltip (date range + active filters) */
.gv-chip--tip { cursor: pointer }
.gv-chip--tip:hover, .gv-chip--tip:focus-visible { background: var(--surface-hover, #dfe4ea) }
.gv-chip--tip:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px }
.gv-ctip { position: fixed; z-index: 10100; max-width: min(260px, calc(100vw - 16px)); padding: 14px 18px; background: var(--surface, #fff); border: 1px solid var(--border, #e4e7ec); border-radius: 12px; box-shadow: 0 6px 22px rgba(16, 24, 40, .16); font-size: 14px; line-height: 1.4; pointer-events: none }
.gv-ctip[hidden] { display: none }
.gv-ctip p { margin: 0 }
.gv-ctip__h { font-weight: 700 }
.gv-ctip__v { margin: 4px 0 0; color: var(--text-muted, #516f90) }
.gv-ctip__h + .gv-ctip__v + .gv-ctip__h { margin-top: 10px }
.gv-ctip__l { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px }
.gv-ctip__l li { position: relative; padding-left: 12px }
.gv-ctip__l li::before { content: ''; position: absolute; left: 0; top: .5em; border-left: 5px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent }
.cw-ft, .cw-ft .cw-fr {gap: 8px;}
.cw-ft .cw-fr {display: flex;flex-wrap: wrap;}
@media screen and (max-width: 767px){
    .cw-ft .cw-fr, .cw-ft {flex-direction: column;}
}
