/* App shell (sidebar, top bar, avatar menu, footer) and dashboard,
   from the Claude Design file "Camimac CRM Shell". */

:root {
    --cm-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --cm-bg: #f5f6f9;
    --cm-surface: #ffffff;
    --cm-border: #e6e8ef;
    --cm-border-soft: #f0f2f6;
    --cm-ink: #141a2e;
    --cm-text: #4a5170;
    --cm-muted: #8a91a8;
    --cm-faint: #9aa1b4;
    --cm-navy: #1f3a8f;
    --cm-navy-tint: #eef2fb;
    --cm-green: #2bb04a;
    --cm-green-dark: #1f8a3a;
    --cm-green-tint: #e7f6ea;
    --cm-amber: #b26a00;
    --cm-amber-tint: #fff4e0;
    --cm-red: #c0392b;
    --cm-red-tint: #fdecea;
    --cm-sidebar-w: 264px;
    --cm-rail-w: 76px;
}

body.cm-body {
    margin: 0;
    padding: 0;
    background: var(--cm-bg);
    font-family: var(--cm-font);
    color: var(--cm-ink);
    -webkit-font-smoothing: antialiased;
}

body.cm-body h1, body.cm-body h2, body.cm-body h3, body.cm-body h4, body.cm-body h5, body.cm-body h6,
body.cm-body .btn, body.cm-body input, body.cm-body select, body.cm-body textarea, body.cm-body table {
    font-family: var(--cm-font);
}

.cm-shell {
    height: 100vh;
    display: flex;
    background: var(--cm-bg);
    overflow: hidden;
}

.cm-shell button {
    font-family: var(--cm-font);
}

.cm-shell svg {
    flex: none;
}

/* ---------- sidebar ---------- */

.cm-sidebar {
    width: var(--cm-sidebar-w);
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--cm-surface);
    border-right: 1px solid var(--cm-border);
    transition: width .2s ease;
    overflow: hidden;
    z-index: 40;
}

.cm-brand {
    height: 68px;
    flex: none;
    display: flex;
    align-items: center;
    padding: 0 18px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--cm-border);
}

.cm-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    white-space: nowrap;
    text-decoration: none !important;
}

.cm-brand-mark {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(20, 26, 46, .08);
    overflow: hidden;
}

.cm-brand-mark img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.cm-brand-name {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--cm-navy);
    text-transform: uppercase;
}

.cm-brand-name span {
    color: var(--cm-green);
}

/* organization logo replaces the Camimac wordmark when the org uploaded one */
.cm-org-logo {
    display: none;
    width: 100%;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
}

.cm-has-org-logo .cm-brand-link .cm-brand-mark,
.cm-has-org-logo .cm-brand-link .cm-brand-name {
    display: none;
}

.cm-has-org-logo .cm-brand-link {
    flex: 1;
}

.cm-has-org-logo .cm-org-logo {
    display: block;
}

.cm-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
}

.cm-nav-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cm-nav-title {
    padding: 4px 12px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cm-green);
    white-space: nowrap;
}

.cm-nav-divider {
    display: none;
    height: 1px;
    margin: 4px 14px 8px;
    background: var(--cm-border);
}

.cm-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--cm-text) !important;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background .12s, color .12s;
}

.cm-nav-item svg {
    color: var(--cm-muted);
}

.cm-nav-item:hover {
    background: var(--cm-bg);
}

.cm-nav-item.is-active {
    background: var(--cm-navy-tint);
    color: var(--cm-navy) !important;
    font-weight: 700;
}

.cm-nav-item.is-active svg {
    color: var(--cm-navy);
}

.cm-nav-label {
    flex: 1;
}

.cm-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 10px;
    background: #eef0f6;
    color: var(--cm-text);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cm-badge:empty {
    display: none;
}

.cm-sidebar-foot {
    height: 44px;
    flex: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-top: 1px solid var(--cm-border);
}

