/* All application status tags share the notification Pending finish and semantic palettes. Rims a step darker in
   every shade (owner, 2026-11-26: "borders of all the tags darker"); tags keep these day colours at night. */
:root {
    --crm-tag-blue-fill: #dbeafe; --crm-tag-blue-text: #1d4ed8;
    --crm-tag-green-fill: #dcfce7; --crm-tag-green-text: #15803d;
    --crm-tag-amber-fill: #fef3c7; --crm-tag-amber-text: #b45309;
    --crm-tag-red-fill: #fee2e2; --crm-tag-red-text: #dc2626;
    --crm-tag-gray-fill: #f1f5f9; --crm-tag-gray-text: #64748b;
}

/* Neutral is the default for unclassified, No, inactive and open tags in every context. */
:root :is(.stock-badge,.heading-tag,.iv-badge,.iv-badge-info,.iv-badge-success,.iv-badge-warning,.iv-badge-danger,.movement-type-badge,.email-connection-status,.entity-view-customized,.product-code-badge,.ledger-serial-count,.index-group-count,.designer-subgrid-mode-chip,.ownership-owner) {
    --crm-tag-top:#f7f9fc;--crm-tag-upper:#e6ebf2;--crm-tag-lower:#c8d1de;--crm-tag-bottom:#dce3ed;--crm-tag-rim:#64748b;--crm-tag-ink:#334155;
}
/* Semantic states override only the shade; every tag uses the same surface below. */
:root :is(.ownership-owner,.stock-badge.on-demo,.heading-tag.on-demo,.iv-badge-info,.product-code-badge,.ledger-serial-count,.index-group-count,.designer-subgrid-mode-chip) {
    --crm-tag-top:#e0f4ff;--crm-tag-upper:#b9e3fc;--crm-tag-lower:#7fc8f3;--crm-tag-bottom:#a3dbfa;--crm-tag-rim:#2f6f99;--crm-tag-ink:#123e66;
}
:root :is(.stock-badge.healthy,.heading-tag.healthy,.iv-badge-success,.email-connection-status.connected) {
    --crm-tag-top:#e4f7ce;--crm-tag-upper:#c4eaa4;--crm-tag-lower:#9ad36d;--crm-tag-bottom:#b6e28e;--crm-tag-rim:#4d7c2a;--crm-tag-ink:#31551a;
}
:root :is(.stock-badge.danger,.heading-tag.danger,.iv-badge-danger,.email-connection-status.failed) {
    --crm-tag-top:#ffe0e4;--crm-tag-upper:#ffc3cc;--crm-tag-lower:#f59ba9;--crm-tag-bottom:#ffb5c1;--crm-tag-rim:#a84a5c;--crm-tag-ink:#7f1830;
}
:root :is(.stock-badge.low,.heading-tag.low,.iv-badge-warning,.entity-view-customized,.email-connection-status.pending) {
    --crm-tag-top:#fff0b8;--crm-tag-upper:#ffe298;--crm-tag-lower:#ffc95b;--crm-tag-bottom:#ffd77b;--crm-tag-rim:#9a6512;--crm-tag-ink:#713f12;
}
:root :is(.stock-badge,.heading-tag,.heading-tag.heading-tag--owner,.iv-badge,.iv-badge-success,.iv-badge-warning,.iv-badge-danger,.iv-badge-info,.movement-type-badge,.email-connection-status,.entity-view-customized,.product-code-badge,.ledger-serial-count,.index-group-count,.designer-subgrid-mode-chip,.ownership-owner) {
    background:linear-gradient(180deg,var(--crm-tag-top) 0%,var(--crm-tag-upper) 48%,var(--crm-tag-lower) 52%,var(--crm-tag-bottom) 100%) !important;
    border:1px solid var(--crm-tag-rim) !important;color:var(--crm-tag-ink) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.85),0 1px 3px rgba(70,60,35,.18);
    border-radius:999px;
    text-shadow:none;
    --crm-tag-jewel-outline:var(--crm-tag-ink);
}
:root :is(.stock-badge,.heading-tag,.heading-tag.heading-tag--owner,.iv-badge,.iv-badge-success,.iv-badge-warning,.iv-badge-danger,.iv-badge-info,.movement-type-badge,.email-connection-status,.entity-view-customized,.product-code-badge,.ledger-serial-count,.index-group-count,.designer-subgrid-mode-chip,.ownership-owner) i {color:inherit;}

/* Index status tags use the compact Status pill metrics, regardless of their semantic shade. */
:root:root .crm-workspace .inventory-page:not(.inventory-form-page)
.inventory-table:not(:where(.ledger-detail-panel *)) > tbody > tr > td
:is(.stock-badge, .email-connection-status, .iv-badge, .iv-badge-info, .iv-badge-success,
    .iv-badge-warning, .iv-badge-danger, .movement-type-badge) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 8px !important;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: normal;
}

/* Password Strength tag (owner, 2026-11-26: "the tag colour should change the same as the progress colour"): one glossy
   shade per strength level, matching the bar - red (Very Weak / Weak), orange (Fair), yellow (Good), green (Strong), dark
   green (Excellent). The tag is .iv-badge (shared glossy surface) + one of these; same day and night like every tag. */
:root:root .account-strength-tag.account-strength-tag--red { --crm-tag-top:#ffe0e4;--crm-tag-upper:#ffc3cc;--crm-tag-lower:#f59ba9;--crm-tag-bottom:#ffb5c1;--crm-tag-rim:#a84a5c;--crm-tag-ink:#7f1830; }
:root:root .account-strength-tag.account-strength-tag--orange { --crm-tag-top:#ffe8d4;--crm-tag-upper:#ffd0a8;--crm-tag-lower:#fdad6b;--crm-tag-bottom:#ffc28f;--crm-tag-rim:#b45a12;--crm-tag-ink:#7c2d06; }
:root:root .account-strength-tag.account-strength-tag--yellow { --crm-tag-top:#fff0b8;--crm-tag-upper:#ffe298;--crm-tag-lower:#ffc95b;--crm-tag-bottom:#ffd77b;--crm-tag-rim:#9a6512;--crm-tag-ink:#713f12; }
:root:root .account-strength-tag.account-strength-tag--green { --crm-tag-top:#dcfaf0;--crm-tag-upper:#b5f0dc;--crm-tag-lower:#7fdcbb;--crm-tag-bottom:#a2e8cf;--crm-tag-rim:#23876a;--crm-tag-ink:#0f5132; }
/* Excellent: the tag IS the bar's green (#198754) with white text, so tag, bar and checklist are one colour (owner,
   2026-11-26); at night all three are #4ade80 (dark-theme-overrides.css). */
:root:root .account-strength-tag.account-strength-tag--dark-green { --crm-tag-top:#4fbf86;--crm-tag-upper:#2a9d63;--crm-tag-lower:#198754;--crm-tag-bottom:#1f9a5e;--crm-tag-rim:#116a40;--crm-tag-ink:#ffffff; }
