:root {
    --color-primary: #f97316;
    --color-primary-hover: #ea580c;
    --color-primary-soft: #fff7ed;
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-surface-soft: #fffaf5;
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-border-strong: #d1d5db;
    --color-success: #15803d;
    --color-success-soft: #f0fdf4;
    --color-warning: #c2410c;
    --color-warning-soft: #fff7ed;
    --color-danger: #b91c1c;
    --color-danger-soft: #fef2f2;
    --shadow-sm: 0 1px 2px rgba(31, 41, 55, 0.06);
    --shadow-md: 0 10px 24px rgba(31, 41, 55, 0.10);
    --shadow-lg: 0 18px 44px rgba(31, 41, 55, 0.14);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

body {
    min-height: 100vh;
}

a {
    color: var(--color-primary-hover);
    text-decoration: none;
    transition: color 0.18s ease;
}

a:hover {
    color: var(--color-primary);
}

svg {
    display: block;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 0.85rem;
    background: #fff;
    color: var(--color-text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(249, 115, 22, 0.42);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button,
.btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-shadow: 0 1px 2px rgba(249, 115, 22, 0.18);
}

button:hover,
.btn:hover,
.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(249, 115, 22, 0.18);
}

.btn-secondary,
a.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.85rem;
    background: #fff;
    color: var(--color-text);
    font-weight: 600;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn-secondary:hover,
a.btn-secondary:hover {
    background: #f3f4f6;
    border-color: var(--color-border-strong);
    color: var(--color-text);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: #fecaca;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--color-bg);
}

.sidebar {
    width: 300px;
    padding: 1.25rem 0.95rem;
    background: rgba(255, 255, 255, 0.92);
    border-right: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    margin-bottom: 0.9rem;
    background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
    border: 1px solid rgba(249, 115, 22, 0.14);
    box-shadow: var(--shadow-sm);
}

.logo img {
    width: auto;
    height: 52px;
    max-width: 180px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.logo h1 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.logo p {
    margin: 0.1rem 0 0;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.sidebar-nav,
.sidebar-extra {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-extra {
    margin-top: 0.95rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--color-border);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.68rem 0.8rem;
    border-radius: 0.95rem;
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover {
    background: #f3f4f6;
    color: var(--color-text);
    transform: translateX(2px);
}

.nav-link.active {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-weight: 700;
}

.nav-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    color: inherit;
}

.onboarding-panel {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 58%, #f0fdf4 100%);
    border: 1px solid rgba(249, 115, 22, 0.18);
    box-shadow: var(--shadow-md);
}

.onboarding-head {
    align-items: flex-start;
    gap: 1rem;
}

.onboarding-dismiss-form {
    flex: 0 0 auto;
}

.onboarding-dismiss-btn {
    min-height: 38px;
    padding: 0.6rem 0.9rem;
}

.onboarding-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--color-muted);
    font-weight: 600;
}

.onboarding-progress-bar {
    width: 100%;
    height: 0.8rem;
    margin-top: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
}

.onboarding-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f97316 0%, #16a34a 100%);
}

.onboarding-checklist {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.onboarding-step {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
}

.onboarding-step.is-complete {
    border-color: rgba(21, 128, 61, 0.18);
    background: rgba(240, 253, 244, 0.9);
}

.onboarding-step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-weight: 800;
}

.onboarding-step-title {
    font-weight: 700;
    color: var(--color-text);
}

.onboarding-step-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .onboarding-step {
        grid-template-columns: auto 1fr;
    }

    .onboarding-step-action {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .onboarding-progress-meta,
    .onboarding-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 84px;
    padding: 1rem 1.5rem;
    background: rgba(249, 250, 251, 0.88);
    backdrop-filter: blur(12px);
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding-right: 0.5rem;
    color: var(--color-text);
}

.header-brand img {
    width: auto;
    height: 52px;
    max-width: 180px;
    object-fit: contain;
    flex: 0 0 auto;
}

