:root {
    --crm-space-1: 0.35rem;
    --crm-space-2: 0.5rem;
    --crm-space-3: 0.7rem;
    --crm-space-4: 0.9rem;
    --crm-space-5: 1.1rem;
    --crm-radius-sm: 10px;
    --crm-radius-md: 12px;
    --crm-radius-lg: 14px;
    --crm-sidebar-width: 248px;
    --crm-sidebar-width-collapsed: 78px;
    --crm-topbar-height: 60px;
}

body.crm-body {
    background: #f3f5f9;
    color: #172033;
    font-size: 13px;
    min-height: 100vh;
    overflow-x: hidden;
}

body.crm-body,
body.crm-body .form-control,
body.crm-body .form-select,
body.crm-body .btn,
body.crm-body .table {
    font-size: 0.92rem;
}

body.crm-body .container,
body.crm-body .container-fluid {
    --bs-gutter-x: 0.8rem;
}

body.crm-body .row {
    --bs-gutter-x: 0.8rem;
    --bs-gutter-y: 0.8rem;
}

body.crm-body .card {
    border-radius: var(--crm-radius-lg);
}

body.crm-body .card-body,
body.crm-body .card-header,
body.crm-body .card-footer {
    padding: 0.75rem 0.85rem;
}

body.crm-body .form-label {
    color: #44506a;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

body.crm-body .form-control,
body.crm-body .form-select {
    border-color: #d9e0ea;
    border-radius: var(--crm-radius-md);
    min-height: 36px;
    padding: 0.42rem 0.72rem;
}

body.crm-body .btn {
    border-radius: var(--crm-radius-md);
    font-weight: 600;
    min-height: 34px;
    padding: 0.4rem 0.75rem;
}

body.crm-body .btn-sm {
    min-height: 30px;
    padding: 0.24rem 0.58rem;
}

body.crm-body .table {
    --bs-table-bg: transparent;
}

body.crm-body .table > :not(caption) > * > * {
    border-bottom-color: #ebeff5;
    padding: 0.56rem 0.65rem;
    vertical-align: middle;
}

body.crm-body .badge {
    font-weight: 600;
}

.page-shell {
    display: grid;
    gap: 0.8rem;
}

.page-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.8rem;
    justify-content: space-between;
}

.page-eyebrow {
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.page-title {
    color: #111827;
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
}

.page-description {
    color: #667085;
    font-size: 0.84rem;
    line-height: 1.42;
    margin: 0.15rem 0 0;
    max-width: 920px;
}

.page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.crm-panel {
    background: linear-gradient(180deg, #ffffff, #fbfcfe);
    border: 1px solid #e6ebf2;
    border-radius: var(--crm-radius-lg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.045);
}

.crm-panel-header {
    align-items: center;
    border-bottom: 1px solid #edf1f6;
    display: flex;
    gap: 0.55rem;
    justify-content: space-between;
    padding: 0.7rem 0.85rem;
}

.crm-panel-header-title {
    color: #111827;
    font-size: 0.88rem;
    font-weight: 700;
}

.crm-panel-header-subtitle {
    color: #667085;
    font-size: 0.76rem;
    margin-top: 0.1rem;
}

.crm-panel-body {
    padding: 0.82rem;
}

.filter-card {
    padding: 0;
}

.filter-grid {
    align-items: end;
    --bs-gutter-x: 0.65rem;
    --bs-gutter-y: 0.65rem;
}

.data-table-card {
    overflow: hidden;
}

.crm-table {
    line-height: 1.3;
    margin-bottom: 0;
}

.crm-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e6ebf2;
    color: #667085;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.crm-table tbody tr:hover {
    background: #fafcff;
}

.crm-table .cell-main,
.crm-table .fw-semibold {
    line-height: 1.25;
}

.crm-table .cell-sub,
.crm-table .small {
    font-size: 0.76rem;
    line-height: 1.35;
}

.inline-actions {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.inline-actions form {
    margin: 0;
}

.inline-actions .form-control,
.inline-actions .form-select {
    min-width: 112px;
}

.compact-form-grid {
    --bs-gutter-x: 0.65rem;
    --bs-gutter-y: 0.65rem;
}

.compact-form-actions {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.report-filter-summary {
    min-width: 0;
}

.report-filter-summary .small {
    line-height: 1.45;
}

.report-filter-actions {
    justify-content: flex-end;
}

.settings-table-actions {
    align-items: flex-start;
}

.settings-inline-form {
    align-items: center;
}

.settings-inline-switch {
    align-items: center;
    display: inline-flex;
    margin: 0;
    min-height: 30px;
    padding-left: 0;
}

body.crm-body .form-control-color {
    min-height: 36px;
    min-width: 52px;
    padding: 0.25rem;
}

.crm-empty {
    align-items: center;
    color: #667085;
    display: flex;
    justify-content: center;
    min-height: 120px;
    padding: 1rem;
    text-align: center;
}

.metric-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.metric-card {
    min-width: 0;
}

.section-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
}

.section-card-link {
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.form-card {
    max-width: 1280px;
}

.module-kicker {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
}

.module-kicker i {
    color: #2563eb;
}

.module-info-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-info-card {
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border: 1px solid #e6ebf2;
    border-radius: var(--crm-radius-lg);
    padding: 0.82rem;
}

.module-info-title {
    color: #111827;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.module-info-text {
    color: #667085;
    font-size: 0.88rem;
    line-height: 1.5;
}

.module-placeholder-footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.module-placeholder-tag {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.28rem 0.58rem;
}

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

.app-backdrop {
    display: none;
}

.app-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: #d9e2f2;
    display: flex;
    flex: 0 0 var(--crm-sidebar-width);
    flex-direction: column;
    left: 0;
    max-width: var(--crm-sidebar-width);
    position: fixed;
    top: 0;
    transition: width 0.25s ease, max-width 0.25s ease, transform 0.25s ease;
    width: var(--crm-sidebar-width);
    z-index: 1040;
    height: 100vh;
}

.app-sidebar-header,
.app-sidebar-footer {
    padding: 0.8rem;
}

.app-sidebar-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 62px;
}

.app-sidebar-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 0.6rem 0.8rem;
}

.app-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    margin-left: var(--crm-sidebar-width);
    min-width: 0;
    transition: margin-left 0.25s ease;
}

