:root {
    --bg: #f7f8f8;
    --line: #e1e5e8;
    --text: #2f3437;
    --muted: #728089;
    --brand-dark: #505050;
    --accent: #f07030;
    --accent-soft: #fff1eb;
    --blue: var(--accent);
    --card: #ffffff;
    --danger: #d93025;
    --shadow: 0 1px 2px rgba(47, 52, 55, .08);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

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

input,
select,
textarea,
[contenteditable="true"],
.mail-preview-meta,
.mail-preview-modal textarea {
    user-select: text;
}

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

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

.topbar,
.subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
}

.topbar {
    min-height: 54px;
    border-top: 3px solid var(--accent);
}

.app-brand {
    min-width: 0;
}

.app-title {
    min-width: 0;
    overflow: hidden;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand,
.brand-row,
.top-actions,
.left-tools,
.tabs,
.metrics {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    color: var(--brand-dark);
}

.brand-logo-img {
    display: block;
    width: auto;
    height: 32px;
    object-fit: contain;
}

.login-brand-logo {
    height: 40px;
}

.filter-button,
.info-dot,
.icon-button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--brand-dark);
}

.top-actions {
    color: #334155;
    font-size: 12px;
}

.top-actions .disabled,
.tabs .disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.locked-field {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.avatar,
.brand-mark {
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    overflow: hidden;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    font-weight: 700;
    line-height: 1;
}

.avatar img,
.account-face img,
.profile-avatar-preview img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.account-menu {
    position: relative;
}

.notification-menu {
    position: relative;
}

.help-menu {
    position: relative;
}

.notification-trigger,
.help-trigger {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.notification-trigger svg {
    width: 17px;
    height: 17px;
}

.help-trigger {
    font-size: 14px;
    font-weight: 800;
}

.notification-trigger:hover,
.help-trigger:hover,
.notification-menu.open .notification-trigger {
    box-shadow: 0 0 0 3px rgba(240, 112, 48, .12);
}

.help-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -42px;
    z-index: 40;
    display: none;
    width: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, .16);
    color: #111827;
}

.help-menu.open .help-dropdown {
    display: grid;
}

.help-dropdown a,
.help-dropdown small {
    display: block;
    padding: 12px 14px;
}

.help-dropdown a {
    color: #111827;
    font-weight: 700;
}

.help-dropdown a:hover {
    background: #f6f8fa;
}

.help-dropdown small {
    border-top: 1px solid var(--line);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -7px;
    min-width: 19px;
    height: 18px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    padding: 0 5px;
    text-align: center;
}

.notification-badge.empty {
    display: none;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -42px;
    z-index: 40;
    display: none;
    width: min(340px, calc(100vw - 24px));
    max-height: 520px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, .16);
}

.notification-menu.open .notification-dropdown {
    display: block;
}

.notification-dropdown header,
.notification-dropdown footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

.notification-dropdown header {
    border-bottom: 1px solid var(--line);
}

.notification-dropdown header strong {
    font-size: 14px;
}

.notification-dropdown header button,
.notification-dropdown footer a {
    border: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 0;
}

.notification-dropdown footer {
    border-top: 1px solid var(--line);
}

.notification-dropdown-list {
    max-height: 390px;
    overflow-y: auto;
    padding: 0 16px;
}

.notification-dropdown-list article {
    border-bottom: 1px solid var(--line);
    padding: 13px 0;
}

.notification-dropdown-list article.unread strong::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: #dc2626;
}

.notification-dropdown-list article.read {
    opacity: .72;
}

.notification-dropdown-list strong {
    display: block;
    color: #334155;
    font-size: 13px;
    line-height: 1.35;
}

.notification-dropdown-list p {
    margin: 5px 0 0;
    color: #475569;
    line-height: 1.35;
}

.notification-dropdown-list small,
.notification-empty {
    color: var(--muted);
}

.notification-empty {
    margin: 0;
    padding: 18px 0;
}