.header-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.header-brand-copy strong {
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.header-brand-copy span {
    color: var(--color-muted);
    font-size: 0.72rem;
}

.top-search {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    max-width: 760px;
}

.search-shell {
    position: relative;
    flex: 1;
}

.search-shell input {
    padding-left: 2.75rem;
    background: #fff;
}

.search-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-icon svg {
    width: 100%;
    height: 100%;
}

.topbar-note {
    margin: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.9rem;
    flex: 0 0 auto;
}

.notification-menu-wrap {
    position: relative;
}

.notification-bell {
    position: relative;
    width: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 1rem;
    background: #fff;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.notification-bell:hover {
    color: var(--color-text);
    background: #f8fafc;
}

.notification-bell-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.notification-bell-icon svg {
    width: 100%;
    height: 100%;
}

.notification-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.2rem;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(420px, calc(100vw - 2rem));
    max-height: 70vh;
    overflow: hidden;
    border-radius: 1.1rem;
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: var(--shadow-lg);
    z-index: 30;
}

.notification-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.notification-dropdown-head strong,
.notification-dropdown-head span {
    display: block;
}

.notification-dropdown-head span {
    margin-top: 0.15rem;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.notification-list {
    display: flex;
    flex-direction: column;
    max-height: calc(70vh - 64px);
    overflow-y: auto;
}

.notification-item {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item.is-unread {
    background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
}

.notification-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.notification-priority {
    font-size: 0.78rem;
    font-weight: 700;
}

.notification-priority.priority-high {
    color: var(--color-danger);
}

.notification-priority.priority-medium {
    color: var(--color-warning);
}

.notification-priority.priority-low {
    color: var(--color-success);
}

.notification-message {
    margin: 0;
    color: var(--color-text);
}

.notification-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.1rem 1rem;
    color: var(--color-muted);
}

.notification-menu-wrap.is-open .notification-bell {
    border-color: rgba(249, 115, 22, 0.28);
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.global-sales-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 240px;
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(249, 115, 22, 0.2);
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 88%);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.global-sales-kpi:hover {
    color: var(--color-text);
    border-color: rgba(249, 115, 22, 0.34);
    box-shadow: var(--shadow-md);
}

.global-sales-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary-hover);
}

.global-sales-kpi-value {
    font-size: 1.45rem;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.global-sales-kpi-meta {
    color: var(--color-muted);
    font-size: 0.78rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.45rem 0.9rem 0.45rem 0.45rem;
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.avatar {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.topbar-user-wrap {
    position: relative;
    flex: 0 0 auto;
}

.topbar-user-copy {
    min-width: 0;
    text-align: left;
}

.topbar-user-caret {
    width: 0.95rem;
    height: 0.95rem;
    color: var(--color-muted);
    flex: 0 0 0.95rem;
}

.topbar-user-caret svg {
    width: 100%;
    height: 100%;
}

.topbar-user-wrap.is-open .topbar-user {
    border-color: rgba(249, 115, 22, 0.26);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.08);
}

.topbar-user-wrap.is-open .topbar-user-caret {
    color: var(--color-primary-hover);
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    min-width: 240px;
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.user-dropdown-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.8rem 0.8rem;
    border-bottom: 1px solid var(--color-border);
}

.user-dropdown-label strong {
    font-size: 0.92rem;
    color: var(--color-text);
}

.user-dropdown-label span {
    font-size: 0.76rem;
    color: var(--color-muted);
}

.user-dropdown-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding: 0.7rem 0.8rem;
    border-radius: 0.8rem;
    color: var(--color-text);
    font-weight: 500;
}

.user-dropdown-link:hover {
    background: #f3f4f6;
    color: var(--color-text);
}

.user-dropdown-link-logout {
    color: var(--color-primary-hover);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.user-role {
    font-size: 0.78rem;
    color: var(--color-muted);
}

.content {
    padding: 1.5rem;
}

.page-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.page-title {
    margin: 0 0 0.25rem;
    font-size: 1.85rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.page-meta {
    margin: 0 0 1.1rem;
    color: var(--color-muted);
    font-size: 0.92rem;
}

.panel,
.card,
.entity-card,
.kpi,
.todo-item,
.kanban-card,
.metric-card,
.list-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.panel {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.entity-card,
.list-card,
.metric-card,
.todo-item,
.kanban-card,
.kpi {
    padding: 1rem;
}

.entity-card:hover,
.list-card:hover,
.metric-card:hover,
.todo-item:hover,
.kanban-card:hover,
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.section-head h2,
.section-head h3,
.section-head h4,
.panel h2,
.panel h3,
.panel h4 {
    margin: 0;
    color: var(--color-text);
    font-weight: 600;
}

.grid {
    display: grid;
    gap: 1rem;
}

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

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

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

.stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.form-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.entity-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.entity-card-shared {
    border-color: #d1d5db;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.entity-card-shared:hover {
    border-color: #9ca3af;
    box-shadow: var(--shadow-md);
}

.entity-title {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.entity-card-head .entity-title {
    margin-bottom: 0;
    min-width: 0;
}

.entity-meta {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.86rem;
}

.entity-owner-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 11rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #f8fafc;
    color: var(--color-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    word-break: break-word;
}

.entity-owner-chip-self {
    border-color: rgba(34, 197, 94, 0.25);
    background: #f0fdf4;
    color: #15803d;
}

.helper-text,
.todo-date,
.metric-label,
.timeline-type {
    color: var(--color-muted);
    font-size: 0.78rem;
}

.email-compose-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1rem;
    align-items: start;
}

.email-compose-main,
.email-compose-side {
    min-width: 0;
}

.recipient-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipient-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.2rem 0;
}

.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    cursor: pointer;
    box-shadow: none;
    min-height: auto;
}

.recipient-chip:hover {
    background: var(--color-primary-soft);
    transform: none;
    box-shadow: none;
}

.recipient-chip-email {
    color: var(--color-text);
    font-weight: 500;
}

.recipient-chip-remove {
    font-weight: 700;
}

.recipient-results {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.recipient-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--color-text);
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.recipient-result:hover {
    background: #fffaf5;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.recipient-result.is-disabled,
.recipient-result:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    background: #f9fafb;
    transform: none;
    box-shadow: none;
}

.recipient-result-main,
.recipient-result-side {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.recipient-result-side {
    align-items: flex-end;
    min-width: 120px;
}

.recipient-result-title {
    font-weight: 700;
}

.recipient-result-meta {
    color: var(--color-text);
}

.recipient-result-extra,
.recipient-result-action {
    color: var(--color-muted);
    font-size: 0.88rem;
}

.attachment-options {
    display: grid;
    gap: 0.75rem;
}

.attachment-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
}

.attachment-option input {
    margin-top: 0.2rem;
}

.attachment-option-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.template-variable-list {
    display: grid;
    gap: 0.65rem;
}

.template-variable-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 247, 237, 0.6);
}