.topbar {
    align-items: center;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    justify-content: space-between;
    min-height: var(--crm-topbar-height);
    padding: 0.5rem 0.8rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-left,
.topbar-right {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.topbar-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.topbar-breadcrumbs {
    align-items: center;
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.69rem;
    gap: 0.3rem;
    line-height: 1.1;
    margin-bottom: 0.1rem;
}

.topbar-breadcrumb-link {
    color: #64748b;
    text-decoration: none;
}

.topbar-breadcrumb-link:hover {
    color: #2563eb;
}

.topbar-breadcrumb-separator,
.topbar-breadcrumb-muted {
    color: #98a2b3;
}

.topbar-breadcrumb-current {
    color: #111827;
    font-weight: 700;
}

.topbar-title {
    color: #111827;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.1;
}

.topbar-subtitle {
    color: #6b7280;
    font-size: 0.72rem;
}

.topbar-user-chip {
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: var(--crm-radius-md);
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    padding: 0.35rem 0.6rem;
}

.topbar-user-name {
    color: #111827;
    font-size: 0.85rem;
    font-weight: 700;
}

.topbar-user-role {
    color: #6b7280;
    font-size: 0.75rem;
}

.sidebar-toggle {
    align-items: center;
    background: #fff;
    border: 1px solid #d9e0ea;
    border-radius: var(--crm-radius-md);
    color: #344054;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.sidebar-toggle:hover {
    background: #f8fafc;
}

.sidebar-toggle-inline {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    color: #d9e2f2;
}

.brand {
    align-items: center;
    color: #fff;
    display: inline-flex;
    gap: 0.55rem;
    min-width: 0;
}

.brand-badge {
    align-items: center;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: var(--crm-radius-md);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.brand-badge-lg {
    height: 56px;
    width: 56px;
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 700;
}

.brand-subtitle {
    color: #94a3b8;
    font-size: 0.7rem;
}

.nav-section-label {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0.8rem 0 0.4rem;
    padding: 0 0.6rem;
    text-transform: uppercase;
}

.app-nav {
    display: grid;
    gap: 0.2rem;
}

.app-nav-link {
    align-items: center;
    border-radius: var(--crm-radius-md);
    color: #cbd5e1;
    display: flex;
    gap: 0.65rem;
    min-height: 38px;
    padding: 0.58rem 0.7rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.app-nav-link i {
    font-size: 1rem;
    min-width: 18px;
}

.app-nav-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-nav-link:hover,
.app-nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-nav-link.active {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-user-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--crm-radius-lg);
    display: flex;
    gap: 0.6rem;
    padding: 0.7rem;
}

.sidebar-user-avatar {
    align-items: center;
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    border-radius: var(--crm-radius-md);
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.sidebar-user-meta {
    min-width: 0;
}

.sidebar-user-name {
    color: #f8fafc;
    font-size: 0.86rem;
    font-weight: 700;
}

.sidebar-user-role {
    color: #94a3b8;
    font-size: 0.75rem;
}

.content-area {
    padding: 0.8rem;
}

.card-metric {
    background: linear-gradient(180deg, #fff, #f8fafc);
    border: 1px solid #e8edf4;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.045);
}

.metric-label {
    color: #667085;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.metric-value {
    font-size: 1.34rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 0.28rem;
}

.metric-value-money {
    font-size: 1.12rem;
}

.crm-alert {
    border: 0;
    border-radius: var(--crm-radius-md);
    font-size: 0.82rem;
    margin-bottom: 0.8rem;
    padding: 0.72rem 0.82rem;
}

.activity-item + .activity-item {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
}

.auth-shell {
    min-height: 100vh;
    padding: 1.5rem 1rem;
}

.auth-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 3rem);
}

.auth-card {
    max-width: 440px;
    width: min(100%, 440px);
}

.auth-card-body {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.auth-card-brand {
    align-items: center;
    display: flex;
    gap: 0.9rem;
}

.auth-card-eyebrow {
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.auth-card-title {
    color: #111827;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.08;
    margin: 0;
}

.auth-card-description {
    color: #667085;
    font-size: 0.84rem;
    line-height: 1.45;
    margin: 0.2rem 0 0;
}

.auth-feedback {
    font-size: 0.82rem;
    margin: 0;
    padding: 0.72rem 0.82rem;
}

.auth-demo-hint {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e6ebf2;
    border-radius: var(--crm-radius-md);
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
    padding: 0.75rem 0.85rem;
}

.auth-demo-label {
    color: #111827;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-right: 0.15rem;
    text-transform: uppercase;
}

.auth-demo-hint code {
    background: #eff6ff;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.16rem 0.45rem;
}

.pipeline-board {
    display: grid;
    gap: 1rem;
    grid-auto-columns: minmax(290px, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}

.pipeline-column {
    background: #eef2f7;
    border: 1px solid #dbe3ee;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
    min-height: 520px;
    min-width: 0;
}

.pipeline-column-drop {
    border-color: #2563eb;
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.pipeline-column-header {
    background: #f8fafc;
    border-bottom: 1px solid #dbe3ee;
    border-radius: 18px 18px 0 0;
    padding: 1rem;
}

.pipeline-column-title-row {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.pipeline-column-color {
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    height: 12px;
    width: 12px;
}

.pipeline-column-title {
    font-size: 0.98rem;
    font-weight: 700;
}

.pipeline-column-subtitle {
    color: #6b7280;
    font-size: 0.78rem;
}

.pipeline-column-total {
    color: #111827;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 0.85rem;
}

.pipeline-column-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.85rem;
    overflow-y: auto;
    padding: 1rem;
    min-width: 0;
}

.pipeline-empty {
    align-items: center;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    justify-content: center;
    min-height: 140px;
    padding: 1.25rem;
    text-align: center;
}

.pipeline-empty i {
    font-size: 1.4rem;
}

.pipeline-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    min-width: 0;
    padding: 0.95rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.pipeline-card-draggable {
    cursor: grab;
}

.pipeline-card-ghost {
    opacity: 0.55;
}

.pipeline-card-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pipeline-card-top-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 0.3rem;
}

.pipeline-probability {
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 700;
}

.pipeline-card-toggle {
    align-items: center;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #d0d9e5;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    color: #2563eb;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    min-height: 28px;
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 28px;
}

.pipeline-card-toggle:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.pipeline-card.is-expanded .pipeline-card-toggle {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
    color: #fff;
}

.pipeline-card.is-expanded .pipeline-card-toggle:hover {
    background: linear-gradient(180deg, #1d4ed8, #1e40af);
    border-color: #1e40af;
    color: #fff;
}

.pipeline-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.6rem;
    overflow-wrap: anywhere;
}

.pipeline-card-amount {
    color: #111827;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.pipeline-card-meta {
    color: #4b5563;
    display: grid;
    gap: 0.45rem;
    font-size: 0.84rem;
}

.pipeline-card-summary {
    display: grid;
    gap: 0.25rem;
    position: relative;
    padding-right: 2.25rem;
}

.pipeline-card-body-collapse {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid #eef2f7;
}

.pipeline-card-insights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pipeline-card-chip {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #475467;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 700;
    gap: 0.35rem;
    max-width: 100%;
    min-height: 28px;
    padding: 0.14rem 0.55rem;
}

.pipeline-card-chip-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #b45309;
}

.pipeline-card-chip-success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #027a48;
}

.pipeline-card-inline-note {
    color: #667085;
    font-size: 0.75rem;
    line-height: 1.4;
}

.pipeline-card-summary-indicator {
    align-items: center;
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.32rem;
    min-width: 0;
}

.pipeline-card-summary-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.64rem;
    font-weight: 800;
    min-height: 18px;
    padding: 0.02rem 0.34rem;
}

.pipeline-card-summary-pill-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.pipeline-card-summary-pill-warning {
    background: #fef3c7;
    color: #b45309;
}

.pipeline-card-summary-pill-danger {
    background: #fee2e2;
    color: #b42318;
}

.pipeline-card-summary-pill-success {
    background: #dcfce7;
    color: #027a48;
}

.pipeline-card-summary-pill-neutral {
    background: #eef2f7;
    color: #475467;
}

.pipeline-card-summary-note {
    color: #667085;
    display: -webkit-box;
    font-size: 0.66rem;
    line-height: 1.1;
    min-width: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

.pipeline-card-risk-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 0.22rem;
    margin-bottom: 0.28rem;
}

.pipeline-card-risk-chip {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
    max-width: 100%;
    min-height: 16px;
    padding: 0.02rem 0.32rem;
    white-space: nowrap;
}

.pipeline-card-risk-chip-danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #b42318;
}

.pipeline-card-risk-chip-warning {
    background: #fffaeb;
    border-color: #fedf89;
    color: #b54708;
}

.pipeline-card-risk-chip-neutral {
    background: #f5f7fa;
    border-color: #d0d5dd;
    color: #475467;
}

.pipeline-card-priority-danger {
    border-color: #fecdd3;
    box-shadow: inset 3px 0 0 #f04438, 0 4px 14px rgba(15, 23, 42, 0.045);
}

.pipeline-card-priority-warning {
    border-color: #fedf89;
    box-shadow: inset 3px 0 0 #f79009, 0 4px 14px rgba(15, 23, 42, 0.045);
}

.pipeline-card-meta div {
    align-items: center;
    display: flex;
    gap: 0.45rem;
    min-width: 0;
}

.pipeline-card-meta div i {
    flex: 0 0 auto;
}

.pipeline-card-meta div span,
.pipeline-card-meta div strong {
    min-width: 0;
}

.pipeline-card-meta div,
.pipeline-card-note,
.opportunity-panel-text,
.opportunity-timeline-description,
.opportunity-timeline-owner,
#detailCompany,
#detailContact,
#detailLead,
#detailOwner,
#detailLossReason,
#detailNotes,
#opportunityDetailsTitle,
#activityOpportunityTitle,
#activityOpportunityContext {
    overflow-wrap: anywhere;
}

.pipeline-card-note {
    border-top: 1px solid #eef2f7;
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.45;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
}

.pipeline-card-footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.pipeline-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.pipeline-card-quick-actions,
.pipeline-card-decision-actions {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.pipeline-card-quick-action,
.pipeline-card-decision-btn {
    align-items: center;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    color: #475467;
    display: inline-flex;
    height: 26px;
    justify-content: center;
    min-height: 26px;
    min-width: 26px;
    padding: 0;
    width: 26px;
}

.pipeline-card-quick-action:hover,
.pipeline-card-decision-btn:hover {
    background: #f8fafc;
    border-color: #98a2b3;
    color: #111827;
}

.pipeline-card-inline-link {
    color: #475467;
    font-size: 0.68rem;
    font-weight: 700;
}

.pipeline-card-inline-link:hover {
    color: #1d4ed8;
}

.pipeline-card-decision-btn-success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #027a48;
}

.pipeline-card-decision-btn-danger {
    background: #fef3f2;
    border-color: #fecdca;
    color: #b42318;
}

.opportunities-page {
    gap: 0.7rem;
}

.opportunities-page .page-header {
    gap: 0.45rem;
}

.opportunities-page .page-title {
    font-size: 1.16rem;
    letter-spacing: -0.01em;
}

.opportunities-page .page-description {
    font-size: 0.77rem;
    line-height: 1.32;
    max-width: 640px;
}

.opportunities-page .page-actions {
    gap: 0.35rem;
}

.opportunities-page .page-actions .badge,
.opportunities-page .page-actions .btn,
.opportunity-header-tag {
    font-size: 0.72rem;
    min-height: 30px;
    padding: 0.3rem 0.6rem;
}

.opportunity-header-tag {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
}

.opportunity-header-tag-success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #027a48;
}