.account-trigger {
    aspect-ratio: 1 / 1;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.account-trigger:hover,
.account-menu.open .account-trigger {
    box-shadow: 0 0 0 3px rgba(240, 112, 48, .16);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    display: none;
    width: min(304px, calc(100vw - 24px));
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
    color: #111827;
}

.account-menu.open .account-dropdown {
    display: block;
}

.account-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: 0 16px;
    border-bottom: 1px solid var(--line);
    padding: 16px 0 14px;
}

.account-summary div {
    min-width: 0;
}

.account-summary strong,
.account-summary span,
.account-summary small {
    display: block;
}

.account-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.account-summary span {
    overflow-wrap: anywhere;
    color: #4b5563;
    font-size: 12px;
}

.account-summary small {
    width: fit-content;
    max-width: 100%;
    margin-top: 8px;
    border-radius: 4px;
    background: #dbeafe;
    padding: 2px 6px;
    color: #1d4ed8;
    font-size: 11px;
}

.account-face {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e8f3f7;
    color: #6b8794;
    font-weight: 700;
}

.account-links {
    display: grid;
    gap: 2px;
    padding: 12px 16px;
}

.account-links + .account-links {
    border-top: 1px solid var(--line);
}

.account-links a,
.account-links span {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    border-radius: 6px;
    padding: 7px 8px;
    color: #111827;
    font-size: 13px;
}

.account-links span.disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.account-links a:hover {
    background: #f6f8fa;
}

.account-links a[href="notifications.php"] {
    justify-content: flex-start;
}

.menu-icon {
    flex: 0 0 20px;
    display: grid;
    place-items: center;
    color: #111827;
}

.menu-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

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

.profile-workspace {
    background: #f7f8f8;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px;
}

.profile-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 20px;
}

.profile-card > header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.profile-avatar-preview {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

.profile-card h1,
.profile-card h2,
.profile-card p {
    margin: 0;
}

.profile-card h1 {
    font-size: 22px;
}

.profile-card p {
    color: var(--muted);
}

.profile-card header span {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    border-radius: 4px;
    background: #dbeafe;
    padding: 3px 7px;
    color: #1d4ed8;
    font-size: 11px;
}

.profile-form {
    display: grid;
    gap: 14px;
}

.profile-form label {
    display: grid;
    gap: 6px;
    color: #475569;
    font-weight: 700;
}

.profile-form input {
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 10px;
    color: var(--text);
    font-weight: 400;
}

.profile-form input[type="file"] {
    padding: 8px;
}

.profile-form footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.profile-info h2 {
    margin-bottom: 16px;
    font-size: 16px;
}

.profile-info dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.profile-info dt {
    color: var(--muted);
    font-size: 12px;
}

.profile-info dd {
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.profile-reset-form {
    display: grid;
    gap: 8px;
    margin-top: 20px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.profile-reset-form p {
    color: var(--muted);
    font-size: 12px;
}

.forms-workspace {
    background: #f7f8f8;
}

.forms-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    padding: 0 16px 24px;
}

.forms-list-panel,
.forms-main-panel,
.form-manager-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.forms-list-panel header,
.form-manager-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 14px;
}

.forms-list-panel h2,
.forms-main-header h1,
.form-manager-card h2 {
    margin: 0;
}

.forms-list {
    display: grid;
    gap: 4px;
    padding: 10px;
}

.form-list-item {
    display: grid;
    gap: 4px;
    border-radius: 6px;
    padding: 10px;
}

.form-list-item:hover,
.form-list-item.active {
    background: var(--accent-soft);
}

.form-list-item span {
    color: var(--muted);
    font-size: 12px;
}

.forms-main-panel {
    overflow: hidden;
}

.forms-main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 16px;
}

.forms-main-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.form-manager-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 16px;
    padding: 16px;
}

.field-table {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.managed-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #edf1f5;
    border-radius: 6px;
    padding: 10px;
}

.managed-field-row div {
    min-width: 0;
}

.managed-field-row strong,
.managed-field-row span,
.managed-field-row small {
    display: block;
}

.managed-field-row span,
.managed-field-row small {
    color: var(--muted);
    font-size: 12px;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.pill,
.ghost,
.primary,
.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 12px;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
    font-weight: 700;
}

.secondary {
    color: #334155;
}

