:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #667085;
    --line: #d8dee8;
    --primary: #176b87;
    --primary-dark: #0f4e63;
    --danger: #b42318;
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 210px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 Arial, Helvetica, sans-serif;
}

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

.sidebar {
    background: #ffffff;
    border-right: 1px solid var(--line);
    bottom: 0;
    flex: 0 0 var(--sidebar-width);
    left: 0;
    min-height: 100vh;
    overflow-y: auto;
    padding: 18px 14px;
    position: fixed;
    top: 0;
    transition: width .2s ease, box-shadow .2s ease;
    width: var(--sidebar-width);
    z-index: 30;
}

body.sidebar-collapsed .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    bottom: auto;
    box-shadow: 0 8px 24px rgba(31, 41, 51, .12);
    height: 64px;
    min-height: 64px;
    overflow: hidden;
    padding: 12px 18px;
    width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: -4px 0 14px;
    padding: 0 0 14px;
}

.sidebar-logo-button,
.sidebar-menu-button {
    align-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
}

.sidebar-logo-button {
    min-width: 0;
    padding: 4px 0;
}

.sidebar-logo-button:hover,
.sidebar-menu-button:hover {
    opacity: .82;
}

.sidebar-system-logo {
    display: block;
    height: 36px;
    max-width: 142px;
    object-fit: contain;
}

.sidebar-menu-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    flex: 0 0 38px;
    height: 38px;
    padding: 0;
    position: relative;
    width: 38px;
}

.sidebar-menu-button span {
    background: var(--primary-dark);
    border-radius: 999px;
    display: block;
    height: 2px;
    position: absolute;
    width: 17px;
}

.sidebar-menu-button span:nth-child(1) {
    transform: translateY(-6px);
}

.sidebar-menu-button span:nth-child(3) {
    transform: translateY(6px);
}

body.sidebar-collapsed .side-tree {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    border-bottom: 0;
    margin: 0;
    padding: 0;
}

.side-tree details {
    margin-bottom: 8px;
}

.side-tree summary {
    color: #344054;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
    padding: 9px 10px;
}

.side-tree summary::-webkit-details-marker {
    display: none;
}

.side-tree summary::before {
    color: var(--primary);
    content: "▸";
    display: inline-block;
    margin-right: 8px;
    transition: transform .15s ease;
}

.side-tree details[open] summary::before {
    transform: rotate(90deg);
}

.side-tree a {
    border-radius: 6px;
    color: #344054;
    display: block;
    font-weight: 700;
    margin: 2px 0 2px 22px;
    padding: 8px 10px;
    text-decoration: none;
}

.side-tree a:hover {
    background: #eef6f8;
    color: var(--primary-dark);
}

.print-menu summary {
    list-style: none;
}

.print-menu {
    position: relative;
}

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

.print-options {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 230px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(31, 41, 51, 0.12);
    padding: 8px;
    z-index: 30;
}

.print-options a,
.print-options button,
.print-options p,
.print-options strong {
    display: block;
    padding: 8px 10px;
}

.print-options p {
    color: var(--muted);
    margin: 0;
}

.report-option-button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--primary-dark);
    display: block;
    justify-content: flex-start;
    min-height: auto;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.report-option-button:hover {
    background: #eef6f8;
}

.today-grid,
.search-results-grid,
.contact-summary-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.today-card {
    min-height: 260px;
}

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

.timeline-list.compact {
    gap: 8px;
}

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

.timeline-item:hover {
    background: #f8fbfc;
}

.timeline-item small,
.timeline-item em,
.timeline-item span {
    color: var(--muted);
}

.activity-notes-preview {
    color: #475467;
    display: block;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.timeline-item em {
    font-style: normal;
    font-weight: 700;
}

.activity-history-current {
    background: #f0f9ff;
    border-left-color: #0e7490;
}

.summary-list {
    display: grid;
    gap: 8px 14px;
    grid-template-columns: max-content 1fr;
}

.summary-list dt {
    color: var(--muted);
    font-weight: 700;
}

.summary-list dd {
    margin: 0;
}

.search-page-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr auto;
}

.row-action-menu {
    position: relative;
}

.row-action-menu summary {
    list-style: none;
}

.row-action-menu summary::-webkit-details-marker {
    display: none;
}

.row-action-menu > div {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(31, 41, 51, .14);
    display: grid;
    min-width: 170px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 35;
}

.row-action-menu a {
    border-radius: 6px;
    color: var(--primary-dark);
    font-weight: 700;
    padding: 8px 10px;
    text-decoration: none;
    white-space: nowrap;
}

.row-action-menu a:hover {
    background: #eef6f8;
}

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

.pipeline-column {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    border-top: 4px solid var(--stage-color, var(--primary));
    min-height: 220px;
    padding: 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pipeline-column.drag-over {
    border-color: var(--stage-color, var(--primary));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--stage-color, var(--primary)) 24%, transparent);
}

.pipeline-column header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pipeline-column h2 {
    font-size: 16px;
    margin: 0;
}

.pipeline-column header span {
    color: var(--muted);
    font-weight: 800;
}

.pipeline-cards,
.pipeline-card,
.pipeline-card-actions {
    display: grid;
    gap: 10px;
}

.pipeline-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: grab;
    padding: 10px;
}

.pipeline-card.dragging {
    cursor: grabbing;
    opacity: .55;
}

.pipeline-card span,
.pipeline-card small {
    color: var(--muted);
}

.pipeline-card-actions a {
    color: var(--primary-dark);
    font-weight: 800;
}

.tag-chip {
    background: color-mix(in srgb, var(--tag-color, var(--primary)) 12%, white);
    border: 1px solid color-mix(in srgb, var(--tag-color, var(--primary)) 45%, white);
    border-radius: 999px;
    color: var(--tag-color, var(--primary-dark));
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    margin: 2px 4px 2px 0;
    padding: 3px 8px;
}

.attachment-form,
.attachment-list {
    display: grid;
    gap: 10px;
}

