:root {
    --bg: #f4f7fe;
    --panel: #ffffff;
    --ink: #18212f;
    --muted: #667085;
    --line: #e5e7eb;
    --accent: #ff5a1f;
    --teal: #16a394;
    --navy: #18212f;
    --gold: #f6b33f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.45;
}

.app {
    min-height: 100vh;
    overflow-x: hidden;
}

.app.sidebar-collapsed {
    overflow-x: hidden;
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        #111111;
    color: #fff;
    height: 100vh;
    left: 0;
    overflow-x: visible;
    overflow-y: auto;
    padding: 24px 20px;
    position: fixed;
    top: 0;
    width: 280px;
    z-index: 20;
    transition: width 0.22s ease, padding 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
}

.app.sidebar-collapsed .sidebar {
    opacity: 1;
    overflow-x: visible;
    overflow-y: auto;
    padding: 18px 10px 18px 12px;
    visibility: visible;
    width: 80px;
}

.brand {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
}

.brand-mark {
    align-items: center;
    background: var(--accent);
    border-radius: 8px;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.brand-mark-image {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.brand-mark .icon {
    height: 18px;
    width: 18px;
}

.brand-text {
    display: grid;
    gap: 2px;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.15;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.78rem;
    line-height: 1.3;
}

.nav a {
    align-items: center;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    padding: 12px;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav a,
.nav-group > summary {
    position: relative;
}

.nav a.active {
    background: rgba(255, 90, 31, 0.16);
    color: #fff;
    font-weight: 700;
}

.nav-badge {
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 22px;
    justify-content: center;
    padding: 2px 6px;
    margin-left: auto;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-groups {
    display: grid;
    gap: 8px;
}

.nav-group {
    border-radius: 14px;
}

.nav-group > summary {
    align-items: center;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 12px;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-group-summary-left {
    align-items: center;
    color: rgba(255, 255, 255, 0.86);
    display: inline-flex;
    gap: 12px;
    font-weight: 700;
}

.nav-group-chevron {
    align-items: center;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
    transition: transform 0.18s ease;
}

.nav-group[open] > summary .nav-group-chevron {
    transform: rotate(90deg);
}

.nav-group.active > summary,
.nav-group > summary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-group-children {
    display: grid;
    gap: 4px;
    margin-left: 10px;
    padding: 6px 0 4px 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-group-children a {
    align-items: center;
    border-radius: 10px;
    display: flex;
    gap: 10px;
    color: rgba(255, 255, 255, 0.74);
    text-decoration: none;
    padding: 10px 12px;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav-group-children a.active {
    background: rgba(255, 90, 31, 0.14);
    color: #fff;
    font-weight: 700;
}

.nav-group-children a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.app.sidebar-collapsed .sidebar .brand {
    justify-content: center;
    margin-bottom: 18px;
}

.app.sidebar-collapsed .sidebar .brand-text {
    display: none;
}

.app.sidebar-collapsed .sidebar .nav {
    gap: 6px;
}

.app.sidebar-collapsed .sidebar .nav a,
.app.sidebar-collapsed .sidebar .nav-group > summary {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
}

.app.sidebar-collapsed .sidebar .nav a,
.app.sidebar-collapsed .sidebar .nav-group > summary,
.app.sidebar-collapsed .sidebar .nav-group-children a {
    color: transparent;
    font-size: 0;
    line-height: 0;
}

.app.sidebar-collapsed .sidebar .nav a .icon,
.app.sidebar-collapsed .sidebar .nav-group-summary-left .icon,
.app.sidebar-collapsed .sidebar .nav-group-children a .icon {
    color: #fff;
    font-size: 17px;
}

.app.sidebar-collapsed .sidebar .nav-badge {
    color: #fff;
    font-size: 0.68rem;
    line-height: 1;
}

.app.sidebar-collapsed .sidebar .nav-group-chevron,
.app.sidebar-collapsed .sidebar .nav-group-children {
    display: none;
}

.app.sidebar-collapsed .sidebar .nav-group {
    position: relative;
}

.app.sidebar-collapsed .sidebar .nav-group:hover .nav-group-children,
.app.sidebar-collapsed .sidebar .nav-group:focus-within .nav-group-children,
.app.sidebar-collapsed .sidebar .nav-group[open] .nav-group-children {
    background: #151515;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    display: grid;
    left: calc(100% + 12px);
    margin: 0;
    min-width: 210px;
    padding: 8px;
    position: absolute;
    top: 0;
    z-index: 40;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
}

.app.sidebar-collapsed .sidebar .nav-group:hover .nav-group-children::before,
.app.sidebar-collapsed .sidebar .nav-group:focus-within .nav-group-children::before,
.app.sidebar-collapsed .sidebar .nav-group[open] .nav-group-children::before {
    border-bottom: 8px solid transparent;
    border-right: 9px solid rgba(21, 21, 21, 0.98);
    border-top: 8px solid transparent;
    content: '';
    display: block;
    left: -9px;
    position: absolute;
    top: 18px;
}

.app.sidebar-collapsed .sidebar .nav-group:hover .nav-group-children a,
.app.sidebar-collapsed .sidebar .nav-group:focus-within .nav-group-children a,
.app.sidebar-collapsed .sidebar .nav-group[open] .nav-group-children a {
    color: rgba(255, 255, 255, 0.82);
    display: flex;
    font-size: 0.9rem;
    line-height: 1.2;
    padding: 10px 12px;
}

.app.sidebar-collapsed .sidebar .nav-group:hover .nav-group-children a .icon,
.app.sidebar-collapsed .sidebar .nav-group:focus-within .nav-group-children a .icon,
.app.sidebar-collapsed .sidebar .nav-group[open] .nav-group-children a .icon {
    color: #fff;
    font-size: 17px;
}

.app.sidebar-collapsed .sidebar .nav-group:hover .nav-group-children a.active,
.app.sidebar-collapsed .sidebar .nav-group:focus-within .nav-group-children a.active,
.app.sidebar-collapsed .sidebar .nav-group[open] .nav-group-children a.active {
    background: rgba(255, 90, 31, 0.18);
    color: #fff;
}

.app.sidebar-collapsed .sidebar .nav a:hover::after,
.app.sidebar-collapsed .sidebar .nav-group > summary:hover::after {
    background: rgba(17, 17, 17, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #fff;
    content: attr(title);
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    left: calc(100% + 12px);
    line-height: 1.2;
    padding: 10px 12px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    z-index: 50;
}

.app.sidebar-collapsed .sidebar .nav a:hover::before,
.app.sidebar-collapsed .sidebar .nav-group > summary:hover::before {
    border-bottom: 7px solid transparent;
    border-right: 8px solid rgba(17, 17, 17, 0.98);
    border-top: 7px solid transparent;
    content: '';
    display: block;
    left: calc(100% + 4px);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 51;
}

.icon {
    display: inline-block;
    fill: none;
    flex: 0 0 auto;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 17px;
}

.main {
    background: var(--bg);
    border-left: 1px solid rgba(229, 231, 235, 0.75);
    min-height: 100vh;
    margin-left: 280px;
    overflow-x: hidden;
    padding: 104px 32px 32px;
    position: relative;
    width: calc(100% - 280px);
}

.main > * {
    min-width: 0;
}

.main-dashboard {
    padding-left: 40px;
    padding-right: 36px;
}

.app.sidebar-collapsed .main {
    margin-left: 80px;
    width: calc(100% - 80px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(14px);
    background: linear-gradient(180deg, rgba(244, 247, 254, 0.94), rgba(244, 247, 254, 0.8));
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    left: 280px;
    position: fixed;
    top: 0;
    width: calc(100% - 280px);
    z-index: 60;
    margin-bottom: 0;
    padding: 18px 0 16px;
}

.app.sidebar-collapsed .topbar {
    left: 80px;
    width: calc(100% - 80px);
}

.topbar-left {
    align-items: center;
    display: flex;
    gap: 12px;
}

.page-title {
    margin: 0;
    font-size: 1.65rem;
}

.page-subtitle {
    color: var(--muted);
    margin-top: 3px;
    font-size: 0.92rem;
}

.icon-btn {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9)),
        repeating-linear-gradient(135deg, rgba(255, 90, 31, 0.055) 0 1px, transparent 1px 12px);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.mt-14 {
    margin-top: 14px;
}

.mt-18 {
    margin-top: 18px;
}

.mb-18 {
    margin-bottom: 18px;
}

.mb-10 {
    margin-bottom: 10px;
}

.hidden-form {
    display: none;
}

.section-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-avatar-large {
    height: 54px;
    width: 54px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
    align-items: start;
}

.grid > *,
.dashboard-chart-grid > *,
.dashboard-report-grid > *,
.dashboard-trend-grid > *,
.dashboard-notification-summary > *,
.dashboard-task-snapshot > *,
.task-alert-stats > *,
.task-dashboard-summary > *,
.report-executive-grid > *,
.report-breakdown-grid > *,
.pipeline-analytics-grid > *,
.pipeline-overview-grid > *,
.company-usage-grid > *,
.company-insight-grid > *,
.admin-overview-grid > *,
.admin-stats-grid > *,
.plan-summary-grid > *,
.module-grid > *,
.column-grid > *,
.builder-grid > *,
.saved-view-summary-grid > * {
    min-width: 0;
}

.stat {
    background: var(--stat-bg, linear-gradient(135deg, #ff5a1f, #ff8a3d));
    color: white;
    border-radius: 8px;
    overflow: hidden;
    padding: 16px;
    position: relative;
    min-height: 108px;
}

.stat::after {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 18px 18px;
    content: "";
    inset: 0;
    opacity: 0.32;
    position: absolute;
}

.stat > * {
    position: relative;
    z-index: 1;
}

.stat-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.stat-icon .icon {
    height: 19px;
    width: 19px;
}

.stat.leads { --stat-bg: linear-gradient(135deg, #ff5a1f, #f6b33f); }
.stat.followups { --stat-bg: linear-gradient(135deg, #18212f, #3b4b63); }
.stat.won { --stat-bg: linear-gradient(135deg, #16a394, #24c7ad); }
.stat.new { --stat-bg: linear-gradient(135deg, #4f46e5, #0ea5e9); }

.stat .value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 3px;
}

.section-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.section-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head.compact {
    margin-bottom: 10px;
}

.section-subtitle {
    margin: 0;
    font-size: 0.98rem;
}

.section-head .section-title {
    margin: 0;
}

.muted {
    color: var(--muted);
}

.flash {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #027a48;
    font-weight: 700;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 14px;
    position: fixed;
    right: 24px;
    top: 24px;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    z-index: 30;
}

.flash.hide {
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
}

.workspace-banner {
    align-items: center;
    border: 1px solid rgba(255, 90, 31, 0.16);
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0 0;
    padding: 16px 18px;
}

.workspace-banner-company {
    background: linear-gradient(135deg, rgba(255, 90, 31, 0.08), rgba(255, 255, 255, 0.96));
}

.workspace-banner-warning {
    background: linear-gradient(135deg, rgba(255, 195, 77, 0.12), rgba(255, 255, 255, 0.96));
    border-color: rgba(255, 195, 77, 0.24);
}

.workspace-banner-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.workspace-banner-copy strong {
    font-size: 1rem;
}

.workspace-banner-copy span {
    color: var(--muted);
    line-height: 1.45;
}

.workspace-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .workspace-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-banner-actions {
        justify-content: flex-start;
        width: 100%;
    }
}

.panel-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #15803d;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 12px;
}

.panel-success.hide {
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
}

.app-toast {
    background: rgba(24, 33, 47, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    bottom: 24px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    max-width: min(360px, calc(100vw - 32px));
    opacity: 0;
    padding: 14px 16px;
    position: fixed;
    right: 24px;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    visibility: hidden;
    z-index: 60;
}

.app-toast.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.toolbar {
    display: grid;
    grid-template-columns: 1.4fr repeat(6, minmax(130px, 0.6fr));
    gap: 12px;
    margin-bottom: 18px;
}

.saved-view-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.saved-view-toolbar .select {
    min-width: 220px;
}

.saved-view-status {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    margin-left: auto;
}

.inline-form {
    display: contents;
}

.input,
.select,
.textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.35;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

.textarea {
    min-height: 92px;
    resize: vertical;
}

.profile-grid {
    display: grid;
    grid-auto-rows: min-content;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    gap: 18px;
    align-items: start;
}

.profile-stack,
.profile-side-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.profile-stack > .card,
.profile-side-stack > .card {
    width: 100%;
    align-self: start;
    height: auto;
    padding: 18px;
}

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

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10px;
}

.branding-preview {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
}

.branding-preview-item {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 8px;
    padding: 12px;
}

.branding-preview-row {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.branding-preview-logo {
    align-items: center;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.branding-preview-logo img {
    border-radius: 14px;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.branding-preview-favicon {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 36px;
    justify-content: center;
    overflow: hidden;
    width: 36px;
}

.branding-preview-favicon img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.detail {
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 8px;
    padding: 13px;
}

.detail-label {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.76rem;
    font-weight: 800;
    gap: 7px;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.detail-value {
    font-weight: 750;
    min-height: 22px;
}

.profile-hero {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.3rem;
    font-weight: 900;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.identity {
    align-items: center;
    display: flex;
    gap: 13px;
}

.identity h2 {
    font-size: 1.3rem;
    margin: 0 0 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.form-field label {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.field-help {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 7px;
}

.lead-owner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.lead-owner-actions .btn {
    min-width: 0;
}

.lead-permission-message {
    display: block;
    color: #9a3412;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255, 237, 213, 0.9));
    border: 1px solid rgba(251, 146, 60, 0.28);
    border-radius: 14px;
    padding: 12px 14px;
    line-height: 1.5;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.lead-notes-form .textarea {
    min-height: 74px;
}

.lead-notes-form .form-grid {
    gap: 8px;
}

.lead-notes-form .btn {
    width: auto;
}

.lead-notes-form .field-help.lead-permission-message {
    margin-top: 8px;
}

.lead-note-item {
    display: grid;
    gap: 10px;
}

.lead-note-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.lead-note-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.lead-note-actions form {
    margin: 0;
}

.lead-note-actions .btn {
    width: auto;
}

.lead-note-menu {
    margin-left: auto;
    position: relative;
}

.lead-note-menu summary {
    list-style: none;
}

.lead-note-menu summary::-webkit-details-marker {
    display: none;
}

.lead-note-menu-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.lead-note-menu[open] .lead-note-menu-trigger,
.lead-note-menu-trigger:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lead-note-menu-panel {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    display: grid;
    gap: 4px;
    min-width: 160px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: 38px;
    z-index: 3;
}

.lead-note-menu-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 8px;
    justify-content: flex-start;
    padding: 10px 10px;
    text-align: left;
    width: 100%;
}

.lead-note-menu-item:hover {
    background: #f8fafc;
    color: var(--accent);
}

.lead-note-menu-item.danger {
    color: #b42318;
}

.lead-note-menu-item.danger:hover {
    background: #fef2f2;
    color: #991b1b;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-field.stage-required label {
    color: #b42318;
}

.form-field.stage-required .input,
.form-field.stage-required .textarea {
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(252, 165, 165, 0.18);
}

.timeline {
    display: grid;
    gap: 10px;
}

.timeline-item {
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 8px;
    padding: 10px;
}

.timeline-item-activity,
.timeline-item-note {
    border-left: 4px solid rgba(255, 90, 31, 0.36);
}

.timeline-item-stage_change {
    border-left: 4px solid rgba(22, 163, 148, 0.36);
}

.timeline-item-task_move {
    border-left: 4px solid rgba(255, 90, 31, 0.5);
    background: linear-gradient(90deg, rgba(255, 90, 31, 0.03), rgba(255, 255, 255, 0.95) 56%);
}

.timeline-item-create {
    border-left: 4px solid rgba(24, 33, 47, 0.3);
}

.timeline-top {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 5px;
}

.timeline-type {
    align-items: center;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 850;
    gap: 7px;
    text-transform: uppercase;
}

.timeline-type-create {
    color: #18212f;
}

.timeline-type-update {
    color: #c2410c;
}

.timeline-type-note {
    color: #0f766e;
}

.timeline-type-stage_change {
    color: #2563eb;
}

.timeline-type-task_move {
    color: #ea580c;
}

.timeline-type-pending {
    color: #475569;
}

.timeline-type-today {
    color: #b45309;
}

.timeline-type-overdue {
    color: #dc2626;
}

.timeline-type-closed {
    color: #15803d;
}

.lead-profile-activity-panel .timeline-item,
.lead-profile-notes-panel .timeline-item,
.activities-panel .timeline-item {
    padding: 10px;
}

.lead-profile-notes-panel .timeline {
    gap: 8px;
}

.lead-profile-notes-panel .timeline-item {
    background: rgba(255, 255, 255, 0.7);
}

.lead-profile-task-panel .task-filter-bar {
    margin-top: 6px;
}

.lead-profile-task-panel .task-board {
    gap: 8px;
}

.lead-profile-task-panel .task-card {
    padding: 11px;
}

.lead-profile-task-panel .task-card .task-actions {
    margin-top: 6px;
}

.lead-profile-update-panel .lead-owner-actions,
.lead-profile-notes-panel .lead-owner-actions {
    margin-top: 10px;
}

.activities-panel .timeline {
    gap: 8px;
}

.activities-panel .timeline-item {
    padding: 10px 12px;
}

.audit-panel .table-scroll table {
    min-width: 1080px;
}

.audit-filter-bar {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 18px;
    display: grid;
    gap: 14px;
    margin: 14px 0 16px;
    padding: 14px;
}

.audit-filter-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audit-filter-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.audit-panel table th,
.audit-panel table td {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 0.84rem;
}

.audit-panel table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.task-action-strip {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 90, 31, 0.08), rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(255, 90, 31, 0.14);
    border-radius: 14px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 10px 0 16px;
    padding: 14px 16px;
}

.task-action-strip strong {
    display: block;
    font-size: 0.94rem;
    margin-bottom: 3px;
}

.task-action-strip .muted {
    max-width: 420px;
}

.lead-action-bar {
    align-items: center;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 9px 11px;
}

.lead-action-bar-copy strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 3px;
}

.lead-action-bar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.lead-action-bar-actions .badge {
    font-size: 0.72rem;
    padding: 4px 9px;
}

.task-overview-mini {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.task-filter-bar {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1.25fr) minmax(180px, 0.8fr) auto;
    margin: 8px 0 10px;
}

.task-filter-bar .form-field {
    margin-bottom: 0;
}

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

.task-filter-bar .input,
.task-filter-bar .select {
    min-height: 36px;
    padding: 7px 10px;
}

.task-filter-bar .btn {
    padding: 7px 10px;
}

.task-board {
    display: grid;
    gap: 10px;
}

.task-bucket-card.hidden,
.task-card[hidden] {
    display: none !important;
}

.task-bucket-card {
    padding: 11px;
}

.task-bucket-card .section-head {
    margin-bottom: 10px;
}

.task-bucket-card .section-title {
    font-size: 0.96rem;
}

.task-card {
    padding: 12px;
}

.task-card .timeline-top {
    margin-bottom: 3px;
}

.task-card strong {
    display: block;
    font-size: 0.96rem;
    margin: 3px 0 2px;
}

.task-card .muted {
    font-size: 0.84rem;
}

.task-card .task-actions {
    gap: 5px;
    margin-top: 8px;
}

.task-card .task-action-form .select {
    min-width: 140px;
}

.task-alert-panel .task-alert-stats {
    margin-top: 0;
}

.task-dashboard-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 14px;
}

.task-hero {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 90, 31, 0.08), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(255, 90, 31, 0.12);
    border-radius: 16px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) 320px;
    margin-top: 14px;
    padding: 16px;
}

.task-hero-copy h3 {
    font-size: 1.08rem;
    margin: 6px 0 8px;
}

.task-hero-copy p {
    color: var(--muted);
    margin: 0;
    max-width: 68ch;
}

.task-hero-eyebrow {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.task-hero-pills {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-hero-pill {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-height: 74px;
    text-align: center;
}

.task-hero-pill strong {
    color: var(--text);
    display: block;
    font-size: 1.3rem;
    line-height: 1;
}

.task-dashboard-summary .task-summary-card {
    background: linear-gradient(180deg, #fff, #f8fafc);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.task-summary-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.task-summary-value {
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
    margin-top: 4px;
}

.task-summary-note {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 3px;
}

.task-alert-panel .stat {
    min-height: 108px;
}

.task-alert-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-top: 14px;
}

.task-sla-card .section-head {
    margin-bottom: 8px;
}

.task-sla-card .section-title {
    font-size: 0.96rem;
}

.task-sla-card .task-aging-actions .btn {
    padding: 7px 10px;
}

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

.task-sla-card {
    min-height: 100%;
}

.task-aging-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.task-aging-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
}

.bulk-task-form {
    display: grid;
    gap: 10px;
}

.bulk-task-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-bulk-select {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.task-bulk-select input {
    accent-color: var(--accent);
}

.task-drag-handle {
    align-items: center;
    background: #f1f5f9;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    cursor: grab;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 10px;
    padding: 4px 10px;
}

.task-card.dragging {
    opacity: 0.55;
}

.task-card.drag-over {
    box-shadow: inset 0 -3px 0 var(--accent);
}

.task-drop-indicator {
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 999px;
    height: 4px;
    margin: 6px 0;
    width: 100%;
}

.task-overview-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.task-overview-row {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    padding: 12px 14px;
}

.task-overview-pills {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.task-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.task-action-form {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.task-action-form .select {
    min-width: 180px;
}

.task-unread-pill,
.task-read-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
}

.task-unread-pill {
    background: #fef3c7;
    color: #92400e;
}

.task-read-pill {
    background: #e2e8f0;
    color: #475569;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
    padding: 18px;
    text-align: center;
}

.table-scroll {
    overflow-x: auto;
    width: 100%;
}

.table-scroll table {
    min-width: 1280px;
}

.module-entitlement-panel {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 18px;
    margin-top: 14px;
    padding: 16px;
}

.module-entitlement-panel .table-scroll table {
    min-width: 980px;
}

.entitlement-table {
    width: 100%;
}

.entitlement-table thead th {
    color: #475467;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.entitlement-table tbody td,
.entitlement-table tbody th {
    padding-top: 10px;
    padding-bottom: 10px;
    vertical-align: top;
}

.entitlement-table tbody td strong {
    color: var(--text);
    font-size: 0.95rem;
}

.column-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
}

.column-option {
    align-items: center;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
}

.column-option input {
    accent-color: var(--accent);
    height: 16px;
    width: 16px;
}

.hierarchy-tree {
    display: grid;
    gap: 14px;
}

.hierarchy-panel {
    position: relative;
}

.hierarchy-panel::before {
    border-radius: 8px 0 0 8px;
    content: "";
    left: 0;
    position: absolute;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), var(--teal));
    opacity: 0.9;
}

.hierarchy-summary-panel {
    overflow: hidden;
}

.hierarchy-summary-panel .grid {
    margin-bottom: 0;
}

.settings-branding-panel .branding-preview,
.settings-lead-panel .table-scroll,
.hierarchy-role-panel .table-scroll {
    margin-top: 4px;
}

.settings-branding-panel .form-grid,
.settings-lead-panel .form-grid,
.hierarchy-role-panel .form-grid {
    gap: 10px;
}

.settings-branding-panel .btn.primary,
.settings-lead-panel .btn.primary,
.settings-system-panel .btn.primary {
    padding: 8px 12px;
}

.settings-branding-panel .input,
.settings-branding-panel .select,
.settings-branding-panel .textarea,
.settings-lead-panel .input,
.settings-lead-panel .select,
.settings-lead-panel .textarea {
    min-height: 38px;
    padding: 8px 10px;
}

.settings-branding-panel .field-help,
.settings-lead-panel .field-help {
    margin-top: 6px;
}

.settings-lead-panel .row-actions {
    display: inline-flex;
    justify-content: flex-end;
}

.settings-lead-panel .dots-btn {
    height: 30px;
    width: 30px;
}

.hierarchy-role-panel .table-actions .btn,
.team-directory-panel .table-actions .btn {
    padding: 7px 10px;
}

.hierarchy-role-panel .table-scroll,
.hierarchy-tree-panel .hierarchy-tree,
.hierarchy-branch-panel .form-grid {
    margin-top: 2px;
}

.team-form-panel .form-grid {
    margin-top: 2px;
}

.hierarchy-role-panel .table-scroll table {
    min-width: 100%;
}

.team-directory-panel .table-scroll table {
    min-width: 1420px;
}

.settings-lead-panel .table-scroll table {
    min-width: 1180px;
}

.settings-overview-panel {
    overflow: hidden;
}

.settings-plan-panel {
    overflow: hidden;
}

.settings-integrations-panel {
    overflow: hidden;
}

.admin-overview-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 10px;
}

.company-snapshot-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
}

.company-snapshot-chip {
    align-items: flex-start;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    display: grid;
    gap: 6px;
    min-height: 84px;
    padding: 14px 16px;
}

.company-snapshot-chip span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.company-snapshot-chip strong {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.2;
    word-break: break-word;
}

.company-snapshot-chip-success {
    border-color: rgba(34, 197, 94, 0.22);
}

.company-snapshot-chip-warning {
    border-color: rgba(245, 158, 11, 0.28);
}

.company-snapshot-chip-info {
    border-color: rgba(14, 165, 233, 0.22);
}

.company-snapshot-chip-danger {
    border-color: rgba(239, 68, 68, 0.24);
}

.company-usage-panel {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 18px;
    margin-top: 14px;
    padding: 16px;
}

.company-usage-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company-usage-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    display: grid;
    gap: 12px;
    min-height: 148px;
    padding: 14px 16px;
}

.company-usage-card-top {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.company-usage-card-top strong {
    color: var(--text);
    display: block;
    font-size: 1.28rem;
    line-height: 1.15;
    margin-top: 4px;
}

.company-usage-meter {
    margin-top: 2px;
}

.company-usage-card-bottom {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.82rem;
    gap: 8px;
    justify-content: space-between;
}

.company-insight-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.company-insight-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 18px;
    padding: 16px;
}

.trend-bars {
    display: grid;
    gap: 10px;
}

.trend-row {
    display: grid;
    gap: 8px;
}

.trend-row-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.trend-row-bars {
    background: #eef2f7;
    border-radius: 999px;
    display: grid;
    gap: 4px;
    padding: 3px;
}

.trend-bar {
    border-radius: 999px;
    height: 8px;
}

.trend-bar-leads {
    background: linear-gradient(90deg, #ff5a1f, #fb923c);
}

.trend-bar-activity {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.trend-row-values {
    color: var(--muted);
    display: flex;
    font-size: 0.8rem;
    justify-content: space-between;
}

.tenant-health-score {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: auto 1fr;
    margin-top: 2px;
}

.tenant-health-ring {
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
    border: 8px solid rgba(226, 232, 240, 0.95);
    border-radius: 999px;
    display: grid;
    height: 110px;
    justify-items: center;
    width: 110px;
}

.tenant-health-ring strong {
    color: var(--text);
    font-size: 1.9rem;
    line-height: 1;
}

.tenant-health-ring span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tenant-health-ring-healthy {
    border-color: rgba(34, 197, 94, 0.34);
}

.tenant-health-ring-warning {
    border-color: rgba(245, 158, 11, 0.36);
}

.tenant-health-ring-full {
    border-color: rgba(239, 68, 68, 0.34);
}

.tenant-health-copy p {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 12px;
}

.tenant-health-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tenant-health-pill {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 999px;
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
}

.tenant-health-pill strong {
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tenant-health-pill em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.82rem;
    font-weight: 700;
}

.tenant-risk-row {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.tenant-risk-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 6px 10px;
    white-space: nowrap;
}

.tenant-risk-badge-healthy {
    background: #dcfce7;
    color: #166534;
}

.tenant-risk-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.tenant-risk-badge-full {
    background: #fee2e2;
    color: #b91c1c;
}

.tenant-action-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
}

.tenant-action-item {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 14px;
    display: grid;
    gap: 5px;
    padding: 12px 14px;
}

.tenant-action-item strong {
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tenant-action-item span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.overview-metric {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.96));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    min-height: 112px;
    padding: 16px;
}

.overview-metric-label {
    color: var(--muted);
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.overview-metric strong {
    color: var(--text);
    display: block;
    font-size: 1.4rem;
    line-height: 1.15;
    margin-bottom: 6px;
}

.admin-control-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.workflow-map {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.workflow-map-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 16px;
    display: grid;
    gap: 6px;
    padding: 14px 16px;
}

.workflow-map-item strong {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workflow-map-item span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.admin-control-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
    color: inherit;
    display: grid;
    gap: 18px;
    padding: 16px 18px;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.admin-control-card:hover {
    border-color: rgba(249, 115, 22, 0.28);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.admin-control-card-top {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.admin-control-card h3 {
    color: var(--text);
    font-size: 0.98rem;
    margin: 0 0 6px;
}

.admin-control-card p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0;
}

.admin-control-card-footer {
    align-items: center;
    color: var(--accent);
    display: flex;
    font-size: 0.88rem;
    font-weight: 800;
    gap: 8px;
    justify-content: space-between;
}

.status-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 10px;
    white-space: nowrap;
}

.status-pill-success {
    background: #dcfce7;
    color: #166534;
}

.status-pill-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-pill-info {
    background: #e0f2fe;
    color: #075985;
}

.status-pill-healthy {
    background: #dcfce7;
    color: #166534;
}

.status-pill-full {
    background: #fee2e2;
    color: #b91c1c;
}

.plan-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 10px;
}

.plan-summary-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    min-height: 120px;
    padding: 16px;
}

.plan-summary-card strong {
    color: var(--text);
    display: block;
    font-size: 1.35rem;
    line-height: 1.15;
    margin-bottom: 6px;
}

.integration-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.integration-summary-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    min-height: 112px;
    padding: 16px;
}

.integration-summary-card strong {
    color: var(--text);
    display: block;
    font-size: 1.3rem;
    line-height: 1.15;
    margin-bottom: 6px;
}

.integration-section-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}

.integration-group {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 18px;
    display: grid;
    gap: 12px;
    padding: 16px;
}

.integration-group-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.integration-group-head .section-subtitle {
    margin-bottom: 6px;
}

.integration-footer-note {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-top: 12px;
}

.seat-meter {
    display: grid;
    gap: 8px;
}

.seat-meter-track {
    background: #e5e7eb;
    border-radius: 999px;
    display: block;
    height: 10px;
    overflow: hidden;
}

.seat-meter-fill {
    border-radius: inherit;
    display: block;
    height: 100%;
}

.seat-meter-fill-healthy {
    background: linear-gradient(90deg, #34d399, #10b981);
}

.seat-meter-fill-warning {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.seat-meter-fill-full {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.seat-meter-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.82rem;
    justify-content: space-between;
    gap: 8px;
}

.module-summary-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 14px;
}

.module-summary-chip {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 16px;
    display: grid;
    gap: 4px;
    min-height: 82px;
    padding: 14px 16px;
}

.module-summary-chip strong {
    color: var(--text);
    font-size: 1rem;
}

.module-summary-chip span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.module-summary-chip-good {
    border-color: rgba(34, 197, 94, 0.24);
}

.module-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.module-lock-pill {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 999px;
    color: #c2410c;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 7px 11px;
}

.module-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-option {
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 16px;
    display: flex;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px;
}

.module-option input {
    accent-color: var(--accent);
    flex: 0 0 auto;
    height: 18px;
    margin-top: 2px;
    width: 18px;
}

.module-option-body {
    display: grid;
    gap: 4px;
}

.module-option-body strong {
    color: var(--text);
    font-size: 0.94rem;
}

.module-option-body span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.settings-branding-panel#branding {
    scroll-margin-top: 20px;
}

.settings-lead-panel#lead-setup {
    scroll-margin-top: 20px;
}

.settings-system-panel#system {
    scroll-margin-top: 20px;
}

.settings-plan-panel#plan-access {
    scroll-margin-top: 20px;
}

@media (max-width: 1180px) {
    .admin-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .company-usage-grid {
        grid-template-columns: 1fr;
    }

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

    .integration-summary-grid,
    .integration-section-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 860px) {
    .admin-control-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    .admin-overview-grid {
        grid-template-columns: 1fr;
    }

    .company-snapshot-strip {
        grid-template-columns: 1fr;
    }

    .company-usage-panel {
        padding: 14px;
    }

    .company-usage-card-top,
    .company-usage-card-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .workflow-map {
        grid-template-columns: 1fr;
    }

    .plan-summary-grid {
        grid-template-columns: 1fr;
    }

    .integration-summary-grid,
    .integration-section-grid {
        grid-template-columns: 1fr;
    }

    .module-summary-strip {
        grid-template-columns: 1fr;
    }

    .admin-control-card-top {
        flex-direction: column;
    }

    .admin-control-card-footer {
        align-items: flex-start;
    }
}

.team-directory-panel table thead th {
    color: #475467;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    padding-bottom: 14px;
}

.settings-lead-panel table th,
.settings-lead-panel table td,
.team-directory-panel table th,
.team-directory-panel table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.team-directory-panel table tbody tr:hover {
    background: rgba(255, 90, 31, 0.025);
}

.team-directory-panel table tbody td:first-child strong {
    font-size: 0.95rem;
}

.team-directory-panel .badge {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.03);
}

.lead-inbox-panel .toolbar {
    margin-top: 2px;
}

.lead-inbox-panel .table-scroll {
    margin-top: 4px;
}

.lead-inbox-panel .table-scroll table {
    min-width: 1100px;
}

.lead-inbox-panel .toolbar {
    gap: 8px;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr) auto auto;
}

.lead-inbox-panel .toolbar .input,
.lead-inbox-panel .toolbar .select {
    min-height: 36px;
    padding: 7px 10px;
}

.lead-inbox-panel .toolbar .btn {
    padding: 7px 10px;
}

.lead-inbox-panel table th,
.lead-inbox-panel table td {
    padding: 8px 7px;
    font-size: 0.84rem;
}

.lead-inbox-panel table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.lead-inbox-panel .saved-view-toolbar {
    gap: 8px;
    margin-bottom: 12px;
    row-gap: 8px;
}

.lead-inbox-panel .saved-view-toolbar .select {
    min-width: 180px;
}

.lead-inbox-panel .saved-view-toolbar .btn,
.lead-inbox-panel .saved-view-toolbar .btn.primary,
.lead-inbox-panel .saved-view-toolbar .btn.ghost {
    padding: 7px 10px;
}

.lead-inbox-panel .bulk-transfer-bar {
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px 12px;
}

.lead-inbox-panel .bulk-transfer-bar .form-field {
    margin-bottom: 0;
}

.lead-inbox-panel .bulk-transfer-bar .input,
.lead-inbox-panel .bulk-transfer-bar .select {
    min-height: 36px;
    padding: 7px 10px;
}

.lead-inbox-panel .bulk-transfer-bar .btn {
    padding: 7px 10px;
}

.lead-inbox-panel .table-select-col {
    width: 38px;
}

.lead-inbox-panel tbody .lead-row td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.pipeline-page-panel .pipeline-overview-grid,
.pipeline-page-panel .pipeline-analytics-grid,
.pipeline-page-panel .pipeline-grid {
    margin-top: 4px;
}

.pipeline-page-panel .pipeline-board-head {
    margin-top: 14px;
}

.pipeline-page-panel .pipeline-overview-grid {
    gap: 12px;
    margin-bottom: 14px;
}

.pipeline-page-panel .pipeline-overview-card,
.pipeline-page-panel .pipeline-funnel-shell {
    padding: 14px;
}

.pipeline-page-panel .pipeline-range-form {
    margin-bottom: 14px;
}

.pipeline-page-panel .pipeline-range-fields {
    gap: 8px;
}

.pipeline-page-panel .pipeline-range-actions .btn {
    padding: 7px 10px;
}

.pipeline-page-panel .pipeline-quick-grid {
    gap: 8px;
}

.pipeline-page-panel .pipeline-quick-item {
    padding: 10px;
}

.pipeline-page-panel .pipeline-quick-value {
    font-size: 1.42rem;
}

.pipeline-page-panel .pipeline-funnel {
    gap: 7px;
}

.pipeline-page-panel .pipeline-funnel-stage {
    padding: 10px 14px;
}

.pipeline-page-panel .pipeline-funnel-main,
.pipeline-page-panel .pipeline-funnel-sub {
    gap: 8px;
}

.pipeline-page-panel .pipeline-funnel-sub {
    font-size: 0.74rem;
}

.pipeline-page-panel .pipeline-column {
    min-height: 430px;
    padding: 10px;
}

.pipeline-page-panel .pipeline-head {
    margin-bottom: 10px;
    padding-bottom: 8px;
}

.pipeline-page-panel .pipeline-list {
    gap: 8px;
}

.pipeline-page-panel .pipeline-card {
    padding: 12px;
}

.pipeline-page-panel .pipeline-card h3 {
    font-size: 0.92rem;
}

.pipeline-page-panel .pipeline-card p {
    margin-bottom: 6px;
}

.pipeline-page-panel .pipeline-meta {
    gap: 5px;
}

.pipeline-page-panel .pipeline-meta-row {
    font-size: 0.77rem;
    gap: 6px;
}

.pipeline-page-panel .pipeline-follow-up-row {
    margin-top: 10px;
    padding: 8px 10px 8px 14px;
}

.pipeline-page-panel .pipeline-follow-up-label {
    font-size: 0.75rem;
    gap: 6px;
}

.pipeline-page-panel .pipeline-card-actions {
    margin-top: 8px;
}

.pipeline-page-panel .pipeline-card-actions .btn {
    padding: 6px 9px;
}

.hierarchy-role-panel .role-manager-list thead th {
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hierarchy-role-panel .role-manager-list tbody tr td {
    vertical-align: top;
    padding-top: 9px;
    padding-bottom: 9px;
}

.hierarchy-branch-panel .field-help,
.hierarchy-tree-panel .muted,
.hierarchy-role-panel .field-help,
.team-form-panel .field-help,
.team-directory-panel .muted {
    max-width: 900px;
}

.hierarchy-dropzone {
    align-items: center;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.92));
    border: 1px dashed rgba(14, 165, 233, 0.35);
    border-radius: 14px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 14px 16px;
}

.hierarchy-dropzone strong {
    color: var(--text);
}

.hierarchy-dropzone.drop-target {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.72);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.hierarchy-node {
    display: grid;
    gap: 14px;
    padding-left: 18px;
    border-left: 1px dashed rgba(148, 163, 184, 0.45);
}

.hierarchy-node:first-child {
    padding-left: 0;
    border-left: 0;
}

.hierarchy-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    padding: 16px 16px 14px 18px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
    cursor: grab;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    position: relative;
}

.hierarchy-card::before {
    background: linear-gradient(180deg, rgba(255, 90, 31, 0.92), rgba(22, 163, 148, 0.92));
    border-radius: 999px;
    content: "";
    height: calc(100% - 26px);
    left: 12px;
    position: absolute;
    top: 13px;
    width: 4px;
}

.hierarchy-card-head {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-left: 14px;
}

.hierarchy-card-heading {
    display: grid;
    gap: 4px;
}

.hierarchy-card:active {
    cursor: grabbing;
}

.hierarchy-card.dragging {
    opacity: 0.72;
    transform: scale(0.985);
}

.hierarchy-card.drop-target {
    border-color: rgba(14, 165, 233, 0.75);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12), 0 14px 28px rgba(15, 23, 42, 0.08);
}

.hierarchy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 12px;
    padding-left: 14px;
}

.hierarchy-meta span {
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    padding: 6px 10px;
}

.hierarchy-level-pill {
    align-items: center;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 4px 9px;
    text-transform: uppercase;
    width: fit-content;
}

.hierarchy-branch {
    display: grid;
    gap: 14px;
    margin-left: 18px;
    padding-left: 18px;
    border-left: 1px solid rgba(226, 232, 240, 0.9);
}

.hierarchy-card .btn {
    cursor: pointer;
    padding: 7px 10px;
}

.role-manager-table .role-permissions {
    min-height: 88px;
}

.role-manager-table .role-active-cell {
    min-width: 130px;
}

.hierarchy-role-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.hierarchy-role-summary-pill {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 122, 34, 0.1), rgba(255, 122, 34, 0.04));
    border: 1px solid rgba(255, 122, 34, 0.16);
    border-radius: 999px;
    color: #b44d09;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    max-width: 100%;
    line-height: 1.1;
    padding: 5px 9px;
}

.permission-audit-strip {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.permission-audit-chip {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
}

.permission-audit-chip strong {
    color: #1f2937;
    font-size: 0.84rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.permission-audit-chip span {
    color: #475467;
    font-size: 0.92rem;
    line-height: 1.35;
    word-break: break-word;
}

.permission-audit-chip-good {
    border-color: rgba(34, 197, 94, 0.24);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.04);
}

.permission-audit-chip-good strong {
    color: #166534;
}

.role-manager-list .table-actions {
    justify-content: flex-end;
}

.role-manager-row {
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.role-manager-row:hover {
    background: rgba(255, 122, 34, 0.03);
}

.role-manager-row.is-dragging {
    background: rgba(255, 122, 34, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 122, 34, 0.18);
    opacity: 0.7;
}

.role-handle-cell {
    width: 44px;
}

.role-drag-handle {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    cursor: grab;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 30px;
}

.role-drag-handle:active {
    cursor: grabbing;
}

.role-manager-list th:nth-child(4),
.role-manager-list td:nth-child(4) {
    min-width: 132px;
}

.role-manager-list tbody tr td:nth-child(2) {
    white-space: nowrap;
}

.role-scope-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 6px 10px;
}

.role-scope-badge.full {
    background: rgba(22, 163, 74, 0.1);
    color: #166534;
}

.role-scope-badge.limited {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.role-modal-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin: 8px 0 10px;
}

.role-permission-search {
    flex: 1 1 260px;
}

.role-modal-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.permission-item {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.permission-item:hover {
    border-color: rgba(255, 122, 34, 0.28);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
}

.permission-item span {
    font-weight: 600;
}

.permission-item input:checked + span {
    color: #9a3412;
}

.modal-backdrop {
    align-items: center;
    background: rgba(15, 23, 42, 0.42);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 20;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    max-width: 480px;
    overflow: hidden;
    padding: 18px;
    width: min(100%, 480px);
}

.modal-wide {
    max-width: 820px;
    width: min(100%, 820px);
}

.modal-wide,
.modal {
    overscroll-behavior: contain;
}

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

.permission-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.permission-group-list {
    display: grid;
    gap: 10px;
    max-height: min(58vh, 620px);
    overflow-y: auto;
    padding-right: 4px;
}

.permission-group-block {
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    padding: 10px;
}

.permission-group-title {
    color: #475569;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.permission-item {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 9px;
    display: flex;
    gap: 8px;
    padding: 8px 10px;
}

.permission-item input {
    accent-color: var(--accent);
    height: 16px;
    width: 16px;
}

.modal-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.modal-head h2 {
    font-size: 1.15rem;
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}

.role-modal-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.role-modal-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.role-modal-body .form-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.role-modal-form .field-help {
    margin-top: 2px;
}

@media (max-width: 980px) {
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-actions {
        width: 100%;
    }

    .section-actions .btn,
    .section-actions form {
        width: 100%;
    }

    .modal {
        max-height: calc(100vh - 24px);
        max-width: none;
        width: 100%;
    }

    .modal-wide {
        width: 100%;
        max-width: none;
    }

    .modal-wide .permission-grid,
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .module-entitlement-panel .table-scroll table {
        min-width: 860px;
    }

    .company-usage-grid {
        grid-template-columns: 1fr;
    }

    .role-modal-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .role-modal-actions-inline {
        justify-content: stretch;
    }

    .permission-audit-strip {
        grid-template-columns: 1fr;
    }

    .task-action-strip {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .modal-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .modal {
        border-radius: 14px 14px 0 0;
        max-height: calc(100vh - 24px);
    }

    .modal-wide {
        width: 100%;
    }

    .role-modal-body .form-grid {
        padding-right: 0;
    }

    .permission-audit-chip {
        padding: 9px 10px;
    }

    .permission-group-list {
        max-height: min(50vh, 520px);
        padding-right: 0;
    }
}

.task-confirm-modal .modal {
    max-width: 460px;
}

.row-actions {
    position: relative;
}

.table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bulk-transfer-bar {
    align-items: end;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(240px, 1.5fr) minmax(220px, 1fr) minmax(240px, 1.25fr) auto;
    margin: 14px 0 16px;
    padding: 14px;
}

.bulk-transfer-bar .form-field {
    margin-bottom: 0;
}

.checkbox-row {
    align-items: center;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(229, 231, 235, 0.92);
    border-radius: 10px;
    display: flex;
    gap: 10px;
    padding: 12px 14px;
}

.checkbox-row input {
    accent-color: var(--accent);
    height: 16px;
    width: 16px;
}

.builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.builder-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.builder-checkbox {
    min-height: 44px;
}

.saved-view-summary-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 14px 0 6px;
}

.saved-view-summary-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 244, 0.9));
    border: 1px solid rgba(255, 122, 34, 0.12);
    border-radius: 14px;
    min-width: 0;
    padding: 12px 14px;
}

.saved-view-summary-card span {
    color: #7c3f16;
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.saved-view-summary-card strong {
    color: var(--text);
    display: block;
    font-size: 1.08rem;
    line-height: 1.2;
}

.saved-view-summary-card .muted {
    margin-top: 4px;
    word-break: break-word;
}

.report-snapshot-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-snapshot-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 241, 0.92));
    border: 1px solid rgba(255, 122, 34, 0.12);
    border-radius: 14px;
    min-width: 0;
    padding: 14px;
}