.metric-label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.metric-value,
.kpi-value {
    margin-top: 0.4rem;
    color: var(--color-text);
    font-size: 1.8rem;
    line-height: 1.1;
    font-weight: 700;
}

.todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.todo-list-scroll {
    max-height: 22rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.followup-close-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.followup-close-form input {
    flex: 1 1 14rem;
}

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

.scroll-grid {
    max-height: 64vh;
    overflow: auto;
    padding-right: 0.25rem;
}

.scroll-table {
    max-height: 58vh;
    overflow: auto;
}

.scroll-timeline {
    max-height: 52vh;
    overflow: auto;
}

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

th,
td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    font-size: 0.85rem;
}

th {
    background: #fcfcfd;
    color: var(--color-muted);
    font-weight: 600;
}

tr:hover td {
    background: #fffdfb;
}

.actions,
.inline-actions,
.card-footer {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.card-footer {
    margin-top: 0.9rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--color-border);
}

.status-row,
.tags-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.badge,
.status-pill,
.inline-chip,
.tag-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.inline-chip {
    padding: 0.35rem 0.7rem;
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-muted);
}

.badge,
.status-pill {
    padding: 0.4rem 0.78rem;
    border: 1px solid transparent;
}

.badge.ok,
.status-pill.open,
.status-pill.won {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: #bbf7d0;
}

.badge.warn,
.status-pill.process {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: #fdba74;
}

.badge.dim,
.status-pill.closed,
.status-pill.lost {
    background: #f3f4f6;
    color: var(--color-muted);
    border-color: var(--color-border);
}