.ghost {
    border-color: transparent;
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-wrap input {
    width: 280px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 9px 14px;
}

.search-wrap input:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.login-form input:focus,
.report-filters input:focus,
.report-filters select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240, 112, 48, .16);
    outline: 0;
}

.workspace {
    min-height: calc(100vh - 103px);
}

.tabs {
    min-height: 48px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
}

.tabs a {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 2px solid transparent;
    color: #263545;
}

.tabs .active {
    color: var(--brand-dark);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

.metrics {
    justify-content: flex-end;
    padding: 10px 18px;
    color: var(--muted);
}

.metrics span {
    color: var(--text);
    font-weight: 700;
}

.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 1fr);
    gap: 8px;
    height: calc(100vh - 170px);
    overflow-x: auto;
    padding: 0 8px 12px;
}

.column {
    display: flex;
    min-width: 250px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #eef2f6;
}

.column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    border-top: 3px solid;
    border-bottom: 1px solid var(--line);
    background: #fff;
    padding: 6px 10px;
}

.column-head div {
    display: flex;
    gap: 8px;
    align-items: center;
}

.column-head span {
    border-radius: 10px;
    background: #edf2f7;
    padding: 1px 7px;
    color: #475569;
    font-size: 11px;
}

.mini-add {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 20px;
}

.column-total {
    padding: 6px 10px;
    color: #64748b;
    font-size: 11px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.card-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.card-list.over {
    background: var(--accent-soft);
}

.deal-card {
    margin-bottom: 8px;
    border: 1px solid #e3e9ef;
    border-radius: 6px;
    background: var(--card);
    box-shadow: var(--shadow);
    padding: 10px;
    cursor: grab;
}

.deal-card:hover {
    border-color: #f7b28e;
    box-shadow: 0 0 0 2px rgba(240, 112, 48, .12), var(--shadow);
}

.deal-card.dragging {
    opacity: .55;
}

.card-topline,
.deal-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tag {
    border-radius: 10px;
    padding: 2px 7px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.tag.frio {
    background: #38bdf8;
}

.tag.morno {
    background: #f59e0b;
}

.tag.quente {
    background: #ef4444;
}

.card-id {
    color: #64748b;
    font-weight: 700;
}

.card-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 8px 0 2px;
}

.card-quick-actions button {
    border: 1px solid #dbe4ee;
    border-radius: 5px;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-size: 11px;
    padding: 5px 6px;
}

.card-quick-actions button:hover,
.card-quick-actions .done {
    border-color: var(--blue);
    background: var(--accent-soft);
    color: var(--blue);
}

.created-highlight {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(15, 99, 246, .18), var(--shadow);
}

.deal-card h3 {
    margin: 8px 0 10px;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.3;
}

.deal-card dl {
    margin: 0;
}

.deal-card dt {
    margin-top: 7px;
    color: #62748a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.deal-card dd {
    margin: 0;
    color: #0f172a;
    font-size: 12px;
}

.deal-card footer {
    margin-top: 10px;
    color: #64748b;
    font-size: 11px;
}

.due,
.expired {
    border-radius: 4px;
    padding: 2px 5px;
    font-weight: 700;
}

.due {
    background: #fff7ed;
    color: #c2410c;
}

.expired {
    background: #fee2e2;
    color: #b91c1c;
}

.new-stage {
    min-width: 220px;
}

.new-stage button,
.new-stage a {
    display: block;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    padding: 10px;
    color: #475569;
    cursor: pointer;
    text-align: center;
}

.flow-workspace {
    background: #eef1f5;
}

.flow-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 72px;
    padding: 18px 24px;
}

.module-switcher label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-weight: 700;
}

.module-switcher select {
    min-height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 7px 10px;
    color: #111827;
}

.quick-stage-trigger {
    position: static;
}

.segmented {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
}

.segmented button {
    min-width: 92px;
    border: 0;
    border-right: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    padding: 8px 16px;
    cursor: pointer;
}

.segmented button:last-child {
    border-right: 0;
}

.segmented .active {
    border: 1px solid var(--blue);
    background: var(--accent-soft);
    color: var(--blue);
    margin: -1px;
}

