:root {
    --crm-background: #f2f6f8;
    --crm-surface: #ffffff;
    --crm-surface-muted: #edf3f7;
    --crm-text: #1f3145;
    --crm-text-muted: #667789;
    --crm-border: #dde7ee;
    --crm-primary: #183657;
    --crm-primary-soft: #23456b;
    --crm-accent: #249ef0;
    --crm-accent-soft: rgba(36, 158, 240, 0.12);
    --crm-danger: #e05252;
    --crm-radius: 14px;
    --crm-shadow: 0 20px 45px rgba(18, 39, 62, 0.08);
    --crm-sidebar-width: 264px;
    --crm-sidebar-collapsed-width: 88px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--crm-background);
    color: var(--crm-text);
    font-family: Inter, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.crm-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.crm-sidebar {
    width: var(--crm-sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 24%),
        linear-gradient(180deg, #1d3554 0%, #233f63 46%, #27476f 100%);
    color: #f6fbff;
    padding: 1rem 0.85rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: width 0.24s ease, transform 0.24s ease;
    z-index: 1040;
}

.crm-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0 0.85rem 1rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: inherit;
    text-decoration: none;
    transition: opacity 0.18s ease;
}

.crm-sidebar-brand:hover,
.crm-sidebar-brand:focus-visible {
    color: inherit;
    text-decoration: none;
    opacity: 0.92;
}

.crm-sidebar-brand-mark {
    width: 2.7rem;
    height: 2.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.42rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 10px 22px rgba(8, 18, 29, 0.16),
        inset 0 0 0 1px rgba(24, 54, 87, 0.08);
}

.crm-sidebar-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.crm-sidebar-brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.crm-sidebar-nav {
    display: grid;
    gap: 0.25rem;
    padding-top: 0.4rem;
}

.crm-sidebar-header-toggle {
    flex-shrink: 0;
}

.crm-sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    padding: 0.82rem 0.95rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    border: 1px solid transparent;
    overflow: hidden;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.crm-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.04);
    color: #fff;
    transform: none;
}