.attachment-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    text-decoration: none;
}

.attachment-item small,
.attachment-item span {
    color: var(--muted);
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left .2s ease;
}

body.sidebar-collapsed .app-main {
    margin-left: 0;
}

body.sidebar-collapsed .app-header {
    padding-left: calc(var(--sidebar-collapsed-width) + 24px);
}

.app-header {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 16px;
    grid-template-columns: auto minmax(220px, 520px) 1fr auto auto;
    min-height: 64px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.global-search-form {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.global-search-form input {
    min-width: 0;
    width: 100%;
}

.notification-button {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary-dark);
    display: inline-flex;
    font-weight: 900;
    gap: 4px;
    height: 38px;
    justify-content: center;
    min-width: 38px;
    padding: 0 10px;
    text-decoration: none;
}

.notification-button strong {
    background: var(--danger);
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    min-width: 18px;
    padding: 4px 5px;
    text-align: center;
}

.header-left {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.system-logo-button {
    align-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: flex;
    min-height: 44px;
    padding: 4px 0;
}

.system-logo-button:hover {
    opacity: .82;
}

.header-system-logo {
    display: block;
    height: 34px;
    max-width: 150px;
    object-fit: contain;
}

.icon-navigation-button {
    align-items: center;
    display: inline-flex;
    font-size: 21px;
    height: 42px;
    justify-content: center;
    min-width: 42px;
    padding: 0;
    width: 42px;
}

.calendar-period-navigation {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    margin-bottom: 18px;
}

.calendar-period-title {
    min-width: 0;
    text-align: center;
}

.calendar-period-title h2 {
    margin: 0;
}

.calendar-period-title span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

.company-header-logo {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 44px;
}

.company-header-logo img {
    display: block;
    height: 34px;
    max-width: min(180px, 32vw);
    object-fit: contain;
}

.user-profile-menu {
    justify-self: end;
    position: relative;
}

.user-profile-menu summary {
    align-items: center;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    height: 42px;
    justify-content: center;
    list-style: none;
    width: 42px;
}

.user-profile-menu summary::-webkit-details-marker {
    display: none;
}

.user-avatar {
    background: #eef6f8;
    border: 2px solid #d5e5eb;
    border-radius: 999px;
    display: block;
    height: 38px;
    object-fit: cover;
    overflow: hidden;
    width: 38px;
}

.user-avatar-placeholder {
    position: relative;
}

.user-avatar-placeholder::before {
    background: #7a8b9a;
    border-radius: 999px;
    content: "";
    height: 11px;
    left: 50%;
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    width: 11px;
}

.user-avatar-placeholder::after {
    background: #7a8b9a;
    border-radius: 14px 14px 8px 8px;
    bottom: 7px;
    content: "";
    height: 14px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 22px;
}

.user-profile-dropdown {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(31, 41, 51, .16);
    display: grid;
    gap: 4px;
    min-width: 190px;
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
}

.user-profile-dropdown strong {
    color: var(--text);
    font-size: 14px;
}

.user-profile-dropdown small {
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    margin-bottom: 6px;
    padding-bottom: 8px;
}

.user-profile-dropdown a {
    border-radius: 6px;
    color: var(--text);
    font-weight: 700;
    padding: 8px;
    text-decoration: none;
}

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

.user-photo-field {
    display: grid;
    gap: 8px;
}

.user-photo-field > span {
    color: #344054;
    font-weight: 800;
}

.user-photo-preview {
    align-items: center;
    display: flex;
    min-height: 64px;
}

.user-photo-preview img,
.user-photo-preview .user-avatar {
    height: 58px;
    width: 58px;
}

.page {
    width: min(1680px, calc(100% - 28px));
    margin: 0 auto;
    padding: 22px 0 48px;
}

.app-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    margin: 0 auto;
    padding: 16px;
    text-align: center;
    width: min(1680px, calc(100% - 28px));
}

.public-page {
    width: min(1680px, calc(100% - 28px));
}

.policy-page {
    width: min(860px, calc(100% - 32px));
}

.policy-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
}

.policy-card h1 {
    margin-bottom: 8px;
}

.policy-card h2 {
    border-top: 1px solid var(--line);
    margin: 24px 0 10px;
    padding-top: 20px;
}

.policy-card p,
.policy-card li {
    color: #344054;
}

.policy-card ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.policy-updated {
    color: var(--muted);
    margin-bottom: 20px;
}

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

.section-tools {
    align-items: center;
    display: flex;
    gap: 12px;
}

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

.page-size-form label {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    flex-direction: row;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
}

.page-size-form select {
    min-height: 34px;
    min-width: 78px;
    padding: 5px 8px;
}

.contacts-sticky-head {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    margin: -18px -18px 16px;
    padding: 18px;
    position: sticky;
    top: 64px;
    z-index: 15;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 19px;
    margin-bottom: 14px;
}

p,
.section-head span,
.muted-text {
    color: var(--muted);
}

.contact-lookup-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 6px 0;
}

.contact-lookup-row .button {
    align-self: stretch;
}

.actions,
.filter-actions,
.form-actions,
.row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.panel.form-grid {
    padding-bottom: 0;
}

.panel.form-grid > .form-actions.span-2 {
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    bottom: 0;
    box-shadow: 0 -10px 24px rgba(31, 41, 51, .08);
    justify-content: flex-end;
    margin: 10px -18px 0;
    padding: 12px 18px;
    position: sticky;
    z-index: 18;
}

.panel.form-grid > .form-actions.span-2 .primary {
    min-width: 120px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
}

.icon-button,
.print-menu summary {
    width: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.menu-toggle {
    min-width: 68px;
    padding: 0 12px;
    width: auto;
}

.button.primary,
button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.button.primary:hover,
button.primary:hover {
    background: var(--primary-dark);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}

.user-field-hidden,
.user-column-hidden {
    display: none !important;
}

.field-display-settings {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px 18px;
}

.field-display-settings > summary {
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 700;
}

.field-display-form {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
}

.field-display-help {
    color: var(--muted);
    margin: 0;
}

.field-order-list {
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    max-height: 420px;
    overflow-y: auto;
}

.field-order-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 10px;
}