.outline-blue {
    position: absolute;
    right: 22px;
    border: 1px solid var(--blue);
    border-radius: 18px;
    background: #fff;
    color: var(--blue);
    padding: 8px 14px;
    cursor: pointer;
}

.flow-canvas {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 240px;
    align-items: start;
    gap: 84px;
    min-height: calc(100vh - 190px);
    overflow-x: auto;
    padding: 34px 72px 80px;
}

.flow-card {
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.flow-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    border-radius: 8px 8px 0 0;
    padding: 12px 16px;
}

.flow-card p {
    min-height: 42px;
    margin: 0;
    padding: 14px 16px 8px;
    color: #425466;
    font-size: 12px;
}

.stage-menu {
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, .72);
    color: #475569;
    cursor: pointer;
    font-weight: 700;
    padding: 4px 8px;
}

.flow-action {
    display: block;
    width: calc(100% - 32px);
    margin: 0 16px 8px;
    border: 1px dashed #e2e8f0;
    border-radius: 5px;
    background: #fbfcfe;
    color: #334155;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
}

.flow-card small {
    display: block;
    margin: 0 16px 14px;
    color: #718096;
}

.flow-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border-top: 1px solid #edf2f7;
    padding: 12px 16px 16px;
}

.flow-card-actions button {
    width: 100%;
    padding: 8px 10px;
}

.delete-options {
    margin: 12px 0;
    border: 1px solid #fee2e2;
    border-radius: 7px;
    background: #fff7f7;
    padding: 12px;
}

.delete-options strong {
    display: block;
    color: #991b1b;
    margin-bottom: 4px;
}

.delete-options p {
    margin: 0 0 10px;
    color: #64748b;
    font-size: 12px;
}

.fields-panel {
    margin: 14px 0;
    border: 1px solid #fed7c2;
    border-radius: 7px;
    background: #fffaf7;
    padding: 12px;
}

.fields-panel > header {
    display: flex;
    min-height: auto;
    border-radius: 0;
    padding: 0 0 10px;
    background: transparent;
}

.fields-panel strong {
    display: block;
    color: #9a4319;
}

.fields-panel span {
    color: #64748b;
    font-size: 12px;
}

.fields-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    padding: 9px;
}

.field-row strong,
.field-row span {
    display: block;
}

.field-row span {
    color: #64748b;
    font-size: 11px;
}

.field-row > div:last-child {
    display: flex;
    gap: 6px;
}

.field-row button {
    padding: 6px 8px;
}

.empty-fields {
    margin: 0;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    color: #64748b;
    padding: 10px;
}

.field-editor {
    display: grid;
    gap: 10px;
    border-top: 1px solid #fed7c2;
    padding-top: 12px;
}

.field-editor-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 110px auto auto;
    align-items: end;
    gap: 8px;
}

.check-label {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    margin: 0 0 12px !important;
}

.check-label input {
    width: auto !important;
}

.start-card header {
    background: var(--accent-soft);
    color: #9a4319;
}

.quick-stage-card {
    overflow: hidden;
    border-style: dashed;
}

.quick-stage-card header {
    background: #f8fafc;
}

.quick-stage-card header button {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #334155;
    padding: 6px 9px;
    cursor: pointer;
}

.quick-stage-form {
    display: grid;
    gap: 9px;
    padding: 14px 16px 16px;
}

.quick-stage-form input,
.quick-stage-form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px;
}

.quick-stage-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    gap: 8px;
}

.quick-stage-row input[type="color"] {
    height: 38px;
    padding: 4px;
}

.quick-stage-row span {
    color: #64748b;
    font-size: 12px;
}

