/* Quelinka CRM — shell layout, home, and module screens */

:root {
    /* Brand palette */
    --white: #fff;
    --color-deep: #012837;
    --color-accent: #4effff;
    --color-indigo: #4b5093;
    --color-blue: #597fb8;
    --color-charcoal: #2d3233;

    /* Semantic tokens */
    --primary-blue: var(--color-accent);
    --primary-blue-dark: var(--color-deep);
    --text: var(--color-charcoal);
    --text-muted: var(--color-blue);
    --border: color-mix(in srgb, var(--color-blue) 28%, var(--white));
    --bg-page: color-mix(in srgb, var(--white) 88%, var(--color-blue));
    --bg-white: var(--white);
    --sidebar-active: color-mix(in srgb, var(--color-accent) 22%, var(--white));
    --sidebar-bg: var(--white);
    --brand-deep: var(--color-deep);
    --sidebar-hover: color-mix(in srgb, var(--color-blue) 10%, var(--white));
    --nav-icon: var(--text-muted);
    --link: var(--color-blue);
    --link-hover: var(--color-deep);
    --focus-ring: color-mix(in srgb, var(--color-accent) 35%, transparent);
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 56px;
    --shell-top-height: 56px;
    --shell-footer-height: 56px;
    --activity-visible-count: 2.5;
    --activity-item-height: 5.5rem;
    --dashlet-header-block: 2.125rem;
    --dashlet-scroll-body-height: calc(var(--activity-visible-count) * var(--activity-item-height));
    --dashlet-pair-height: calc(var(--dashlet-header-block) + var(--dashlet-scroll-body-height));
    --opportunity-visible-cards: 5;
    --opportunity-card-height: 86px;
    --opportunity-card-gap: 7px;
    --opportunities-board-height: calc(
        24px + 6px +
        (var(--opportunity-visible-cards) * var(--opportunity-card-height)) +
        ((var(--opportunity-visible-cards) - 1) * var(--opportunity-card-gap)) +
        10px
    );
}

* {
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--shell-top-height) 1fr var(--shell-footer-height);
    min-height: 100vh;
    transition: grid-template-columns 0.2s ease;
}

.layout.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}

/* Sidebar — grid children via display: contents */
.sidebar {
    display: contents;
}

.sidebar-brand {
    grid-column: 1;
    grid-row: 1;
    border-right: 1px solid var(--border);
    height: var(--shell-top-height);
    min-height: var(--shell-top-height);
    max-height: var(--shell-top-height);
    padding: 0;
    background: linear-gradient(
        180deg,
        var(--color-deep) 0%,
        color-mix(in srgb, var(--color-deep) 55%, var(--color-indigo)) 32%,
        color-mix(in srgb, var(--color-blue) 45%, var(--white)) 68%,
        var(--sidebar-bg) 100%
    );
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0 16px;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.sidebar-brand-link:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: -2px;
    border-radius: 0;
}

.sidebar-brand img {
    max-width: 172px;
    max-height: 36px;
    height: auto;
    display: block;
    width: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.sidebar-brand-fallback {
    font-weight: 600;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.sidebar-brand-accent {
    color: var(--color-accent);
}

.sidebar-nav-block {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-self: start;
    width: 100%;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
}

.nav-scroll {
    overflow: visible;
    padding: 4px 0 0;
}

.sidebar-rail {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
}

.nav-section-label {
    margin: 16px 18px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.35;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    text-align: left;
    border-radius: 0;
    transition: background 0.12s ease;
}

.nav-link:hover,
.nav-link--toggle:hover {
    background: var(--sidebar-hover);
}

.nav-link.active,
.nav-link--toggle.active {
    background: var(--sidebar-active);
    font-weight: 500;
    color: var(--primary-blue-dark);
}

.nav-link--toggle {
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.nav-group.is-open .nav-submenu-chevron svg {
    transform: rotate(-90deg);
}

.nav-submenu {
    display: none;
    padding: 2px 0 6px;
}

.nav-group.is-open .nav-submenu {
    display: block;
}

.nav-sublink {
    display: block;
    padding: 7px 18px 7px 46px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.nav-sublink:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.nav-sublink.active {
    color: var(--color-deep);
    font-weight: 500;
    background: var(--sidebar-active);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    color: var(--nav-icon);
}

.nav-icon svg {
    display: block;
}

.nav-link.active .nav-icon {
    color: var(--color-deep);
}

.nav-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-submenu-chevron {
    display: inline-flex;
    color: var(--text-muted);
    opacity: 0.7;
    flex-shrink: 0;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--shell-footer-height);
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border);
    box-sizing: border-box;
}

.sidebar-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
}

.sidebar-footer-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.sidebar-footer-more {
    position: relative;
}

.sidebar-more-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    min-width: 168px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(1, 40, 55, 0.12);
    padding: 4px 0;
    z-index: 20;
}

.sidebar-more-menu[hidden] {
    display: none;
}

.sidebar-more-item {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
}

.sidebar-more-item:hover {
    background: var(--sidebar-hover);
    color: var(--link);
}

.module-page {
    padding: 18px 20px 24px;
    background: var(--bg-page);
    min-height: auto;
}

.module-toolbar {
    margin-bottom: 14px;
}

.module-title {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 600;
    color: var(--text);
}

.module-lead {
    margin: 0 0 18px;
    color: var(--text-muted);
    max-width: 520px;
}

.module-back {
    font-size: 14px;
    color: var(--link);
    text-decoration: none;
}

.module-back:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.layout.sidebar-collapsed .nav-section-label,
.layout.sidebar-collapsed .nav-label,
.layout.sidebar-collapsed .nav-submenu-chevron,
.layout.sidebar-collapsed .sidebar-brand img,
.layout.sidebar-collapsed .sidebar-brand-fallback {
    display: none;
}

.layout.sidebar-collapsed .sidebar-brand {
    display: flex;
    justify-content: center;
}

.layout.sidebar-collapsed .sidebar-brand-link {
    padding: 0 8px;
}

.layout.sidebar-collapsed .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.layout.sidebar-collapsed .sidebar-footer {
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
}

.layout.sidebar-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* Main column — grid children via display: contents */
.main {
    display: contents;
}

.header-bar {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 200;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    height: var(--shell-top-height);
    min-height: var(--shell-top-height);
    max-height: var(--shell-top-height);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: visible;
}

.header-search-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, calc(100% - 200px));
    z-index: 1;
}

.header-search-center .search-wrap {
    max-width: none;
}

.search-wrap {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.search-wrap svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.45;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.header-notifications {
    position: relative;
}

.header-notifications-btn {
    position: relative;
}

.header-notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.header-notifications-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, 92vw);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    z-index: 300;
    overflow: hidden;
    transform-origin: top right;
}

.header-notifications-menu:not([hidden]) {
    animation: header-notifications-popover-in 0.2s ease-out;
}

@keyframes header-notifications-popover-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.header-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}

.header-notifications-mark-all {
    border: 0;
    background: transparent;
    color: var(--link);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.header-notifications-mark-all:hover {
    text-decoration: underline;
}

.header-notifications-list {
    max-height: 360px;
    overflow-y: auto;
}

.header-notification-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    background: transparent;
    text-align: left;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

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

.header-notification-item:hover {
    background: var(--sidebar-hover);
}

.header-notification-item.is-unread {
    background: color-mix(in srgb, var(--color-accent) 10%, var(--white));
}

.header-notification-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.header-notification-message {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.header-notification-time {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.header-notifications-empty {
    display: block;
    padding: 14px 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-blue), var(--color-indigo));
    color: var(--white);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--bg-white);
    box-shadow: 0 0 0 1px var(--border);
}

.user-menu {
    position: relative;
    z-index: 1;
}

.user-menu:has(.user-menu-trigger[aria-expanded="true"]) {
    z-index: 300;
}

.user-menu-trigger {
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    padding: 0;
    cursor: pointer;
}

.user-menu-trigger svg {
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.user-menu-trigger[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    z-index: 300;
    overflow: hidden;
}

.user-menu-dropdown[hidden] {
    display: none;
}

.user-menu-item {
    display: block;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
}

.user-menu-item:hover {
    background: var(--sidebar-hover);
}

.dashboard-page,
.accounts-page,
.meetings-page,
.documents-page,
.calls-page,
.tickets-page,
.tasks-page,
.meeting-create-page,
.document-create-page,
.call-create-page,
.ticket-create-page,
.task-create-page,
.module-page,
.opportunities-page,
.opportunity-create-page,
.calendar-page,
.calendario-page,
.administration-page,
.password-page {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    min-height: 0;
}

.administration-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(100%, 1320px);
    margin-inline: auto;
}

.administration-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-inline: auto;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.administration-title {
    margin: 10px 0 0;
    font-size: 34px;
    font-weight: 500;
    color: #111827;
    text-align: center;
}

.administration-search-wrap {
    width: min(100%, 960px);
}

.administration-search-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    outline: none;
    display: flex;
}

.administration-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.administration-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
    width: 100%;
}

.administration-card {
    border: 1px solid #d5dce8;
    border-radius: 10px;
    background: #f8fafc;
    margin-inline: 12px;
}

.administration-card-title {
    margin: 0;
    padding: 12px 16px;
    font-size: 34px;
    font-weight: 500;
    color: #1f2937;
    text-align: center;
}

.administration-card-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    border-top: 1px solid #d5dce8;
}