.crm-sidebar-link.is-active {
    background: rgba(57, 92, 136, 0.64);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.crm-sidebar-link::after {
    display: none;
}

.crm-sidebar-link-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: rgba(246, 251, 255, 0.92);
    box-shadow: none;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.crm-sidebar-link-icon i {
    font-size: 1rem;
    line-height: 1;
}

.crm-sidebar-link-label {
    min-width: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.crm-sidebar-link:hover .crm-sidebar-link-icon {
    color: #fff;
}

.crm-sidebar-link.is-active .crm-sidebar-link-icon {
    color: #fff;
}

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

.crm-topbar {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--crm-border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.crm-topbar-heading {
    display: grid;
    gap: 0.15rem;
    min-width: 200px;
}

.crm-topbar-heading h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.crm-topbar-heading p {
    margin: 0;
    color: var(--crm-text-muted);
    font-size: 0.9rem;
}

.crm-topbar-spacer {
    flex: 1;
}

.crm-search-form {
    position: relative;
    flex: 1;
    max-width: 34rem;
}

.crm-search-icon {
    position: absolute;
    top: 50%;
    left: 0.95rem;
    transform: translateY(-50%);
    color: var(--crm-text-muted);
    pointer-events: none;
}

.crm-search-input {
    min-height: 2.75rem;
    padding-left: 2.6rem;
    border-radius: 12px;
    border-color: var(--crm-border);
    background: var(--crm-surface);
    box-shadow: none;
}

.crm-search-input:focus {
    border-color: rgba(36, 158, 240, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(36, 158, 240, 0.12);
}

.crm-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.crm-user-chip {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 132px;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    background: var(--crm-surface);
    line-height: 1.15;
}

.crm-user-chip-link {
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.crm-user-chip-link:hover {
    transform: translateY(-1px);
    border-color: rgba(36, 158, 240, 0.32);
    box-shadow: 0 10px 24px rgba(18, 39, 62, 0.08);
}

.crm-user-chip-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.crm-user-chip-subtitle {
    color: var(--crm-text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.crm-create-button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    background: var(--crm-accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(36, 158, 240, 0.22);
}

.crm-create-button:hover,
.crm-create-button:focus {
    background: #1793e7;
    color: #fff;
}

.crm-create-button.is-solid-only {
    box-shadow: none;
}

.crm-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    background: var(--crm-surface);
    color: var(--crm-text);
    transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.crm-icon-button:hover {
    transform: translateY(-1px);
    border-color: rgba(36, 158, 240, 0.32);
    color: var(--crm-accent);
}

.crm-icon-button.is-muted {
    color: var(--crm-text-muted);
}

.crm-notification-trigger {
    position: relative;
}

.crm-notification-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    min-width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: var(--crm-danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(224, 82, 82, 0.24);
}

.crm-notification-menu {
    width: min(92vw, 360px);
    padding: 0;
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    box-shadow: 0 24px 55px rgba(18, 39, 62, 0.16);
    overflow: hidden;
}

.crm-notification-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.9rem;
    border-bottom: 1px solid rgba(221, 231, 238, 0.8);
}

.crm-notification-menu-header strong,
.crm-notification-item-content strong {
    display: block;
}

.crm-notification-menu-header small,
.crm-notification-item-content span {
    color: var(--crm-text-muted);
    font-size: 0.82rem;
}

.crm-notification-menu-link {
    color: var(--crm-primary);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.crm-notification-list {
    display: grid;
}

.crm-notification-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    text-decoration: none;
    transition: background-color 0.18s ease;
}

.crm-notification-item + .crm-notification-item {
    border-top: 1px solid rgba(221, 231, 238, 0.8);
}

.crm-notification-item:hover {
    background: rgba(24, 54, 87, 0.04);
}

.crm-notification-item-logo {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid var(--crm-border);
    background: #f6f9fb;
    overflow: hidden;
    flex-shrink: 0;
}

.crm-notification-item-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.crm-notification-item-logo.is-fallback {
    color: var(--crm-accent);
}

.crm-notification-item-content {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.crm-notification-empty {
    padding: 1rem;
    color: var(--crm-text-muted);
    font-size: 0.92rem;
}

.crm-content {
    padding: 1.5rem;
    display: grid;
    gap: 1.9rem;
}

.crm-layout-edit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 12px;
}

.crm-layout-edit-button.is-active {
    background: var(--crm-primary);
    border-color: var(--crm-primary);
    color: #fff;
}

.crm-layout-edit-button.is-active:hover {
    color: #fff;
}

.crm-workspace-toolbar {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1.1rem;
    padding: 1rem 1.2rem;
    border-radius: 26px;
    border: 1px solid rgba(199, 217, 230, 0.9);
    background:
        radial-gradient(circle at top right, rgba(36, 158, 240, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 252, 0.94));
    box-shadow: 0 18px 38px rgba(18, 39, 62, 0.07);
}

.crm-shell.is-layout-editing .crm-workspace-toolbar {
    display: flex;
}

.crm-workspace-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.crm-layout-column-picker,
.crm-layout-reset-button {
    display: none;
}

.crm-shell.is-layout-editing .crm-layout-column-picker,
.crm-shell.is-layout-editing .crm-layout-reset-button {
    display: inline-flex;
}

.crm-layout-scope-picker {
    display: none;
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(24, 54, 87, 0.06);
}

.crm-shell.is-layout-editing .crm-layout-scope-picker {
    display: inline-flex;
}

.crm-layout-column-picker {
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(24, 54, 87, 0.06);
}

.crm-layout-column-button,
.crm-layout-scope-button,
.crm-layout-chip {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--crm-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.crm-layout-column-button {
    min-width: 4rem;
    padding: 0.55rem 0.75rem;
}

.crm-layout-scope-button {
    padding: 0.55rem 0.95rem;
    white-space: nowrap;
}

.crm-layout-column-button.is-active,
.crm-layout-scope-button.is-active,
.crm-layout-chip.is-active {
    background: #fff;
    color: var(--crm-primary);
    box-shadow: 0 10px 18px rgba(18, 39, 62, 0.08);
}

.crm-layout-status {
    color: var(--crm-text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    min-height: 1.2rem;
}

.crm-layout-status:empty {
    display: none;
}

.crm-layout-status[data-tone="saving"] {
    color: var(--crm-accent);
}

.crm-layout-status[data-tone="success"] {
    color: #268d5f;
}

.crm-layout-status[data-tone="error"] {
    color: var(--crm-danger);
}

.crm-workspace-board {
    --dashboard-columns: 4;
    display: grid;
    grid-template-columns: repeat(var(--dashboard-columns), minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.crm-workspace-board.is-masonry-active {
    display: block;
    position: relative;
    min-height: 0;
}

.crm-workspace-board.is-masonry-active > .crm-workspace-block {
    position: absolute;
    margin: 0;
}

.crm-workspace-block {
    position: relative;
    min-width: 0;
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--crm-border);
    box-shadow: 0 18px 42px rgba(18, 39, 62, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, left 0.22s ease, top 0.22s ease, width 0.22s ease;
}

.crm-workspace-block:hover {
    transform: translateY(-2px);
    border-color: rgba(36, 158, 240, 0.24);
    box-shadow: 0 24px 48px rgba(18, 39, 62, 0.1);
}

.crm-shell.is-layout-editing .crm-workspace-block {
    cursor: grab;
}

.crm-shell.is-layout-editing .crm-workspace-block:active {
    cursor: grabbing;
}

.crm-workspace-block.is-dragging {
    opacity: 0.78;
    transform: scale(0.99);
    z-index: 4;
    box-shadow: 0 28px 58px rgba(18, 39, 62, 0.16);
}

.crm-workspace-board.is-drag-over .crm-workspace-block:not(.is-dragging) {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, left 0.22s ease, top 0.22s ease, width 0.22s ease;
}

.crm-workspace-block.is-drop-before,
.crm-workspace-block.is-drop-after {
    z-index: 3;
    border-color: rgba(36, 158, 240, 0.46);
    box-shadow: 0 24px 52px rgba(36, 158, 240, 0.15);
}

.crm-workspace-block.is-drop-before::before,
.crm-workspace-block.is-drop-after::after {
    content: "";
    position: absolute;
    left: 1.1rem;
    right: 1.1rem;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(36, 158, 240, 0.08), var(--crm-accent), rgba(36, 158, 240, 0.08));
    box-shadow: 0 0 0 5px rgba(36, 158, 240, 0.12), 0 12px 24px rgba(36, 158, 240, 0.28);
    pointer-events: none;
    z-index: 3;
}

.crm-workspace-block.is-drop-before::before {
    top: -0.72rem;
}

.crm-workspace-block.is-drop-after::after {
    bottom: -0.72rem;
}

.crm-workspace-block-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.crm-workspace-block-heading {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.crm-workspace-block-title-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.crm-workspace-block .crm-category-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-transform: none;
}

.crm-workspace-block-subtitle {
    margin: 0;
    color: var(--crm-text-muted);
    font-size: 0.86rem;
}

.crm-workspace-block-header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.crm-block-layout-tools {
    display: none;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.crm-shell.is-layout-editing .crm-block-layout-tools {
    display: flex;
}

.crm-layout-drag-handle {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: rgba(24, 54, 87, 0.07);
    color: var(--crm-text-muted);
    cursor: grab;
}

.crm-layout-drag-handle:active {
    cursor: grabbing;
}

.crm-layout-chip-group {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem;
    border-radius: 999px;
    background: rgba(24, 54, 87, 0.06);
}

.crm-layout-chip {
    padding: 0.48rem 0.62rem;
    min-width: 2.2rem;
}

.crm-form-grid,
.crm-admin-grid {
    display: grid;
    gap: 1.25rem;
}

.crm-form-card {
    padding: 1.4rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--crm-border);
    box-shadow: 0 18px 42px rgba(18, 39, 62, 0.06);
}

.crm-form-card-header {
    margin-bottom: 1rem;
}

.crm-form-card-header h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
}

.crm-form-card-header p {
    margin: 0.45rem 0 0;
    color: var(--crm-text-muted);
}

.crm-team-layout {
    display: grid;
    gap: 1.25rem;
    align-items: start;
}

.crm-team-sidebar {
    display: grid;
    gap: 1.25rem;
}

.crm-team-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.crm-team-table-wrap {
    overflow: auto;
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    background: #fff;
}

.crm-team-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.crm-team-table th,
.crm-team-table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(221, 231, 238, 0.8);
    vertical-align: top;
    text-align: left;
}

.crm-team-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fbfd;
    color: var(--crm-text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-team-table tbody tr:last-child td {
    border-bottom: 0;
}

.crm-team-table td.is-actions,
.crm-team-table th.is-actions {
    width: 1%;
    white-space: nowrap;
}

.crm-table-link {
    color: var(--crm-primary);
    text-decoration: none;
    font-weight: 600;
}

.crm-table-link:hover {
    color: var(--crm-accent);
}

.crm-table-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.crm-table-muted {
    color: var(--crm-text-muted);
    font-size: 0.9rem;
}

.crm-table-empty {
    min-height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--crm-text-muted);
    text-align: center;
}

.crm-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(24, 54, 87, 0.08);
    color: var(--crm-primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.crm-role-badge.is-admin {
    background: rgba(36, 158, 240, 0.12);
    color: var(--crm-accent);
}

.crm-login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(24, 54, 87, 0.08);
    color: var(--crm-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.crm-login-badge.is-google {
    background: rgba(36, 158, 240, 0.1);
    color: var(--crm-primary);
}

.crm-modal-grid {
    display: grid;
    gap: 1rem;
}

.crm-checkbox-grid {
    display: grid;
    gap: 0.65rem;
}

.crm-form-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.crm-form-switch {
    margin-bottom: 1rem;
}

.crm-form-info-banner {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: rgba(180, 83, 9, 0.12);
    color: #9a5d12;
    font-weight: 600;
}

.crm-checkbox-panel {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(24, 54, 87, 0.04);
    margin-bottom: 1rem;
}

.crm-checkbox-panel h3 {
    margin: 0 0 0.3rem;
    font-size: 0.92rem;
    font-weight: 700;
}

.crm-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--crm-text);
}

.crm-checkbox-item small {
    color: var(--crm-text-muted);
}

.crm-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.crm-inline-form,
.crm-stacked-form {
    display: grid;
    gap: 0.8rem;
}

.crm-tag-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
}

.crm-tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(24, 54, 87, 0.04);
}

.crm-user-grid {
    display: grid;
    gap: 1rem;
}

.crm-user-card,
.crm-email-template-card {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid var(--crm-border);
    background: #fff;
}

.crm-user-card-header,
.crm-email-template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.crm-email-template-header small {
    display: block;
    color: var(--crm-text-muted);
}

.crm-email-template-list {
    display: grid;
    gap: 1rem;
}

.crm-email-template-form {
    display: grid;
    gap: 0.8rem;
}

.crm-email-template-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.crm-email-template-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 12px;
}

.crm-email-template-help {
    color: var(--crm-text-muted);
    font-size: 0.86rem;
}

.crm-email-template-preview-note {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(36, 158, 240, 0.08);
    color: var(--crm-text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.crm-email-test-form {
    display: grid;
    gap: 0.85rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(24, 54, 87, 0.08);
}

.crm-email-test-header {
    display: grid;
    gap: 0.25rem;
}

.crm-email-test-header strong {
    color: var(--crm-text);
    font-size: 0.98rem;
}

.crm-email-test-header span {
    color: var(--crm-text-muted);
    font-size: 0.88rem;
}

.crm-email-test-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.crm-email-test-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 12px;
    white-space: nowrap;
}

.crm-documents-layout {
    display: grid;
    gap: 1.25rem;
}

.crm-document-summary-grid {
    display: grid;
    gap: 1rem;
}

.crm-document-metric {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--crm-border);
    box-shadow: 0 16px 36px rgba(18, 39, 62, 0.06);
}

.crm-document-metric-label {
    color: var(--crm-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.crm-document-metric strong {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.crm-document-table-wrap {
    overflow: auto;
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    background: #fff;
}

.crm-document-table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
}

.crm-document-table th,
.crm-document-table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(221, 231, 238, 0.8);
    text-align: left;
    vertical-align: middle;
}

.crm-document-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fbfd;
    color: var(--crm-text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-document-table tbody tr:last-child td {
    border-bottom: 0;
}

.crm-document-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-top: 1rem;
    color: var(--crm-text-muted);
    font-size: 0.9rem;
}

.crm-document-pagination nav {
    margin-left: auto;
}

.crm-document-pagination .pagination {
    margin: 0;
}

.crm-document-pagination .page-link {
    border-color: var(--crm-border);
    color: var(--crm-primary);
}

.crm-document-pagination .active .page-link {
    border-color: var(--crm-accent);
    background: var(--crm-accent);
}

.crm-document-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
}

.crm-document-link:hover {
    color: var(--crm-primary);
}

.crm-document-name-group {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.crm-document-name-group strong {
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.35;
}

.crm-document-icon {
    width: 2.7rem;
    height: 2.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 14px;
    background: rgba(36, 158, 240, 0.12);
    color: var(--crm-accent);
    font-size: 1.1rem;
}

.crm-document-icon.is-folder {
    background: rgba(24, 54, 87, 0.08);
    color: var(--crm-primary);
}

.crm-profile-summary {
    display: grid;
    gap: 1rem;
}

.crm-profile-summary-item {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(24, 54, 87, 0.04);
}

.crm-profile-summary-label {
    color: var(--crm-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.crm-profile-summary-value {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.crm-profile-summary-empty {
    color: var(--crm-text-muted);
    font-size: 0.9rem;
}

.crm-upload-hint {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.crm-upload-hint img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 14px;
    padding: 0.35rem;
}

.crm-rich-text-editor-wrap {
    overflow: hidden;
    border: 1px solid var(--crm-border);
    border-radius: 18px;
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.crm-rich-text-editor-wrap:focus-within {
    border-color: rgba(36, 158, 240, 0.42);
    box-shadow: 0 0 0 0.25rem rgba(36, 158, 240, 0.1);
}

.crm-rich-text-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0.55rem;
    border-bottom: 1px solid rgba(221, 231, 238, 0.8);
    background: #f8fbfd;
}

.crm-rich-text-toolbar button {
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--crm-text);
    padding: 0.35rem 0.55rem;
    font-weight: 700;
    line-height: 1;
}

.crm-rich-text-toolbar button:hover,
.crm-rich-text-toolbar button:focus {
    border-color: rgba(36, 158, 240, 0.26);
    background: rgba(36, 158, 240, 0.08);
    color: var(--crm-primary);
}

.crm-rich-text-toolbar > span {
    width: 1px;
    height: 1.45rem;
    background: rgba(24, 54, 87, 0.12);
}

.crm-rich-text-editor {
    min-height: 15rem;
    padding: 1rem;
    outline: none;
    line-height: 1.75;
}

.crm-rich-text-editor:empty::before {
    content: "Schrijf hier het kennisartikel...";
    color: var(--crm-text-muted);
}

.crm-rich-text-editor h2,
.crm-rich-text-editor h3,
.knowledge-article-detail-body h2,
.knowledge-article-detail-body h3 {
    margin: 1rem 0 0.5rem;
    color: var(--crm-text);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.crm-rich-text-editor h2,
.knowledge-article-detail-body h2 {
    font-size: 1.35rem;
}

.crm-rich-text-editor h3,
.knowledge-article-detail-body h3 {
    font-size: 1.12rem;
}

.crm-rich-text-editor p,
.knowledge-article-detail-body p {
    margin: 0 0 0.9rem;
}

.crm-rich-text-editor ul,
.crm-rich-text-editor ol,
.knowledge-article-detail-body ul,
.knowledge-article-detail-body ol {
    margin: 0 0 0.9rem;
    padding-left: 1.35rem;
}

.crm-rich-text-editor blockquote,
.knowledge-article-detail-body blockquote {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--crm-accent);
    border-radius: 0 14px 14px 0;
    background: rgba(36, 158, 240, 0.08);
    color: var(--crm-primary);
    font-weight: 600;
}

.knowledge-article-detail-body a {
    color: var(--crm-accent);
    font-weight: 700;
    text-decoration: none;
}

.knowledge-article-detail-body a:hover {
    text-decoration: underline;
}

.crm-attachment-source-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.crm-radio-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    padding: 0.85rem;
    border: 1px solid var(--crm-border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.crm-radio-card:hover,
.crm-radio-card:has(input:checked) {
    border-color: rgba(36, 158, 240, 0.42);
    background: rgba(36, 158, 240, 0.04);
    box-shadow: 0 12px 26px rgba(18, 39, 62, 0.06);
}

.crm-radio-card.is-disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.crm-radio-card input {
    margin-top: 0.2rem;
}

.crm-radio-card span {
    display: grid;
    gap: 0.18rem;
}

.crm-radio-card strong {
    color: var(--crm-text);
    font-size: 0.92rem;
}

.crm-radio-card small {
    color: var(--crm-text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.crm-attachment-panel {
    display: grid;
    gap: 0.65rem;
}

.crm-attachment-panel.is-muted {
    opacity: 0.5;
}

.crm-inline-help-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--crm-primary);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.crm-inline-help-link:hover {
    color: var(--crm-accent);
}

.crm-article-category-new.is-hidden {
    display: none;
}

.knowledge-preview-card,
.knowledge-list-card,
.knowledge-article-detail {
    padding: 1.25rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--crm-border);
    box-shadow: 0 18px 42px rgba(18, 39, 62, 0.06);
}

.knowledge-preview-header,
.knowledge-list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.knowledge-preview-kicker {
    display: inline-flex;
    margin-bottom: 0.45rem;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crm-accent);
    font-weight: 700;
}

.knowledge-preview-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.knowledge-preview-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(221, 231, 238, 0.8);
    font-weight: 700;
    color: var(--crm-primary);
    text-decoration: none;
}

.knowledge-preview-list,
.knowledge-list {
    display: grid;
}

.knowledge-preview-item,
.knowledge-list-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 0;
    text-decoration: none;
}

.knowledge-list-item + .knowledge-list-item,
.knowledge-preview-item + .knowledge-preview-item {
    border-top: 1px solid rgba(221, 231, 238, 0.8);
}

.knowledge-preview-logo,
.knowledge-list-logo,
.knowledge-article-detail-logo {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #f6f9fb;
    border: 1px solid var(--crm-border);
    overflow: hidden;
    flex-shrink: 0;
}

.knowledge-preview-logo img,
.knowledge-list-logo img,
.knowledge-article-detail-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.knowledge-preview-logo.is-fallback,
.knowledge-list-logo.is-fallback {
    color: var(--crm-accent);
}

.knowledge-preview-body,
.knowledge-list-content {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.knowledge-preview-body strong,
.knowledge-list-content strong {
    font-size: 1rem;
    font-weight: 700;
}

.knowledge-preview-body span,
.knowledge-list-meta {
    color: var(--crm-text-muted);
    font-size: 0.86rem;
}

.knowledge-preview-meta,
.knowledge-list-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--crm-text-muted);
    font-size: 0.86rem;
}

.knowledge-preview-empty {
    min-height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--crm-text-muted);
}

.knowledge-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: rgba(24, 54, 87, 0.05);
    font-weight: 700;
}

.knowledge-filter-pill.is-muted {
    background: rgba(24, 54, 87, 0.08);
}

.knowledge-filter-form {
    min-width: 220px;
}

.knowledge-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.knowledge-list-link {
    flex: 1;
}

.knowledge-list-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.knowledge-list-card-archived {
    margin-top: 1.25rem;
}

.knowledge-archive-caption {
    margin: 0;
    color: var(--crm-text-muted);
    font-size: 0.88rem;
}

.knowledge-list-item.is-archived .knowledge-list-link {
    opacity: 0.9;
}

.knowledge-article-detail {
    display: grid;
    gap: 1.5rem;
}

.knowledge-article-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.knowledge-article-detail-title h2 {
    margin: 0 0 0.45rem;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.knowledge-article-detail-title p {
    margin: 0;
    color: var(--crm-text-muted);
}

.knowledge-article-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.knowledge-article-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(36, 158, 240, 0.12);
    color: var(--crm-accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.knowledge-article-badge.is-muted {
    background: rgba(24, 54, 87, 0.08);
    color: var(--crm-primary);
}

.knowledge-article-badge.is-user {
    background: rgba(102, 119, 137, 0.12);
    color: var(--crm-text);
}

.knowledge-article-detail-body {
    line-height: 1.8;
    font-size: 1rem;
}

.knowledge-article-detail-attachment,
.knowledge-article-detail-audience {
    display: grid;
    gap: 0.6rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(24, 54, 87, 0.04);
}

.knowledge-article-detail-attachment span,
.knowledge-article-detail-audience h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.knowledge-article-detail-attachment a {
    font-weight: 700;
    text-decoration: none;
}

.crm-alert {
    margin-bottom: 0;
    border-radius: 14px;
    border: 0;
    box-shadow: 0 12px 28px rgba(18, 39, 62, 0.08);
}

.crm-category-section {
    display: grid;
    gap: 0.9rem;
}

.crm-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crm-category-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.crm-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(24, 54, 87, 0.08);
    color: var(--crm-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.crm-category-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.crm-inline-action {
    width: 1.9rem;
    height: 1.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--crm-text-muted);
    transition: color 0.18s ease, background-color 0.18s ease;
}

.crm-inline-action:hover {
    background: rgba(24, 54, 87, 0.08);
    color: var(--crm-accent);
}

.crm-inline-action.is-danger:hover {
    color: var(--crm-danger);
}

.crm-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 0.7rem;
}

.crm-tile-grid.is-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scroll-snap-type: x proximity;
}

.crm-tile-grid.is-row .crm-tile-wrap {
    flex: 0 0 124px;
    scroll-snap-align: start;
}

.crm-tile-wrap {
    position: relative;
}

.crm-tile-manage {
    position: absolute;
    top: -0.4rem;
    right: -0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.crm-tile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 126px;
    padding: 1rem 0.75rem;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    text-align: center;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.crm-tile-card:hover {
    transform: translateY(-2px);
    border-color: rgba(36, 158, 240, 0.4);
    box-shadow: var(--crm-shadow);
}

.crm-tile-icon {
    width: 2.8rem;
    height: 2.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--crm-surface-muted);
    color: var(--crm-text-muted);
    transition: background-color 0.18s ease, color 0.18s ease;
}

.crm-tile-logo {
    width: 2.9rem;
    height: 2.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    border-radius: 12px;
    background: var(--crm-surface-muted);
    overflow: hidden;
}

.crm-tile-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.crm-tile-logo.is-fallback {
    background: linear-gradient(180deg, #edf4fa, #e3edf6);
    color: var(--crm-primary);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(24, 54, 87, 0.08);
}

.crm-tile-card:hover .crm-tile-icon {
    background: var(--crm-accent-soft);
    color: var(--crm-accent);
}

.crm-tile-name {
    font-size: 0.77rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crm-tile-delete-form {
    display: flex;
}

.crm-tile-manage-button,
.crm-tile-delete-button {
    width: 1.3rem;
    height: 1.3rem;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--crm-danger);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(224, 82, 82, 0.3);
    transition: opacity 0.18s ease;
}

.crm-tile-manage-button {
    background: var(--crm-accent);
    color: #fff;
    opacity: 0;
    box-shadow: 0 8px 18px rgba(36, 158, 240, 0.26);
}

.crm-tile-delete-button {
    opacity: 0;
}

.crm-tile-wrap:focus-within .crm-tile-delete-button,
.crm-tile-wrap:focus-within .crm-tile-manage-button,
.crm-tile-wrap:hover .crm-tile-delete-button,
.crm-tile-wrap:hover .crm-tile-manage-button {
    opacity: 1;
}

.crm-empty-state {
    min-height: 12rem;
    border: 1px dashed rgba(102, 119, 137, 0.35);
    border-radius: calc(var(--crm-radius) + 2px);
    background: rgba(255, 255, 255, 0.7);
    color: var(--crm-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-empty-state.is-inline {
    min-height: 8rem;
}

.crm-modal {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(16, 31, 49, 0.2);
}

.crm-modal-description {
    margin-top: 0.35rem;
    color: var(--crm-text-muted);
    font-size: 0.94rem;
}

.crm-logo-preview {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 1rem;
    padding: 0.9rem;
    border-radius: 14px;
    background: rgba(24, 54, 87, 0.05);
}

.crm-logo-preview.is-hidden {
    display: none;
}

.crm-logo-preview-label {
    color: var(--crm-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.crm-logo-preview img {
    width: 3.4rem;
    height: 3.4rem;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    padding: 0.45rem;
    border: 1px solid var(--crm-border);
}

.crm-logo-fetch-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.crm-logo-fetch-status {
    color: var(--crm-text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.crm-logo-fetch-status.is-success {
    color: #0f8f5f;
}

.crm-logo-fetch-status.is-error {
    color: #c2410c;
}

.crm-logo-fetch-panel .btn.is-loading .bi {
    animation: crm-spin 0.85s linear infinite;
}

@keyframes crm-spin {
    to {
        transform: rotate(360deg);
    }
}

.crm-auth-body {
    background:
        radial-gradient(circle at top left, rgba(36, 158, 240, 0.22), transparent 30%),
        radial-gradient(circle at bottom right, rgba(24, 54, 87, 0.12), transparent 34%),
        linear-gradient(180deg, #edf4f9 0%, #f7fafc 100%);
}

.crm-auth-screen {
    min-height: 100vh;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: 0.75rem;
}

.crm-auth-card {
    width: min(100%, 460px);
    display: grid;
    gap: 0;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(221, 231, 238, 0.9);
    box-shadow: 0 24px 70px rgba(18, 39, 62, 0.13);
}

.crm-auth-panel {
    padding: 1rem;
}

.crm-auth-panel-brand {
    display: flex;
    align-items: center;
    min-height: auto;
    padding: 0.9rem 1rem;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 38%),
        linear-gradient(180deg, #173557 0%, #20456c 100%);
    color: #f5fbff;
}

.crm-auth-panel-form {
    display: grid;
    align-content: center;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.97);
}

.crm-auth-brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.crm-auth-brand-mark {
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 12px 24px rgba(8, 18, 29, 0.18),
        inset 0 0 0 1px rgba(24, 54, 87, 0.08);
}

.crm-auth-brand-mark img {
    width: 1.7rem;
    height: 1.7rem;
    object-fit: contain;
}

.crm-auth-brand-copy {
    display: grid;
    gap: 0.55rem;
}

.crm-auth-brand-copy h1 {
    margin: 0;
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.crm-auth-badge {
    display: none;
    justify-self: start;
    padding: 0.38rem 0.68rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #d6ecff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-auth-brand-figure {
    display: none;
    place-items: center;
    padding: 1.1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 34px rgba(10, 23, 37, 0.16);
}

.crm-auth-logo {
    width: min(100%, 230px);
    height: auto;
}

.crm-auth-form-heading {
    display: grid;
    gap: 0.5rem;
}

.crm-auth-form-heading h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.crm-auth-form-heading p {
    margin: 0;
    color: var(--crm-text-muted);
}

.crm-auth-form {
    display: grid;
    gap: 0.75rem;
}

.crm-auth-alert {
    margin: 0;
    border: 0;
    border-radius: 14px;
    font-size: 0.92rem;
}

.crm-google-login-button {
    min-height: 3.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 1px solid rgba(36, 158, 240, 0.34);
    border-radius: 14px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    color: var(--crm-primary);
    font-weight: 700;
    box-shadow:
        0 14px 28px rgba(36, 158, 240, 0.14),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.crm-google-login-button:hover,
.crm-google-login-button:focus {
    border-color: rgba(36, 158, 240, 0.58);
    background: #eef8ff;
    color: var(--crm-primary);
    transform: translateY(-1px);
}

.crm-google-login-icon {
    width: 1.6rem;
    height: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
}

.crm-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--crm-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.crm-auth-divider::before,
.crm-auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--crm-border);
}

.crm-auth-remember {
    color: var(--crm-text-muted);
}

.crm-auth-submit {
    min-height: 2.95rem;
    border: 0;
    border-radius: 14px;
    background: var(--crm-primary);
    color: #fff;
    font-weight: 700;
}

.crm-auth-submit:hover,
.crm-auth-submit:focus {
    background: var(--crm-primary-soft);
    color: #fff;
}

@media (min-width: 768px) {
    .crm-auth-screen {
        padding: clamp(0.85rem, 2.4vw, 1.5rem);
    }
}

@media (min-width: 992px) {
    .crm-auth-screen {
        place-items: center;
    }

    .crm-auth-card {
        width: min(100%, 820px);
        border-radius: 28px;
        grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
    }

    .crm-auth-panel {
        padding: clamp(1.15rem, 3vw, 2rem);
    }

    .crm-auth-panel-brand {
        display: grid;
        align-content: center;
        gap: 1.15rem;
    }

    .crm-auth-panel-form {
        gap: 1rem;
    }

    .crm-auth-brand-lockup {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 1rem;
        align-items: start;
    }

    .crm-auth-brand-mark {
        width: 3.2rem;
        height: 3.2rem;
        border-radius: 18px;
    }

    .crm-auth-brand-mark img {
        width: 2.1rem;
        height: 2.1rem;
    }

    .crm-auth-brand-copy h1 {
        font-size: 1.65rem;
        line-height: 1.2;
    }

    .crm-auth-form-heading h2 {
        font-size: 1.85rem;
    }

    .crm-auth-badge {
        display: inline-flex;
    }

    .crm-auth-brand-figure {
        display: grid;
    }

    .crm-auth-form {
        gap: 0.85rem;
    }
}

@media (max-width: 991.98px) {
    .crm-auth-badge,
    .crm-auth-brand-figure {
        display: none !important;
    }

    .crm-auth-panel-form {
        padding-top: 1.15rem;
    }

    .crm-google-login-button {
        min-height: 3rem;
    }

    .crm-auth-submit {
        min-height: 2.85rem;
    }

    .crm-attachment-source-group {
        grid-template-columns: 1fr;
    }
}

.sidebar-collapsed .crm-sidebar {
    width: var(--crm-sidebar-collapsed-width);
    padding-inline: 0.55rem;
}

.sidebar-collapsed .crm-sidebar-brand {
    justify-content: center;
    padding-inline: 0.6rem;
}

.sidebar-collapsed .crm-sidebar-brand-text,
.sidebar-collapsed .crm-sidebar-link-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-collapsed .crm-sidebar-link {
    justify-content: center;
    padding-inline: 0.55rem;
}

.sidebar-collapsed .crm-sidebar-link::after {
    inset: auto 0 0 0;
    width: auto;
    height: 4px;
}

.crm-sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .crm-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--crm-sidebar-width);
        transform: translateX(-100%);
    }

    .sidebar-collapsed .crm-sidebar {
        width: var(--crm-sidebar-width);
        padding-inline: 0.85rem;
    }

    .sidebar-collapsed .crm-sidebar-brand {
        justify-content: flex-start;
        padding-inline: 0.85rem;
    }

    .sidebar-collapsed .crm-sidebar-brand-text,
    .sidebar-collapsed .crm-sidebar-link-label {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .sidebar-collapsed .crm-sidebar-link {
        justify-content: flex-start;
        padding-inline: 0.9rem;
    }

    .sidebar-collapsed .crm-sidebar-link::after {
        inset: 0 auto 0 0;
        width: 4px;
        height: auto;
    }

    .crm-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(17, 28, 43, 0.45);
        z-index: 1035;
    }

    .mobile-sidebar-open .crm-sidebar {
        transform: translateX(0);
    }

    .mobile-sidebar-open .crm-sidebar-backdrop {
        display: block;
    }

    .crm-topbar {
        flex-wrap: wrap;
    }

    .crm-topbar-heading {
        min-width: 0;
        flex: 1;
    }

    .crm-search-form {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }

    .crm-topbar-actions {
        margin-left: 0;
    }

    .crm-user-chip {
        min-width: 0;
    }

    .crm-content {
        padding: 1rem;
    }

    .crm-workspace-toolbar,
    .crm-workspace-block-header {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-workspace-toolbar-actions,
    .crm-block-layout-tools {
        width: 100%;
    }

    .crm-workspace-board {
        grid-template-columns: minmax(0, 1fr);
    }

    .crm-workspace-board > .crm-workspace-block {
        grid-column: 1 / -1 !important;
    }

    .crm-layout-column-picker {
        width: 100%;
        justify-content: space-between;
    }

    .crm-layout-column-button {
        flex: 1;
    }

    .knowledge-preview-header,
    .knowledge-list-card-header,
    .knowledge-article-detail-header,
    .crm-form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .knowledge-list-item {
        flex-direction: column;
        align-items: stretch;
    }

    .knowledge-filter-form {
        min-width: 0;
    }

    .crm-document-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 992px) {
    .crm-document-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .crm-team-layout {
        grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    }

    .crm-modal-grid,
    .crm-form-row,
    .crm-admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-user-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