.danger-button {
    border: 1px solid #fecaca;
    border-radius: 7px;
    background: #fef2f2;
    color: #b91c1c;
    padding: 9px 12px;
    cursor: pointer;
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

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

.access-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.danger-zone-panel {
    grid-column: 1 / -1;
    border-color: #fecaca;
}

.danger-zone-content {
    padding: 14px;
}

.danger-zone-content strong {
    display: block;
    color: #991b1b;
    margin-bottom: 6px;
}

.danger-zone-content p {
    max-width: 820px;
    color: #64748b;
    margin: 0 0 12px;
}

.stage-fields-runtime {
    display: grid;
    gap: 12px;
}

.stage-fields-group {
    display: grid;
    gap: 12px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    padding: 14px;
}

.stage-fields-group[hidden] {
    display: none;
}

.stage-fields-group h3 {
    margin: 0;
    color: #9a3412;
    font-size: 14px;
}

.inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stage-field-info {
    display: block;
    color: #64748b;
    font-size: 13px;
}

.permission-picker {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
    margin: 0 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: 12px;
}

.permission-picker legend {
    color: #334155;
    font-weight: 700;
    padding: 0 6px;
}

.permission-picker label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 400;
}

.access-lists {
    align-items: start;
}

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

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

.modal {
    width: min(560px, 100%);
    max-height: 92vh;
    overflow: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
    padding: 18px;
}

.modal header,
.modal footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.modal header button {
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.modal label {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    color: #334155;
    font-weight: 700;
}

.modal input,
.modal select,
.modal textarea,
.login-form input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px;
    color: #111827;
}

.inline-create-fields label {
    display: none;
}

.system-id-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 7px;
    background: #f8fafc;
    padding: 11px;
}

.system-id-preview > span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
}

.system-id-preview strong,
.system-id-preview small {
    display: block;
}

.system-id-preview small {
    color: #64748b;
}

.opportunity-form input[type="file"] {
    background: #f8fafc;
}

.reports-workspace {
    background: #f4f6f8;
}

.opportunity-workspace {
    background: #f7f8f8;
}

.opportunity-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 12px;
}

.opportunity-header h1 {
    margin: 10px 0 4px;
    font-size: 24px;
}

.opportunity-header p {
    margin: 0;
    color: #64748b;
}

.back-link {
    display: inline-flex;
}

.opportunity-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.opportunity-summary span,
.opportunity-summary strong {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 9px 12px;
}

.opportunity-summary span {
    color: var(--accent);
    font-weight: 700;
}

.opportunity-detail-grid {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) 320px;
    gap: 12px;
    padding: 12px 24px;
}

.opportunity-detail-form {
    overflow: hidden;
}

.opportunity-side-panel {
    align-self: start;
}

.opportunity-facts {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 14px;
}

.opportunity-facts dt {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.opportunity-facts dd {
    margin: 0 0 6px;
    color: #111827;
}

.opportunity-documents {
    margin: 12px 24px 28px;
}

.customers-workspace {
    background: #f7f8f8;
}

.database-workspace {
    background: #f2f2f2;
}

.database-titlebar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    padding: 14px 18px;
}

.database-titlebar p {
    margin: 14px 0 0;
    color: #334155;
}

.database-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #dbeafe;
    background: #fff;
    padding: 10px 18px;
}

.list-filters {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.list-filters select {
    min-height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    padding: 8px 10px;
}

.list-table {
    min-width: 1480px;
}

.activity-filters {
    margin-top: 0;
}

.activities-workspace {
    min-height: calc(100vh - 50px);
    background: #f4f6f8;
}

.activities-titlebar {
    align-items: center;
    padding: 8px 8px;
}

.activities-titlebar p {
    margin: 0;
}

.activity-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-search input {
    width: 280px;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    background: #fff;
    padding: 7px 12px;
}

.activities-table-wrap {
    margin: 0;
}

.activities-table {
    min-width: 1640px;
}

.activities-table th {
    height: 54px;
    color: #202833;
    font-size: 13px;
}

.activities-table td {
    height: 44px;
}

.floating-create-button {
    position: fixed;
    left: 16px;
    bottom: 22px;
    z-index: 20;
    border: 0;
    border-radius: 18px;
    background: #0b63ff;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    padding: 11px 18px;
    box-shadow: 0 8px 22px rgba(11, 99, 255, .24);
}

.side-modal-backdrop {
    justify-content: flex-start;
    z-index: 60;
    padding: 0;
}

.side-modal-backdrop.open {
    display: flex;
}

.activity-create-modal {
    display: flex;
    flex-direction: column;
    width: min(470px, 100%);
    height: 100vh;
    max-height: none;
    border-radius: 0;
    box-shadow: 12px 0 34px rgba(15, 23, 42, .14);
    padding: 24px;
    overflow-y: auto;
}

.activity-create-modal footer {
    position: sticky;
    bottom: -24px;
    margin: 8px -24px -24px;
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 14px 24px 18px;
}

.activity-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-modal-title h2 {
    margin: 0;
    font-size: 22px;
}

.activity-modal-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: #eaf1ff;
    color: #0b63ff;
    font-weight: 800;
}