.report-snapshot-card span {
    color: #7c3f16;
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.report-snapshot-card strong {
    color: var(--text);
    display: block;
    font-size: 1.35rem;
    line-height: 1.1;
}

.report-snapshot-card .muted {
    margin-top: 4px;
}

@media (max-width: 700px) {
    .builder-grid {
        grid-template-columns: 1fr;
    }

    .saved-view-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .notification-dropdown {
        min-width: min(92vw, 460px);
        right: -12px;
    }

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

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

@media (max-width: 640px) {
    .notification-dropdown {
        min-width: min(94vw, 360px);
        right: -72px;
    }

    .notification-head,
    .notification-foot {
        gap: 10px;
        align-items: flex-start;
        flex-direction: column;
    }

    .notification-head-actions {
        justify-content: flex-start;
    }

    .notification-summary,
    .report-snapshot-grid {
        grid-template-columns: 1fr;
    }
}

.table-select-col {
    width: 36px;
}

.table-actions form {
    margin: 0;
}

.dots-btn {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.15rem;
    height: 34px;
    justify-content: center;
    line-height: 1;
    width: 34px;
}

.row-menu {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
    display: none;
    min-width: 130px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: 38px;
    z-index: 15;
}

.row-menu.active {
    display: grid;
    gap: 4px;
}

.menu-action {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.menu-action:hover {
    background: #f8fafc;
}

.menu-action.danger {
    color: #b42318;
}

.menu-action:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td {
    vertical-align: top;
}

th,
td {
    white-space: nowrap;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

a.badge {
    color: inherit;
    text-decoration: none;
}

a.badge:hover {
    filter: brightness(0.97);
}

a.badge:focus-visible {
    outline: 2px solid rgba(255, 122, 34, 0.35);
    outline-offset: 2px;
}

.badge.high { background: #fee2e2; color: #b42318; }
.badge.medium { background: #fef3c7; color: #b45309; }
.badge.new { background: #e0f2fe; color: #075985; }
.badge.low { background: #dcfce7; color: #166534; }
.badge.follow-up { background: #ede9fe; color: #5b21b6; }
.badge.won { background: #d1fae5; color: #047857; }
.badge.open { background: #e0f2fe; color: #075985; }
.badge.closed { background: #f1f5f9; color: #475569; }
.badge.inactive { background: #fee2e2; color: #b42318; }
.badge.owner { background: #ede9fe; color: #5b21b6; }
.badge.admin { background: #e0f2fe; color: #075985; }
.badge.manager { background: #dcfce7; color: #166534; }
.badge.agent { background: #fef3c7; color: #b45309; }
.badge.viewer { background: #f1f5f9; color: #475569; }

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.actions .btn {
    padding: 8px 12px;
}

.notification-menu {
    position: relative;
}

.notification-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    position: relative;
    width: 38px;
}

.notification-trigger:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.notification-badge {
    align-items: center;
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 800;
    height: 20px;
    justify-content: center;
    min-width: 20px;
    padding: 0 5px;
    position: absolute;
    right: -6px;
    top: -6px;
}

.notification-dropdown {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
    display: none;
    min-width: 400px;
    padding: 10px;
    position: absolute;
    right: 0;
    top: 52px;
    z-index: 19;
}

.notification-dropdown.active {
    display: grid;
    gap: 10px;
}

.notification-head,
.notification-foot {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.notification-head-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.notification-head a,
.notification-foot a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.notification-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.notification-search {
    display: grid;
}

.notification-summary {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.notification-summary-chip {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 241, 0.9));
    border: 1px solid rgba(255, 122, 34, 0.12);
    border-radius: 12px;
    color: var(--muted);
    display: grid;
    gap: 2px;
    justify-items: center;
    padding: 8px 10px;
    text-align: center;
}

.notification-summary-chip strong {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.1;
}

.notification-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.notification-tab {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 10px;
}

.notification-tab.active {
    background: rgba(255, 90, 31, 0.12);
    border-color: rgba(255, 90, 31, 0.2);
    color: var(--accent);
}

.notification-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    color: inherit;
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    text-decoration: none;
}

.notification-item:hover {
    background: #f8fafc;
    border-color: rgba(255, 90, 31, 0.2);
}

.notification-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.notification-action-form {
    display: inline-flex;
    margin: 0;
}

.notification-item strong {
    font-size: 0.94rem;
}

.notification-item-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.notification-empty {
    color: var(--muted);
    padding: 8px 4px;
}

.profile-menu {
    position: relative;
}

.profile-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    gap: 10px;
    padding: 8px 12px;
}

.profile-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.profile-avatar img {
    border-radius: 50%;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.profile-name {
    font-weight: 800;
}

.profile-dropdown {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    display: none;
    min-width: 220px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: 52px;
    z-index: 18;
}

.profile-dropdown.active {
    display: grid;
    gap: 4px;
}

.profile-dropdown a {
    align-items: center;
    border-radius: 6px;
    color: var(--ink);
    display: flex;
    gap: 9px;
    padding: 10px;
    text-decoration: none;
}

.profile-dropdown a:hover {
    background: #f8fafc;
}

.profile-dropdown form {
    margin: 0;
}

.dropdown-action {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 9px;
    padding: 10px;
    text-align: left;
    width: 100%;
}

.dropdown-action:hover {
    background: #f8fafc;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    text-decoration: none;
    font-weight: 650;
    line-height: 1.1;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn.compact {
    border-radius: 999px;
    font-size: 0.76rem;
    gap: 4px;
    padding: 6px 10px;
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn .icon {
    height: 16px;
    width: 16px;
}

.btn:hover {
    background: #f8fafc;
    border-color: rgba(24, 33, 47, 0.24);
    color: var(--accent);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.btn.primary:hover {
    background: #e94c14;
    border-color: #e94c14;
    color: #111827;
    box-shadow: 0 14px 30px rgba(233, 76, 20, 0.2);
}

.btn.ghost {
    background: #f8fafc;
}

.btn.ghost:hover {
    background: #eef2ff;
    border-color: rgba(99, 102, 241, 0.24);
    color: #4f46e5;
}

.btn.danger {
    border-color: #fecaca;
    color: #b42318;
}

.btn.danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.pipeline-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: start;
}

.pipeline-analytics-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
    align-items: start;
}

.main-dashboard .grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
}

.dashboard-report-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: start;
}

.dashboard-report-grid .report-card {
    padding: 14px;
}

.dashboard-report-grid .report-card .section-title {
    margin-bottom: 8px;
}

.dashboard-report-grid .report-card .bar-chart {
    gap: 10px;
}

.dashboard-report-grid .report-card .bar-chart-label {
    font-size: 0.84rem;
}

.dashboard-report-grid .report-card .bar-chart-track {
    height: 10px;
}

.dashboard-trend-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
}

.dashboard-trend-card {
    min-height: 280px;
    display: grid;
    gap: 12px;
}

.dashboard-notification-card {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 16px;
}

.dashboard-notification-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dashboard-notification-pill {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
}

.dashboard-notification-pill span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-notification-pill strong {
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.15;
}

.dashboard-task-snapshot {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dashboard-task-chip {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 241, 0.88));
    border: 1px solid rgba(255, 122, 34, 0.12);
    border-radius: 16px;
    min-width: 0;
    padding: 12px 14px;
}

.dashboard-task-chip span {
    color: #7c3f16;
    display: block;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.dashboard-task-chip strong {
    color: var(--text);
    display: block;
    font-size: 1.35rem;
    line-height: 1.05;
}

.dashboard-task-chip .muted {
    margin-top: 4px;
}

.notification-preview-list {
    display: grid;
    gap: 10px;
}

.notification-preview-item {
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 12px 14px;
}

.notification-preview-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.notification-preview-main strong {
    font-size: 0.94rem;
}

.notification-preview-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.notification-preview-chip {
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 6px 10px;
    text-transform: uppercase;
}

.notification-preview-chip-open,
.notification-preview-chip-today {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.18);
    color: #1d4ed8;
}

.notification-preview-chip-warning,
.notification-preview-chip-overdue {
    background: rgba(255, 90, 31, 0.08);
    border-color: rgba(255, 90, 31, 0.18);
    color: #c2410c;
}

.notification-preview-chip-escalated {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.18);
    color: #6d28d9;
}

.notification-preview-chip-closed {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.18);
    color: #15803d;
}

.chart-card {
    overflow: hidden;
    padding: 16px;
    position: relative;
}

.chart-card::before {
    background: linear-gradient(180deg, rgba(255, 90, 31, 0.12), rgba(22, 163, 148, 0.06));
    content: "";
    inset: 0;
    opacity: 0.65;
    pointer-events: none;
    position: absolute;
}

.chart-card > * {
    position: relative;
    z-index: 1;
}

.report-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.report-page-panel .section-head {
    align-items: flex-start;
}

.report-page-panel .section-title {
    margin-bottom: 2px;
}

.report-hero {
    align-items: stretch;
    background: linear-gradient(135deg, rgba(255, 90, 31, 0.06), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(255, 90, 31, 0.12);
    border-radius: 16px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) 320px;
    margin-top: 14px;
    padding: 16px;
}

.report-hero-copy h3 {
    font-size: 1.1rem;
    margin: 6px 0 8px;
}

.report-hero-copy p {
    color: var(--muted);
    margin: 0;
    max-width: 70ch;
}

.report-eyebrow {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.report-hero-aside {
    display: grid;
    gap: 10px;
}

.report-mini-stat {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
}

.report-mini-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-kpi-grid .stat {
    min-height: 120px;
}

.report-snapshot-grid {
    margin-top: 16px;
}

.report-trend-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.report-trend-card {
    min-height: 320px;
    display: grid;
    gap: 12px;
}

.report-trend-card .section-head {
    align-items: flex-start;
}

.report-trend-chip {
    background: rgba(255, 90, 31, 0.08);
    border: 1px solid rgba(255, 90, 31, 0.14);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 6px 10px;
    white-space: nowrap;
}

.report-trend-chart {
    gap: 9px;
}

.report-insight-grid .report-card {
    min-height: 280px;
}

.report-table-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.report-table-card .table-scroll {
    margin-top: 10px;
}

.report-actions {
    align-items: flex-end;
}

.report-breakdown-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.report-page-panel .dashboard-chart-grid,
.report-trend-grid,
.report-breakdown-grid {
    margin-top: 16px;
}

.report-breakdown-card {
    display: grid;
    gap: 12px;
}

.report-executive-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    display: grid;
    gap: 14px;
    padding: 15px;
}

.report-executive-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-executive-pill {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    display: grid;
    gap: 4px;
    min-height: 100px;
    padding: 12px 14px;
}

.report-executive-pill span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.report-executive-pill strong {
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.2;
}

.report-executive-pill .muted {
    font-size: 0.82rem;
}

.stacked-bar {
    background: #eef2f7;
    border-radius: 999px;
    display: flex;
    height: 16px;
    overflow: hidden;
}

.stacked-bar-segment {
    display: block;
    height: 100%;
}

.stacked-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.stacked-legend span {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    gap: 6px;
    font-size: 0.77rem;
    font-weight: 600;
}

.stacked-legend i {
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.bar-chart {
    display: grid;
    gap: 10px;
}

.bar-chart-row {
    display: grid;
    gap: 8px;
}

.bar-chart-label {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.85rem;
}

.bar-chart-label strong {
    color: var(--ink);
}

.bar-chart-track {
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    height: 11px;
    overflow: hidden;
}

.bar-chart-fill {
    border-radius: inherit;
    display: block;
    height: 100%;
}

.bar-chart-fill-primary {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.bar-chart-fill-accent {
    background: linear-gradient(90deg, #ff5a1f, #f97316);
}

.pipeline-kpi-card {
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 8px;
    min-height: 116px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.pipeline-kpi-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: var(--kpi-accent, var(--accent));
}

.pipeline-kpi-primary { --kpi-accent: #1d4ed8; }
.pipeline-kpi-success { --kpi-accent: #059669; }
.pipeline-kpi-alert { --kpi-accent: #d97706; }
.pipeline-kpi-neutral { --kpi-accent: #475569; }

.pipeline-kpi-top {
    align-items: center;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pipeline-kpi-icon {
    align-items: center;
    background: rgba(24, 33, 47, 0.06);
    border-radius: 8px;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.pipeline-kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.pipeline-kpi-meta {
    color: var(--muted);
    font-size: 0.84rem;
}

.pipeline-overview-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 320px minmax(0, 1fr);
    margin-bottom: 16px;
}

.pipeline-overview-card {
    background: #fff;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 8px;
    padding: 16px;
}

.pipeline-range-form {
    margin-bottom: 18px;
}

.pipeline-range-fields {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 180px)) 1fr;
}

.pipeline-range-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.pipeline-quick-grid {
    display: grid;
    gap: 10px;
}

.pipeline-quick-item {
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    display: grid;
    gap: 5px;
    padding: 12px;
}

.pipeline-quick-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pipeline-quick-value {
    font-size: 1.55rem;
    line-height: 1;
}

.pipeline-quick-meta {
    color: var(--muted);
    font-size: 0.8rem;
}

.pipeline-funnel-shell {
    background: linear-gradient(180deg, #f8fafc, #eef2ff);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 8px;
    padding: 16px;
}

.pipeline-funnel-header {
    margin-bottom: 12px;
}

.pipeline-funnel {
    display: grid;
    gap: 8px;
}

.pipeline-funnel-row {
    display: flex;
    justify-content: center;
}

.pipeline-funnel-stage {
    background: linear-gradient(135deg, #18212f, #334155);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    color: #fff;
    display: block;
    padding: 12px 16px;
    text-decoration: none;
}

.pipeline-funnel-stage-1 {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.pipeline-funnel-stage-2 {
    background: linear-gradient(135deg, #0f766e, #0d9488);
}

.pipeline-funnel-stage-3 {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.pipeline-funnel-stage-4 {
    background: linear-gradient(135deg, #15803d, #16a34a);
}

.pipeline-funnel-stage-5 {
    background: linear-gradient(135deg, #b45309, #d97706);
}

.pipeline-funnel-stage-6 {
    background: linear-gradient(135deg, #b42318, #dc2626);
}

.pipeline-funnel-stage.is-clickable {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pipeline-funnel-stage.is-clickable:hover {
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
    transform: translateY(-1px);
}

.pipeline-funnel-stage.is-empty {
    cursor: default;
    opacity: 0.92;
}

.pipeline-funnel-main,
.pipeline-funnel-sub {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.pipeline-funnel-main {
    margin-bottom: 6px;
}

.pipeline-funnel-sub {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.8rem;
}

.pipeline-board-head {
    margin-bottom: 12px;
}

.pipeline-grid-corporate {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    align-items: start;
}

.pipeline-column {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 8px;
    min-height: 460px;
    padding: 12px;
}

.pipeline-column.drag-over {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 2px rgba(255, 90, 31, 0.18);
}

.pipeline-head {
    align-items: center;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.pipeline-head-meta {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 4px;
}

.pipeline-stage-link {
    color: inherit;
    text-decoration: none;
}

.pipeline-stage-link:hover {
    color: var(--accent);
}

.pipeline-count {
    background: rgba(24, 33, 47, 0.08);
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 5px 9px;
}

.pipeline-list {
    display: grid;
    gap: 10px;
}

.pipeline-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    cursor: grab;
    padding: 14px;
    position: relative;
}

.pipeline-card:active {
    cursor: grabbing;
}

.pipeline-card::before {
    background: var(--pipeline-card-accent, #cbd5e1);
    border-radius: 999px;
    content: "";
    height: calc(100% - 20px);
    left: 10px;
    position: absolute;
    top: 10px;
    width: 4px;
}

.pipeline-card-overdue { --pipeline-card-accent: #dc2626; }
.pipeline-card-today { --pipeline-card-accent: #d97706; }
.pipeline-card-scheduled { --pipeline-card-accent: #2563eb; }

.pipeline-card-top {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-left: 10px;
}

.pipeline-card h3 {
    font-size: 0.95rem;
    margin: 0 0 4px;
}

.pipeline-card p {
    margin: 0 0 8px;
}

.pipeline-meta {
    display: grid;
    gap: 6px;
    padding-left: 10px;
}

.pipeline-meta-row {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.8rem;
    gap: 7px;
}

.pipeline-meta-row .icon {
    height: 15px;
    width: 15px;
}

.pipeline-follow-up-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 11px 9px 18px;
}

.pipeline-follow-up-label {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    font-size: 0.8rem;
    gap: 8px;
}

.pipeline-follow-up-pill {
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 5px 8px;
    text-transform: uppercase;
}

.pipeline-follow-up-pill-overdue {
    background: #fee2e2;
    color: #b42318;
}

.pipeline-follow-up-pill-today {
    background: #fef3c7;
    color: #b45309;
}

.pipeline-follow-up-pill-scheduled {
    background: #dbeafe;
    color: #1d4ed8;
}

.pipeline-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    padding-left: 10px;
}

.pipeline-card-actions .btn {
    padding: 7px 10px;
}

@media (max-width: 1100px) {
    .sidebar {
        display: none;
    }

    .main {
        border-left: 0;
        margin-left: 0;
        min-height: auto;
        overflow: visible;
        position: relative;
        width: 100%;
    }

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

    .toolbar {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-stack,
    .profile-side-stack {
        gap: 14px;
    }

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

    .dashboard-chart-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-report-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-trend-grid {
        grid-template-columns: 1fr;
    }

    .task-hero {
        grid-template-columns: 1fr;
    }

    .task-hero-pills {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

    .report-trend-grid {
        grid-template-columns: 1fr;
    }

    .report-breakdown-grid {
        grid-template-columns: 1fr;
    }

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

    .pipeline-overview-grid {
        grid-template-columns: 1fr;
    }

    .branding-preview {
        grid-template-columns: 1fr;
    }

    .pipeline-range-fields {
        grid-template-columns: 1fr;
    }

    .sidebar-toggle {
        display: none;
    }

    .topbar {
        left: 0;
        width: 100%;
    }
}

@media (max-width: 700px) {
    .main {
        padding: 136px 14px 14px;
    }

    .main-dashboard {
        padding-left: 14px;
        padding-right: 14px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

    .details-grid,
    .form-grid,
    .column-grid {
        grid-template-columns: 1fr;
    }

    .pipeline-analytics-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-report-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-trend-grid {
        grid-template-columns: 1fr;
    }

    .task-hero {
        grid-template-columns: 1fr;
    }

    .task-hero-pills,
    .report-snapshot-grid {
        grid-template-columns: 1fr;
    }

    .report-trend-grid {
        grid-template-columns: 1fr;
    }

    .report-breakdown-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        left: 0;
        padding: 14px;
        width: 100%;
    }

    .topbar-left {
        width: 100%;
    }

    .actions {
        width: 100%;
        justify-content: flex-start;
    }

    .actions .btn,
    .actions .notification-menu,
    .actions .profile-menu {
        width: 100%;
    }

    .actions .notification-trigger,
    .actions .profile-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .section-actions .btn {
        flex: 1 1 auto;
    }

    .card {
        padding: 14px;
    }

    .stat {
        min-height: 90px;
        padding: 12px;
    }

    .stat .value {
        font-size: 1.5rem;
    }

    .pipeline-page-panel .pipeline-column,
    .task-bucket-card,
    .lead-profile-activity-panel,
    .lead-profile-notes-panel,
    .lead-profile-task-panel {
        padding: 10px;
    }

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

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

    .pipeline-funnel-main,
    .pipeline-funnel-sub,
    .pipeline-card-top,
    .pipeline-follow-up-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-filter-bar,
    .lead-inbox-panel .toolbar,
    .saved-view-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .task-filter-bar .btn,
    .lead-inbox-panel .toolbar .btn,
    .saved-view-toolbar .btn,
    .saved-view-toolbar .btn.primary,
    .saved-view-toolbar .btn.ghost {
        width: 100%;
    }

    .task-dashboard-summary {
        grid-template-columns: 1fr;
    }

    .task-hero-pills {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-report-grid .report-card,
    .chart-card {
        padding: 14px;
    }

    .notification-preview-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .notification-preview-actions {
        justify-content: flex-start;
    }

    .bar-chart {
        gap: 8px;
    }

    .report-executive-grid {
        grid-template-columns: 1fr;
    }

    .company-snapshot-strip {
        grid-template-columns: 1fr;
    }

    .company-usage-panel {
        padding: 14px;
    }

    .company-usage-card-top,
    .company-usage-card-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .company-insight-grid {
        grid-template-columns: 1fr;
    }

    .tenant-health-score {
        grid-template-columns: 1fr;
    }

    .tenant-health-ring {
        height: 96px;
        width: 96px;
    }

    .tenant-risk-row,
    .tenant-action-strip {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .audit-filter-grid {
        grid-template-columns: 1fr;
    }

    .audit-filter-actions {
        justify-content: stretch;
    }

    .audit-filter-actions .btn,
    .audit-filter-actions a {
        width: 100%;
        justify-content: center;
    }

    .dashboard-notification-summary {
        grid-template-columns: 1fr;
    }

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

    .notification-preview-actions .btn,
    .notification-preview-actions a,
    .notification-preview-actions form {
        width: 100%;
    }

    .report-executive-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-task-snapshot {
        grid-template-columns: 1fr;
    }
}