.administration-item {
    box-sizing: border-box;
    width: 250px;
    height: 150px;
    padding: 10px 20px 0;
    background: #f8fafc;
    text-decoration: none;
    text-align: center;
    border-top: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.administration-item:hover {
    background: #eef3fb;
}

.administration-item-name {
    color: #2f6eb9;
    font-size: 18px;
    margin-bottom: 4px;
}

.administration-item-description {
    color: #4b5563;
    font-size: 16px;
    text-align: center;
    
}

@media (max-width: 900px) {
    .administration-card {
        margin-inline: 0;
    }

    .administration-item {
        min-height: 0;
        width: 100%;
    }
}

/* Administration detail screens (settings sub-pages) */
.admin-detail-page {
    align-items: stretch;
    padding: 16px 20px 28px;
}

.admin-detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 14px;
    color: #6b7280;
}

.admin-detail-breadcrumb a {
    color: #2f6eb9;
    text-decoration: none;
}

.admin-detail-breadcrumb a:hover {
    text-decoration: underline;
}

.admin-detail-breadcrumb-current {
    color: #4b5563;
}

.admin-detail-breadcrumb-sep {
    color: #9ca3af;
}

.admin-detail-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.admin-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.admin-detail-btn--primary {
    background: #5b9bd5;
    border-color: #4a8cc8;
    color: #fff;
}

.admin-detail-btn--primary:hover {
    background: #4f8fc9;
}

.admin-detail-btn--secondary {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}

.admin-detail-btn--secondary:hover {
    background: #f9fafb;
}

.admin-detail-panel {
    border: 1px solid #d5dce8;
    border-radius: 6px;
    background: #fff;
    padding: 18px 20px 8px;
}

.admin-detail-form {
    display: block;
}

.admin-detail-section {
    padding: 0 0 18px;
    margin: 0 0 18px;
    border-bottom: 1px solid #e5e7eb;
}

.admin-detail-section--last {
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 0;
}

.admin-detail-section-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.admin-detail-field {
    display: block;
    margin: 0 0 14px;
}

.admin-detail-field--wide {
    max-width: 520px;
}

.admin-detail-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #9ca3af;
}

.admin-detail-label--hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-detail-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #f9fafb;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    cursor: help;
}

.admin-detail-input {
    width: 100%;
    max-width: 220px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: #374151;
    outline: none;
}

.admin-detail-input:focus {
    border-color: #5b9bd5;
    box-shadow: 0 0 0 2px rgba(91, 155, 213, 0.18);
}

.admin-detail-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.admin-detail-checkbox input[type="checkbox"] {
    margin-top: 2px;
    width: 15px;
    height: 15px;
    accent-color: #5b9bd5;
    flex-shrink: 0;
}

.admin-detail-paired-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 48px;
    align-items: start;
}

.admin-detail-paired-grid--compact .admin-detail-checkbox {
    margin-bottom: 10px;
}

.admin-detail-paired-spacer {
    min-height: 1px;
}

.toggle-chip-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
}

.toggle-chip-group:focus-within {
    border-color: #5b9bd5;
    box-shadow: 0 0 0 2px rgba(91, 155, 213, 0.18);
}

.toggle-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid #c5ced8;
    border-radius: 4px;
    background: linear-gradient(180deg, #f8fafc 0%, #e8edf2 100%);
    color: #4b5563;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 1px 2px rgba(15, 23, 42, 0.08);
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        transform 0.12s ease;
}

