body {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(25, 135, 84, 0.08), transparent 24%),
        #f8f9fa;
}

.home-hero {
    background:
        linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(25, 135, 84, 0.08)),
        #fff;
}

.stat-card {
    background: rgba(255, 255, 255, 0.88);
}

.stat-card-primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(13, 110, 253, 0.03));
}

.stat-label {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-value {
    color: #212529;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 0.4rem;
}

.stat-note {
    color: #6c757d;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.company-card-clickable,
.contact-card-clickable {
    cursor: pointer;
}

.company-card-clickable:hover,
.company-card-clickable:focus-within,
.company-card-clickable:focus,
.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.nav-tabs .nav-link.active {
    font-weight: 700;
    border-bottom: 3px solid #0d6efd;
}

.card {
    border: 0;
    border-radius: 16px;
}

.company-header h1 {
    letter-spacing: -0.02em;
}

.company-card-shell {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 26px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.company-card {
    display: flex;
    flex-direction: column;
}

.contact-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 26px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.contact-card-clickable {
    cursor: pointer;
    user-select: text;
}

.contact-card-clickable:focus-within,
.contact-card-clickable:focus,
.contact-card-clickable:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.company-card-clickable {
    user-select: text;
}

.company-card-body {
    gap: 1rem;
    min-height: 100%;
    padding: 1.55rem 1.75rem 1.45rem;
}

.company-card-header {
    padding-right: 3.4rem;
}

.company-card-title {
    color: #161c27;
    font-size: 1.95rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.06;
}

.company-card-industry {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.35;
    margin-top: 0.45rem;
}

.company-card-chip-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.company-card-chip {
    align-items: center;
    border-radius: 14px;
    display: inline-flex;
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1;
    padding: 0.6rem 0.82rem;
    white-space: nowrap;
}

.company-card-chip-dark {
    background: #6b7280;
    color: #fff;
}

.company-card-chip-light {
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #1f2937;
}

.company-card-chip-row .health-score-badge {
    font-size: 0.92rem;
    padding: 0.55rem 0.82rem;
}

.company-card-info {
    display: grid;
    gap: 0.7rem;
}

.company-card-line {
    color: #111827;
    font-size: 1.02rem;
    line-height: 1.35;
}

.company-card-line-label {
    color: #111827;
    font-size: 1.02rem;
    font-weight: 700;
    margin-right: 0.25rem;
}

.company-card-next-step-block {
    display: grid;
    gap: 0.45rem;
}

.company-card-next-step {
    color: #374151;
    font-size: 1rem;
    line-height: 1.42;
}

.company-card-next-step-empty {
    color: #6b7280;
}

.company-card-next-step-meta {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.35;
}

.company-card-footer {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.35;
    margin-top: 0.15rem;
}

.contact-card-body {
    gap: 0.95rem;
    min-height: 100%;
    padding: 1.6rem 1.75rem 1.45rem;
}

.contact-card-header {
    padding-right: 3.4rem;
}

.contact-card-title {
    line-height: 1.08;
}

.contact-card-name {
    color: #161c27;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.contact-card-name:hover {
    color: #161c27;
}

.contact-card-company {
    font-size: 1.06rem;
    font-weight: 500;
    line-height: 1.38;
    margin-top: 0.35rem;
}

.contact-card-company a {
    color: #5f7198;
    text-decoration: none;
    transition: color 0.15s ease;
}

.contact-card-company a:hover,
.contact-card-company a:focus {
    color: #455a84;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.14em;
}

.contact-card-role {
    color: #1f2937;
    font-size: 1.06rem;
    line-height: 1.38;
}

.contact-card-details {
    color: #1f2937;
    display: grid;
    gap: 0.5rem;
    font-size: 1.06rem;
    line-height: 1.38;
    margin-top: 0.1rem;
}

.contact-card-detail {
    min-height: 1.2em;
}

.contact-card-detail a {
    color: inherit;
    text-decoration: none;
}

.contact-card-detail a:hover {
    color: #2f466f;
}

.card-action-menu {
    position: absolute;
    z-index: 6;
}

.card-action-menu .dropdown-menu {
    position: relative;
    z-index: 7;
}

.contact-card-action-layer,
.contact-card-detail a {
    position: relative;
    z-index: 2;
}

.card-menu-button,
.contact-card-menu-button {
    align-items: center;
    background: rgba(248, 250, 252, 0.94);
    border-color: rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    color: #5b6475;
    display: inline-flex;
    justify-content: center;
    min-height: 3rem;
    min-width: 3rem;
    padding: 0.4rem 0.55rem;
}

.card-menu-button:hover,
.card-menu-button:focus,
.contact-card-menu-button:hover,
.contact-card-menu-button:focus {
    background: #fff;
    color: #2b3342;
}

.contact-card-type {
    color: #1f2937;
    display: inline;
    font-size: 1.06rem;
    font-weight: 500;
    padding: 0;
}

.crm-id {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background: rgba(13, 110, 253, 0.08);
    border-radius: 8px;
    padding: 0.2rem 0.45rem;
}

.company-header-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.6rem;
}

.company-header-meta-divider {
    opacity: 0.65;
}

.health-score-badge {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 0.3rem;
    line-height: 1.1;
    padding: 0.28rem 0.6rem;
    white-space: nowrap;
}

.health-score-badge-prefix {
    font-weight: 600;
    opacity: 0.9;
}

.health-score-badge-success {
    background: rgba(25, 135, 84, 0.14);
    border-color: rgba(25, 135, 84, 0.2);
    color: #146c43;
}

.health-score-badge-warning {
    background: rgba(255, 193, 7, 0.18);
    border-color: rgba(255, 193, 7, 0.3);
    color: #7a5a00;
}

.health-score-badge-danger {
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.22);
    color: #b02a37;
}

.health-score-badge-muted {
    background: rgba(108, 117, 125, 0.12);
    border-color: rgba(108, 117, 125, 0.2);
    color: #495057;
}

.empty-state {
    border: 1px dashed rgba(108, 117, 125, 0.4);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.75);
}