.activity-category-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border: 0;
    margin: 0;
    padding: 0;
}

.activity-category-picker legend {
    flex: 0 0 100%;
    color: #334155;
    font-weight: 700;
    margin-bottom: 2px;
}

.activity-category-picker label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-weight: 400;
}

.activity-category-picker input {
    width: auto;
}

.activity-submit-button {
    border-radius: 18px;
    background: #0b63ff;
}

.activity-board {
    display: grid;
    gap: 10px;
    padding: 14px 24px 24px;
}

.activity-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-left: 4px solid #94a3b8;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 14px;
}

.activity-card.overdue {
    border-left-color: #dc2626;
    background: #fffafa;
}

.activity-card.done {
    border-left-color: #16a34a;
    opacity: .75;
}

.activity-card header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.activity-card header span {
    border-radius: 999px;
    background: var(--accent-soft);
    color: #9a4319;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
}

.activity-card header strong {
    font-size: 15px;
}

.activity-card p {
    margin: 0 0 6px;
    color: #475569;
}

.activity-card small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.database-search {
    width: min(320px, 100%);
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    padding: 8px 14px;
}

.database-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240, 112, 48, .16);
    outline: 0;
}

.database-table-wrap {
    overflow-x: auto;
    margin: 14px 10px 0;
    background: #fff;
}

.database-table {
    width: 100%;
    min-width: 1260px;
    border-collapse: collapse;
    font-size: 13px;
}

.database-table th,
.database-table td {
    border-bottom: 1px solid #d7dde5;
    border-right: 1px solid #edf2f7;
    padding: 13px 16px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.database-table th {
    color: #202833;
    font-weight: 700;
}

.database-table tbody tr:hover {
    background: #fffaf7;
}

.database-table td:nth-child(4) {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.database-empty {
    padding: 20px !important;
    color: #111827;
    font-weight: 700;
    text-align: center !important;
}

.customers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 12px;
}

.customers-header h1 {
    margin: 0 0 4px;
    font-size: 22px;
}

.customers-header p {
    margin: 0;
    color: #64748b;
}

.customer-stats {
    display: flex;
    gap: 10px;
}

.customer-stats span {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 9px 12px;
    color: #64748b;
}

.customer-stats strong {
    color: var(--accent);
}

.customers-grid,
.customers-lists {
    display: grid;
    gap: 12px;
    padding: 12px 24px;
}

.customers-grid,
.customers-lists {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.relationship-panel {
    grid-column: 1 / -1;
}

.customer-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.notifications-panel {
    display: grid;
    gap: 8px;
    padding: 12px 24px 24px;
}

.notification-compose {
    margin: 0 24px 12px;
}

.notification-row,
.empty-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    box-shadow: var(--shadow);
}

.notification-row.unread {
    border-left: 4px solid var(--accent);
}

.notification-row.read {
    opacity: .72;
}

.notification-row strong,
.empty-state h2 {
    display: block;
    margin: 0;
    font-size: 15px;
}

.notification-row p,
.empty-state p {
    margin: 5px 0;
    color: #475569;
}

.notification-row small {
    color: var(--muted);
}

.notification-link {
    display: inline-flex;
    margin-top: 8px;
    color: var(--accent);
    font-weight: 700;
}

.customer-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 14px;
}

.customer-panel h2 {
    margin: 0;
    font-size: 15px;
}

.customer-panel header span {
    color: #64748b;
}

.customer-form {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.customer-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
}

.customer-form input,
.customer-form select,
.customer-form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px;
    color: #111827;
}