.toggle-chip:hover:not(.is-selected) {
    background: linear-gradient(180deg, #f1f5f9 0%, #dde4ec 100%);
    border-color: #b8c4d0;
}

.toggle-chip.is-selected {
    background: #d5dde6;
    border-color: #a8b4c2;
    color: #374151;
    box-shadow:
        inset 0 2px 4px rgba(15, 23, 42, 0.16),
        inset 0 1px 2px rgba(15, 23, 42, 0.1);
    transform: translateY(1px);
}

.toggle-chip:focus-visible {
    outline: 2px solid #5b9bd5;
    outline-offset: 1px;
}

@media (max-width: 900px) {
    .admin-detail-paired-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .admin-detail-paired-spacer {
        display: none;
    }

    .admin-detail-field--wide,
    .admin-detail-input {
        max-width: 100%;
    }
}

.accounts-page,
.meetings-page,
.documents-page,
.calls-page,
.tickets-page,
.tasks-page,
.meeting-create-page,
.document-create-page,
.call-create-page,
.ticket-create-page,
.task-create-page,
.module-page,
.opportunities-page,
.opportunity-create-page,
.password-page {
    overflow-y: auto;
}

.administration-page.admin-detail-page {
    overflow-y: auto;
}

.main--dashboard .dashboard-page {
    background: var(--bg-page);
}

.header-tabs,
.dashboard-tabs {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    padding-left: 4px;
    scrollbar-width: none;
}

.header-tabs::-webkit-scrollbar,
.dashboard-tabs::-webkit-scrollbar {
    display: none;
}

.header-tab,
.dashboard-tab {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    height: 100%;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: default;
    flex-shrink: 0;
}

a.header-tab,
a.dashboard-tab {
    cursor: pointer;
}

a.header-tab:hover,
a.dashboard-tab:hover {
    color: var(--text);
}

.header-tab.is-active,
.dashboard-tab.is-active {
    color: var(--color-deep);
    border-bottom-color: var(--color-deep);
}

.header-tab-more,
.dashboard-tab-more {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0 10px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    height: 100%;
    flex-shrink: 0;
}

/* Dashboard (Inicio) — EspoCRM layout */
.dashboard-page {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 0;
    overflow: visible;
}

.dashboard-page .dashboard-grid {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: visible;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 10px 12px 0;
    align-items: start;
    min-height: 0;
    overflow: visible;
}

.dashlet--calendar {
    grid-column: 1 / 9;
    grid-row: 1;
}

.dashlet--chart {
    grid-column: 9 / -1;
    grid-row: 1;
}

.dashlet--activities {
    grid-column: 1 / 7;
    grid-row: 2;
}

.dashlet--cases {
    grid-column: 7 / -1;
    grid-row: 2;
}

.dashlet--calendar,
.dashlet--chart,
.dashlet--activities,
.dashlet--cases {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dashlet.dashlet--calendar {
    height: auto;
    overflow: visible;
}

.dashlet--chart {
    height: 100%;
}

.dashlet--activities,
.dashlet--cases {
    height: var(--dashlet-pair-height);
    min-height: var(--dashlet-pair-height);
    max-height: var(--dashlet-pair-height);
    align-self: start;
    overflow: hidden;
}

.dashlet--activities .dashlet-header,
.dashlet--cases .dashlet-header {
    flex-shrink: 0;
}

.dashlet--calendar .calendar-wrap {
    flex: 0 0 auto;
    overflow: visible;
}

.dashlet--calendar .calendar-full-wrap {
    flex: 0 0 auto;
    overflow: visible;
    padding: 0 8px 8px;
}

.dashlet--calendar .calendar-full-row {
    min-height: 52px;
    flex: 0 0 auto;
}

.dashlet--calendar .calendar-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.dashlet--calendar .dashlet-breadcrumb-current {
    color: inherit;
    text-decoration: none;
}

.dashlet--calendar .dashlet-breadcrumb-current:hover {
    color: var(--color-accent);
}

.dashlet--calendar .calendar-days {
    grid-template-rows: repeat(6, minmax(48px, auto));
}

.dashlet--activities .activity-list {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.dashlet--activities .activity-item {
    min-height: var(--activity-item-height);
    box-sizing: border-box;
}

.dashlet--cases .cases-table {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashlet--cases .cases-head {
    flex-shrink: 0;
}

.dashlet--cases .cases-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.dashlet--chart .chart-wrap {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.dashlet {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: none;
    min-width: 0;
    overflow: hidden;
}

.dashlet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--white) 85%, var(--color-blue));
    min-height: 34px;
}

.dashlet-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.dashlet-breadcrumb {
    font-weight: 400;
    color: var(--link);
}

.dashlet-breadcrumb-sep {
    margin: 0 4px;
    color: var(--text-muted);
    font-weight: 400;
}

.dashlet-breadcrumb-current {
    font-weight: 600;
    color: var(--text);
}

.calendar-nav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.calendar-nav-btn {
    width: 22px;
    height: 22px;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    font-size: 14px;
    padding: 0;
}

.activity-list,
.cases-list,
.chart-legend {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-list {
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 16px;
    padding-top: 2px;
    display: flex;
    flex-shrink: 0;
    color: var(--text-muted);
}

.activity-body {
    min-width: 0;
    flex: 1;
}

.activity-title {
    display: block;
    font-size: 12px;
    color: var(--link);
    text-decoration: none;
    margin-bottom: 3px;
    line-height: 1.35;
}

.activity-title:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.activity-date {
    font-size: 11px;
    color: var(--text-muted);
}

.activity-related {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
}

.activity-related:hover {
    color: var(--link);
    text-decoration: underline;
}

.badge {
    display: inline-block;
    font-size: 10px;
    line-height: 1.25;
    padding: 1px 6px;
    border-radius: 2px;
    font-weight: 500;
}

.badge--neutral {
    background: color-mix(in srgb, var(--color-charcoal) 12%, var(--white));
    color: var(--color-charcoal);
}

.badge--planned {
    background: color-mix(in srgb, var(--color-indigo) 18%, var(--white));
    color: var(--color-indigo);
}

.badge--started {
    background: color-mix(in srgb, var(--color-blue) 20%, var(--white));
    color: var(--color-deep);
}

.badge--urgent {
    background: color-mix(in srgb, var(--color-accent) 35%, var(--white));
    color: var(--color-deep);
}

.badge--pending {
    background: color-mix(in srgb, var(--color-indigo) 25%, var(--white));
    color: var(--color-deep);
}

.badge--new {
    background: color-mix(in srgb, var(--color-blue) 15%, var(--white));
    color: var(--color-deep);
}

.badge--assigned {
    background: color-mix(in srgb, var(--color-blue) 22%, var(--white));
    color: var(--color-deep);
}

.badge--priority-high {
    background: color-mix(in srgb, var(--color-accent) 28%, var(--white));
    color: var(--color-deep);
}

.calendar-wrap {
    padding: 6px 8px 10px;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}

.calendar-weekdays span {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 5px 0;
    background: color-mix(in srgb, var(--white) 80%, var(--color-blue));
    font-weight: 500;
}

.dashlet--calendar .calendar-day {
    position: relative;
    min-height: 52px;
    height: 100%;
    padding: 2px 3px 3px;
    background: var(--white);
    font-size: 10px;
    vertical-align: top;
    overflow: hidden;
}

.calendar-day:not(.is-outside):not(.is-weekend) {
    background: var(--white);
}

.calendar-day.is-outside {
    background: color-mix(in srgb, var(--color-blue) 24%, var(--white));
}

.calendar-day.is-outside .calendar-day-num {
    color: color-mix(in srgb, var(--text-muted) 65%, var(--white));
}

.calendar-day.is-weekend:not(.is-outside) {
    background: color-mix(in srgb, var(--color-blue) 14%, var(--white));
}

.calendar-day.is-today:not(.is-outside) {
    background: color-mix(in srgb, var(--color-accent) 16%, var(--white));
}

.calendar-day.is-today .calendar-day-num {
    color: var(--color-deep);
    font-weight: 700;
}

.calendar-day-num {
    position: absolute;
    top: 3px;
    right: 4px;
    color: var(--text-muted);
    line-height: 1.2;
    font-size: 11px;
    z-index: 1;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 16px;
}

.calendar-event {
    display: block;
    font-size: 10px;
    line-height: 1.25;
    padding: 2px 4px;
    border-radius: 1px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event-time {
    font-weight: 600;
}

.calendar-event--green { background: #6fc078; }
.calendar-event--red { background: #d9534f; }
.calendar-event--blue { background: var(--color-blue); }
.calendar-event--orange { background: #e5a331; }
.calendar-event--purple { background: var(--color-indigo); }

.calendar-weekdays span:nth-child(6),
.calendar-weekdays span:nth-child(7) {
    background: color-mix(in srgb, var(--color-blue) 14%, var(--white));
}

.cases-table {
    font-size: 12px;
}

.cases-head,
.cases-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 100px minmax(120px, auto);
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
}

.cases-head {
    color: var(--text-muted);
    font-size: 11px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--white) 85%, var(--color-blue));
}

.cases-row {
    border-bottom: 1px solid var(--border);
}

.cases-row:last-child {
    border-bottom: none;
}

.cases-id {
    color: var(--text-muted);
}

.cases-title {
    color: var(--link);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cases-title:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.cases-type {
    color: var(--text-muted);
}

.cases-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.dashlet--chart .chart-wrap {
    flex: 1;
    padding: 12px 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.dashlet--chart .pie-chart {
    width: min(210px, 100%);
    height: min(210px, 100%);
    max-width: 210px;
    max-height: 210px;
    aspect-ratio: 1;
    border-radius: 50%;
    flex-shrink: 0;
}

.dashlet--chart .chart-legend {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-items: start;
    column-gap: 14px;
    row-gap: 5px;
    font-size: 11px;
    color: var(--text);
}

.dashlet--chart .chart-legend li {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
}

.chart-swatch {
    width: 9px;
    height: 9px;
    border-radius: 1px;
    flex-shrink: 0;
}

.app-footer {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    align-items: center;
    min-height: var(--shell-footer-height);
    padding: 10px 16px 14px;
    font-size: 11px;
    color: var(--text-muted);
    background: transparent;
    border-top: none;
    box-sizing: border-box;
}

.app-footer small {
    display: block;
    line-height: 1.2;
}

/* Copyright directly under My Activities on dashboard */
.app-footer--below-activities {
    flex-shrink: 0;
    width: calc(50% - 5px);
    margin: 0 0 0 12px;
    padding: 4px 0 0;
    min-height: 0;
}

.app-footer--below-prospecting {
    flex-shrink: 0;
    width: calc((100% - 32px) / 5);
    min-height: 0;
    padding: 0;
    margin-top: 0;
}

.app-footer--below-calendario {
    flex-shrink: 0;
    width: 100%;
    min-height: var(--shell-footer-height);
    margin: 0;
    padding: 0 4px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* Opportunities kanban */
.opportunities-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
    padding: 16px 14px 12px;
    background: #eef0f2;
}

.opportunities-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 34px;
}

.opportunities-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.opportunities-title-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #83bd5a;
    flex-shrink: 0;
}

.opportunities-title {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.opportunities-subtitle {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.opportunities-create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 31px;
    padding: 5px 10px;
    border: 1px solid #d7dee5;
    border-radius: 4px;
    color: var(--text);
    background: #fff;
    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    box-shadow: none;
}

.opportunities-create:hover {
    background: #f8fafc;
}

.opportunities-toolbar {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(200px, 1.5fr) auto;
    align-items: center;
    width: min(620px, 100%);
    border: 1px solid #d8dde3;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    overflow: hidden;
}

.opportunities-filter,
.opportunities-more {
    min-height: 31px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.opportunities-filter {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    border-right: 1px solid #d8dde3;
    color: var(--text);
}

.opportunities-filter::after {
    content: "";
    width: 0;
    height: 0;
    margin-left: 5px;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.65;
}

.opportunities-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.opportunities-search input {
    width: 100%;
    min-height: 31px;
    padding: 5px 34px 5px 10px;
    border: none;
    color: var(--text);
    background: transparent;
    outline: none;
}

.opportunities-search svg {
    position: absolute;
    right: 10px;
    color: var(--text-muted);
}

.opportunities-more {
    width: 34px;
    border-left: 1px solid #d8dde3;
    font-size: 16px;
    line-height: 1;
}

.opportunities-viewbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-height: 22px;
    padding: 2px 8px 0 0;
}

.opportunities-board-summary {
    color: var(--text-muted);
    font-size: 12px;
}

.opportunities-view {
    display: inline-grid;
    gap: 2px;
    width: 18px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.opportunities-view span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.opportunities-view.is-active {
    color: var(--text);
}

.kanban-board {
    flex: 0 0 var(--opportunities-board-height);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    height: var(--opportunities-board-height);
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 0;
    scrollbar-color: color-mix(in srgb, var(--color-blue) 42%, var(--white)) transparent;
}

.kanban-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 0;
    border-radius: 4px;
    background: transparent;
}

.kanban-column-header {
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: none;
}

.kanban-column-header--gray {
    background: #9b9b9b;
}

.kanban-column-header--blue {
    background: #5a96d8;
}

.kanban-column-header--orange {
    background: #e5a331;
}

.kanban-column-header--green {
    background: #6fc078;
}

.kanban-column-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--opportunity-card-gap);
    min-height: 0;
    max-height: calc(
        (var(--opportunity-visible-cards) * var(--opportunity-card-height)) +
        ((var(--opportunity-visible-cards) - 1) * var(--opportunity-card-gap)) +
        10px
    );
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1px 0 10px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    transition: background 0.12s ease, outline-color 0.12s ease;
}

.kanban-column.is-drag-over .kanban-column-list {
    background: color-mix(in srgb, var(--color-accent) 12%, transparent);
    outline: 1px dashed color-mix(in srgb, var(--color-blue) 60%, var(--white));
    outline-offset: 3px;
}

.opportunity-card {
    position: relative;
    display: grid;
    gap: 8px;
    min-height: var(--opportunity-card-height);
    padding: 8px;
    border: 1px solid #dde2e7;
    border-radius: 5px;
    background: var(--white);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: grab;
    user-select: none;
    transition: opacity 0.12s ease, border-color 0.12s ease;
}

.opportunity-card:hover {
    border-color: #c8d5e0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

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

.opportunity-card.is-dragging {
    opacity: 0.55;
}

.opportunity-card.is-saving {
    opacity: 0.7;
    pointer-events: none;
}

.opportunity-card-top {
    min-width: 0;
}

.opportunity-card-title {
    color: var(--link);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    text-decoration: none;
}

.opportunity-card-title:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.opportunity-card-amount {
    justify-self: end;
    color: var(--text);
    font-size: 17px;
    font-weight: 400;
    line-height: 1;
}

.opportunity-card-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
}

.opportunity-account {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opportunity-account::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 4px;
    border-radius: 1px;
    background: #d2bd58;
    vertical-align: 1px;
}

.opportunity-date {
    white-space: nowrap;
}

.layout:has(.main--dashboard) {
    grid-template-rows: var(--shell-top-height) auto;
}

.layout:has(.main--dashboard) .sidebar-rail {
    display: none;
}

.layout:has(.opportunities-page) {
    grid-template-rows: var(--shell-top-height) auto;
    align-content: start;
}

.layout:has(.opportunities-page) .sidebar-rail {
    display: none;
}

.layout:has(.opportunity-create-page) {
    grid-template-rows: var(--shell-top-height) auto;
    align-content: start;
}

.layout:has(.opportunity-create-page) .sidebar-rail {
    display: none;
}

.layout:has(.opportunity-create-page) .main {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.layout:has(.opportunity-create-page) .header-bar,
.layout:has(.opportunity-create-page) .opportunity-create-page,
.layout:has(.opportunity-create-page) .app-footer {
    grid-column: auto;
    grid-row: auto;
}

.layout:has(.meeting-create-page),
.layout:has(.document-create-page),
.layout:has(.call-create-page) {
    grid-template-rows: var(--shell-top-height) auto;
    align-content: start;
}

.layout:has(.meeting-create-page) .sidebar-rail,
.layout:has(.document-create-page) .sidebar-rail,
.layout:has(.call-create-page) .sidebar-rail {
    display: none;
}

.layout:has(.meeting-create-page) .main,
.layout:has(.document-create-page) .main,
.layout:has(.call-create-page) .main {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.layout:has(.meeting-create-page) .header-bar,
.layout:has(.meeting-create-page) .meeting-create-page,
.layout:has(.meeting-create-page) .app-footer,
.layout:has(.document-create-page) .header-bar,
.layout:has(.document-create-page) .document-create-page,
.layout:has(.document-create-page) .app-footer,
.layout:has(.call-create-page) .header-bar,
.layout:has(.call-create-page) .call-create-page,
.layout:has(.call-create-page) .app-footer {
    grid-column: auto;
    grid-row: auto;
}

.layout:has(.meeting-create-page) .app-footer,
.layout:has(.document-create-page) .app-footer,
.layout:has(.call-create-page) .app-footer {
    min-height: 0;
    padding: 4px 16px 8px;
}

@media (max-width: 900px) {
    .header-search-center {
        width: min(280px, calc(100% - 120px));
    }

    .dashboard-page {
        max-height: none;
        overflow: visible;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, minmax(280px, auto));
        overflow: visible;
    }

    .dashlet--calendar,
    .dashlet--chart,
    .dashlet--activities,
    .dashlet--cases {
        grid-column: 1;
        grid-row: auto;
        max-height: none;
    }

    .dashlet--activities,
    .dashlet--cases {
        min-height: 0;
    }

    .cases-head {
        display: none;
    }

    .cases-row {
        grid-template-columns: 44px 1fr;
        grid-template-rows: auto auto auto;
    }

    .cases-type,
    .cases-badges {
        grid-column: 2;
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-rows: var(--shell-top-height) 1fr var(--shell-footer-height);
    }

    .sidebar-brand,
    .sidebar-nav-block,
    .sidebar-rail {
        display: none;
    }

    .header-bar,
    .dashboard-page,
    .accounts-page,
    .module-page,
    .opportunities-page,
    .opportunity-create-page,
    .calendar-page,
    .app-footer {
        grid-column: 1;
    }

    .header-bar {
        grid-row: 1;
    }

    .dashboard-page,
    .accounts-page,
    .module-page,
    .opportunities-page,
    .opportunity-create-page,
    .calendar-page {
        grid-row: 2;
    }

    .app-footer {
        grid-row: 3;
    }

    .layout:has(.main--dashboard) {
        grid-template-rows: var(--shell-top-height) auto;
    }

    .app-footer--below-activities {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
    }
}

@media (max-width: 1100px) {
    .kanban-board {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .opportunities-page {
        padding: 12px;
    }

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

    .opportunities-toolbar {
        grid-template-columns: 104px minmax(0, 1fr) 34px;
        width: 100%;
    }

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

/* Accounts screen */
.accounts-page {
    padding: 18px 20px 24px;
    background: var(--bg-page);
    min-height: auto;
}

.accounts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.accounts-title {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    color: var(--text);
}

.accounts-create-btn {
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.accounts-create-btn:hover {
    background: var(--sidebar-hover);
}

.accounts-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.accounts-filter-btn {
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 88px;
    text-align: left;
    cursor: pointer;
}

.accounts-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: 10px;
    padding: 0 10px;
    max-width: 460px;
}

.accounts-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.accounts-search input {
    border: 0;
    outline: none;
    width: 100%;
    padding: 8px 0;
    font-size: 13px;
    background: transparent;
    color: var(--text);
}

.accounts-search input::placeholder {
    color: var(--text-muted);
}

.accounts-table-wrap {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-white);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.accounts-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.accounts-page-actions {
    display: inline-flex;
    gap: 4px;
}

.page-arrow {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    background: var(--bg-white);
    line-height: 1;
}

.page-arrow:hover {
    background: var(--sidebar-hover);
}

.page-arrow.is-disabled {
    color: var(--text-muted);
    background: color-mix(in srgb, var(--white) 80%, var(--color-blue));
    cursor: not-allowed;
}

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

.accounts-table thead th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    background: color-mix(in srgb, var(--white) 85%, var(--color-blue));
}

.accounts-table tbody td {
    border-bottom: 1px solid var(--border);
    padding: 9px 12px;
    color: var(--text);
}

.accounts-table tbody tr:hover td {
    background: color-mix(in srgb, var(--white) 92%, var(--color-blue));
}

.accounts-table tbody tr:last-child td {
    border-bottom: none;
}

.accounts-table a {
    color: var(--primary-blue-dark);
    text-decoration: none;
}

.accounts-table a:hover {
    text-decoration: underline;
}

.accounts-table th:first-child,
.accounts-table td:first-child {
    width: 32px;
}

.accounts-table th:last-child,
.accounts-table td:last-child {
    width: 26px;
    text-align: right;
}

.account-type {
    color: var(--primary-blue-dark);
}

.row-menu {
    color: var(--text-muted);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    line-height: 1;
}

.row-menu-cell {
    position: relative;
    text-align: right;
}

.row-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 20;
    min-width: 140px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.row-menu-dropdown a,
.row-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.row-menu-dropdown a:hover,
.row-menu-dropdown button:hover {
    background: var(--sidebar-hover);
}

.row-menu-dropdown form {
    margin: 0;
}

.task-card,
.opportunity-card {
    position: relative;
}

.crm-card-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
    z-index: 2;
}

.task-card .crm-card-delete {
    top: auto;
    right: auto;
    bottom: 6px;
    left: 6px;
}

.crm-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
}

.crm-delete-btn svg {
    display: block;
}

.crm-delete-btn:hover {
    background: color-mix(in srgb, #d9534f 12%, var(--white));
    color: #b91c1c;
    border-color: color-mix(in srgb, #d9534f 35%, var(--border));
}

.crm-row-delete {
    margin: 0;
}

.row-menu-cell .crm-delete-btn {
    margin: 0 auto;
}

.row-menu-dropdown .crm-delete-btn--menu {
    width: 100%;
    height: 28px;
}

.layout:has(.meetings-page),
.layout:has(.documents-page),
.layout:has(.calls-page),
.layout:has(.tickets-page) {
    grid-template-rows: var(--shell-top-height) auto;
    align-content: start;
}

.layout:has(.tasks-page) {
    grid-template-rows: var(--shell-top-height) auto var(--shell-footer-height);
    align-content: start;
}

.layout:has(.meetings-page) .sidebar-rail,
.layout:has(.documents-page) .sidebar-rail,
.layout:has(.calls-page) .sidebar-rail,
.layout:has(.tickets-page) .sidebar-rail,
.layout:has(.tasks-page) .sidebar-rail {
    display: none;
}

.layout:has(.meetings-page) .app-footer,
.layout:has(.documents-page) .app-footer,
.layout:has(.calls-page) .app-footer,
.layout:has(.tickets-page) .app-footer,
.layout:has(.tasks-page) .app-footer {
    min-height: 0;
    padding: 2px 16px 6px;
    margin-top: -2px;
}

.layout--module,
.layout:has(.module-page) {
    grid-template-rows: var(--shell-top-height) auto var(--shell-footer-height);
    align-content: start;
}

.layout--module .sidebar-rail,
.layout:has(.module-page) .sidebar-rail {
    display: none;
}

.layout--module .app-footer,
.layout:has(.module-page) .app-footer {
    min-height: 0;
    padding: 2px 16px 6px;
    margin-top: -2px;
}

/* Meetings screen */
.meetings-page {
    padding: 12px 20px 4px;
    background: var(--bg-page);
}

.meetings-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.meetings-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.meetings-create-btn {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: var(--color-deep);
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(1, 40, 55, 0.15);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.meetings-create-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.meetings-filters {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.meetings-filter-select {
    min-width: 110px;
    height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    border-radius: 10px 0 0 10px;
}

.meetings-filter-select:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-blue) 18%, transparent);
}

.meetings-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    min-width: 200px;
    max-width: 420px;
    border: 1px solid var(--border);
    border-left: 0;
    background: var(--white);
    border-radius: 0 10px 10px 0;
    padding: 0 12px;
}

.meetings-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.meetings-search input {
    border: 0;
    outline: none;
    width: 100%;
    padding: 6px 0;
    font-size: 12px;
    background: transparent;
    color: var(--text);
}

.meetings-search input::placeholder {
    color: var(--text-muted);
}

.meetings-more-btn {
    width: 32px;
    height: 32px;
    margin-left: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.meetings-more-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.meetings-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.meetings-page-actions {
    display: inline-flex;
    gap: 4px;
}

.meetings-table-wrap {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    margin-bottom: 0;
}

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

.meetings-table thead th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--border);
    padding: 5px 10px;
    background: color-mix(in srgb, var(--white) 88%, var(--color-blue));
    white-space: nowrap;
}

.meetings-table tbody td {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    padding: 4px 10px;
    color: var(--text);
    vertical-align: middle;
    line-height: 1.25;
}

.meetings-table tbody tr:hover td {
    background: color-mix(in srgb, var(--color-accent) 8%, var(--white));
}

.meetings-table tbody tr:last-child td {
    border-bottom: none;
}

.meetings-table th:first-child,
.meetings-table td:first-child {
    width: 36px;
}

.meetings-table th:last-child,
.meetings-table td:last-child {
    width: 28px;
    text-align: right;
}

.meetings-cell-name a {
    color: var(--color-deep);
    font-weight: 500;
    text-decoration: none;
}

.meetings-cell-name a:hover {
    text-decoration: underline;
}

.meetings-cell-date {
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.meeting-status {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.meeting-status--planned {
    background: color-mix(in srgb, var(--text-muted) 14%, var(--white));
    color: var(--text);
}

.meeting-status--held {
    background: color-mix(in srgb, #6fc078 22%, var(--white));
    color: #2d6a34;
}

.meeting-parent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meeting-parent-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.meeting-parent-dot--green { background: #6fc078; }
.meeting-parent-dot--blue { background: var(--color-blue); }
.meeting-parent-dot--orange { background: #e5a331; }
.meeting-parent-dot--red { background: #d9534f; }
.meeting-parent-dot--purple { background: var(--color-indigo); }

.meeting-assignee {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.meeting-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-deep) 12%, var(--white));
    color: var(--color-deep);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.meeting-assignee-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

@media (max-width: 1100px) {
    .meetings-filters {
        flex-direction: column;
        align-items: stretch;
    }

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

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

    .meetings-table {
        min-width: 880px;
    }
}

/* Documents screen */
.documents-page {
    padding: 12px 20px 4px;
    background: var(--bg-page);
}

.documents-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.documents-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.documents-create-btn {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: var(--color-deep);
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(1, 40, 55, 0.15);
    transition: filter 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.documents-create-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.documents-filters {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.documents-filter-select {
    min-width: 110px;
    height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    border-radius: 10px 0 0 10px;
}

.documents-filter-select:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-blue) 18%, transparent);
}

.documents-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    min-width: 200px;
    max-width: 420px;
    border: 1px solid var(--border);
    border-left: 0;
    background: var(--white);
    border-radius: 0 10px 10px 0;
    padding: 0 12px;
}

.documents-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.documents-search input {
    border: 0;
    outline: none;
    width: 100%;
    padding: 6px 0;
    font-size: 12px;
    background: transparent;
    color: var(--text);
}

.documents-search input::placeholder {
    color: var(--text-muted);
}

.documents-more-btn {
    width: 32px;
    height: 32px;
    margin-left: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.documents-more-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.documents-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.documents-page-actions {
    display: inline-flex;
    gap: 4px;
}

.documents-table-wrap {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    margin-bottom: 0;
}

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

.documents-table thead th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--border);
    padding: 5px 10px;
    background: color-mix(in srgb, var(--white) 88%, var(--color-blue));
    white-space: nowrap;
}

.documents-table tbody td {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    padding: 4px 10px;
    color: var(--text);
    vertical-align: middle;
    line-height: 1.25;
}

.documents-table tbody tr:hover td {
    background: color-mix(in srgb, var(--color-accent) 8%, var(--white));
}

.documents-table tbody tr:last-child td {
    border-bottom: none;
}

.documents-table th:first-child,
.documents-table td:first-child {
    width: 36px;
}

.documents-table th:last-child,
.documents-table td:last-child {
    width: 28px;
    text-align: right;
}

.documents-cell-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.documents-cell-name a {
    color: var(--color-deep);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.documents-cell-name a:hover {
    text-decoration: underline;
}

.documents-cell-size,
.documents-cell-date {
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.document-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    flex-shrink: 0;
}

.document-file-icon--pdf {
    background: color-mix(in srgb, #ef4444 14%, var(--white));
    color: #b91c1c;
}

.document-file-icon--docx {
    background: color-mix(in srgb, #2563eb 14%, var(--white));
    color: #1d4ed8;
}

.document-file-icon--xlsx {
    background: color-mix(in srgb, #16a34a 14%, var(--white));
    color: #15803d;
}

.document-file-icon--pptx {
    background: color-mix(in srgb, #ea580c 14%, var(--white));
    color: #c2410c;
}

.document-file-icon--other {
    background: color-mix(in srgb, var(--text-muted) 14%, var(--white));
    color: var(--text-muted);
}

.document-type {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.document-type--pdf {
    background: color-mix(in srgb, #ef4444 16%, var(--white));
    color: #b91c1c;
}

.document-type--docx {
    background: color-mix(in srgb, #2563eb 16%, var(--white));
    color: #1d4ed8;
}

.document-type--xlsx {
    background: color-mix(in srgb, #16a34a 16%, var(--white));
    color: #15803d;
}

.document-type--pptx {
    background: color-mix(in srgb, #ea580c 16%, var(--white));
    color: #c2410c;
}

.document-type--other {
    background: color-mix(in srgb, var(--text-muted) 16%, var(--white));
    color: var(--text-muted);
}

.document-related {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-related-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.document-related-dot--green { background: #6fc078; }
.document-related-dot--blue { background: var(--color-blue); }
.document-related-dot--orange { background: #e5a331; }
.document-related-dot--red { background: #d9534f; }
.document-related-dot--purple { background: var(--color-indigo); }

.document-uploader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.document-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-deep) 12%, var(--white));
    color: var(--color-deep);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.document-uploader-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

@media (max-width: 1100px) {
    .documents-filters {
        flex-direction: column;
        align-items: stretch;
    }

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

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

    .documents-table {
        min-width: 960px;
    }
}

/* Calls screen */
.calls-page {
    padding: 12px 20px 4px;
    background: var(--bg-page);
}

.calls-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.calls-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.calls-create-btn {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.calls-create-btn:hover {
    background: var(--sidebar-hover);
    border-color: color-mix(in srgb, var(--border) 70%, var(--text-muted));
}

.calls-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.calls-filter-select {
    min-width: 110px;
    height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

.calls-search {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-width: 200px;
    max-width: none;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
}

.calls-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 13px;
    background: transparent;
    min-width: 0;
}

.calls-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    border: none;
    border-left: 1px solid var(--border);
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
}

.calls-search-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.calls-more-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 8px;
}

.calls-more-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.calls-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.calls-page-actions {
    display: inline-flex;
    gap: 2px;
}

.calls-table-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

.calls-table thead th {
    padding: 8px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--bg-page) 55%, var(--white));
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.calls-table tbody td {
    padding: 6px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
    vertical-align: middle;
}

.calls-table tbody tr:hover td {
    background: color-mix(in srgb, var(--color-blue) 4%, var(--white));
}

.calls-table tbody tr:last-child td {
    border-bottom: none;
}

.calls-th-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calls-th-name input[type="checkbox"] {
    margin: 0;
}

.calls-col-menu {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 10px;
}

.calls-th-sorted {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.calls-sort-icon {
    font-size: 11px;
    color: var(--color-deep);
    font-weight: 600;
}

.calls-cell-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.calls-cell-name a {
    color: var(--link, var(--color-blue));
    text-decoration: none;
    font-weight: 500;
}

.calls-cell-name a:hover {
    text-decoration: underline;
}

.calls-cell-date {
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.call-status {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.call-status--planned {
    background: color-mix(in srgb, var(--text-muted) 14%, var(--white));
    color: var(--text);
}

.call-status--held {
    background: color-mix(in srgb, #6fc078 22%, var(--white));
    color: #2d6a34;
}

.call-status--not_held {
    background: color-mix(in srgb, #d9534f 16%, var(--white));
    color: #8b3a3a;
}

.call-parent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-parent-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.call-parent-dot--green { background: #6fc078; }
.call-parent-dot--blue { background: var(--color-blue); }
.call-parent-dot--orange { background: #e5a331; }
.call-parent-dot--red { background: #d9534f; }
.call-parent-dot--purple { background: var(--color-indigo); }

.call-assignee {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.call-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-deep) 12%, var(--white));
    color: var(--color-deep);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.call-assignee-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

@media (max-width: 1100px) {
    .calls-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .calls-filter-select {
        width: 100%;
    }

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

    .calls-table {
        min-width: 880px;
    }
}

/* Tickets screen */
.tickets-page {
    padding: 12px 20px 4px;
    background: var(--bg-page);
}

.tickets-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tickets-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.tickets-create-btn {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tickets-create-btn:hover {
    background: var(--sidebar-hover);
    border-color: color-mix(in srgb, var(--border) 70%, var(--text-muted));
}

.tickets-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.tickets-filter-select {
    min-width: 110px;
    height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

.tickets-search {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-width: 200px;
    max-width: none;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
}

.tickets-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 13px;
    background: transparent;
    min-width: 0;
}

.tickets-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    border: none;
    border-left: 1px solid var(--border);
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
}

.tickets-search-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.tickets-more-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 8px;
}

.tickets-more-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.tickets-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.tickets-page-actions {
    display: inline-flex;
    gap: 2px;
}

.tickets-table-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

.tickets-table thead th {
    padding: 8px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--bg-page) 55%, var(--white));
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.tickets-table tbody td {
    padding: 6px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
    vertical-align: middle;
}

.tickets-table tbody tr:hover td {
    background: color-mix(in srgb, var(--color-blue) 4%, var(--white));
}

.tickets-table tbody tr:last-child td {
    border-bottom: none;
}

.tickets-th-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tickets-th-name input[type="checkbox"] {
    margin: 0;
}

.tickets-col-menu {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 10px;
}

.tickets-th-sorted {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tickets-sort-icon {
    font-size: 11px;
    color: var(--color-deep);
    font-weight: 600;
}

.tickets-cell-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tickets-cell-name a {
    color: var(--link, var(--color-blue));
    text-decoration: none;
    font-weight: 500;
}

.tickets-cell-name a:hover {
    text-decoration: underline;
}

.tickets-cell-number {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.ticket-status {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.ticket-status--new {
    background: color-mix(in srgb, var(--text-muted) 14%, var(--white));
    color: var(--text);
}

.ticket-status--pending {
    background: color-mix(in srgb, #e5a331 24%, var(--white));
    color: #8a5a12;
}

.ticket-status--assigned {
    background: color-mix(in srgb, var(--color-blue) 18%, var(--white));
    color: var(--color-deep);
}

.ticket-status--closed {
    background: color-mix(in srgb, #6fc078 22%, var(--white));
    color: #2d6a34;
}

.ticket-status--rejected {
    background: color-mix(in srgb, var(--color-indigo) 20%, var(--white));
    color: var(--color-indigo);
}

.ticket-priority {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    font-size: 12px;
    white-space: nowrap;
}

.ticket-priority--normal {
    color: var(--text);
}

.ticket-priority--low {
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 12%, var(--white));
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.ticket-priority--high {
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, #e5a331 24%, var(--white));
    color: #8a5a12;
    font-size: 11px;
    font-weight: 500;
}

.ticket-priority--urgent {
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, #d9534f 18%, var(--white));
    color: #8b3a3a;
    font-size: 11px;
    font-weight: 500;
}

.ticket-account {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-account-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.ticket-account-dot--green { background: #6fc078; }
.ticket-account-dot--blue { background: var(--color-blue); }
.ticket-account-dot--orange { background: #e5a331; }
.ticket-account-dot--red { background: #d9534f; }
.ticket-account-dot--purple { background: var(--color-indigo); }

.ticket-assignee {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ticket-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-blue) 18%, var(--white));
    color: var(--color-deep);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.ticket-assignee-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.ticket-attachments-field {
    margin-top: 4px;
}

.ticket-attachment-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
}

.ticket-attachment-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.ticket-hidden-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 4px;
}

@media (max-width: 1100px) {
    .tickets-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .tickets-filter-select {
        width: 100%;
    }

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

    .tickets-table {
        min-width: 920px;
    }
}

/* Tasks Kanban screen */
.tasks-page {
    --task-card-height: 104px;
    --task-card-gap: 8px;
    --tasks-visible-cards: 4;
    --tasks-column-body-height: 450px;
    --tasks-column-head-height: 44px;
    --tasks-column-height: 494px;

    padding: 12px 20px 16px;
    background: var(--bg-page);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.tasks-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tasks-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.tasks-create-btn {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tasks-create-btn:hover {
    background: var(--sidebar-hover);
    border-color: color-mix(in srgb, var(--border) 70%, var(--text-muted));
}

.tasks-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tasks-filter-select {
    min-width: 110px;
    height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

.tasks-search {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-width: 200px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
}

.tasks-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 13px;
    background: transparent;
    min-width: 0;
}

.tasks-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    border: none;
    border-left: 1px solid var(--border);
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
}

.tasks-search-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.tasks-kanban {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 12px;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 4px;
    box-sizing: border-box;
}

.tasks-column {
    display: flex;
    flex-direction: column;
    min-width: 260px;
    height: var(--tasks-column-height);
    min-height: var(--tasks-column-height);
    max-height: var(--tasks-column-height);
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in srgb, var(--white) 55%, var(--bg-page));
}

.tasks-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px 10px 0 0;
}

.tasks-column--grey .tasks-column-head {
    background: color-mix(in srgb, #9ca3af 28%, var(--white));
}

.tasks-column--blue .tasks-column-head {
    background: color-mix(in srgb, var(--color-blue) 22%, var(--white));
}

.tasks-column--green .tasks-column-head {
    background: color-mix(in srgb, #6fc078 28%, var(--white));
}

.tasks-column-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.tasks-column-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.tasks-column-body {
    display: flex;
    flex-direction: column;
    gap: var(--task-card-gap);
    flex: 0 0 auto;
    box-sizing: border-box;
    height: var(--tasks-column-body-height);
    min-height: var(--tasks-column-body-height);
    max-height: var(--tasks-column-body-height);
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.tasks-column-body::-webkit-scrollbar {
    width: 6px;
}

.tasks-column-body::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 35%, transparent);
    border-radius: 999px;
}

.task-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 var(--task-card-height);
    height: var(--task-card-height);
    min-height: var(--task-card-height);
    max-height: var(--task-card-height);
    box-sizing: border-box;
    padding: 10px 10px 28px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
    cursor: grab;
    touch-action: none;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.task-card.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
    transform: rotate(1deg) scale(0.98);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.task-card.is-saving {
    opacity: 0.7;
    pointer-events: none;
}

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

.tasks-column-body.is-drop-target {
    background: color-mix(in srgb, var(--color-blue) 8%, var(--white));
    outline: 2px dashed color-mix(in srgb, var(--color-blue) 45%, var(--border));
    outline-offset: -4px;
    border-radius: 8px;
}

.tasks-kanban--dragging .task-card:not(.is-dragging) {
    transition: transform 0.12s ease;
}

.task-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.task-card-title a {
    color: var(--link, var(--color-blue));
    text-decoration: none;
}

.task-card-title a:hover {
    text-decoration: underline;
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-priority {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
}

.task-priority--normal {
    color: var(--text-muted);
}

.task-priority--high {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, #e5a331 24%, var(--white));
    color: #8a5a12;
}

.task-priority--urgent {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, #d9534f 20%, var(--white));
    color: #8b3a3a;
}

.task-card-parent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-parent-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.task-parent-dot--green { background: #6fc078; }
.task-parent-dot--blue { background: var(--color-blue); }
.task-parent-dot--orange { background: #e5a331; }
.task-parent-dot--red { background: #d9534f; }
.task-parent-dot--purple { background: var(--color-indigo); }

.task-card-due {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .tasks-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .tasks-filter-select {
        width: 100%;
    }

    .tasks-kanban {
        grid-template-columns: repeat(3, minmax(240px, 1fr));
    }
}

@media (max-width: 900px) {
    .tasks-kanban {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin: 0 auto;
    }

    .tasks-column {
        height: var(--tasks-column-height);
        min-height: var(--tasks-column-height);
        max-height: var(--tasks-column-height);
    }
}

/* Meeting create screen */
.meeting-create-page {
    padding: 16px 20px 20px;
    background: #eef0f2;
    flex: 1 1 auto;
}

.meeting-create-breadcrumb {
    font-size: 19px;
    margin-bottom: 10px;
}

.meeting-create-breadcrumb a {
    color: var(--link, var(--color-blue));
}

.meeting-create-actions {
    margin-bottom: 12px;
}

.meeting-form-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
}

.meeting-form-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meeting-parent-composite {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
}

.meeting-datetime-composite {
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 8px;
}

.meeting-duration-field {
    max-width: 200px;
}

.meeting-reminders-field {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.meeting-reminder-add {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.meeting-reminder-add:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.meeting-attendees-group {
    margin-top: 4px;
}

.meeting-assignee-picker {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 8px;
    background: var(--white);
}

.meeting-assignee-picker input {
    border: none;
    outline: none;
    padding: 4px 0;
    font-size: 13px;
    background: transparent;
    min-width: 0;
}

.meeting-picker-clear,
.meeting-picker-open {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
}

.meeting-picker-clear:hover,
.meeting-picker-open:hover {
    color: var(--text);
}

.meeting-avatar--pink {
    background: #f4c4cb;
    color: #8b3a47;
}

.meeting-scheduler-card {
    margin-top: 12px;
}

.meeting-scheduler-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.meeting-scheduler {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--white) 92%, var(--color-blue));
    overflow: hidden;
}

.meeting-scheduler-head {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    font-size: 11px;
    color: var(--text-muted);
}

.meeting-scheduler-day {
    font-weight: 600;
    color: var(--text);
}

.meeting-scheduler-times {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    text-align: center;
}

.meeting-scheduler-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    align-items: center;
    padding: 10px;
    min-height: 48px;
}

.meeting-scheduler-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text);
}

.meeting-scheduler-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    min-height: 36px;
    align-items: stretch;
}

.meeting-scheduler-block {
    grid-column: calc(var(--start) + 1) / span var(--span);
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--color-blue) 35%, var(--white)) 0%,
        color-mix(in srgb, var(--color-blue) 55%, var(--white)) 50%,
        color-mix(in srgb, #d9534f 40%, var(--white)) 100%
    );
    border: 1px solid color-mix(in srgb, var(--color-blue) 50%, var(--border));
    min-height: 32px;
}

@media (max-width: 1100px) {
    .meeting-form-layout {
        grid-template-columns: 1fr;
    }

    .meeting-scheduler-head,
    .meeting-scheduler-row {
        grid-template-columns: 1fr;
    }

    .meeting-scheduler-times {
        display: none;
    }
}

/* Account create screen */
.account-create-page {
    padding: 18px 20px 24px;
}

.account-create-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 22px;
    margin-bottom: 12px;
}

.account-create-breadcrumb a {
    color: var(--text);
    text-decoration: none;
}

.account-create-breadcrumb a:hover {
    text-decoration: underline;
}

.account-create-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.account-form-flash {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.account-form-flash--error {
    background: color-mix(in srgb, #d9534f 14%, var(--white));
    border: 1px solid color-mix(in srgb, #d9534f 35%, var(--border));
    color: #8b3a3a;
}

.account-save-btn,
.account-cancel-btn,
.account-more-btn {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-white);
    color: var(--text);
    font-size: 13px;
    padding: 6px 12px;
    text-decoration: none;
    cursor: pointer;
}

.account-save-btn {
    background: var(--color-deep);
    border-color: var(--color-deep);
    color: #fff;
}

.account-save-btn:hover {
    opacity: 0.9;
}

.account-cancel-btn:hover,
.account-more-btn:hover {
    background: var(--sidebar-hover);
}

.send-invitation-btn {
    border-color: color-mix(in srgb, var(--color-accent) 55%, var(--border));
    color: var(--color-deep);
    font-weight: 500;
}

.send-invitation-btn:hover {
    background: color-mix(in srgb, var(--color-accent) 12%, var(--bg-white));
}

.send-invitation-btn--muted {
    opacity: 0.75;
}

.account-more-btn {
    padding: 6px 10px;
    line-height: 1;
}

.account-form-layout {
    display: grid;
    grid-template-columns: minmax(640px, 1fr) 320px;
    gap: 14px;
    align-items: start;
}

.account-form-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.prospect-create-layout.account-form-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    align-items: stretch;
}

.prospect-create-layout .account-form-main {
    min-width: 0;
}

.prospect-form-side {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 14px;
    min-height: 100%;
}

.prospect-form-side .account-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prospect-create-layout .prospect-form-side .account-card:last-child {
    min-height: 0;
}

.prospect-create-layout .prospect-form-side .account-card:last-child .field:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.prospect-form-side .field textarea {
    min-height: 72px;
}

.prospect-create-layout .prospect-form-side .account-card:last-child textarea {
    flex: 1;
    min-height: 72px;
}

.account-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-white);
    padding: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.account-card-title {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.name-composite {
    display: grid;
    grid-template-columns: minmax(72px, 22%) minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.currency-composite {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(88px, 30%);
    gap: 8px;
}

.field-repeater .repeater-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-add-btn {
    align-self: flex-start;
    margin-top: 4px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.field-add-btn:hover {
    border-color: rgba(6, 182, 212, 0.4);
    color: var(--text);
}

.address-photo-row {
    grid-template-columns: minmax(0, 1fr) 120px;
    align-items: start;
    margin-top: 4px;
}

.industry-field {
    max-width: calc(50% - 5px);
}

.photo-upload {
    position: relative;
}

.photo-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.photo-upload-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--text-muted);
    cursor: pointer;
}

.photo-upload-trigger:hover {
    border-color: rgba(6, 182, 212, 0.45);
    color: #0e7490;
}

.account-grid {
    display: grid;
    gap: 10px;
}

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

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

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field span {
    font-size: 12px;
    color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
    outline: none;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.phone-composite {
    display: grid;
    grid-template-columns: 25% 1fr;
    gap: 8px;
}

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

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-title {
    font-size: 13px;
    color: var(--text-muted);
}

.details-group {
    margin-top: 14px;
}

.account-form-side .account-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Opportunity create screen */
.opportunity-create-page {
    padding: 18px 20px 24px;
    background: #eef0f2;
}

.opportunity-create-breadcrumb {
    margin-bottom: 14px;
    font-size: 19px;
}

.opportunity-create-breadcrumb::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #83bd5a;
}

.opportunity-create-breadcrumb a {
    color: var(--link);
}

.opportunity-create-actions {
    gap: 4px;
    margin-bottom: 14px;
}

.opportunity-create-actions .account-save-btn,
.opportunity-create-actions .account-cancel-btn,
.opportunity-create-actions .account-more-btn {
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
}

.opportunity-create-actions .account-save-btn {
    background: #5c91cb;
    border-color: #5c91cb;
}

.opportunity-form-layout {
    grid-template-columns: minmax(620px, 1fr) 360px;
    gap: 12px;
    align-items: start;
    max-width: 1120px;
}

.opportunity-form-card {
    border-color: #dfe4ea;
    border-radius: 4px;
    padding: 12px;
    box-shadow: none;
}

.opportunity-create-page .account-grid {
    gap: 10px 14px;
    margin-bottom: 10px;
}

.opportunity-create-page .field {
    gap: 3px;
}

.opportunity-create-page .field span,
.opportunity-section-title {
    color: #8a949e;
    font-size: 12px;
    font-weight: 400;
}

.opportunity-create-page .field input,
.opportunity-create-page .field select,
.opportunity-create-page .field textarea {
    min-height: 31px;
    border-color: #d8dde3;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
}

.opportunity-create-page .field textarea {
    min-height: 50px;
}

/* Document create screen */
.document-create-page {
    padding: 18px 20px 24px;
    background: #eef0f2;
    flex: 1 1 auto;
}

.document-create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.document-create-title {
    margin: 0;
    font-size: 22px;
    font-weight: 400;
    color: #4b5563;
    letter-spacing: -0.01em;
}

.document-create-window-controls {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.document-window-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.document-window-btn:hover {
    color: #4b5563;
}

.document-create-actions {
    gap: 4px;
    margin-bottom: 14px;
}

.document-create-actions .account-save-btn,
.document-create-actions .account-cancel-btn,
.document-full-form-btn {
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
}

.document-create-actions .account-save-btn {
    background: #5c91cb;
    border-color: #5c91cb;
}

.document-form-layout {
    grid-template-columns: minmax(620px, 1fr) 360px;
    gap: 12px;
    align-items: start;
    max-width: 1120px;
}

.document-form-card,
.document-form-side-card {
    border-color: #dfe4ea;
    border-radius: 4px;
    padding: 12px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.document-create-page .field {
    gap: 3px;
}

.document-create-page .field span {
    color: #8a949e;
    font-size: 12px;
    font-weight: 400;
}

.document-create-page .field span strong {
    color: #8a949e;
    font-weight: 400;
}

.document-create-page .field input,
.document-create-page .field select,
.document-create-page .field textarea {
    min-height: 31px;
    border: 1px solid #d8dde3;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    background: #fff;
    color: var(--text);
}

.document-create-page .field textarea {
    min-height: 120px;
    resize: vertical;
}

.document-file-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 31px;
}

.document-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #d8dde3;
    border-radius: 4px;
    background: #fff;
    color: #8a949e;
    cursor: pointer;
}

.document-attach-btn:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.document-file-name {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1100px) {
    .document-form-layout {
        grid-template-columns: 1fr;
    }
}

.opportunity-money-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px;
}

.opportunity-money-field input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.opportunity-money-field select {
    border-left: none !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.opportunity-items-section {
    margin: 8px -12px 10px;
    padding: 6px 12px 8px;
    border-top: 1px solid #e4e8ed;
    border-bottom: 1px solid #e4e8ed;
}

.opportunity-items-section .opportunity-section-title {
    margin: 0 0 12px;
}

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

.opportunity-items-section.is-editor-open .opportunity-items-actions {
    display: none;
}

.opportunity-add-item {
    width: 26px;
    height: 26px;
    border: 1px solid #d8dde3;
    border-radius: 4px;
    background: #fff;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.opportunity-items-editor-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin: 4px 0 6px;
}

.opportunity-items-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.opportunity-items-confirm {
    color: #5c91cb;
}

.opportunity-items-table {
    border-top: 1px solid #e4e8ed;
}

.opportunity-items-table-head,
.opportunity-items-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.6fr) 72px 100px 100px minmax(100px, 1fr);
    gap: 8px;
    align-items: center;
}

.opportunity-items-row + .opportunity-items-row {
    margin-top: 6px;
}

.opportunity-items-table-head {
    padding: 6px 0 8px;
    color: #8a949e;
    font-size: 12px;
}

.opportunity-items-col-total {
    text-align: right;
}

.opportunity-item-input {
    width: 100%;
    min-height: 31px;
    border: 1px solid #d8dde3;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    color: var(--text);
    background: #fff;
    outline: none;
}

.opportunity-item-input:focus {
    border-color: #5c91cb;
    box-shadow: 0 0 0 2px color-mix(in srgb, #5c91cb 25%, transparent);
}

.opportunity-items-row-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.opportunity-item-line-total {
    min-width: 52px;
    text-align: right;
    font-size: 12px;
    color: var(--text);
}

.opportunity-item-drag {
    color: #b8c0c8;
    font-size: 12px;
    letter-spacing: -0.15em;
    transform: rotate(90deg);
    cursor: grab;
}

.opportunity-item-remove {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: #5c91cb;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.opportunity-items-add-row {
    margin-top: 8px;
    padding: 0;
    border: none;
    background: transparent;
    color: #5c91cb;
    font-size: 12px;
    cursor: pointer;
}

.opportunity-currency-field {
    width: 112px;
}

.opportunity-form-side .opportunity-form-card {
    gap: 12px;
}

@media (max-width: 1200px) {
    .account-form-layout {
        grid-template-columns: 1fr;
    }

    .prospect-create-layout.account-form-layout {
        grid-template-columns: 1fr;
    }

    .prospect-form-side {
        grid-template-rows: auto;
    }

    .prospect-create-layout .prospect-form-side .account-card:last-child .field:last-child,
    .prospect-create-layout .prospect-form-side .account-card:last-child textarea {
        flex: initial;
    }
}

@media (max-width: 760px) {
    .account-create-breadcrumb {
        font-size: 18px;
    }

    .account-grid.two-cols,
    .account-grid.three-cols,
    .account-address-grid {
        grid-template-columns: 1fr;
    }

    .phone-composite {
        grid-template-columns: 1fr;
    }
}

/* Full-screen calendar page */
.layout--calendar,
.layout:has(.calendario-page) {
    grid-template-rows: var(--shell-top-height) auto;
    align-content: start;
}

.layout--calendar .sidebar-rail,
.layout:has(.calendar-page) .sidebar-rail,
.layout:has(.calendario-page) .sidebar-rail {
    display: none;
}

.main--calendar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.calendar-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    padding: 0;
    background: var(--white);
    overflow: hidden;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.calendar-toolbar-start,
.calendar-toolbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.calendar-toolbar-end {
    justify-content: flex-end;
}

.calendar-month-title {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.01em;
}

.calendar-today-btn {
    min-height: 28px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--white);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}

.calendar-today-btn:hover {
    background: var(--sidebar-hover);
}

.calendar-view-tabs {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    height: 44px;
}

.calendar-view-tab {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.calendar-view-tab:hover {
    color: var(--text);
}

.calendar-view-tab.is-active {
    color: var(--color-deep);
    border-bottom-color: var(--color-deep);
    font-weight: 500;
}

.calendar-more-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.calendar-more-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.calendar-full-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.calendar-full-head,
.calendar-full-row {
    display: grid;
    grid-template-columns: 36px repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
}

.calendar-full-head {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.calendar-full-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 1px;
    background: var(--border);
}

.calendar-full-row {
    flex: 1 1 0;
    min-height: 0;
}

.calendar-weeknum-head,
.calendar-weeknum {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6px 0;
    background: color-mix(in srgb, var(--white) 82%, var(--color-blue));
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.calendar-weekday {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    background: color-mix(in srgb, var(--white) 82%, var(--color-blue));
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.calendar-weekday.is-weekend {
    background: color-mix(in srgb, var(--color-blue) 10%, var(--white));
}

.calendar-page:not(.calendar-page--dashboard-based) .calendar-day {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    padding: 4px 5px 5px;
    background: var(--white);
    font-size: 11px;
    overflow: hidden;
}

.calendar-page .calendar-day.is-weekend:not(.is-outside) {
    background: color-mix(in srgb, var(--color-blue) 6%, var(--white));
}

.calendar-page .calendar-day.is-outside {
    background: color-mix(in srgb, var(--white) 94%, var(--color-blue));
}

.calendar-page .calendar-day.is-today {
    background: color-mix(in srgb, var(--color-accent) 14%, var(--white));
}

.calendar-page .calendar-day-num {
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.calendar-page .calendar-events {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    gap: 3px;
}

.calendar-page .calendar-event {
    font-size: 11px;
    line-height: 1.3;
    padding: 3px 5px;
    border-radius: 2px;
}

/* Full-screen calendar page (same markup as dashboard dashlet) */
.calendar-page--dashboard-based {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--shell-top-height));
    height: calc(100vh - var(--shell-top-height));
    padding: 10px 12px;
    background: var(--bg-page);
    overflow: hidden;
    box-sizing: border-box;
}

.calendar-page--dashboard-based .dashlet--full-screen,
.calendar-page--dashboard-based .dashlet.dashlet--calendar {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.calendar-page--dashboard-based .dashlet--calendar .calendar-wrap,
.calendar-page--dashboard-based .dashlet--calendar .calendar-wrap--full-screen {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 6px 8px 10px;
    overflow: hidden;
}

.calendar-page--dashboard-based .dashlet--calendar .calendar-weekdays {
    flex-shrink: 0;
}

.calendar-page--dashboard-based .dashlet--calendar .calendar-days {
    flex: 1 1 auto;
    min-height: 360px;
    height: 100%;
    grid-template-rows: repeat(6, minmax(72px, 1fr));
}

.calendar-page--dashboard-based .dashlet--calendar .calendar-day {
    min-height: 72px;
    height: auto;
    padding: 4px 5px 5px;
    overflow: auto;
}

.calendar-page--dashboard-based .dashlet--calendar .calendar-events {
    max-height: none;
    overflow: visible;
}

@media (max-width: 900px) {
    .calendar-toolbar {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        padding: 8px 10px;
        gap: 8px;
    }

    .calendar-month-title {
        grid-row: 1;
        grid-column: 1;
    }

    .calendar-toolbar-start {
        grid-row: 2;
    }

    .calendar-toolbar-end {
        grid-row: 2;
        justify-content: space-between;
        flex: 1;
    }

    .calendar-view-tabs {
        height: auto;
    }

    .calendar-view-tab {
        padding: 6px 8px;
        border-bottom-width: 2px;
    }

    .calendar-full-head,
    .calendar-full-row {
        grid-template-columns: 28px repeat(7, minmax(0, 1fr));
    }

    .calendar-page .calendar-event {
        font-size: 10px;
        padding: 2px 4px;
    }
}

/* Login page */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--color-accent) 18%, transparent), transparent 42%),
        var(--bg-page);
}

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

.login-card {
    width: min(100%, 420px);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 40px color-mix(in srgb, var(--color-deep) 12%, transparent);
    padding: 32px;
}

.login-header {
    margin-bottom: 24px;
}

.login-brand {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--brand-deep);
}

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

.login-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: color-mix(in srgb, #ef4444 12%, var(--white));
    border: 1px solid color-mix(in srgb, #ef4444 35%, var(--white));
    color: #991b1b;
    font-size: 13px;
}

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

.login-field {
    display: grid;
    gap: 6px;
}

.login-field span {
    font-weight: 600;
    color: var(--text);
}

.login-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: var(--bg-white);
}

.login-field input:focus {
    outline: 2px solid var(--focus-ring);
    border-color: var(--color-blue);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.login-submit {
    margin-top: 4px;
    width: 100%;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-deep);
    color: var(--white);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.login-submit:hover {
    background: color-mix(in srgb, var(--brand-deep) 88%, var(--color-accent));
}

.user-menu-label {
    display: block;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.user-menu-item--button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
    color: var(--text);
}

.user-menu-item--button:hover {
    background: var(--sidebar-hover);
}

/* Password setup / change */
.password-page {
    display: grid;
    place-items: start center;
    width: 100%;
    min-height: 0;
    padding: 32px 20px;
}

.password-card {
    width: min(100%, 460px);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--color-deep) 10%, transparent);
    padding: 28px;
}

.password-header {
    margin-bottom: 20px;
}

.password-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: var(--brand-deep);
}

.password-subtitle {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.password-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: color-mix(in srgb, #ef4444 12%, var(--white));
    border: 1px solid color-mix(in srgb, #ef4444 35%, var(--white));
    color: #991b1b;
    font-size: 13px;
}

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

.password-field {
    display: grid;
    gap: 6px;
}

.password-field span {
    font-weight: 600;
}

.password-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: var(--bg-white);
}

.password-field input:focus {
    outline: 2px solid var(--focus-ring);
    border-color: var(--color-blue);
}

.password-submit {
    margin-top: 6px;
    width: 100%;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-deep);
    color: var(--white);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.password-submit:hover {
    background: color-mix(in srgb, var(--brand-deep) 88%, var(--color-accent));
}

.kanban-column-empty,
.tasks-column-empty {
    margin: 0;
    padding: 12px 10px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Email compose page */
.layout--email-compose,
.layout:has(.email-compose-page) {
    grid-template-rows: var(--shell-top-height) auto;
    align-content: start;
}

.layout--email-compose .sidebar-rail,
.layout:has(.email-compose-page) .sidebar-rail {
    display: none;
}

.layout--email-compose .main,
.layout:has(.email-compose-page) .main {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.layout--email-compose .header-bar,
.layout--email-compose .email-compose-shell,
.layout:has(.email-compose-page) .header-bar,
.layout:has(.email-compose-page) .email-compose-shell {
    grid-column: auto;
    grid-row: auto;
}

.email-compose-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: calc(100vh - var(--shell-top-height));
    background: #eef0f2;
}

.email-compose-page {
    flex: 1 1 auto;
    padding: 16px 20px 24px;
    background: #eef0f2;
}

.app-footer--email-compose {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    min-height: var(--shell-footer-height);
    padding: 10px 20px 14px;
    border-top: 1px solid var(--border);
    background: #eef0f2;
    color: var(--text-muted);
}

.email-compose-breadcrumb {
    font-size: 19px;
    margin-bottom: 10px;
}

.email-compose-actions {
    margin-bottom: 12px;
}

.email-compose-send-btn {
    min-width: 72px;
}

.email-compose-form {
    max-width: 1180px;
}

.email-compose-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

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

.email-from-notice {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    color: var(--text);
}

.email-subject-field {
    margin-top: 2px;
}

.email-body-field > span {
    margin-bottom: 2px;
}

.email-editor {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    overflow: visible;
}

.email-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 10px 10px 0 0;
    overflow: visible;
}

.email-editor-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}

.email-editor-btn-tip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    z-index: 5;
    min-width: 72px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--text);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(2px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.email-editor-btn:hover .email-editor-btn-tip,
.email-editor-btn:focus-visible .email-editor-btn-tip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.email-editor-btn:hover {
    background: var(--sidebar-hover);
    border-color: var(--border);
}

.email-editor-sep {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--border);
}

.email-editor-size {
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 6px;
    font-size: 12px;
    background: #fff;
}

.email-editor-body-wrap {
    position: relative;
    min-height: 25px;
    height: 125px;
    overflow: hidden;
    border-radius: 0 0 10px 10px;
}

.email-editor-body-wrap .email-editor-source {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: hidden;
    overflow-y: auto;
    resize: none;
    box-sizing: border-box;
    outline: none;
    background: #fff;
}

.email-editor-body-wrap .email-editor-source:focus {
    outline: none;
}

.email-editor-body {
    position: relative;
    z-index: 2;
    min-height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    outline: none;
    box-sizing: border-box;
    background: #fff;
}

.email-editor-body:empty::before {
    content: 'Escriba su mensaje…';
    color: var(--text-muted);
}

.email-compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
}

.email-attachments {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.email-attachments-label {
    font-size: 12px;
    color: var(--text-muted);
}

.email-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.email-attach-btn:hover {
    background: var(--sidebar-hover);
}

.email-attach-names {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-html-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.email-html-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-deep);
}

.gcal-create-btn {
    text-decoration: none;
}

.account-form-flash--success {
    background: color-mix(in srgb, #6fc078 16%, var(--white));
    border: 1px solid color-mix(in srgb, #6fc078 40%, var(--border));
    color: #2d6a3a;
}

@media (max-width: 900px) {
    .email-compose-header-grid {
        grid-template-columns: 1fr;
    }
}