.status-pill.contracted {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.status-pill.executed {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: #bbf7d0;
}

.status-pill.pending {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: #fdba74;
}

.finance-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.tag-chip {
    padding: 0.38rem 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    border: 1px solid rgba(249, 115, 22, 0.16);
}

.tag-skill {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.tag-sector {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #ddd6fe;
}

.tag-zona {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.tag-tipo-profesional {
    background: #ecfeff;
    color: #0f766e;
    border-color: #a5f3fc;
}

.tag-group {
    padding: 0.9rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid var(--color-border);
}

.tag-group-title {
    margin: 0 0 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.check-grid {
    columns: 1;
}

.check-grid-double {
    columns: 2;
}

.check-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.84rem;
    color: var(--color-text);
}

.tag-selector-shell {
    display: grid;
    gap: 1rem;
}

.tag-group-zone {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border-color: #bfdbfe;
}

.tag-tree-panel {
    padding: 0.35rem 0;
}

.tag-tree-selector,
.tag-admin-tree {
    display: grid;
    gap: 0.75rem;
}

.tag-tree-node,
.tag-admin-node {
    position: relative;
}

.tag-tree-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 0.95rem;
    background: #fff;
}

.tag-tree-name {
    font-weight: 600;
    color: var(--color-text);
}

.tag-tree-children {
    margin-top: 0.7rem;
    margin-left: 1.1rem;
    padding-left: 1rem;
    border-left: 2px solid #dbeafe;
}

.tag-admin-card-active {
    border-color: rgba(249, 115, 22, 0.28);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.08);
}

.tag-flat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.tag-flat-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.link-button {
    padding: 0;
    min-height: auto;
    border: 0;
    background: transparent;
    color: var(--color-primary-hover);
    box-shadow: none;
    font-weight: 600;
}

.link-button:hover {
    background: transparent;
    color: var(--color-primary);
    transform: none;
    box-shadow: none;
}

.danger-link {
    color: var(--color-danger);
}

.tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.65rem 0.95rem;
    border-radius: 0.85rem;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    font-weight: 600;
}

.tab-link:hover {
    background: var(--color-primary-soft);
    border-color: rgba(249, 115, 22, 0.18);
    color: var(--color-primary-hover);
}

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

.owner-summary {
    border-color: rgba(148, 163, 184, 0.28);
}