.cm-collapse {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--cm-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cm-collapse:hover {
    background: var(--cm-bg);
}

.cm-collapse svg {
    transition: transform .2s;
}

/* collapsed rail (user choice on desktop, always on tablet) */
.cm-collapsed .cm-sidebar {
    width: var(--cm-rail-w);
}

.cm-collapsed .cm-brand {
    padding: 0 19px;
}

.cm-collapsed .cm-brand-name,
.cm-collapsed .cm-nav-title,
.cm-collapsed .cm-nav-label,
.cm-collapsed .cm-badge,
.cm-collapsed .cm-collapse span {
    display: none;
}

.cm-collapsed .cm-brand-mark {
    width: 38px;
    height: 38px;
}

.cm-collapsed.cm-has-org-logo .cm-org-logo {
    width: 38px;
    height: 38px;
    background-position: center;
}

.cm-collapsed .cm-nav-divider {
    display: block;
}

.cm-collapsed.cm-org-logo-wide .cm-org-logo {
    display: none;
}

.cm-collapsed.cm-org-logo-wide .cm-brand-link .cm-brand-mark {
    display: flex;
}

.cm-collapsed .cm-nav-section:first-child .cm-nav-divider {
    display: none;
}

.cm-collapsed .cm-nav-item,
.cm-collapsed .cm-collapse {
    justify-content: center;
    padding: 0;
}

.cm-collapsed .cm-collapse svg {
    transform: scaleX(-1);
}

/* ---------- main column ---------- */

.cm-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cm-header {
    height: 68px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: var(--cm-surface);
    border-bottom: 1px solid var(--cm-border);
    position: relative;
    z-index: 20;
}

.cm-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cm-crumb {
    font-size: 12px;
    font-weight: 500;
    color: var(--cm-muted);
    white-space: nowrap;
}

.cm-crumb-link {
    color: var(--cm-muted);
    font-weight: 600;
}

.cm-crumb-link:hover {
    color: var(--cm-navy);
}

.cm-crumb:empty {
    display: none;
}

.cm-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--cm-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cm-search-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.cm-search {
    position: relative;
    width: 100%;
    max-width: 420px;
    min-width: 220px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 14px;
    box-sizing: border-box;
    border-radius: 10px;
    background: var(--cm-bg);
    border: 1px solid var(--cm-border);
}

.cm-search:focus-within {
    border-color: #c9d2ea;
    background: #fff;
}

.cm-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: 500 14px var(--cm-font);
    color: var(--cm-ink);
}

.cm-search input::placeholder {
    color: var(--cm-faint);
}

.cm-kbd {
    flex: none;
    padding: 3px 7px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--cm-border);
    font: 600 11px ui-monospace, Menlo, monospace;
    color: var(--cm-muted);
}

.cm-search-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 46px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--cm-border);
    border-radius: 12px;
    box-shadow: 0 24px 48px -16px rgba(20, 26, 46, .22), 0 4px 12px -4px rgba(20, 26, 46, .08);
    max-height: 60vh;
    overflow-y: auto;
}

.cm-search.is-open .cm-search-results {
    display: block;
}

.cm-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--cm-ink) !important;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none !important;
}

.cm-search-result svg {
    color: var(--cm-muted);
}

.cm-search-result small {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--cm-faint);
}

.cm-search-result.is-selected,
.cm-search-result:hover {
    background: var(--cm-bg);
}

.cm-search-empty {
    padding: 10px;
    font-size: 13px;
    color: var(--cm-muted);
}

.cm-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.cm-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cm-border);
    border-radius: 10px;
    background: #fff;
    color: var(--cm-text);
    cursor: pointer;
}

.cm-icon-btn:hover {
    background: var(--cm-bg);
}

.cm-menu-btn,
.cm-search-icon {
    display: none;
}

.cm-create {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 12px;
    border: 0;
    border-radius: 10px;
    background: var(--cm-green);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px -10px rgba(43, 176, 74, .8);
}

.cm-create:hover {
    background: #26a844;
}

.cm-header-divider {
    width: 1px;
    height: 28px;
    background: var(--cm-border);
    margin: 0 6px;
}

.cm-pop-wrap {
    position: relative;
}

.cm-pop {
    display: none;
    position: absolute;
    right: 0;
    top: 54px;
    z-index: 31;
    background: #fff;
    border: 1px solid var(--cm-border);
    border-radius: 16px;
    box-shadow: 0 24px 48px -16px rgba(20, 26, 46, .22), 0 4px 12px -4px rgba(20, 26, 46, .08);
    overflow: hidden;
    transform-origin: top right;
}

.cm-pop.is-open {
    display: block;
    animation: cmDrop .14s ease-out both;
}

@keyframes cmDrop {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.cm-pop-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cm-pop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--cm-ink) !important;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    text-decoration: none !important;
    white-space: nowrap;
}

.cm-pop-item[hidden] {
    display: none;
}

.cm-pop-item svg {
    color: var(--cm-text);
}