.customer-form input:focus,
.customer-form select:focus,
.customer-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240, 112, 48, .16);
    outline: 0;
}

.customer-list,
.relationship-list {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.timeline-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px);
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 10px;
}

.timeline-filters input,
.timeline-filters select {
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
}

.customer-row,
.relationship-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #edf2f7;
    border-radius: 7px;
    background: #fbfcfe;
    padding: 10px;
}

.customer-row strong,
.customer-row span,
.customer-row small,
.relationship-list strong,
.relationship-list span,
.relationship-list small {
    display: block;
}

.customer-row span,
.relationship-list span {
    color: #64748b;
    font-size: 12px;
}

.customer-row small,
.relationship-list small {
    color: #728089;
    font-size: 11px;
}

.relationship-table {
    margin: 12px 24px 28px;
}

.reports-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 12px;
}

.reports-header h1 {
    margin: 0 0 4px;
    font-size: 22px;
}

.reports-header p {
    margin: 0;
    color: #64748b;
}

.report-kpis,
.reports-grid {
    display: grid;
    gap: 12px;
    padding: 12px 24px;
}

.report-kpis {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.report-kpis article,
.report-panel,
.custom-report {
    border: 1px solid #dce3ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.report-kpis article {
    padding: 16px;
}

.report-kpis span {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.report-kpis strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}

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

.report-panel header,
.report-builder header,
.report-table-wrap header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 14px;
}

.report-panel h2,
.report-builder h2 {
    margin: 0;
    font-size: 15px;
}

.report-list {
    display: grid;
    gap: 1px;
    padding: 8px;
}

.report-row {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    padding: 9px;
}

.report-row:hover {
    background: #f8fafc;
}

.report-row span {
    color: #64748b;
}

.stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.custom-report {
    margin: 12px 24px 28px;
    overflow: hidden;
}

.report-builder {
    border-bottom: 1px solid #e2e8f0;
}

.report-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    padding: 14px;
}

.report-filters label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
}

.report-filters input,
.report-filters select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px;
    color: #111827;
}

.column-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    border: 0;
    border-top: 1px solid #edf2f7;
    padding: 12px 14px 14px;
}

.column-picker legend {
    color: #334155;
    font-weight: 700;
    padding: 0 0 8px;
}

.column-picker label {
    border: 1px solid #dbe4ee;
    border-radius: 16px;
    background: #f8fafc;
    padding: 6px 10px;
}

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

.report-table-wrap header span {
    color: #64748b;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.report-table th,
.report-table td {
    border-bottom: 1px solid #edf2f7;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(240, 112, 48, .9), rgba(80, 80, 80, .76)),
        url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="1200" height="800" viewBox="0 0 1200 800"%3E%3Crect width="1200" height="800" fill="%23f8fafc"/%3E%3Cg fill="%23cbd5e1"%3E%3Crect x="100" y="120" width="220" height="130" rx="10"/%3E%3Crect x="360" y="90" width="220" height="180" rx="10"/%3E%3Crect x="620" y="150" width="220" height="120" rx="10"/%3E%3Crect x="880" y="100" width="220" height="170" rx="10"/%3E%3Crect x="170" y="360" width="220" height="180" rx="10"/%3E%3Crect x="450" y="340" width="220" height="145" rx="10"/%3E%3Crect x="760" y="360" width="220" height="180" rx="10"/%3E%3C/g%3E%3C/svg%3E');
    background-size: cover;
}

.login-shell {
    width: min(440px, calc(100vw - 32px));
}

.login-panel {
    border-radius: 8px;
    background: #fff;
    padding: 30px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.brand-row span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.login-panel h1 {
    margin: 26px 0 8px;
    font-size: 28px;
    line-height: 1.1;
}

.login-panel p {
    margin: 0 0 22px;
    color: #526173;
}

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

.login-form label {
    color: #334155;
    font-weight: 700;
}

.login-form .setup-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.login-form .setup-check input {
    width: auto;
}

.login-form button {
    border: 0;
    border-radius: 7px;
    background: var(--blue);
    color: #fff;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
}

.login-link,
.login-primary-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 4px;
}

.login-link {
    color: var(--accent);
    font-weight: 700;
}

.login-primary-link {
    width: 100%;
}

.alert {
    margin-bottom: 14px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fef2f2;
    color: #991b1b;
    padding: 10px;
}

.success-alert {
    margin-bottom: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    background: #f0fdf4;
    color: #166534;
    padding: 10px;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(320px, 920px);
    gap: 18px;
    padding: 12px 24px 24px;
}

.settings-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    padding: 10px 24px 0;
}