.owner-summary-self {
    border-color: rgba(34, 197, 94, 0.26);
    background: linear-gradient(180deg, #f3fff8 0%, #ffffff 100%);
    box-shadow: 0 14px 28px rgba(34, 197, 94, 0.08);
}

.ficha-subtitle {
    margin: 0;
    color: var(--color-muted);
}

.timeline {
    display: grid;
    gap: 0.75rem;
}

.timeline-item {
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
}

.timeline-text {
    margin-top: 0.35rem;
}

.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.kanban-column {
    min-width: 280px;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    background: #fff;
}

.kanban-column-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.kanban-meta,
.kanban-score,
.kanban-empty {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.kanban-empty,
.empty-state {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px dashed var(--color-border-strong);
    background: #fff;
}

.empty-title {
    margin: 0;
    color: var(--color-text);
    font-size: 0.96rem;
    font-weight: 600;
}

.empty-text {
    margin: 0.35rem 0 0;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.live-flash {
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12), var(--shadow-md);
}

.ai-hero {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(220px, 0.8fr);
    gap: 1rem;
    align-items: center;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 32%),
        linear-gradient(135deg, #fff7ed 0%, #ffffff 58%, #f8fafc 100%);
    border-color: rgba(249, 115, 22, 0.18);
}

.ai-eyebrow {
    display: inline-flex;
    margin-bottom: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--color-primary-hover);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ai-hero h2 {
    margin: 0 0 0.5rem;
    font-size: 1.65rem;
    line-height: 1.1;
}

.ai-hero-primary {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
}

.ai-hero-status {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.ai-summary-card {
    position: relative;
    overflow: hidden;
}

.ai-summary-card::after {
    content: "";
    position: absolute;
    inset: auto -2.25rem -2.25rem auto;
    width: 6rem;
    height: 6rem;
    border-radius: 999px;
    opacity: 0.14;
}

.ai-summary-card-neutral::after {
    background: #94a3b8;
}

.ai-summary-card-warning::after {
    background: #f59e0b;
}

.ai-summary-card-critical::after {
    background: #ef4444;
}

.ai-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ai-filter-button-active,
.ai-filter-button.ai-filter-button-active:hover {
    background: var(--color-primary-soft);
    border-color: rgba(249, 115, 22, 0.28);
    color: var(--color-primary-hover);
}

.ai-dashboard-grid {
    align-items: start;
}

.ai-section-panel {
    min-height: 28rem;
}

.ai-audit-card {
    border-left: 5px solid transparent;
}

.ai-priority-critical {
    border-left-color: #dc2626;
    background: linear-gradient(180deg, #fffefe 0%, #fff9f9 100%);
}

.ai-priority-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
}

.ai-priority-ok {
    border-left-color: #16a34a;
}

.ai-issue-list {
    margin: 0.9rem 0 0;
    padding-left: 1.1rem;
    color: var(--color-text);
    display: grid;
    gap: 0.35rem;
}

.ai-unknown-row {
    border-left: 4px solid #f59e0b;
}

.ai-editor-drawer {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.ai-editor-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
}

.ai-editor-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(780px, 100%);
    height: 100%;
    padding: 1.25rem;
    overflow-y: auto;
    background: #fff;
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.ai-file-field input[type="file"] {
    padding: 0.55rem 0.65rem;
}

body.drawer-open {
    overflow: hidden;
}

.pipeline-add-form {
    display: grid;
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: end;
}

.pipeline-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.pipeline-overview-card {
    background: linear-gradient(180deg, #fffdfb 0%, #ffffff 100%);
}

.cv-viewer-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.cv-viewer-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 68vh;
    overflow: auto;
    padding-right: 0.2rem;
}

.cv-viewer-item {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: #fff;
}

.cv-viewer-item.is-previewable {
    border-color: rgba(249, 115, 22, 0.18);
    background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
}

.cv-viewer-open.is-active,
.cv-viewer-open.is-active:hover {
    background: var(--color-primary-soft);
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--color-primary-hover);
}

.cv-viewer-stage {
    min-width: 0;
}

.cv-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.cv-viewer-frame-shell {
    min-height: 72vh;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.cv-viewer-frame-shell iframe {
    width: 100%;
    min-height: 72vh;
    border: 0;
    background: #fff;
}

.whatsapp-filter-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

.whatsapp-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.whatsapp-inbox-grid {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.whatsapp-thread-panel,
.whatsapp-chat-panel {
    margin-bottom: 0;
}

.whatsapp-thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 74vh;
    overflow: auto;
    padding-right: 0.25rem;
}

.whatsapp-thread-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: #fff;
    color: var(--color-text);
}

.whatsapp-thread-row:hover {
    background: #fffaf5;
    border-color: rgba(249, 115, 22, 0.24);
    color: var(--color-text);
}

.whatsapp-thread-row.is-active {
    border-color: rgba(249, 115, 22, 0.3);
    background: var(--color-primary-soft);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.whatsapp-thread-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.whatsapp-unread-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--color-primary);
    flex: 0 0 0.55rem;
}

.whatsapp-thread-link {
    margin-top: 0;
}

.whatsapp-thread-preview {
    color: var(--color-text);
    font-size: 0.84rem;
}

.whatsapp-thread-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    color: var(--color-muted);
    font-size: 0.78rem;
}

.whatsapp-chat-head {
    padding-bottom: 0.95rem;
    margin-bottom: 0.95rem;
    border-bottom: 1px solid var(--color-border);
}

.whatsapp-message-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-height: 58vh;
    overflow: auto;
    padding-right: 0.2rem;
}

.whatsapp-message-row {
    display: flex;
}

.whatsapp-message-row.is-outbound {
    justify-content: flex-end;
}

.whatsapp-message-row.is-inbound {
    justify-content: flex-start;
}

.whatsapp-message-bubble {
    width: min(82%, 680px);
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: #fff;
}

.whatsapp-message-row.is-outbound .whatsapp-message-bubble {
    border-color: rgba(249, 115, 22, 0.3);
    background: var(--color-primary-soft);
}

.whatsapp-message-row.is-inbound .whatsapp-message-bubble {
    border-color: rgba(148, 163, 184, 0.22);
    background: #fff;
}

.whatsapp-message-content {
    color: var(--color-text);
    font-size: 0.88rem;
    word-break: break-word;
}

.whatsapp-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.45rem;
    color: var(--color-muted);
    font-size: 0.76rem;
}

.whatsapp-state {
    font-weight: 600;
}

.whatsapp-state.is-failed {
    color: var(--color-danger);
}

.whatsapp-error-note {
    margin-top: 0.35rem;
    color: var(--color-danger);
}