.opportunity-header-tag-dark {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.opportunities-page .metric-grid {
    gap: 0.55rem;
}

.opportunities-page .metric-card .card-body {
    padding: 0.55rem 0.65rem;
}

.opportunities-page .metric-label {
    font-size: 0.62rem;
}

.opportunities-page .metric-value {
    font-size: 1.08rem;
    margin-top: 0.15rem;
}

.opportunities-page .metric-value-money {
    font-size: 0.9rem;
}

.opportunities-page .crm-panel-body {
    padding: 0.65rem 0.7rem;
}

.opportunities-page .filter-grid {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

.opportunities-page .form-label {
    font-size: 0.64rem;
    margin-bottom: 0.18rem;
}

.opportunities-page .form-control,
.opportunities-page .form-select {
    font-size: 0.78rem;
    min-height: 32px;
    padding: 0.34rem 0.58rem;
}

.opportunities-page .pipeline-board {
    align-items: start;
    gap: 0.55rem;
    grid-auto-columns: auto;
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
    overflow-x: visible;
    padding-bottom: 0;
}

.opportunities-page .pipeline-column {
    border-radius: 14px;
    max-height: calc(100vh - 188px);
    min-height: 300px;
}

.opportunities-page .pipeline-column-header {
    padding: 0.54rem 0.58rem;
}

.opportunities-page .pipeline-column-title-row {
    align-items: flex-start;
    gap: 0.45rem;
}

.opportunities-page .pipeline-column-title {
    font-size: 0.78rem;
    line-height: 1.15;
}

.opportunities-page .pipeline-column-subtitle {
    font-size: 0.64rem;
}

.pipeline-column-meta {
    align-items: center;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    justify-content: space-between;
    margin-top: 0.18rem;
}

.opportunities-page .pipeline-column-total {
    font-size: 0.66rem;
    margin-top: 0;
}

.opportunities-page .pipeline-column-body {
    gap: 0.45rem;
    padding: 0.55rem;
}

.opportunities-page .pipeline-empty {
    font-size: 0.72rem;
    min-height: 84px;
    padding: 0.65rem;
}

.opportunities-page .pipeline-card {
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
    padding: 0.5rem 0.52rem;
}

.opportunities-page .pipeline-card.is-expanded {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border-color: #c7d7fe;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.09);
}

.opportunities-page .pipeline-card.pipeline-card-priority-danger.is-expanded {
    border-color: #fda4af;
    box-shadow: inset 3px 0 0 #f04438, 0 8px 22px rgba(240, 68, 56, 0.12);
}

.opportunities-page .pipeline-card.pipeline-card-priority-warning.is-expanded {
    border-color: #fcd34d;
    box-shadow: inset 3px 0 0 #f79009, 0 8px 22px rgba(247, 144, 9, 0.12);
}

.opportunities-page .pipeline-card.is-expanded .pipeline-card-summary {
    padding-bottom: 0.1rem;
}

.opportunities-page .pipeline-card.is-expanded .pipeline-card-title {
    color: #0f172a;
}

.opportunities-page .pipeline-card.is-expanded .pipeline-card-inline-note {
    color: #1d4ed8;
    font-weight: 600;
}

.opportunities-page .pipeline-card.is-expanded .pipeline-card-body-collapse {
    border-top-color: #dbeafe;
}

.opportunities-page .pipeline-card-top {
    gap: 0.3rem;
    margin-bottom: 0.35rem;
}

.opportunities-page .pipeline-card-top .badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.18rem 0.32rem;
}

.opportunities-page .pipeline-probability {
    font-size: 0.64rem;
    letter-spacing: -0.01em;
}

.opportunities-page .pipeline-card-toggle {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    height: 20px;
    min-height: 20px;
    top: 0.05rem;
    width: 20px;
}

.opportunities-page .pipeline-card-title {
    display: -webkit-box;
    font-size: 0.76rem;
    line-height: 1.18;
    margin-bottom: 0.22rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.opportunities-page .pipeline-card-amount {
    font-size: 0.82rem;
    line-height: 1.1;
    margin-bottom: 0.26rem;
}

.opportunities-page .pipeline-card-summary-indicator {
    gap: 0.25rem;
    margin-bottom: 0.22rem;
}

.opportunities-page .pipeline-card-summary-pill {
    font-size: 0.56rem;
    min-height: 16px;
    padding: 0 0.28rem;
}

.opportunities-page .pipeline-card-summary-note {
    font-size: 0.58rem;
}

.opportunities-page .pipeline-card-risk-indicators {
    gap: 0.18rem;
    margin-bottom: 0.2rem;
}

.opportunities-page .pipeline-card-risk-chip {
    font-size: 0.52rem;
    min-height: 14px;
    padding: 0 0.24rem;
}

.opportunities-page .pipeline-card-meta {
    gap: 0.18rem;
    font-size: 0.67rem;
    line-height: 1.2;
}

.opportunities-page .pipeline-card-meta div {
    gap: 0.28rem;
}

.opportunities-page .pipeline-card-meta i {
    font-size: 0.68rem;
}

.opportunities-page .pipeline-card-body-collapse {
    gap: 0.32rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
}

.opportunities-page .pipeline-card-insights {
    gap: 0.22rem;
}

.opportunities-page .pipeline-card-chip {
    font-size: 0.6rem;
    gap: 0.22rem;
    min-height: 20px;
    padding: 0.02rem 0.35rem;
}

.opportunities-page .pipeline-card-inline-note {
    display: -webkit-box;
    font-size: 0.63rem;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.opportunities-page .pipeline-card-note {
    display: -webkit-box;
    font-size: 0.64rem;
    line-height: 1.25;
    margin-top: 0.28rem;
    padding-top: 0.28rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.opportunities-page .pipeline-card-footer,
.opportunities-page .pipeline-card-actions {
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.opportunities-page .pipeline-card-footer {
    align-items: center;
}

.opportunities-page .pipeline-card-quick-actions,
.opportunities-page .pipeline-card-decision-actions {
    gap: 0.18rem;
}

.opportunities-page .pipeline-card-quick-action,
.opportunities-page .pipeline-card-decision-btn {
    height: 22px;
    min-height: 22px;
    min-width: 22px;
    width: 22px;
}

.opportunities-page .pipeline-card-inline-link {
    font-size: 0.58rem;
}

.opportunities-page .pipeline-card-actions form {
    flex: 0 0 auto;
}

.crm-offcanvas {
    width: min(460px, 100vw);
}

.crm-offcanvas .offcanvas-header {
    padding: 0.7rem 0.82rem;
}

.crm-offcanvas .offcanvas-body {
    padding: 0.82rem;
}

.opportunity-panel-body {
    display: grid;
    gap: 0;
}

@media (min-width: 1400px) {
    .opportunities-page .pipeline-board {
        grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
    }

    .opportunities-page .pipeline-column {
        min-height: 280px;
    }

    .opportunities-page .pipeline-card {
        padding: 0.46rem 0.48rem;
    }
}

.opportunity-panel-section + .opportunity-panel-section {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
}

.opportunity-panel-kpis {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.opportunity-panel-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.opportunity-panel-label {
    color: #6b7280;
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 0.14rem;
    text-transform: uppercase;
}

.opportunity-panel-heading {
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.opportunity-panel-heading-row {
    align-items: center;
    display: flex;
    gap: 0.55rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.opportunity-panel-heading-row .opportunity-panel-heading {
    margin-bottom: 0;
}

.opportunity-panel-text {
    color: #4b5563;
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.opportunity-panel-alerts,
.opportunity-panel-history {
    display: grid;
    gap: 0.55rem;
}

.opportunity-panel-alert {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.65rem 0.72rem;
}

.opportunity-panel-alert-title {
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.35;
}

.opportunity-panel-alert-description {
    color: #4b5563;
    font-size: 0.74rem;
    line-height: 1.4;
    margin-top: 0.2rem;
}

.opportunity-panel-alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.opportunity-panel-alert-danger .opportunity-panel-alert-title {
    color: #b42318;
}

.opportunity-panel-alert-warning {
    background: #fffaeb;
    border-color: #fedf89;
}

.opportunity-panel-alert-warning .opportunity-panel-alert-title {
    color: #b54708;
}

.opportunity-panel-alert-neutral {
    background: #f8fafc;
}

.opportunity-panel-empty {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    border-radius: 12px;
    color: #667085;
    display: flex;
    gap: 0.55rem;
    justify-content: center;
    min-height: 60px;
    padding: 0.78rem;
    text-align: center;
}

.opportunity-history-list {
    display: grid;
    gap: 0.5rem;
}

.opportunity-history-item {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.68rem 0.74rem;
}

.opportunity-history-top {
    align-items: flex-start;
    display: flex;
    gap: 0.55rem;
    justify-content: space-between;
}

.opportunity-history-title {
    color: #111827;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.35;
}

.opportunity-history-meta,
.opportunity-history-actor {
    color: #667085;
    font-size: 0.7rem;
}

.opportunity-history-actor {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
    white-space: nowrap;
}

.opportunity-history-description {
    color: #4b5563;
    font-size: 0.74rem;
    line-height: 1.4;
    margin-top: 0.32rem;
    white-space: pre-wrap;
}

.opportunity-panel-activities {
    display: block;
}

.opportunity-timeline-filters {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.72rem;
}

.opportunity-timeline-filter-group {
    display: grid;
    gap: 0.45rem;
}

.opportunity-timeline-filter-label {
    color: #667085;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.opportunity-timeline-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.opportunity-timeline-filter-chip {
    background: #fff;
    border: 1px solid #dbe3ee;
    color: #475467;
    min-height: 26px;
    padding: 0.12rem 0.55rem;
}

.opportunity-timeline-filter-chip:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #111827;
}

.opportunity-timeline-filter-chip.is-active {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.opportunity-timeline-filter-summary {
    color: #667085;
    font-size: 0.72rem;
    line-height: 1.35;
}

.opportunity-timeline {
    display: grid;
    gap: 0.72rem;
}

.opportunity-timeline-group {
    display: grid;
    gap: 0.55rem;
}

.opportunity-timeline-group-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.opportunity-timeline-group-title {
    color: #111827;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.opportunity-timeline-group-count {
    background: #eef2f7;
    border-radius: 999px;
    color: #475467;
    font-size: 0.66rem;
    font-weight: 700;
    min-width: 24px;
    padding: 0.12rem 0.42rem;
    text-align: center;
}

.opportunity-timeline-group-items {
    display: grid;
    gap: 0.72rem;
}

.opportunity-timeline-group-overdue .opportunity-timeline-group-title {
    color: #b42318;
}

.opportunity-timeline-group-today .opportunity-timeline-group-title {
    color: #175cd3;
}

.opportunity-timeline-group-upcoming .opportunity-timeline-group-title {
    color: #6941c6;
}

.opportunity-timeline-group-completed .opportunity-timeline-group-title {
    color: #027a48;
}

.opportunity-timeline-item {
    display: grid;
    gap: 0.72rem;
    grid-template-columns: 24px minmax(0, 1fr);
}

.opportunity-timeline-marker {
    align-items: flex-start;
    display: flex;
    justify-content: center;
    position: relative;
}

.opportunity-timeline-marker::after {
    background: #dbe3ee;
    border-radius: 999px;
    bottom: -1rem;
    content: "";
    left: 50%;
    position: absolute;
    top: 1.7rem;
    transform: translateX(-50%);
    width: 2px;
}

.opportunity-timeline-item:last-child .opportunity-timeline-marker::after {
    display: none;
}

.opportunity-timeline-dot {
    align-items: center;
    background: #dbeafe;
    border: 2px solid #bfdbfe;
    border-radius: 999px;
    color: #2563eb;
    display: flex;
    height: 24px;
    justify-content: space-between;
    width: 24px;
}

.opportunity-timeline-item-success .opportunity-timeline-dot {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.opportunity-timeline-item-danger .opportunity-timeline-dot {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.opportunity-timeline-item-warning .opportunity-timeline-dot {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #b45309;
}

.opportunity-timeline-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.72rem;
}

.opportunity-timeline-top {
    align-items: flex-start;
    display: flex;
    gap: 0.55rem;
    justify-content: space-between;
}

.opportunity-timeline-title {
    color: #111827;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.opportunity-timeline-subtitle {
    color: #667085;
    font-size: 0.7rem;
    margin-top: 0.12rem;
}

.opportunity-timeline-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.opportunity-timeline-chip {
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.18rem 0.46rem;
}

.opportunity-timeline-chip-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.opportunity-timeline-chip-success {
    background: #dcfce7;
    color: #15803d;
}

.opportunity-timeline-chip-warning {
    background: #fef3c7;
    color: #b45309;
}

.opportunity-timeline-chip-danger {
    background: #fee2e2;
    color: #dc2626;
}

.opportunity-timeline-owner {
    align-items: center;
    color: #667085;
    display: inline-flex;
    font-size: 0.7rem;
    gap: 0.35rem;
}

.opportunity-timeline-description {
    color: #4b5563;
    font-size: 0.76rem;
    line-height: 1.42;
    margin-top: 0.52rem;
    white-space: pre-wrap;
}

.opportunity-timeline-empty {
    align-items: center;
    border: 1px dashed #dbe3ee;
    border-radius: 12px;
    color: #667085;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    min-height: 90px;
    padding: 0.8rem;
    text-align: center;
}

.opportunity-timeline-empty-filtered {
    background: #f8fafc;
}

.opportunity-activity-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.opportunity-inline-activity-header {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 0.72rem;
    padding: 0.68rem 0.74rem;
}

.users-page {
    gap: 0.72rem;
}

.users-admin-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
}

.users-side-stack {
    display: grid;
    gap: 0.8rem;
}

.users-panel-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.users-role-chip {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 700;
    min-height: 28px;
    padding: 0.18rem 0.58rem;
}

.users-role-chip-admin {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #5b21b6;
}

.users-role-chip-gestor {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.users-role-chip-comercial {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #027a48;
}

.users-role-chip-leitura {
    background: #f2f4f7;
    border-color: #d0d5dd;
    color: #475467;
}

.users-user-cell {
    align-items: center;
    display: flex;
    gap: 0.65rem;
}

.users-avatar {
    align-items: center;
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.users-user-meta {
    min-width: 0;
}

.users-inline-note {
    color: #667085;
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 0.12rem;
}

.users-table .form-control,
.users-table .form-select {
    min-width: 112px;
}

.users-inline-form {
    align-items: center;
}

.users-table-actions {
    justify-content: flex-end;
}

.users-governance-list {
    display: grid;
    gap: 0.7rem;
}

.users-governance-item {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    display: grid;
    gap: 0.25rem;
    padding: 0.78rem 0.82rem;
}

.users-governance-item strong {
    color: #111827;
    font-size: 0.8rem;
}

.users-governance-item span {
    color: #667085;
    font-size: 0.78rem;
    line-height: 1.4;
}

.settings-page {
    gap: 0.58rem;
}

.settings-metric-grid {
    gap: 0.45rem;
}

.settings-summary-card .card-body {
    display: grid;
    gap: 0.18rem;
}

.settings-summary-text {
    color: #4b5563;
    font-size: 0.7rem;
    line-height: 1.28;
}

.settings-grid {
    align-items: start;
    display: grid;
    gap: 0.58rem;
    grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.92fr);
}

.settings-stack {
    display: grid;
    gap: 0.58rem;
}

.settings-panel {
    min-width: 0;
}

.settings-panel .crm-panel-header {
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.46rem 0.56rem;
}

.settings-panel .crm-panel-body {
    padding: 0.5rem 0.56rem;
}

.settings-compact-form {
    --bs-gutter-x: 0.38rem;
    --bs-gutter-y: 0.28rem;
}

.settings-compact-form > [class*="col-"] {
    min-width: 0;
}

.settings-panel-badge {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #475467;
    display: inline-flex;
    font-size: 0.6rem;
    font-weight: 700;
    min-height: 20px;
    padding: 0.02rem 0.34rem;
    white-space: nowrap;
}

.settings-page .metric-card .card-body {
    padding: 0.42rem 0.5rem;
}

.settings-page .metric-label {
    font-size: 0.58rem;
    line-height: 1.05;
}

.settings-page .metric-value {
    font-size: 0.94rem;
    margin-top: 0.06rem;
}

.settings-page .page-description {
    font-size: 0.7rem;
    line-height: 1.25;
    margin-top: 0.12rem;
    max-width: 640px;
}

.settings-page .page-actions {
    gap: 0.24rem;
}

.settings-page .page-actions .btn,
.settings-page .page-actions .module-placeholder-tag {
    font-size: 0.64rem;
    min-height: 26px;
    padding: 0.16rem 0.4rem;
}

.settings-page .form-label {
    font-size: 0.56rem;
    margin-bottom: 0.1rem;
}

.settings-page .form-control,
.settings-page .form-select {
    background: #fcfdff;
    border-color: #d7deea;
    font-size: 0.7rem;
    min-height: 26px;
    padding: 0.16rem 0.38rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.settings-page .btn {
    font-size: 0.68rem;
    min-height: 26px;
    padding: 0.16rem 0.42rem;
    white-space: nowrap;
}

.settings-page .btn-sm {
    font-size: 0.62rem;
    min-height: 22px;
    padding: 0.06rem 0.3rem;
}

.settings-page .crm-panel-header-title {
    font-size: 0.72rem;
    line-height: 1.06;
}

.settings-page .crm-panel-header-subtitle {
    color: #667085;
    font-size: 0.62rem;
    line-height: 1.16;
    margin-top: 0.08rem;
}

.settings-page .form-control:focus,
.settings-page .form-select:focus,
.settings-page .form-check-input:focus,
.settings-page .btn:focus {
    box-shadow: 0 0 0 0.12rem rgba(37, 99, 235, 0.14);
}

.settings-page .form-control:focus,
.settings-page .form-select:focus {
    background: #ffffff;
    border-color: #93c5fd;
}

.settings-page .form-control::placeholder {
    color: #98a2b3;
}

.settings-page .form-check.form-switch {
    align-items: center;
    display: inline-flex;
    margin: 0;
    min-height: 26px;
    padding-left: 1.95rem;
}

.settings-page .form-check-input {
    border-color: #cbd5e1;
    box-shadow: none;
    cursor: pointer;
    height: 0.92rem;
    margin-left: -1.95rem;
    margin-top: 0;
    width: 1.72rem;
}

.settings-page .form-check-input:checked {
    background-color: #111827;
    border-color: #111827;
}

.settings-toolbar-btn,
.settings-add-btn,
.settings-icon-btn {
    align-items: center;
    display: inline-flex;
    gap: 0.28rem;
    justify-content: center;
}

.settings-toolbar-btn i,
.settings-add-btn i,
.settings-icon-btn i {
    font-size: 0.72rem;
    line-height: 1;
}

.settings-add-btn {
    gap: 0.32rem;
    font-weight: 700;
    padding-left: 0.34rem;
    padding-right: 0.34rem;
}

.settings-icon-btn {
    gap: 0;
    min-width: 24px;
    padding-left: 0;
    padding-right: 0;
    width: 24px;
}

.settings-toolbar-btn span,
.settings-add-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-page .btn-outline-secondary {
    border-color: #d7deea;
    color: #475467;
}

.settings-page .btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: #98a2b3;
    color: #111827;
}

.settings-page .btn-outline-danger:hover {
    background: #fef3f2;
}

.settings-color-chip,
.settings-mini-chip {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #475467;
    display: inline-flex;
    font-size: 0.58rem;
    font-weight: 700;
    gap: 0.24rem;
    min-height: 18px;
    padding: 0.01rem 0.28rem;
}

.settings-mini-chip-success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #027a48;
}

.settings-mini-chip-warning {
    background: #fffaeb;
    border-color: #fedf89;
    color: #b54708;
}

.settings-mini-chip-neutral {
    background: #f2f4f7;
    border-color: #d0d5dd;
    color: #475467;
}

.settings-color-dot {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.settings-item-list {
    display: grid;
    gap: 0.4rem;
}

.settings-item-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.03);
    display: grid;
    gap: 0.34rem;
    padding: 0.44rem;
}

.settings-item-card:hover {
    border-color: #d7deea;
}

.settings-item-top {
    align-items: flex-start;
    display: flex;
    gap: 0.3rem;
    justify-content: space-between;
}

.settings-item-title-wrap,
.settings-item-meta,
.settings-item-edit-wrap {
    min-width: 0;
}

.settings-item-title {
    color: #111827;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.settings-item-subtitle {
    color: #667085;
    font-size: 0.6rem;
    line-height: 1.18;
    margin-top: 0.08rem;
}

.settings-item-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.22rem;
    justify-content: flex-end;
}

.settings-item-edit-wrap {
    display: grid;
    gap: 0.22rem;
}

.settings-edit-grid {
    display: grid;
    gap: 0.22rem;
    min-width: 0;
}

.settings-edit-grid > * {
    min-width: 0;
}

.settings-edit-grid-stage {
    grid-template-columns: minmax(0, 1fr) 52px 42px 58px;
}

.settings-edit-grid-simple {
    grid-template-columns: minmax(0, 1fr) 28px 58px;
}

.settings-inline-switch-card {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    margin: 0;
    min-height: 24px;
    padding-left: 0;
}

.settings-delete-form {
    justify-self: end;
}

.settings-empty {
    background: #fbfcfe;
    border: 1px dashed #dbe3ee;
    min-height: 72px;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        max-width: min(86vw, 288px);
        transform: translateX(-100%);
        width: min(86vw, 288px);
    }

    .app-main {
        margin-left: 0;
    }

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

    .app-backdrop {
        background: rgba(15, 23, 42, 0.42);
        display: block;
        inset: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        transition: opacity 0.25s ease;
        z-index: 1035;
    }

    body.sidebar-mobile-open .app-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar {
        padding: 0.45rem 0.65rem;
    }

    .content-area {
        padding: 0.7rem;
    }

    .page-header,
    .page-actions {
        width: 100%;
    }

    .section-grid,
    .module-info-grid {
        grid-template-columns: 1fr;
    }

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

    .page-actions > .btn,
    .page-actions > a.btn,
    .page-actions > button,
    .page-actions > .module-placeholder-tag,
    .page-actions > .badge {
        justify-content: center;
    }

    .opportunities-page .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .opportunities-page .page-actions {
        width: 100%;
    }

    .opportunities-page .page-actions .btn,
    .opportunities-page .page-actions .badge {
        justify-content: center;
    }

    .pipeline-column,
    .opportunities-page .pipeline-column {
        max-height: none;
        min-height: 460px;
    }

    .opportunity-panel-kpis,
    .opportunity-panel-grid,
    .users-admin-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    body.crm-body {
        font-size: 12.5px;
    }

    body.crm-body .container,
    body.crm-body .container-fluid,
    body.crm-body .row {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }

    .page-shell {
        gap: 0.65rem;
    }

    .auth-shell {
        padding: 0.85rem;
    }

    .auth-page {
        min-height: calc(100vh - 1.7rem);
    }

    .auth-card-body {
        gap: 0.85rem;
        padding: 0.9rem;
    }

    .auth-card-brand {
        align-items: flex-start;
        gap: 0.7rem;
    }

    .page-header {
        gap: 0.45rem;
    }

    .page-title {
        font-size: 1.06rem;
    }

    .page-description {
        font-size: 0.78rem;
    }

    .page-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-actions > * {
        min-width: 0;
    }

    .page-actions > .btn,
    .page-actions > a.btn,
    .page-actions > button,
    .page-actions > .module-placeholder-tag,
    .page-actions > .badge {
        width: 100%;
    }

    .crm-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .crm-panel-body,
    .crm-panel-header {
        padding-left: 0.72rem;
        padding-right: 0.72rem;
    }

    .metric-grid {
        gap: 0.55rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-card .card-body {
        padding: 0.65rem 0.72rem;
    }

    .metric-value {
        font-size: 1.14rem;
    }

    .metric-value-money {
        font-size: 0.98rem;
    }

    .filter-grid > [class*="col-"],
    .filter-grid .d-flex,
    .filter-grid .inline-actions {
        width: 100%;
    }

    .filter-grid .d-flex,
    .inline-actions {
        justify-content: flex-start;
    }

    .filter-grid .d-flex,
    .compact-form-actions {
        flex-direction: column;
    }

    .filter-grid .btn,
    .compact-form-actions .btn {
        width: 100%;
    }

    .report-filter-summary {
        order: 2;
    }

    .report-filter-actions {
        flex-direction: column;
        justify-content: flex-start;
        order: 1;
    }

    .report-filter-actions .btn,
    .report-filter-actions a.btn {
        width: 100%;
    }

    .table-responsive-stack {
        overflow: visible;
    }

    .table-responsive-stack .crm-table thead {
        display: none;
    }

    .table-responsive-stack .crm-table,
    .table-responsive-stack .crm-table tbody,
    .table-responsive-stack .crm-table tr,
    .table-responsive-stack .crm-table td {
        display: block;
        width: 100%;
    }

    .table-responsive-stack .crm-table tbody {
        display: grid;
        gap: 0.65rem;
    }

    .table-responsive-stack .crm-table tr {
        background: #fff;
        border: 1px solid #e6ebf2;
        border-radius: var(--crm-radius-lg);
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
        overflow: hidden;
        padding: 0.18rem 0;
    }

    .table-responsive-stack .crm-table > :not(caption) > * > * {
        border-bottom: 0;
        padding: 0.34rem 0.72rem;
    }

    .table-responsive-stack .crm-table td {
        align-items: flex-start;
        display: grid;
        gap: 0.18rem;
        text-align: left !important;
    }

    .table-responsive-stack .crm-table td::before {
        color: #667085;
        content: attr(data-label);
        font-size: 0.64rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        line-height: 1.1;
        text-transform: uppercase;
    }

    .table-responsive-stack .crm-table td[data-label="Acoes"]::before {
        margin-bottom: 0.18rem;
    }

    .table-responsive-stack .inline-actions,
    .table-responsive-stack .inline-actions form,
    .table-responsive-stack .inline-actions .btn {
        width: 100%;
    }

    .table-responsive-stack .inline-actions {
        align-items: stretch;
        display: grid;
        gap: 0.35rem;
        justify-content: stretch;
    }

    .table-responsive-stack .inline-actions .btn {
        text-align: center;
    }

    .table-responsive-stack .settings-inline-form {
        display: grid;
        gap: 0.35rem;
    }

    .table-responsive-stack .settings-inline-form-stage,
    .table-responsive-stack .settings-inline-form-simple {
        grid-template-columns: 1fr;
    }

    .table-responsive-stack .settings-inline-form .form-control,
    .table-responsive-stack .settings-inline-form .form-select,
    .table-responsive-stack .settings-inline-form .form-control-color,
    .table-responsive-stack .settings-inline-form .btn {
        width: 100%;
    }

    .table-responsive-stack .settings-inline-switch {
        justify-content: flex-start;
        min-height: 34px;
        padding-top: 0.1rem;
    }

    .topbar {
        align-items: flex-start;
        gap: 0.45rem;
    }

    .topbar-left {
        align-items: flex-start;
        min-width: 0;
    }

    .topbar-title-group {
        min-width: 0;
    }

    .topbar-breadcrumbs,
    .topbar-subtitle {
        display: none;
    }

    .topbar-right .btn {
        min-width: 0;
        white-space: nowrap;
    }

    .opportunities-page {
        gap: 0.75rem;
    }

    .opportunities-page .page-header {
        gap: 0.6rem;
    }

    .opportunities-page .page-title {
        font-size: 1.18rem;
    }

    .opportunities-page .page-description {
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .opportunities-page .page-actions {
        gap: 0.45rem;
    }

    .opportunities-page .page-actions .btn,
    .opportunities-page .page-actions .badge,
    .opportunity-header-tag {
        flex: 1 1 calc(50% - 0.45rem);
        min-height: 34px;
        min-width: 0;
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    .opportunities-page .crm-panel-body {
        padding: 0.8rem;
    }

    .opportunities-page .filter-grid {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }

    .opportunities-page .filter-grid > [class*="col-"] {
        width: 100%;
    }

    .opportunities-page .filter-grid .d-flex {
        flex-direction: column;
    }

    .opportunities-page .filter-grid .btn,
    .opportunities-page .filter-grid .flex-fill {
        width: 100%;
    }

    .opportunities-page .crm-alert {
        font-size: 0.82rem;
        padding: 0.7rem 0.8rem;
    }

    .users-panel-meta {
        justify-content: flex-start;
    }

    .users-table-actions,
    .users-inline-form {
        justify-content: flex-start;
    }

    .settings-page .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-grid {
        gap: 0.58rem;
    }

    .settings-panel .crm-panel-header,
    .settings-panel .crm-panel-body {
        padding-left: 0.58rem;
        padding-right: 0.58rem;
    }

    .opportunities-page .metric-grid {
        gap: 0.65rem;
    }

    .opportunities-page .metric-card .card-body {
        padding: 0.7rem 0.8rem;
    }

    .opportunities-page .metric-value {
        font-size: 1.25rem;
    }

    .opportunities-page .metric-value-money {
        font-size: 1.02rem;
    }

    .opportunities-page .pipeline-board {
        gap: 0.75rem;
        grid-auto-columns: auto;
        grid-auto-flow: row;
        grid-template-columns: minmax(0, 1fr);
        overflow-x: visible;
        padding-bottom: 0;
    }

    .opportunities-page .pipeline-column {
        border-radius: 16px;
        min-height: auto;
    }

    .opportunities-page .pipeline-column-header {
        display: grid;
        gap: 0.45rem;
        padding: 0.68rem 0.72rem;
    }

    .opportunities-page .pipeline-column-title-row {
        align-items: flex-start;
        gap: 0.55rem;
    }

    .opportunities-page .pipeline-column-title {
        font-size: 0.9rem;
        line-height: 1.25;
    }

    .opportunities-page .pipeline-column-subtitle,
    .opportunities-page .pipeline-column-total {
        font-size: 0.76rem;
    }

    .opportunities-page .pipeline-column-total {
        margin-top: 0;
    }

    .pipeline-column-meta {
        gap: 0.25rem 0.4rem;
    }

    .opportunities-page .pipeline-column-body {
        gap: 0.65rem;
        overflow: visible;
        padding: 0.75rem;
    }

    .opportunities-page .pipeline-card {
        border-radius: 14px;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
        padding: 0.78rem;
    }

    .opportunities-page .pipeline-card-top {
        gap: 0.45rem;
        margin-bottom: 0.55rem;
    }

    .opportunities-page .pipeline-card-top .badge {
        max-width: calc(100% - 56px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .opportunities-page .pipeline-card-top-actions {
        align-self: flex-start;
    }

    .opportunities-page .pipeline-probability {
        font-size: 0.76rem;
    }

    .opportunities-page .pipeline-card-title {
        font-size: 0.9rem;
        margin-bottom: 0.45rem;
    }

    .opportunities-page .pipeline-card-amount {
        font-size: 1rem;
        margin-bottom: 0.55rem;
    }

    .opportunities-page .pipeline-card-meta {
        gap: 0.35rem;
        font-size: 0.78rem;
    }

    .opportunities-page .pipeline-card-note {
        font-size: 0.76rem;
        margin-top: 0.65rem;
        padding-top: 0.65rem;
    }

    .opportunities-page .pipeline-card-footer,
    .opportunities-page .pipeline-card-actions {
        gap: 0.45rem;
        margin-top: 0.65rem;
    }

    .opportunities-page .pipeline-card-insights {
        gap: 0.35rem;
    }

    .opportunities-page .pipeline-card-chip {
        flex: 1 1 calc(50% - 0.35rem);
        justify-content: center;
    }

    .opportunities-page .pipeline-card-actions form {
        flex: 1 1 calc(50% - 0.45rem);
    }

    .opportunities-page .pipeline-card-actions .btn {
        width: 100%;
    }

    .crm-offcanvas {
        width: 100vw;
    }

    .crm-offcanvas .offcanvas-header,
    .crm-offcanvas .offcanvas-body {
        padding-left: 0.72rem;
        padding-right: 0.72rem;
    }

    .opportunity-panel-heading-row {
        align-items: stretch;
        flex-direction: column;
        gap: 0.55rem;
    }

    .opportunity-panel-heading-row .btn {
        width: 100%;
    }

    .opportunity-timeline-filter-actions {
        gap: 0.35rem;
    }

    .opportunity-timeline-filter-chip {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: 0;
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .opportunity-timeline-item {
        gap: 0.65rem;
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .opportunity-timeline-dot {
        height: 24px;
        width: 24px;
    }

    .opportunity-timeline-card {
        border-radius: 14px;
        padding: 0.75rem;
    }

    .opportunity-timeline-top {
        flex-direction: column;
        gap: 0.55rem;
    }

    .opportunity-activity-item-actions {
        width: 100%;
    }

    .opportunity-activity-item-actions .btn {
        flex: 1 1 calc(50% - 0.45rem);
    }

    #opportunityFormModal .modal-dialog,
    #opportunityActivityModal .modal-dialog {
        margin: 0.5rem;
    }

    #opportunityFormModal .modal-body,
    #opportunityActivityModal .modal-body {
        padding: 0.85rem;
    }

    #opportunityFormModal .modal-footer,
    #opportunityActivityModal .modal-footer {
        gap: 0.5rem;
    }

    #opportunityFormModal .modal-footer .btn,
    #opportunityActivityModal .modal-footer .btn {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

@media (max-width: 479.98px) {
    .auth-shell {
        padding: 0.6rem;
    }

    .auth-page {
        min-height: calc(100vh - 1.2rem);
    }

    .auth-card-body {
        padding: 0.82rem;
    }

    .auth-card-brand {
        flex-direction: column;
    }

    .auth-card-title {
        font-size: 1.16rem;
    }

    .report-filter-summary .small {
        font-size: 0.74rem;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-left,
    .topbar-right {
        width: 100%;
    }

    .topbar-right .btn {
        width: 100%;
    }

    .page-actions,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .settings-page .metric-grid {
        grid-template-columns: 1fr;
    }

    .settings-item-card {
        padding: 0.42rem;
    }

    .settings-toolbar-btn,
    .settings-add-btn {
        width: 100%;
    }

    .settings-item-top {
        flex-direction: column;
    }

    .settings-item-meta {
        justify-content: flex-start;
    }

    .settings-edit-grid-stage,
    .settings-edit-grid-simple {
        grid-template-columns: 1fr;
    }

    .settings-delete-form,
    .settings-edit-grid .btn,
    .settings-delete-form .btn {
        width: 100%;
    }

    .opportunities-page .metric-grid {
        grid-template-columns: 1fr;
    }

    .opportunities-page .page-actions .btn,
    .opportunities-page .page-actions .badge,
    .opportunity-header-tag,
    .opportunities-page .pipeline-card-actions form,
    .opportunities-page .pipeline-card-chip,
    .opportunity-timeline-filter-chip,
    .opportunity-activity-item-actions .btn,
    #opportunityFormModal .modal-footer .btn,
    #opportunityActivityModal .modal-footer .btn {
        flex-basis: 100%;
    }

    .opportunities-page .pipeline-card-footer {
        flex-direction: column;
        gap: 0.3rem;
    }

    .opportunities-page .pipeline-card-footer .btn {
        width: 100%;
        text-align: left;
    }

    .opportunities-page .pipeline-card-quick-actions,
    .opportunities-page .pipeline-card-decision-actions {
        display: grid;
        gap: 0.35rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .opportunities-page .pipeline-card-quick-action,
    .opportunities-page .pipeline-card-decision-btn {
        height: 30px;
        min-height: 30px;
        min-width: 0;
        width: 100%;
    }

    .crm-offcanvas .offcanvas-header {
        align-items: flex-start;
        gap: 0.5rem;
    }

    .crm-offcanvas .offcanvas-header .d-flex {
        display: grid;
        gap: 0.45rem;
        justify-items: stretch;
        width: 100%;
    }

    .crm-offcanvas .offcanvas-header #js-open-edit-opportunity {
        width: 100%;
    }

    .crm-offcanvas .offcanvas-header .btn-close {
        justify-self: end;
    }
}

@media (min-width: 992px) {
    body.sidebar-collapsed .app-sidebar {
        max-width: var(--crm-sidebar-width-collapsed);
        width: var(--crm-sidebar-width-collapsed);
    }

    body.sidebar-collapsed .app-main {
        margin-left: var(--crm-sidebar-width-collapsed);
    }

    body.sidebar-collapsed .brand-text-wrap,
    body.sidebar-collapsed .nav-section-label,
    body.sidebar-collapsed .app-nav-link span,
    body.sidebar-collapsed .sidebar-user-meta,
    body.sidebar-collapsed .sidebar-toggle-inline {
        display: none;
    }

    body.sidebar-collapsed .app-sidebar-header,
    body.sidebar-collapsed .app-sidebar-footer {
        justify-content: center;
    }

    body.sidebar-collapsed .app-sidebar-body {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    body.sidebar-collapsed .app-nav-link {
        justify-content: center;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    body.sidebar-collapsed .sidebar-user-card {
        justify-content: center;
    }
}