.dashboard-list {
    display: grid;
    gap: 0.85rem;
}

.dashboard-list-item {
    align-items: center;
    background: rgba(248, 249, 250, 0.9);
    border: 1px solid rgba(108, 117, 125, 0.14);
    border-radius: 14px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-list-item:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.task-list-item {
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.95rem;
}

.task-list-item-selected {
    background: rgba(13, 110, 253, 0.03);
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow: inset 3px 0 0 rgba(13, 110, 253, 0.72);
    outline: 2px solid rgba(13, 110, 253, 0.14);
    outline-offset: 1px;
}

.task-list-item-pinned {
    border-color: rgba(13, 110, 253, 0.26);
}

.task-list-item-overdue {
    background:
        linear-gradient(135deg, rgba(220, 53, 69, 0.05), rgba(255, 255, 255, 0.96)),
        rgba(248, 249, 250, 0.9);
    border-color: rgba(220, 53, 69, 0.26);
    box-shadow: inset 3px 0 0 rgba(220, 53, 69, 0.72);
}

.task-list-item-complete {
    opacity: 0.82;
}

.task-pin-badge {
    background: rgba(13, 110, 253, 0.08);
    border: 1px solid rgba(13, 110, 253, 0.18);
    color: #0a58ca;
}

.task-due-hint {
    font-weight: 600;
}

.task-row-actions {
    align-items: center;
    gap: 0.4rem !important;
}

.task-row-select {
    align-items: flex-start;
    display: inline-flex;
    padding-top: 0.15rem;
}

.task-select-checkbox {
    cursor: pointer;
    margin-top: 0.15rem;
}

.task-row-link {
    color: inherit;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.task-row-link:focus-visible {
    border-radius: 10px;
    outline: 2px solid rgba(13, 110, 253, 0.55);
    outline-offset: 4px;
}

.task-row-link:hover .task-row-title {
    color: #0d6efd !important;
}

.task-row-head {
    align-items: flex-start;
    display: flex;
    gap: 0.7rem;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.task-row-title-wrap {
    min-width: 0;
}

.task-row-title {
    font-size: 1rem;
    line-height: 1.28;
}

.task-row-badges {
    display: inline-flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.task-row-meta {
    align-items: center;
    column-gap: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    row-gap: 0.2rem;
}

.task-meta-item {
    align-items: center;
    display: inline-flex;
    gap: 0.38rem;
    line-height: 1.25;
    min-height: 1.4rem;
}

.task-meta-item .bi {
    font-size: 0.85rem;
    opacity: 0.78;
}

.task-bulk-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    justify-content: space-between;
}

@media (max-width: 767.98px) {
    .task-list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-row-actions {
        width: 100%;
    }

    .task-bulk-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-row-select {
        padding-top: 0;
    }
}

.task-icon-button {
    align-items: center;
    display: inline-flex;
    height: 31px;
    justify-content: center;
    min-width: 31px;
    padding: 0;
}

.task-icon-button .bi {
    font-size: 0.95rem;
    line-height: 1;
}

.task-note-list {
    display: grid;
    gap: 0.85rem;
}

.task-note-composer {
    background: rgba(248, 249, 250, 0.95);
    border: 1px solid rgba(108, 117, 125, 0.14);
    border-radius: 16px;
    padding: 1.1rem;
}

.task-note-composer .form-label {
    font-weight: 700;
}

.task-note-composer .form-text {
    color: #6c757d;
}

.task-note-entry {
    background: rgba(248, 249, 250, 0.9);
    border: 1px solid rgba(108, 117, 125, 0.14);
    border-radius: 14px;
    padding: 0.95rem 1rem;
}

.task-note-entry-header {
    align-items: flex-start;
    display: flex;
    gap: 0.9rem;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.task-note-entry-meta {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 0;
}

.task-note-entry-actions {
    display: inline-flex;
    gap: 0.45rem;
    margin-left: auto;
}

.task-note-entry-actions form {
    margin: 0;
}

.task-note-entry-content {
    line-height: 1.6;
    white-space: pre-wrap;
}

.task-note-edit-form {
    border-top: 1px solid rgba(108, 117, 125, 0.16);
    margin-top: 0.95rem;
    padding-top: 0.95rem;
}

.task-note-edit-form .form-label {
    font-weight: 700;
}

.task-note-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.task-note-attachment {
    align-items: center;
    background: rgba(13, 110, 253, 0.05);
    border: 1px solid rgba(13, 110, 253, 0.12);
    border-radius: 12px;
    color: #0a58ca;
    display: inline-flex;
    gap: 0.5rem;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
}

.task-note-attachment:hover {
    background: rgba(13, 110, 253, 0.08);
}

.task-note-attachment-icon {
    align-items: center;
    display: inline-flex;
    font-size: 0.9rem;
    justify-content: center;
}

.task-note-attachment-name {
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.task-note-attachment-image {
    align-items: flex-start;
    color: inherit;
    display: inline-flex;
    flex-direction: column;
    padding: 0.55rem;
    width: 180px;
}

.task-note-image-preview {
    border-radius: 10px;
    display: block;
    height: 120px;
    object-fit: cover;
    width: 100%;
}

.task-single-note-card {
    padding-top: 1.1rem;
}

.task-single-note-display {
    line-height: 1.6;
    min-height: 108px;
    padding: 0.2rem 0 0.35rem;
    white-space: pre-wrap;
}

.task-single-note-display-empty {
    color: #6c757d;
}

.task-single-note-files {
    margin-top: 1rem;
}

.task-single-note-files-label {
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.task-single-note-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.task-single-note-file-link {
    align-items: center;
    background: rgba(13, 110, 253, 0.05);
    border: 1px solid rgba(13, 110, 253, 0.12);
    border-radius: 12px;
    color: #0a58ca;
    display: inline-flex;
    gap: 0.5rem;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
}

.task-single-note-file-link:hover {
    background: rgba(13, 110, 253, 0.08);
}

.task-single-note-editor {
    border-top: 1px solid rgba(108, 117, 125, 0.16);
    margin-top: 1rem;
    padding-top: 1rem;
}

#company-activity-log {
    scroll-margin-top: 90px;
}

.task-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.task-summary-filter {
    align-items: center;
    display: inline-flex;
    min-height: 2rem;
    padding: 0.5rem 0.8rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.task-summary-filter:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.task-summary-filter-active {
    background: #0d6efd;
    border: 1px solid #0d6efd;
    color: #fff;
}

.task-summary-filter-active:hover {
    background: #0b5ed7;
    border-color: #0b5ed7;
    color: #fff;
}

.task-summary-filter-overdue {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #b02a37;
}

.task-summary-filter-overdue-active {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: #fff;
}

.task-summary-filter-overdue-active:hover {
    background: #bb2d3b;
    border-color: #bb2d3b;
    color: #fff;
}

.task-summary-bar-compact {
    margin-top: -0.25rem;
}

.task-section-divider {
    border-top: 1px solid rgba(108, 117, 125, 0.16);
}

.top-revenue-item {
    align-items: flex-start;
    background:
        linear-gradient(135deg, rgba(13, 110, 253, 0.03), rgba(255, 255, 255, 0.95)),
        rgba(248, 249, 250, 0.9);
}

.top-revenue-item-priority {
    border-color: rgba(220, 53, 69, 0.3);
    box-shadow: inset 3px 0 0 rgba(220, 53, 69, 0.7);
}

.churn-risk-item {
    align-items: flex-start;
    background:
        linear-gradient(135deg, rgba(220, 53, 69, 0.04), rgba(255, 255, 255, 0.96)),
        rgba(248, 249, 250, 0.9);
}

.churn-risk-item-urgent {
    border-color: rgba(220, 53, 69, 0.32);
    box-shadow: inset 3px 0 0 rgba(220, 53, 69, 0.75);
}

.risk-pill {
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
    text-align: center;
}

.risk-pill-danger {
    background: rgba(220, 53, 69, 0.12);
    color: #b02a37;
}

.risk-pill-warning {
    background: rgba(255, 193, 7, 0.18);
    color: #8a6d00;
}

.risk-pill-success {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.risk-pill-muted {
    background: rgba(108, 117, 125, 0.12);
    color: #495057;
}

.option-card {
    background:
        linear-gradient(135deg, rgba(13, 110, 253, 0.05), rgba(25, 135, 84, 0.05)),
        #fff;
}

.import-tool-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.98)),
        #fff;
}

.danger-zone-card {
    background:
        linear-gradient(135deg, rgba(220, 53, 69, 0.08), rgba(255, 255, 255, 0.98)),
        #fff;
}

.option-label {
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.import-tool-card-body {
    padding: 1.35rem 1.45rem;
}

.import-tool-title {
    color: #1b2430;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 0.85rem;
}

.import-tool-form {
    display: grid;
    gap: 0.9rem;
}

.import-file-shell {
    position: relative;
}

.import-file-input {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 10px;
    color: transparent;
    cursor: pointer;
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
    min-height: 46px;
    width: 100%;
}

.import-file-input::file-selector-button {
    background: rgba(248, 249, 250, 0.98);
    border: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.26);
    color: #212529;
    cursor: pointer;
    font-weight: 600;
    margin: 0 0.95rem 0 0;
    padding: 0.7rem 1rem;
}

.import-file-input::-webkit-file-upload-button {
    background: rgba(248, 249, 250, 0.98);
    border: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.26);
    color: #212529;
    cursor: pointer;
    font-weight: 600;
    margin: 0 0.95rem 0 0;
    padding: 0.7rem 1rem;
}

.import-file-input:hover {
    border-color: rgba(13, 110, 253, 0.28);
}

.import-file-input:focus {
    border-color: rgba(13, 110, 253, 0.4);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
    outline: none;
}

.import-file-hint {
    color: #6c757d;
    font-size: 0.95rem;
    left: 8.4rem;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    right: 0.95rem;
    text-overflow: ellipsis;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}

.import-file-shell.has-file .import-file-hint {
    color: #212529;
}

.import-actions-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
}

.import-submit-button {
    white-space: nowrap;
}

.import-columns-inline {
    align-items: center;
    color: #6c757d;
    display: flex;
    flex: 1 1 24rem;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    line-height: 1.45;
    min-width: 0;
}

.import-columns-label {
    color: #5c6677;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.import-columns-list {
    color: #6c757d;
    font-size: 0.88rem;
    min-width: 0;
}

.import-summary {
    border-top: 1px solid rgba(108, 117, 125, 0.16);
    margin-top: 1rem;
    padding-top: 1rem;
}

.import-metric {
    background: rgba(248, 249, 250, 0.9);
    border: 1px solid rgba(108, 117, 125, 0.12);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.import-metric-label {
    color: #6c757d;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.import-metric-value {
    color: #212529;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 0.3rem;
}

.import-errors {
    display: grid;
    gap: 0.6rem;
    max-height: 280px;
    overflow-y: auto;
}

.import-error-row {
    background: rgba(220, 53, 69, 0.06);
    border: 1px solid rgba(220, 53, 69, 0.14);
    border-radius: 12px;
    color: #5c1a20;
    font-size: 0.95rem;
    padding: 0.85rem 0.95rem;
}

@media (max-width: 767.98px) {
    .company-card-container,
    .contact-card-container {
        display: block;
    }

    .import-tool-card-body {
        padding: 1.1rem 1rem;
    }

    .import-tool-title {
        font-size: 1.28rem;
        margin-bottom: 0.75rem;
    }

    .import-file-hint {
        left: 8rem;
    }

    .import-actions-row {
        flex-direction: column;
    }

    .import-columns-inline {
        flex-basis: 100%;
        padding-top: 0;
    }
}