.whatsapp-composer {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.95rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--color-border);
}

.whatsapp-composer textarea {
    min-height: 110px;
}

.whatsapp-chat-empty {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

<<<<<<< Updated upstream
=======
.email-conv-filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.communications-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.communications-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.communications-preview {
    margin-top: 0.35rem;
    color: var(--color-muted);
    font-size: 0.82rem;
    max-width: 560px;
}

.communications-category {
    text-transform: none;
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.communications-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.email-conv-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.email-conv-subject {
    font-weight: 700;
    color: var(--color-text);
}

.email-conv-summary {
    margin-top: 0.35rem;
    color: var(--color-muted);
    font-size: 0.8rem;
    max-width: 520px;
}

.email-conv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.email-conv-empty {
    margin-top: 0.4rem;
}

.email-conv-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
    gap: 1rem;
    align-items: start;
}

.email-conv-message-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-height: 62vh;
    overflow: auto;
    padding-right: 0.2rem;
}

.email-conv-message-row {
    display: flex;
}

.email-conv-message-row.is-outbound {
    justify-content: flex-end;
}

.email-conv-message-row.is-inbound {
    justify-content: flex-start;
}

.email-conv-message-bubble {
    width: min(84%, 760px);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 0.8rem 0.9rem;
    background: #fff;
}

.email-conv-message-row.is-outbound .email-conv-message-bubble {
    border-color: rgba(249, 115, 22, 0.26);
    background: var(--color-primary-soft);
}

.email-conv-message-head {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    color: var(--color-muted);
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

.email-conv-message-body {
    margin-top: 0.45rem;
    color: var(--color-text);
    font-size: 0.84rem;
    word-break: break-word;
    white-space: pre-wrap;
}

>>>>>>> Stashed changes
.calendar-filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.calendar-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-top: 1rem;
    margin-bottom: 0.8rem;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.calendar-grid {
    display: grid;
    gap: 0.75rem;
}

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

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

.calendar-grid-day,
.calendar-grid-agenda {
    grid-template-columns: 1fr;
}

.calendar-day-card {
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: #fff;
    padding: 0.8rem;
    min-height: 150px;
}

.calendar-day-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.6rem;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.calendar-event-row {
    border: 1px solid rgba(249, 115, 22, 0.22);
    border-radius: 0.8rem;
    padding: 0.55rem 0.65rem;
    background: var(--color-primary-soft);
}

.calendar-event-title {
    font-weight: 700;
    color: var(--color-text);
}

.calendar-connection-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.calendar-connection-card {
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 0.9rem;
    background: #fff;
}

.error-shell {
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.15), transparent 30%),
        radial-gradient(circle at bottom right, rgba(251, 191, 36, 0.12), transparent 34%),
        linear-gradient(180deg, #fffaf5 0%, #f8fafc 100%);
}

.error-panel {
    width: min(100%, 720px);
    padding: 2rem;
}

.error-brand {
    gap: 1.4rem;
}

.error-code {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary-hover);
}

.error-summary-card {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(249, 115, 22, 0.14);
    border-radius: 1rem;
    background: rgba(255, 247, 237, 0.72);
}

.error-summary-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.error-summary-card p,
.error-support {
    margin: 0;
}

.error-actions {
    justify-content: center;
    margin-top: 1rem;
}

.app-notice-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: min(360px, calc(100vw - 2rem));
}

.app-notice {
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: var(--shadow-lg);
    color: var(--color-text);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-notice-success {
    border-color: #bbf7d0;
    background: var(--color-success-soft);
}

.app-notice-warning {
    border-color: #fdba74;
    background: var(--color-warning-soft);
}

.app-notice.is-leaving {
    opacity: 0;
    transform: translateY(8px);
}

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

select[multiple] {
    min-height: 160px;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.10), transparent 28%),
        radial-gradient(circle at bottom right, rgba(251, 191, 36, 0.10), transparent 32%),
        linear-gradient(180deg, #fffaf5 0%, #f9fafb 100%);
}