.cm-pop-item:hover {
    background: var(--cm-bg);
}

.cm-create-menu {
    width: 220px;
}

/* avatar + menu */
.cm-user-btn {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 4px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.cm-user-btn:hover,
.cm-user-btn.is-open {
    background: var(--cm-bg);
}

.cm-user-btn.is-open {
    border-color: #d9dde8;
}

.cm-user-btn > svg {
    transition: transform .15s;
}

.cm-user-btn.is-open > svg {
    transform: rotate(180deg);
}

.cm-avatar {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    background: var(--cm-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--cm-green);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* a photo with see-through parts sits on white, not on the navy initials circle */
.cm-avatar.has-photo {
    color: transparent;
    background-color: #fff;
}

.cm-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    white-space: nowrap;
}

.cm-user-text b {
    font-size: 13px;
    font-weight: 700;
    color: var(--cm-ink);
}

.cm-user-text small {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--cm-muted);
}

.cm-user-menu {
    width: 300px;
}

.cm-user-head {
    padding: 18px 18px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--cm-navy);
    position: relative;
    overflow: hidden;
}

.cm-user-head::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -50px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 18px solid var(--cm-green);
    opacity: .25;
    box-sizing: border-box;
}

.cm-user-head .cm-avatar {
    width: 46px;
    height: 46px;
    background-color: #fff;
    color: var(--cm-navy);
    font-size: 16px;
    font-weight: 800;
    box-shadow: none;
    position: relative;
}

/* the account menu's avatar sets its own colour: hide the initials here too once the photo has loaded */
.cm-user-head .cm-avatar.has-photo {
    color: transparent;
}

.cm-user-head-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.cm-user-head-text b {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.cm-user-head-text span {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .78);
    overflow: hidden;
    text-overflow: ellipsis;
}

.cm-role {
    align-self: flex-start;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--cm-green);
    color: #fff !important;
    font-size: 10.5px !important;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cm-user-org {
    padding: 12px 12px 6px;
}

.cm-label {
    padding: 0 6px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cm-muted);
}

.cm-org-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: var(--cm-bg);
}

.cm-org-initials {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 8px;
    background: var(--cm-green-tint);
    color: var(--cm-green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.cm-org-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.cm-org-card-text b {
    font-size: 13px;
    font-weight: 700;
    color: var(--cm-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-org-card-text span {
    font-size: 11.5px;
    color: var(--cm-muted);
}

.cm-user-menu .cm-pop-list {
    padding: 4px 12px 8px;
}

.cm-logout-wrap {
    padding: 8px 12px 12px;
    border-top: 1px solid #eef0f4;
}

.cm-logout {
    width: 100%;
    color: #d6453d !important;
    font-weight: 700;
}

.cm-logout svg {
    color: #d6453d;
}

.cm-logout:hover {
    background: var(--cm-red-tint);
}

.cm-main {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 28px;
    box-sizing: border-box;
}

.cm-footer {
    height: 44px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    background: var(--cm-surface);
    border-top: 1px solid var(--cm-border);
    font-size: 12.5px;
    color: var(--cm-muted);
    white-space: nowrap;
}

.cm-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cm-footer b {
    font-weight: 700;
    color: var(--cm-text);
}

.cm-footer a {
    font-weight: 600;
    color: var(--cm-navy);
}

.cm-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #c3c8d6;
}

.cm-version {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--cm-navy-tint);
    color: var(--cm-navy);
    font: 600 11.5px ui-monospace, Menlo, monospace;
}

.cm-backdrop {
    display: none;
}

/* print / standalone pages (view order) hide the chrome */
.cm-bare .cm-sidebar,
.cm-bare .cm-header,
.cm-bare .cm-footer {
    display: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1179px) {
    .cm-user-text,
    .cm-create span {
        display: none;
    }

    .cm-create {
        padding: 0 12px;
    }
}

@media (max-width: 959px) {
    .cm-search-icon {
        display: flex;
    }

    .cm-search-wrap {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 68px;
        padding: 0 16px;
        align-items: center;
        background: #fff;
        z-index: 25;
    }

    .cm-search-wrap.is-open {
        display: flex;
    }

    .cm-search {
        max-width: none;
        min-width: 0;
    }

    .cm-titles {
        flex: 1;
    }
}

/* tablet: icon rail */
@media (max-width: 1024px) {
    .cm-shell .cm-sidebar {
        width: var(--cm-rail-w);
    }

    .cm-sidebar-foot {
        display: none;
    }
}

/* phone: sidebar becomes a drawer */
@media (max-width: 767px) {
    .cm-menu-btn {
        display: flex;
    }

    .cm-shell .cm-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--cm-sidebar-w);
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 24px 48px -16px rgba(20, 26, 46, .3);
    }

    .cm-drawer-open .cm-sidebar {
        transform: none;
    }

    .cm-drawer-open .cm-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(20, 26, 46, .35);
    }

    .cm-header {
        gap: 10px;
        padding: 0 16px;
    }

    .cm-actions {
        gap: 6px;
    }

    .cm-header-divider {
        display: none;
    }

    .cm-user-btn {
        padding: 0 4px;
        gap: 0;
    }

    .cm-user-btn > svg {
        display: none;
    }

    .cm-crumb {
        display: none;
    }

    .cm-title {
        font-size: 16px;
    }

    .cm-main {
        padding: 16px;
    }

    .cm-pop {
        position: fixed;
        top: 62px;
        left: 12px;
        right: 12px;
        width: auto;
    }

    .cm-footer {
        height: auto;
        min-height: 44px;
        padding: 10px 16px;
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .cm-footer .cm-hide-sm {
        display: none;
    }
}