.field-order-row:last-child {
    border-bottom: 0;
}

.field-order-name {
    min-width: 0;
}

.field-order-controls,
.field-display-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-order-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 17px;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.icon-order-button:disabled {
    cursor: default;
    opacity: .35;
}

.field-display-status {
    color: var(--muted);
}

.grid-column-config {
    border: 0;
    margin: 0;
    padding: 0;
    position: relative;
}

.grid-column-config > summary {
    border: 1px solid var(--line);
    border-radius: 6px;
    min-height: 38px;
    padding: 8px 12px;
}

.grid-column-config .filter-config-grid {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(31, 41, 51, 0.12);
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(560px, 88vw);
    z-index: 31;
}

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

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

.span-2 {
    grid-column: span 2;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #344054;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

textarea {
    resize: vertical;
}

.html-editor {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.html-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.html-editor-button {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    padding: 6px 10px;
    cursor: pointer;
}

.html-editor-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.html-editor-surface {
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    overflow: auto;
}

.html-editor-surface:focus {
    outline: 2px solid rgba(25, 118, 210, .18);
    border-color: var(--primary);
}

.html-editor-surface img {
    max-width: 100%;
    height: auto;
}

.html-editor-status {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.html-editor-source-shell {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: #f8fafc;
}

.html-editor-source-shell summary {
    cursor: pointer;
    font-weight: 700;
}

.html-editor-source {
    width: 100%;
    margin-top: 8px;
    font-family: Consolas, Monaco, monospace;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    min-height: 16px;
}

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

.filter-actions {
    align-self: end;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
    table-layout: fixed;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #475467;
    font-size: 13px;
    position: relative;
    text-transform: uppercase;
}

.draggable-column {
    cursor: grab;
    user-select: none;
}

.draggable-column:active {
    cursor: grabbing;
}

.column-resize-handle {
    bottom: 0;
    cursor: col-resize;
    position: absolute;
    right: -4px;
    top: 0;
    width: 9px;
    z-index: 2;
}

.column-resize-handle::after {
    background: transparent;
    bottom: 8px;
    content: "";
    position: absolute;
    right: 4px;
    top: 8px;
    width: 2px;
}

.column-resize-handle:hover::after,
body.column-resizing .column-resize-handle::after {
    background: var(--primary);
}

body.column-resizing {
    cursor: col-resize;
    user-select: none;
}

.contacts-table {
    min-width: 1580px;
    table-layout: auto;
}

.contacts-table [data-col="select"] {
    text-align: center;
    width: 44px;
}

.contacts-table [data-col="company"] {
    width: 150px;
}

.contacts-table [data-col="name"] {
    width: 120px;
}

.contacts-table [data-col="birthday"] {
    width: 110px;
}

.contacts-table [data-col="email"] {
    width: 210px;
}

.contacts-table [data-col="city_state"] {
    width: 150px;
}

.contacts-table [data-col="country"] {
    width: 90px;
}

.contacts-table [data-col="mobile"],
.contacts-table [data-col="phone"] {
    white-space: nowrap;
    width: 170px;
}

.contacts-table [data-col="action_email"],
.contacts-table [data-col="action_agenda"],
.contacts-table [data-col="action_edit"],
.contacts-table [data-col="action_link"],
.contacts-table [data-col="action_delete"] {
    min-width: 54px;
    white-space: nowrap;
    width: 54px;
}

.contacts-table td {
    overflow-wrap: anywhere;
}

.contacts-table [data-col^="action_"] {
    overflow-wrap: normal;
    word-break: keep-all;
}

.table-action-cell {
    text-align: center;
    white-space: nowrap;
}

.table-action-cell .small-button {
    color: var(--primary-dark);
    display: inline-flex;
    min-height: 30px;
    min-width: 82px;
    padding: 5px 10px;
    white-space: nowrap;
    width: auto;
    word-break: keep-all;
}

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

.inline-date-form {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    min-width: 210px;
}

.inline-date-form input[type="date"] {
    min-width: 132px;
    padding: 6px 8px;
}

.table-date-input {
    min-width: 132px;
    padding: 7px 8px;
}

.table-money-input {
    max-width: 86px;
    min-width: 74px;
    padding: 7px 8px;
    text-align: right;
}

.table-action-cell .danger-button {
    border-color: #fecdca;
    color: var(--danger);
}

.icon-action-button {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--primary-dark);
    cursor: pointer;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    width: 34px;
}

.icon-action-button:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

.icon-action-button svg,
.contacts-table th[data-col^="action_"] svg {
    display: block;
    height: 18px;
    width: 18px;
}

.icon-action-button svg path,
.contacts-table th[data-col^="action_"] svg path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.icon-action-button svg circle,
.contacts-table th[data-col^="action_"] svg circle {
    fill: currentColor;
}

.danger-icon-action {
    border-color: #fecdca;
    color: var(--danger);
}

.contacts-table th[data-col^="action_"] {
    color: var(--primary-dark);
    text-align: center;
}

.contacts-table [data-col="action_quick"] {
    min-width: 54px;
    width: 54px;
}

.row-action-menu > summary.button.small-button {
    font-size: 0;
    min-width: 34px;
    padding: 0;
    width: 34px;
}

.row-action-menu > summary.button.small-button::before {
    content: "...";
    font-size: 18px;
    line-height: 1;
}

.pagination {
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
}

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

.pagination-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination .small-button {
    min-width: 38px;
}

.pagination .active-page {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.pagination .disabled {
    opacity: .45;
    pointer-events: none;
}

.pagination-gap {
    padding: 0 4px;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.alert {
    border: 1px solid #fecdca;
    border-radius: 8px;
    background: #fffbfa;
    color: var(--danger);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.success {
    border: 1px solid #abefc6;
    border-radius: 8px;
    background: #f6fef9;
    color: #067647;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.client-access-row {
    align-items: end;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(160px, 1fr) 130px 180px 210px minmax(190px, 1fr) auto;
    padding: 16px 0;
}

.client-access-row:first-of-type {
    border-top: 0;
}

.client-name {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.inline-company-selector {
    margin-bottom: 16px;
    max-width: 560px;
}

.settings-divider {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 18px;
}

.settings-divider h2 {
    margin: 0;
}

.module-license-selector {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
}

.module-license-selector legend {
    font-weight: 700;
    padding: 0 7px;
}

.license-option {
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 12px;
}

.license-option input {
    margin-top: 4px;
}

.license-option span {
    display: grid;
    gap: 4px;
}

.license-option small {
    color: var(--muted);
    font-weight: 400;
}

.public-fields-selector {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 14px;
}

.public-fields-selector legend {
    font-weight: 700;
    padding: 0 7px;
}

.copy-link-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.copy-link-row input {
    flex: 1;
}

.share-result {
    margin-bottom: 16px;
}

.public-contact-shell {
    margin: 30px auto;
    max-width: 760px;
}

.public-contact-header {
    margin: 0 auto 20px;
    max-width: 310px;
}

.public-contact-header img {
    display: block;
    height: auto;
    width: 100%;
}

.public-contact-toolbar {
    margin-bottom: 16px;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px;
}

.status-active {
    background: #ecfdf3;
    color: #067647;
}

.status-blocked {
    background: #fef3f2;
    color: var(--danger);
}

.status-temporary {
    background: #fffaeb;
    color: #b54708;
}

.certificate-status-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 12px 14px;
}

.certificate-status-card strong {
    color: #344054;
}

.certificate-status-card span {
    font-weight: 700;
}

.certificate-status-card small {
    color: var(--muted);
    line-height: 1.45;
}

.certificate-status-valid {
    background: #ecfdf3;
    border-color: #abefc6;
}

.certificate-status-warning {
    background: #fffaeb;
    border-color: #fedf89;
}

.certificate-status-expired {
    background: #fef3f2;
    border-color: #fecdca;
}

.setup-steps {
    color: #344054;
    margin: 0 0 12px 18px;
    padding: 0;
}

.setup-steps li {
    margin-bottom: 8px;
}

.helper-intro {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.helper-intro div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.helper-intro h2 {
    font-size: 15px;
    margin-bottom: 6px;
}

.helper-intro code,
.helper-table code {
    overflow-wrap: anywhere;
}

.helper-warning ul,
.helper-steps {
    color: #344054;
    margin: 0;
}

.helper-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.helper-steps {
    counter-reset: helperStep;
    list-style: none;
    padding: 0;
}

.helper-steps > li {
    border-top: 1px solid var(--line);
    counter-increment: helperStep;
    display: grid;
    gap: 10px;
    padding: 18px 0;
}

.helper-steps > li:first-child {
    border-top: 0;
    padding-top: 0;
}

.helper-steps h3 {
    align-items: center;
    display: flex;
    font-size: 17px;
    gap: 10px;
    margin: 0;
}

.helper-steps h3::before {
    align-items: center;
    background: var(--primary);
    border-radius: 999px;
    color: #fff;
    content: counter(helperStep);
    display: inline-flex;
    flex: 0 0 28px;
    font-size: 13px;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.helper-shot {
    background:
        linear-gradient(90deg, #eef6f8 0 24%, transparent 24%),
        linear-gradient(#ffffff, #f8fafc);
    border: 1px solid #cbd8e5;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
    display: grid;
    gap: 10px;
    min-height: 132px;
    padding: 18px 18px 18px 30%;
    position: relative;
}

.helper-shot::before {
    background: #176b87;
    border-radius: 5px;
    color: #fff;
    content: "print ilustrativo";
    font-size: 12px;
    font-weight: 800;
    left: 16px;
    padding: 5px 8px;
    position: absolute;
    top: 16px;
}

.helper-shot span,
.helper-shot strong,
.helper-shot em {
    align-items: center;
    border-radius: 7px;
    display: flex;
    min-height: 34px;
    padding: 8px 12px;
}

.helper-shot span {
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-weight: 800;
}

.helper-shot strong {
    background: #e9f7fb;
    border: 2px solid #176b87;
    color: #0f4e63;
}

.helper-shot em {
    background: #fff7e6;
    border: 2px solid #f2b94b;
    color: #8a5b00;
    font-style: normal;
    font-weight: 800;
    width: fit-content;
}

.helper-shot.two-columns,
.helper-shot.three-blocks,
.helper-shot.ids-shot,
.helper-shot.webhook-shot,
.helper-shot.token-shot,
.helper-shot.template-shot,
.helper-shot.test-shot,
.helper-shot.video-shot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.helper-shot.two-columns span,
.helper-shot.three-blocks span,
.helper-shot.ids-shot span,
.helper-shot.webhook-shot span,
.helper-shot.token-shot span,
.helper-shot.template-shot span,
.helper-shot.test-shot span,
.helper-shot.video-shot span {
    grid-column: 1 / -1;
}

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

.helper-table th,
.helper-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.helper-table th {
    background: #f8fafc;
    color: #344054;
}

.helper-copy-box {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.helper-copy-box p {
    color: #344054;
}

.phone-cell {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.whatsapp-icon {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    text-decoration: none;
    width: 30px;
}

.whatsapp-icon img {
    display: block;
    height: 24px;
    width: 24px;
}

.whatsapp-icon-denied {
    background: #fee4e2;
    border: 1px solid #fda29b;
}

.whatsapp-icon-denied img {
    filter: grayscale(1) sepia(1) saturate(7) hue-rotate(315deg) brightness(.85);
}

.chat-panel {
    background: #eef6f2;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 560px;
    overflow: hidden;
}

.chat-send-tabs {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.chat-compose[hidden] {
    display: none;
}

.template-send-form {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    padding-top: 14px;
}

.template-send-form[hidden] {
    display: none;
}

.template-send-form label,
#whatsapp_template_parameters {
    display: grid;
    gap: 6px;
}

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

.template-preview {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

.template-variable-button {
    border: 1px solid #cbd8e5;
    background: #f7fafc;
    color: #17324d;
    padding: 7px 9px;
    border-radius: 5px;
    text-align: left;
    cursor: pointer;
}

.template-variable-button:hover {
    border-color: #16718a;
    background: #eef8fa;
}

.whatsapp-template-message-cell {
    min-width: 260px;
    max-width: 420px;
    white-space: normal;
}

.inline-edit-menu {
    position: relative;
}

.inline-edit-menu > summary {
    list-style: none;
}

.inline-template-settings {
    position: absolute;
    z-index: 20;
    right: 0;
    width: min(320px, 85vw);
    padding: 14px;
    border: 1px solid #cbd8e5;
    background: #fff;
    box-shadow: 0 12px 28px rgba(21, 42, 64, .16);
}

.inline-template-settings label {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.template-preview p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

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

.integration-asset-summary div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

.integration-asset-summary span,
.integration-asset-summary strong {
    display: block;
    overflow-wrap: anywhere;
}

.integration-asset-summary span {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.integration-webhook-box {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 10px 12px;
}

.integration-webhook-box span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.integration-webhook-box strong {
    overflow-wrap: anywhere;
}

.template-status {
    border-radius: 999px;
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
}

.template-status.status-approved {
    background: #e3f5ec;
    color: #067647;
}

.template-status.status-rejected,
.template-status.status-disabled {
    background: #fee4e2;
    color: var(--danger);
}

@media (max-width: 700px) {
    .app-header {
        grid-template-columns: auto 1fr auto;
        gap: 10px;
        padding: 8px 12px;
    }

    .global-search-form {
        grid-column: 1 / -1;
        order: 3;
    }

    .today-grid,
    .search-results-grid,
    .contact-summary-grid,
    .search-page-form {
        grid-template-columns: 1fr;
    }

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

    #whatsapp_template_parameters,
    .integration-asset-summary,
    .helper-intro {
        grid-template-columns: 1fr;
    }

    .helper-shot,
    .helper-shot.two-columns,
    .helper-shot.three-blocks,
    .helper-shot.ids-shot,
    .helper-shot.webhook-shot,
    .helper-shot.token-shot,
    .helper-shot.template-shot,
    .helper-shot.test-shot,
    .helper-shot.video-shot {
        background: #f8fafc;
        grid-template-columns: 1fr;
        padding: 56px 12px 12px;
    }
}

.chat-thread {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
}

.chat-bubble {
    border-radius: 8px;
    max-width: min(680px, 86%);
    padding: 10px 12px;
}

.chat-bubble p {
    color: var(--text);
}

.chat-media-link {
    display: block;
}

.chat-media-image {
    border-radius: 8px;
    display: block;
    max-height: 320px;
    max-width: 100%;
    object-fit: contain;
}

.chat-media-video {
    border-radius: 8px;
    display: block;
    max-height: 320px;
    max-width: 100%;
}

.chat-media-audio {
    display: block;
    max-width: 100%;
    min-width: min(280px, 100%);
}

.chat-media-download {
    margin-bottom: 6px;
    width: fit-content;
}

.chat-bubble span,
.chat-bubble small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 6px;
}

.chat-bubble.incoming {
    align-self: flex-start;
    background: #ffffff;
}

.chat-bubble.outgoing {
    align-self: flex-end;
    background: #d9fdd3;
}

.chat-compose {
    align-items: flex-end;
    background: #ffffff;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    padding: 12px;
}

.chat-media-compose label {
    flex: 0 0 260px;
}

.whatsapp-authorization-select {
    flex: 0 0 230px;
}

.chat-dock {
    bottom: 0;
    pointer-events: none;
    position: fixed;
    right: 0;
    z-index: 80;
}

.chat-popup {
    background: #eef6f2;
    border: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
    bottom: 0;
    box-shadow: 0 16px 38px rgba(31, 41, 51, 0.2);
    display: flex;
    flex-direction: column;
    height: 500px;
    overflow: hidden;
    position: fixed;
    width: 320px;
    z-index: 90;
}

.chat-popup-head {
    align-items: center;
    background: #176b87;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    min-height: 52px;
    padding: 9px 12px;
}

.chat-popup-head strong,
.chat-popup-head span {
    display: block;
}

.chat-popup-head span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
}

.chat-popup-actions {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.chat-popup-head button {
    background: transparent;
    border: 0;
    color: #ffffff;
    font-size: 24px;
    min-height: 32px;
    padding: 0 4px;
}

.chat-popup-head .chat-register-contact {
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    font-size: 18px;
    height: 30px;
    line-height: 1;
    width: 30px;
}

.chat-full-link {
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 8px;
    text-decoration: none;
}

.chat-window-alert {
    background: #fffaeb;
    border-top: 1px solid #fedf89;
    color: #93370d;
    font-size: 12px;
    padding: 8px 10px;
}

.chat-window-alert.is-open {
    background: #ecfdf3;
    border-top-color: #abefc6;
    color: #067647;
}

.chat-popup-thread {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 12px;
}

.chat-popup .chat-bubble {
    max-width: 88%;
}

.chat-popup-compose {
    align-items: flex-end;
    background: #ffffff;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
    padding: 10px;
}

.chat-attach-button {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary-dark);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 34px;
    font-size: 21px;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 34px;
}

.chat-attach-button input {
    cursor: pointer;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

.chat-whatsapp-authorization {
    flex: 0 0 96px;
    min-height: 34px;
    padding: 4px 6px;
}

.chat-popup-compose textarea {
    min-height: 44px;
}

.chat-queue-indicator {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    bottom: 18px;
    box-shadow: 0 12px 28px rgba(31, 41, 51, 0.14);
    color: var(--text);
    display: none;
    flex-direction: column;
    min-height: 52px;
    padding: 8px 12px;
    position: fixed;
    right: 18px;
    z-index: 75;
}

.chat-queue-indicator.has-items {
    display: flex;
}

.chat-queue-indicator::after {
    align-items: center;
    background: #d92d20;
    border-radius: 999px;
    color: #ffffff;
    content: attr(data-unread);
    display: flex;
    font-size: 12px;
    font-weight: 800;
    height: 22px;
    justify-content: center;
    min-width: 22px;
    padding: 0 6px;
    position: absolute;
    right: -8px;
    top: -8px;
}

.chat-queue-indicator[data-unread="0"]::after {
    display: none;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(380px, 100%);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    overflow: hidden;
    padding: 24px;
}

.login-links {
    font-size: 13px;
    text-align: center;
}

.login-system-logo {
    display: block;
    height: 116px;
    justify-self: center;
    max-width: 332px;
    object-fit: contain;
    width: 100%;
}

.login-company-logo {
    border-top: 1px solid var(--line);
    display: block;
    height: 82px;
    justify-self: center;
    max-width: 320px;
    object-fit: contain;
    padding-top: 12px;
    width: auto;
}

.filter-config {
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
    padding-bottom: 14px;
}

.filters-panel {
    padding: 0;
}

.filters-shell {
    padding: 18px;
}

.filters-shell > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
}

.filters-shell > summary::-webkit-details-marker {
    display: none;
}

.filters-shell > summary span {
    color: var(--text);
    font-size: 19px;
    font-weight: 800;
}

.filters-shell > summary small {
    color: var(--muted);
    font-weight: 700;
}

.filters-shell > summary::after {
    color: var(--primary);
    content: "Abrir";
    font-size: 13px;
    font-weight: 800;
}

.filters-shell[open] > summary {
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.filters-shell[open] > summary::after {
    content: "Recolher";
}

.filter-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px;
}

.filter-group summary {
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

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

.filter-group .filter-grid {
    margin-top: 14px;
}

.filter-config summary {
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.filter-config-grid {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 12px;
}

.checkbox-line.compact {
    padding-top: 0;
}

.logo-preview {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed var(--line);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 120px;
    padding: 18px;
}

.logo-preview img {
    max-height: 96px;
    max-width: 320px;
    object-fit: contain;
}

.calendar-grid {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(7, minmax(130px, 1fr));
    overflow-x: auto;
}

.calendar-week-grid {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(7, minmax(180px, 1fr));
    overflow-x: auto;
}

.calendar-grid.calendar-business-days,
.calendar-week-grid.calendar-business-days {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.calendar-weekday,
.calendar-day {
    background: #f8fafc;
    min-height: 44px;
    padding: 10px;
}

.calendar-day {
    min-height: 138px;
}

.calendar-date {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
    margin-bottom: 8px;
    min-height: auto;
    padding: 0;
    text-align: left;
}

.calendar-day-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.calendar-add-button {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: 800;
    height: 26px;
    line-height: 1;
    min-height: 26px;
    padding: 0;
    width: 26px;
}

.muted-day {
    opacity: .55;
}

.calendar-day.holiday-day,
.calendar-day-slot.holiday-day {
    background: #eaf8ef;
    border-color: #9fd5af;
}

.calendar-holiday-name {
    color: #176b45;
    display: block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 7px;
}

.calendar-business-days-option {
    align-self: end;
    padding-top: 0;
}

.calendar-event {
    background: #ffffff;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    color: var(--text);
    display: block;
    margin-bottom: 6px;
    padding: 7px 8px;
    text-decoration: none;
}

.calendar-more-link {
    align-items: center;
    background: #e7f3f5;
    border: 1px solid #b8dce3;
    border-radius: 6px;
    color: var(--primary-dark);
    display: flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    min-height: 32px;
    padding: 6px 8px;
    text-align: center;
    text-decoration: none;
}

.calendar-event.type-birthday {
    border-left-color: #d97706;
}

.calendar-event.type-visit {
    border-left-color: #176b87;
}

.calendar-event.type-call {
    border-left-color: #6941c6;
}

.calendar-event.type-whatsapp {
    border-left-color: #128c7e;
}

.calendar-event.type-follow_up {
    border-left-color: #067647;
}

.calendar-event.type-other {
    border-left-color: #475467;
}

.calendar-event.type-custom {
    border-left-color: #176b87;
}

.calendar-event-context {
    color: var(--text);
    display: block;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.calendar-event-details {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

.calendar-event-notes {
    color: #475467;
    display: block;
    font-size: 11px;
    line-height: 1.3;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.calendar-event-type {
    color: #667085;
    display: block;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 4px;
}

.calendar-event.done {
    border-left-color: #067647;
}

.calendar-event.cancelled {
    border-left-color: var(--danger);
}

.calendar-block {
    background: #fff4e5;
    border: 1px solid #f7c97b;
    border-left: 4px solid #b54708;
    border-radius: 6px;
    color: #7a2e0e;
    margin-bottom: 6px;
    padding: 6px 8px;
}

.calendar-block strong,
.calendar-block span {
    display: block;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.calendar-block span {
    color: #93370d;
    margin-top: 2px;
}

.calendar-block-modal-card {
    max-width: 760px;
    width: min(760px, 100%);
}

.calendar-block-list {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 16px;
}

.calendar-block-list h3 {
    font-size: 16px;
    margin: 0 0 10px;
}

.calendar-block-list-item {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 10px 0;
}

.calendar-block-list-item span,
.calendar-block-list-item small {
    color: var(--muted);
    display: block;
    margin-top: 2px;
}

.calendar-filter-bar {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

.calendar-filter-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
    padding: 12px;
}

.calendar-filter-section h2,
.activity-type-filter legend {
    color: #344054;
    font-size: 14px;
    font-weight: 800;
    margin: 0 0 10px;
    padding: 0;
}

.activity-type-filter legend {
    padding: 0 6px;
}

.calendar-filter-fields {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.calendar-filter-fields.single-field {
    grid-template-columns: minmax(220px, 520px);
}

.activity-type-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.activity-type-chip {
    align-items: center;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 999px;
    color: #344054;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    white-space: nowrap;
}

.activity-type-chip input {
    min-height: auto;
    width: auto;
}

.activity-type-chip.type-birthday {
    border-left-color: #d97706;
}

.activity-type-chip.type-visit {
    border-left-color: #176b87;
}

.activity-type-chip.type-call {
    border-left-color: #6941c6;
}

.activity-type-chip.type-whatsapp {
    border-left-color: #128c7e;
}

.activity-type-chip.type-follow_up {
    border-left-color: #067647;
}

.activity-type-chip.type-other {
    border-left-color: #475467;
}

.activity-type-chip.type-custom {
    border-left-color: #176b87;
}

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

.calendar-day-view {
    display: grid;
    gap: 16px;
    grid-template-columns: 220px minmax(0, 1fr);
}

.calendar-day-slot {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 160px;
    padding: 14px;
}

.calendar-day-slot span {
    color: var(--muted);
    font-weight: 400;
}

.calendar-agenda-list {
    display: grid;
    gap: 8px;
}

.dashboard-filters {
    margin-bottom: 18px;
}

.dashboard-status-chip {
    align-items: center;
    border: 1px solid var(--line);
    border-left: 4px solid #176b87;
    border-radius: 999px;
    color: #344054;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    white-space: nowrap;
}

.dashboard-status-chip input {
    min-height: auto;
    width: auto;
}

.dashboard-status-chip.status-done {
    border-left-color: #067647;
}

.dashboard-status-chip.status-cancelled {
    border-left-color: var(--danger);
}

.dashboard-kpis {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(126px, 1fr));
    margin-bottom: 18px;
}

.dashboard-kpi {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 104px;
    padding: 14px 16px;
}

.dashboard-kpi span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-kpi strong {
    color: var(--text);
    font-size: 30px;
    line-height: 1.1;
}

.dashboard-kpi small {
    color: var(--muted);
}

.dashboard-kpi.highlight {
    border-top: 4px solid #067647;
    padding-top: 11px;
}

.dashboard-widget-settings {
    margin-bottom: 18px;
}

.dashboard-content {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(420px, 1.32fr) minmax(300px, .78fr);
}

.dashboard-content > .panel {
    min-width: 0;
}

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

.dashboard-insight-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    min-height: 132px;
    padding: 14px;
}

.dashboard-insight-card span {
    color: #475467;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-insight-card strong {
    color: var(--primary-dark);
    font-size: 30px;
    line-height: 1;
}

.dashboard-insight-card small {
    color: var(--muted);
}

.dashboard-insight-card.warning {
    background: #fffbeb;
    border-color: #fedf89;
}

.dashboard-insight-card.ok {
    background: #f6fef9;
    border-color: #abefc6;
}

.touch-ranking {
    display: grid;
    gap: 11px;
    margin: 16px 0 20px;
}

.touch-ranking-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(110px, 170px) minmax(100px, 1fr) 38px;
}

.touch-ranking-row small {
    color: var(--muted);
    font-size: 12px;
    grid-column: 2 / -1;
    margin-top: -8px;
}

.touch-ranking-label {
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.touch-bar-track {
    background: #e4edf0;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.touch-bar-track span {
    background: #176b87;
    border-radius: inherit;
    display: block;
    height: 100%;
}

.dashboard-note {
    font-size: 12px;
    margin-bottom: 14px;
}

.dashboard-summary-table {
    max-height: 330px;
    overflow-y: auto;
}

.touch-latest-list {
    display: grid;
    gap: 1px;
}

.touch-latest-row {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(130px, 1fr) auto;
    padding: 11px 0;
}

.touch-latest-row div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.touch-latest-row small {
    color: var(--muted);
    font-size: 12px;
}

.touch-latest-row > small {
    grid-column: 1 / -1;
}

.touch-status {
    align-self: start;
    background: #e7f3f5;
    border-radius: 999px;
    color: #176b87;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 8px;
}

.touch-status.status-done {
    background: #e3f5ec;
    color: #067647;
}

.touch-status.status-cancelled {
    background: #fee4e2;
    color: var(--danger);
}

.modal-backdrop {
    align-items: center;
    background: rgba(31, 41, 51, .42);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 20px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 80;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 24px 56px rgba(31, 41, 51, .24);
    max-height: calc(100vh - 40px);
    max-width: 680px;
    overflow: auto;
    padding: 18px;
    width: min(680px, 100%);
}

.quick-contact-modal-card {
    border-radius: 6px;
    height: calc(100vh - 24px);
    max-height: none;
    max-width: none;
    overflow: hidden;
    padding: 14px 18px 18px;
    width: calc(100vw - 24px);
}

.quick-contact-modal-card iframe {
    border: 0;
    height: calc(100% - 48px);
    width: 100%;
}

.nested-modal-backdrop {
    z-index: 90;
}

.standalone-form .page {
    max-width: none;
    padding: 10px 14px 20px;
}

.standalone-form .panel {
    box-shadow: none;
}

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

.quick-contact-success {
    margin: 24px;
}

.label-with-action {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

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

.modal-head h2 {
    margin: 0;
}

.report-parameter-card .form-grid {
    margin: 16px 0;
}

.report-no-parameters {
    margin: 16px 0;
}

.report-library {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.report-card {
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-between;
    min-height: 150px;
    padding: 16px;
}

.report-card h3 {
    font-size: 17px;
    margin: 5px 0 8px;
}

.report-card small {
    color: var(--muted);
    font-weight: 700;
}

.inline-setting-form select {
    min-width: 210px;
}

.smtp-test-card {
    display: grid;
    gap: 14px;
}

.smtp-test-result {
    white-space: pre-line;
}

.import-columns {
    margin-top: 18px;
}

.subtle-alert {
    margin: 0;
}

.backup-repository-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 12px;
}

.backup-repository-card > summary {
    cursor: pointer;
    font-weight: 700;
    padding: 14px 16px;
}

.backup-repository-card > .backup-repository-form {
    border-top: 1px solid var(--border);
    padding: 16px;
}

.import-error-list {
    color: var(--danger);
    display: grid;
    gap: 8px;
    margin: 14px 0 0;
    padding-left: 22px;
}

.checkbox-line {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding-top: 28px;
}

.checkbox-line input,
.check-cell input {
    width: auto;
    min-height: auto;
}

.permission-box {
    border-top: 1px solid var(--line);
    margin-top: 6px;
    padding-top: 16px;
}

.nested-form-grid {
    border: 0;
    padding: 0;
    width: 100%;
}

.product-selection {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
    padding: 12px;
}

.product-selection legend {
    color: #344054;
    font-weight: 800;
    padding: 0 6px;
}

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

.owner-goals-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
    padding: 14px;
}

.owner-goals-box legend {
    color: #344054;
    font-weight: 800;
    padding: 0 6px;
}

.owner-goals-list {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.copy-goals-panel {
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto;
    padding: 14px;
}

.copy-goals-panel p {
    margin: 5px 0 0;
}

.owner-goal-row {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr) minmax(100px, 140px) auto;
}

.variable-docs {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.variable-grid {
    display: grid;
    gap: 8px 14px;
    grid-template-columns: minmax(180px, 240px) 1fr;
    margin-top: 12px;
}

.variable-grid code {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--primary-dark);
    padding: 6px 8px;
}

.permission-grid {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) repeat(4, 100px);
    gap: 1px;
    overflow-x: auto;
}

.owner-permission-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 80px repeat(4, 100px);
    gap: 1px;
    overflow-x: auto;
}

.company-permission-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 100px 140px;
    gap: 1px;
    overflow-x: auto;
}

.resource-permission-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 120px 150px;
    gap: 1px;
    overflow-x: auto;
}

.permission-grid > *,
.owner-permission-grid > *,
.company-permission-grid > *,
.resource-permission-grid > * {
    background: #f8fafc;
    min-height: 40px;
    padding: 10px;
}

.permission-column-toggle {
    background: #f8fafc;
    border: 0;
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 800;
    justify-content: flex-start;
    min-height: 40px;
    padding: 10px;
}

.check-cell {
    align-items: center;
    justify-content: center;
}

.pre-line {
    white-space: pre-line;
}

@media (max-width: 1280px) {
    .calendar-filter-bar {
        grid-template-columns: 1fr;
    }

    .activity-type-filter {
        grid-column: auto;
    }

    .dashboard-kpis {
        grid-template-columns: repeat(3, minmax(126px, 1fr));
    }

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

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

@media (max-width: 1024px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        bottom: 0;
        box-shadow: 0 18px 40px rgba(31, 41, 51, .22);
        left: 0;
        position: fixed;
        top: 0;
        transform: translateX(0);
        transition: transform .2s ease, width .2s ease, height .2s ease;
        width: 270px;
    }

    body.sidebar-collapsed .sidebar {
        border-bottom: 1px solid var(--line);
        border-right: 0;
        bottom: auto;
        box-shadow: 0 8px 24px rgba(31, 41, 51, .12);
        height: 64px;
        min-height: 64px;
        overflow: hidden;
        padding: 12px 18px;
        transform: none;
        width: 100%;
    }

    .app-main,
    body.sidebar-collapsed .app-main {
        margin-left: 0;
        padding-top: 64px;
    }

    body:not(.sidebar-collapsed) .app-main {
        padding-top: 0;
    }

    body.sidebar-collapsed .sidebar-brand {
        border-bottom: 0;
        margin: 0;
        padding: 0;
    }

    body.sidebar-collapsed .sidebar-system-logo {
        height: 36px;
        max-width: 142px;
    }

    .app-header {
        gap: 12px;
        grid-template-columns: auto 1fr auto;
        padding: 14px 18px;
    }

    .header-system-logo {
        height: 30px;
        max-width: 124px;
    }

    .company-header-logo img {
        height: 30px;
        max-width: 120px;
    }

    .user-profile-dropdown {
        right: -4px;
    }

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

    .contacts-sticky-head {
        top: 72px;
    }

    .filter-grid,
    .form-grid,
    .calendar-filter-bar,
    .calendar-day-view {
        grid-template-columns: 1fr;
    }

    .client-access-row {
        grid-template-columns: 1fr;
    }

    .public-fields-selector {
        grid-template-columns: 1fr;
    }

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

    .touch-ranking-row {
        grid-template-columns: minmax(90px, 120px) minmax(72px, 1fr) 34px;
    }

    .owner-goal-row {
        grid-template-columns: 1fr;
    }

    .copy-goals-panel {
        grid-template-columns: 1fr;
    }

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

    .copy-link-row {
        flex-direction: column;
    }

    .span-2 {
        grid-column: span 1;
    }

    .chat-popup {
        height: 70vh;
        left: 12px;
        right: 12px !important;
        width: auto;
    }

    .panel.form-grid > .form-actions.span-2 {
        justify-content: stretch;
    }

.panel.form-grid > .form-actions.span-2 .button,
    .panel.form-grid > .form-actions.span-2 button {
        flex: 1 1 130px;
    }
}

.contact-form-tabs {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
}

.contact-form-tab {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px 8px 0 0;
    color: #334155;
    cursor: pointer;
    font-weight: 700;
    padding: 10px 16px;
}

.contact-form-tab.active {
    background: #ffffff;
    border-bottom-color: #ffffff;
    color: #0f5970;
}

.contact-tab-panel[hidden] {
    display: none;
}

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

.audit-summary-grid div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.audit-summary-grid span {
    color: #64748b;
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.audit-summary-grid strong {
    color: #0f172a;
    display: block;
    overflow-wrap: anywhere;
}

.audit-value-cell {
    max-width: 320px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

@media (max-width: 900px) {
    .contact-form-tabs {
        align-items: stretch;
        flex-direction: column;
    }

    .contact-form-tab {
        border-radius: 8px;
        text-align: left;
    }

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