.login-panel {
    width: min(100%, 460px);
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: #fff;
    border: 1px solid rgba(249, 115, 22, 0.14);
    box-shadow: var(--shadow-lg);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-brand img {
    width: auto;
    height: 108px;
    max-width: 240px;
    object-fit: contain;
    flex: 0 0 auto;
}

.login-panel .page-title,
.login-panel .page-meta {
    text-align: center;
}

.login-panel form,
.login-panel .helper-text {
    position: relative;
    z-index: 1;
}

.bg-gray-50 {
    background: var(--color-bg);
}

.bg-white {
    background: #fff;
}

.bg-orange-50 {
    background: var(--color-primary-soft);
}

.bg-orange-500 {
    background: var(--color-primary);
}

.text-white {
    color: #fff;
}

.text-gray-800 {
    color: var(--color-text);
}

.text-orange-600 {
    color: var(--color-primary-hover);
}

.border-r {
    border-right-width: 1px;
    border-right-style: solid;
}

.border-b {
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.border-gray-200 {
    border-color: var(--color-border);
}

.rounded-lg {
    border-radius: 0.85rem;
}

.rounded-xl {
    border-radius: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.max-w-screen-2xl {
    max-width: 1500px;
}

.min-h-screen {
    min-height: 100vh;
}

.gap-6 {
    gap: 1.5rem;
}

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

.cursor-pointer {
    cursor: pointer;
}

.hover\:bg-gray-100:hover {
    background: #f3f4f6;
}

.hover\:bg-orange-600:hover {
    background: var(--color-primary-hover);
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.focus\:ring-orange-500:focus {
    border-color: rgba(249, 115, 22, 0.42);
}

.whatsapp-embedded-panel {
    border: 1px solid rgba(34, 197, 94, 0.24);
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 36%);
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
}

.inline-check input {
    width: auto;
}

.text-danger {
    color: var(--color-danger);
}

.sales-progress {
    margin-top: 6px;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e6edf7;
    overflow: hidden;
}

.sales-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0ea5e9 0%, #22c55e 100%);
}

.communication-top-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.communication-tab-panel {
    margin-top: 0;
}

.communication-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
    margin-bottom: 1rem;
}

.communication-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.communication-checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 42px;
}

.communication-checkbox-field input {
    width: auto;
}

.communication-inline-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.85rem;
}

.communication-drawer-panel {
    width: min(1080px, 100%);
}

.communication-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.communication-stepper button {
    min-height: 36px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
}

.communication-stepper button.active {
    border-color: rgba(249, 115, 22, 0.34);
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.communication-step-panel {
    margin-bottom: 1rem;
}

.communication-wizard-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.communication-preview-box {
    margin-top: 0.85rem;
}

.communication-preview-text {
    margin: 0;
    padding: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 0.8rem;
    background: #fff;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "Inter", "Segoe UI", sans-serif;
}

.communication-grid-full {
    grid-column: 1 / -1;
}

.communication-variable-pill {
    min-height: 34px;
    padding: 0.45rem 0.72rem;
}

.orch-header {
    display: grid;
    gap: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, #fffaf5 0%, #ffffff 55%, #f8fafc 100%);
}

.orch-header-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.orch-header-meta {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.orch-header-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
}

.orch-section {
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.orch-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.orch-kpi-card {
    display: grid;
    gap: 0.4rem;
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 1rem;
    padding: 0.95rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.orch-kpi-card:hover,
.orch-kpi-card:focus-visible {
    border-color: rgba(249, 115, 22, 0.45);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.orch-kpi-label {
    font-size: 0.82rem;
    color: #475569;
}

.orch-kpi-value {
    font-size: 1.55rem;
    line-height: 1.1;
}

.orch-kpi-link {
    font-size: 0.8rem;
    color: #b45309;
}

.orch-filter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.orch-filter-actions {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.orch-action-list {
    display: grid;
    gap: 0.65rem;
}

.orch-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 0.92rem;
    padding: 0.82rem 0.9rem;
    background: #fff;
}

.orch-action-item strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.orch-action-item p {
    margin: 0;
    color: #64748b;
    font-size: 0.86rem;
}

.orch-empty {
    background: #fff7ed;
    border-color: rgba(249, 115, 22, 0.28);
}

.orch-top-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.82rem;
}

.orch-top-card {
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 0.92rem;
    padding: 0.92rem;
    background: #fff;
    display: grid;
    gap: 0.4rem;
}

.orch-top-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #334155;
}

.orch-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.78rem;
}

.orch-summary-item {
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 0.82rem;
    background: #fff;
    padding: 0.82rem;
    display: grid;
    gap: 0.35rem;
}

.orch-summary-item span {
    font-size: 0.8rem;
    color: #64748b;
}

.orch-summary-item strong {
    font-size: 1.1rem;
    line-height: 1.2;
}

.cm-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.cm-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.cm-variation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 0.9rem;
    background: #fff;
}