/* the drawer always shows labels even if the desktop rail was collapsed */
@media (max-width: 767px) {
    .cm-collapsed .cm-nav-title,
    .cm-collapsed .cm-nav-label,
    .cm-collapsed .cm-badge,
    .cm-collapsed .cm-brand-name {
        display: initial;
    }

    .cm-collapsed .cm-nav-item {
        justify-content: flex-start;
        padding: 0 12px;
    }

    .cm-collapsed .cm-nav-divider {
        display: none;
    }

    .cm-collapsed .cm-badge {
        display: flex;
    }
}

/* tablet rail hides labels even when not collapsed */
@media (min-width: 768px) and (max-width: 1024px) {
    .cm-brand {
        padding: 0 19px;
    }

    .cm-brand-name,
    .cm-nav-title,
    .cm-nav-label,
    .cm-badge {
        display: none;
    }

    .cm-nav-divider {
        display: block;
    }

    .cm-nav-section:first-child .cm-nav-divider {
        display: none;
    }

    .cm-nav-item {
        justify-content: center;
        padding: 0;
    }

    .cm-has-org-logo .cm-org-logo {
        width: 38px;
        height: 38px;
        background-position: center;
    }

    .cm-org-logo-wide .cm-org-logo {
        display: none !important;
    }

    .cm-org-logo-wide .cm-brand-link .cm-brand-mark {
        display: flex;
    }
}

/* ---------- dashboard ---------- */

.cm-dash {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.cm-dash-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cm-greeting {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--cm-ink);
}

.cm-subline {
    margin-top: 4px;
    font-size: 13.5px;
    color: var(--cm-text);
}

.cm-segment {
    display: flex;
    padding: 4px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--cm-border);
    gap: 2px;
}

.cm-segment button {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--cm-text);
    font: 700 12.5px var(--cm-font);
    cursor: pointer;
    transition: all .12s;
}

.cm-segment button.is-active {
    background: var(--cm-navy);
    color: #fff;
}

.cm-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.cm-card {
    background: #fff;
    border: 1px solid var(--cm-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.cm-kpi {
    padding: 18px 18px 16px;
    gap: 12px;
}

.cm-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cm-kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--cm-text);
}

.cm-kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cm-kpi-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--cm-ink);
    line-height: 1;
}

.cm-kpi-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--cm-muted);
    flex-wrap: wrap;
}

.cm-pill {
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 700;
}

.cm-good {
    background: var(--cm-green-tint);
    color: var(--cm-green-dark);
}

.cm-bad {
    background: var(--cm-red-tint);
    color: var(--cm-red);
}

.cm-neutral {
    background: #eef0f6;
    color: var(--cm-text);
}

.cm-row2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 1240px) {
    .cm-row2 {
        grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    }
}

.cm-row3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 16px;
}

.cm-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.cm-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--cm-ink);
}

.cm-card-sub {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--cm-muted);
}

.cm-card-meta {
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-muted);
}

.cm-card-link {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--cm-navy) !important;
}

.cm-card-link:hover {
    color: #26a844 !important;
}

.cm-big {
    font-size: 22px;
    font-weight: 800;
    color: var(--cm-ink);
    letter-spacing: -.02em;
    text-align: right;
}