.settings-tabs button {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #334155;
    cursor: pointer;
    font-weight: 700;
    padding: 10px 12px;
}

.settings-tabs button.active {
    border-color: var(--accent);
    color: var(--accent);
}

.settings-form {
    display: grid;
    gap: 14px;
}

.settings-panel {
    overflow: hidden;
}

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

.settings-form footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--line);
    margin: 2px -14px -14px;
    padding: 12px 14px 14px;
}

.settings-fieldset {
    border: 1px solid var(--line);
    border-radius: 7px;
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 14px;
}

.settings-fieldset[hidden] {
    display: none;
}

.settings-alert {
    border: 1px solid #fed7aa;
    border-radius: 7px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 700;
    line-height: 1.45;
    padding: 10px 12px;
}

.settings-alert a {
    color: #7c2d12;
    text-decoration: underline;
}

.template-manager {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 0;
}

.template-list {
    display: grid;
    align-content: start;
    gap: 8px;
    border-right: 1px solid var(--line);
    padding: 14px;
}

.template-list button {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    padding: 10px;
    text-align: left;
}

.template-list button.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.template-list strong,
.template-list span {
    display: block;
}

.template-list span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.settings-fieldset legend {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    padding: 0 6px;
    text-transform: uppercase;
}

.system-status {
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    max-width: 420px;
    padding: 10px 12px;
}

.system-status.is-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.system-status.is-warning,
.mail-preview-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.mail-preview-modal textarea {
    min-height: 220px;
    resize: vertical;
}

.mail-preview-warning {
    border-radius: 6px;
    font-weight: 700;
    padding: 10px;
}

.mail-preview-meta {
    display: grid;
    gap: 6px 12px;
    grid-template-columns: 90px minmax(0, 1fr);
    margin: 0;
}

.mail-preview-meta dt {
    color: var(--muted);
    font-weight: 800;
}

.mail-preview-meta dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .subbar,
    .metrics {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        gap: 10px;
        min-height: 52px;
        padding: 8px 12px;
    }

    .app-brand {
        flex: 1 1 auto;
        gap: 10px;
    }

    .app-title {
        max-width: 48vw;
    }

    .brand-logo-img {
        height: 28px;
    }

    .top-actions {
        flex: 0 0 auto;
        gap: 8px;
        margin-left: auto;
    }

    .tabs {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        padding: 0 12px;
        white-space: nowrap;
    }

    .tabs a {
        min-height: 46px;
    }

    .search-wrap,
    .search-wrap input {
        width: 100%;
    }

    .database-titlebar,
    .database-toolbar,
    .flow-toolbar,
    .settings-form footer,
    .profile-form footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .database-titlebar .primary,
    .database-titlebar .secondary,
    .database-toolbar .primary,
    .database-toolbar .secondary,
    .flow-toolbar .primary,
    .flow-toolbar .secondary,
    .settings-form footer .primary,
    .settings-form footer .secondary,
    .profile-form footer .primary,
    .profile-form footer .secondary {
        width: auto;
    }

    .quick-stage-trigger {
        position: static;
    }

    .kanban {
        height: calc(100vh - 260px);
    }

    .opportunity-detail-grid,
    .customers-grid,
    .customers-lists,
    .profile-layout,
    .forms-layout,
    .form-manager-grid,
    .report-kpis,
    .reports-grid,
    .report-filters,
    .settings-layout,
    .template-manager {
        grid-template-columns: 1fr;
    }

    .template-list {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .opportunity-header,
    .customers-header,
    .reports-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .app-title {
        max-width: 40vw;
        font-size: 13px;
    }

    .notification-dropdown {
        right: -58px;
    }

    .account-dropdown {
        right: -4px;
    }

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