.cm-variation-item p {
    margin: 0.18rem 0 0;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.cm-funnel {
    display: grid;
    gap: 0.7rem;
}

.cm-funnel-row {
    padding: 0.78rem 0.86rem;
    border: 1px solid var(--color-border);
    border-radius: 0.9rem;
    background: #fff;
}

.cm-funnel-row header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
}

.cm-funnel-bar {
    width: 100%;
    height: 11px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.cm-funnel-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ea580c 0%, #16a34a 100%);
}

.cm-signal-list,
.cm-alert-list,
.cm-action-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.cm-signal-item,
.cm-alert-item,
.cm-action-item {
    border: 1px solid var(--color-border);
    border-radius: 0.9rem;
    padding: 0.78rem 0.9rem;
    background: #fff;
}

.cm-signal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.cm-signal-label {
    font-weight: 600;
    color: var(--color-text);
}

.cm-alert-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

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

.cm-action-item p {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
    font-size: 0.83rem;
}

.cm-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.cm-chart-card {
    border: 1px solid var(--color-border);
    border-radius: 0.95rem;
    padding: 0.9rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.cm-chart-card canvas {
    width: 100%;
    display: block;
    margin-top: 0.55rem;
}

.cm-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.cm-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.52rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-muted);
    font-size: 0.74rem;
}

.cm-legend-item i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

@media (max-width: 900px) {
    .orch-header-main,
    .orch-filter-head,
    .orch-action-item {
        flex-direction: column;
        align-items: stretch;
    }

    .orch-header-search,
    .orch-kpi-grid,
    .orch-top-grid,
    .orch-summary-grid,
    .cm-chart-grid {
        grid-template-columns: 1fr;
    }

    .cm-action-item,
    .cm-variation-item,
    .cm-signal-item,
    .cm-alert-head,
    .cm-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 1280px) {
    .grid-4,
    .metrics-grid,
    .kpis,
    .pipeline-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .topbar {
        position: static;
        padding: 1rem;
    }

    .top-search {
        max-width: none;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 900px) {
    .ai-hero {
        grid-template-columns: 1fr;
    }

    .ai-hero-status {
        justify-content: flex-start;
    }

    .grid-3,
    .grid-cols-3,
    .grid-2,
    .grid-4,
    .dual-list,
    .metrics-grid,
    .kpis,
    .form-inline,
    .email-compose-layout,
    .pipeline-overview-grid,
    .cv-viewer-layout,
    .pipeline-add-form,
    .whatsapp-inbox-grid,
<<<<<<< Updated upstream
=======
    .email-conv-filter-grid,
    .communications-filter-grid,
    .email-conv-detail-grid,
>>>>>>> Stashed changes
    .whatsapp-filter-row,
    .calendar-filter-grid,
    .calendar-grid-month,
    .calendar-grid-week,
    .communication-filter-grid,
    .communication-inline-search {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 1rem;
    }

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

    .ficha-header,
    .section-head,
    .top-search,
    .topbar-start,
    .cv-viewer-toolbar,
    .topbar-actions,
    .whatsapp-filter-actions,
<<<<<<< Updated upstream
=======
    .email-conv-filter-actions,
    .communications-filter-actions,
>>>>>>> Stashed changes
    .calendar-filter-actions,
    .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .header-brand {
        padding-right: 0;
    }

    .topbar {
        align-items: stretch;
    }

    .global-sales-kpi {
        min-width: 0;
    }

    .topbar-user-wrap {
        align-self: flex-end;
    }

    .user-dropdown {
        right: 0;
        left: auto;
    }

    .whatsapp-message-bubble {
        width: 100%;
    }
<<<<<<< Updated upstream
=======

.email-conv-message-bubble {
        width: 100%;
    }
>>>>>>> Stashed changes
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.score-badge.score-high {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.score-badge.score-medium {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.score-badge.score-low {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.ats-widget-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ats-widget-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
}

.ats-widget-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

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

.ats-mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}