.cm-big-28 {
    font-size: 28px;
    text-align: left;
    line-height: 1;
}

.cm-delta {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.cm-chart {
    height: 220px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
}

.cm-chart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 11px;
    color: var(--cm-faint);
    text-align: right;
    padding-bottom: 22px;
}

.cm-chart-plot {
    position: relative;
    display: flex;
    flex-direction: column;
}

.cm-chart-grid {
    position: absolute;
    inset: 0 0 22px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.cm-chart-grid div {
    height: 1px;
    background: #eef0f4;
}

.cm-chart-grid div:last-child {
    background: #e1e4ec;
}

.cm-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    position: relative;
}

.cm-bar {
    flex: 1;
    min-width: 6px;
    background: var(--cm-navy);
    border-radius: 6px 6px 2px 2px;
    transition: background .12s;
}

.cm-bar.is-today {
    background: var(--cm-green);
}

.cm-bar:hover {
    background: var(--cm-green);
}

.cm-bar-labels {
    height: 22px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.cm-bar-labels span {
    flex: 1;
    min-width: 6px;
    text-align: center;
    font-size: 10.5px;
    color: var(--cm-faint);
    font-weight: 500;
}

.cm-bar-labels span.is-today {
    color: var(--cm-green-dark);
    font-weight: 700;
}

.cm-stack {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    gap: 2px;
    background: var(--cm-border-soft);
}

.cm-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--cm-border-soft);
    font-size: 13.5px;
}

.cm-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: none;
}

.cm-status-label {
    flex: 1;
    color: var(--cm-text);
    font-weight: 500;
}

.cm-status-count {
    font-weight: 700;
    color: var(--cm-ink);
}

.cm-status-pct {
    width: 40px;
    text-align: right;
    font-size: 12px;
    color: var(--cm-muted);
}

.cm-agenda-row {
    display: grid;
    grid-template-columns: 52px 3px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    align-items: stretch;
}

.cm-agenda-row.is-done {
    opacity: .5;
}

.cm-agenda-time {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 1px;
}

.cm-agenda-time b {
    font-size: 13px;
    font-weight: 700;
    color: var(--cm-ink);
}

.cm-agenda-time span {
    font-size: 11px;
    color: var(--cm-muted);
}

.cm-agenda-bar {
    border-radius: 2px;
}

.cm-agenda-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.cm-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-agenda-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cm-ink);
}

.cm-agenda-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--cm-muted);
    min-width: 0;
}

.cm-tag {
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    flex: none;
}

.cm-task {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 8px;
    margin: 0 -8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    width: calc(100% + 16px);
}

.cm-task:hover {
    background: var(--cm-bg);
}

.cm-task:disabled {
    cursor: progress;
}

.cm-check {
    width: 20px;
    height: 20px;
    flex: none;
    margin-top: 1px;
    border-radius: 6px;
    border: 1.5px solid #c3c8d6;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .12s;
}

.cm-task.is-done .cm-check {
    border-color: var(--cm-green);
    background: var(--cm-green);
}

.cm-task-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cm-task-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cm-ink);
}

.cm-task.is-done .cm-task-title {
    color: var(--cm-faint);
    text-decoration: line-through;
}

.cm-task-meta {
    font-size: 12px;
    color: var(--cm-muted);
}

.cm-task-due {
    flex: none;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--cm-muted);
    padding-top: 2px;
}

.cm-task-due.is-today {
    color: var(--cm-amber);
}

.cm-task-due.is-overdue {
    color: var(--cm-red);
}

.cm-ticket {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--cm-border-soft);
}

.cm-ticket-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cm-ticket-subject {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cm-ink);
}

.cm-ticket-meta {
    font-size: 12px;
    color: var(--cm-muted);
}

.cm-status {
    flex: none;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
}

.cm-empty {
    padding: 18px 0 6px;
    font-size: 13px;
    color: var(--cm-muted);
}

.cm-skeleton {
    border-radius: 8px;
    background: linear-gradient(90deg, #eef0f4 25%, #f6f7fa 50%, #eef0f4 75%);
    background-size: 200% 100%;
    animation: cmShimmer 1.2s infinite linear;
}

@keyframes cmShimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@media (max-width: 767px) {
    .cm-greeting {
        font-size: 19px;
    }

    .cm-chart {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .cm-bars,
    .cm-bar-labels {
        gap: 4px;
    }

    .cm-bar-labels span:nth-child(even) {
        visibility: hidden;
    }
}

