:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --panel-soft: #f9fafc;
    --line: #e6e9f0;
    --line-strong: #d9dee9;
    --text: #202633;
    --muted: #6d7482;
    --muted-2: #9aa2af;
    --primary: #4557e6;
    --primary-soft: #eef1ff;
    --danger: #dc3d4c;
    --danger-soft: #fff0f2;
    --green: #2f9b62;
    --green-soft: #eefaf3;
    --orange: #d97706;
    --orange-soft: #fff7e6;
    --blue-soft: #eef7ff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-soft: 0 1px 2px rgba(16, 24, 40, 0.04);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    overflow-x: hidden;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 274px minmax(0, 1fr) 324px;
    align-items: stretch;
}

.sidebar {
    background: #fbfcff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    min-width: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    align-self: stretch;
    width: 274px;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand,
.login-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .02em;
}

.sidebar-brand strong,
.login-brand strong {
    display: block;
    font-size: 15px;
    letter-spacing: -.01em;
}

.sidebar-brand span,
.login-brand span {
    color: var(--muted);
    font-size: 12px;
}

.side-nav {
    display: grid;
    gap: 5px;
    margin-top: 28px;
}

.nav-item,
.workspace-link,
.side-create,
.soft-btn,
.primary-btn,
.icon-btn,
.text-btn,
.danger-btn,
.tab,
.stat-card,
.back-link,
.mini-add,
.task-action {
    border: 0;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}

.nav-item {
    width: 100%;
    background: transparent;
    border-radius: 12px;
    padding: 10px 11px;
    color: #3e4655;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    background: #eef1ff;
    color: var(--primary);
}

.nav-icon {
    width: 21px;
    display: inline-flex;
    justify-content: center;
}

.sidebar-section {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

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

.sidebar-section p {
    margin: 0;
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.section-label-row span {
    font-size: 11px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    background: #fff;
}

.workspace-list {
    display: grid;
    gap: 7px;
    max-height: 320px;
    overflow: auto;
    padding-right: 2px;
}

.workspace-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    padding: 9px;
}

.workspace-link:hover,
.workspace-link.active {
    background: #fff;
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
}

.workspace-link.active .workspace-avatar {
    background: var(--primary);
    color: #fff;
}

.workspace-avatar {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    background: #eef0f5;
    color: #525b6c;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex: 0 0 auto;
}

.workspace-copy {
    min-width: 0;
}

.workspace-copy strong,
.workspace-copy small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-copy strong {
    font-size: 13px;
}

.workspace-copy small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.side-create {
    width: 100%;
    border-radius: 12px;
    margin-top: 11px;
    padding: 10px 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 750;
}

.side-create:hover,
.primary-btn:hover,
.soft-btn:hover,
.danger-btn:hover,
.icon-btn:hover,
.task-action:hover,
.mini-add:hover,
.stat-card:hover {
    transform: translateY(-1px);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.user-chip > span {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: #edf0ff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

.user-chip strong,
.user-chip small {
    display: block;
}

.user-chip small {
    color: var(--muted);
    font-size: 11px;
}

.logout-link {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 10px;
}

.logout-link:hover {
    background: #f0f2f7;
    color: var(--text);
}

/* Dark sidebar */
.sidebar {
    background: #0f172a;
    border-right-color: #1e293b;
    color: #e5e7eb;
}

.sidebar-brand strong {
    color: #f8fafc;
}

.sidebar-brand span {
    color: #94a3b8;
}

.sidebar .brand-icon {
    background: #4f5df7;
    color: #ffffff;
}

.sidebar .nav-item {
    color: #cbd5e1;
}

.sidebar .nav-item:hover,
.sidebar .nav-item.active {
    background: rgba(79, 93, 247, 0.16);
    color: #ffffff;
}

.sidebar .sidebar-section,
.sidebar .sidebar-footer {
    border-color: #1e293b;
}

.sidebar .sidebar-section p {
    color: #94a3b8;
}

.sidebar .section-label-row span {
    background: #111c33;
    border-color: #25324a;
    color: #cbd5e1;
}

.sidebar .workspace-link {
    color: #e5e7eb;
}

.sidebar .workspace-link:hover,
.sidebar .workspace-link.active {
    background: #162033;
    border-color: #26344d;
    box-shadow: none;
}

.sidebar .workspace-link.active {
    outline: 1px solid rgba(79, 93, 247, 0.28);
}

.sidebar .workspace-avatar {
    background: #26344d;
    color: #cbd5e1;
}

.sidebar .workspace-link.active .workspace-avatar {
    background: #4f5df7;
    color: #ffffff;
}

.sidebar .workspace-copy strong {
    color: #f8fafc;
}

.sidebar .workspace-copy small {
    color: #94a3b8;
}

.sidebar .side-create {
    background: #4f5df7;
    color: #ffffff;
}

.sidebar .side-create:hover {
    background: #5f6cff;
}

.sidebar .user-chip {
    background: #111c33;
    border-color: #25324a;
}

.sidebar .user-chip > span {
    background: rgba(79, 93, 247, 0.18);
    color: #dbeafe;
}

.sidebar .user-chip strong {
    color: #f8fafc;
}

.sidebar .user-chip small,
.sidebar .logout-link {
    color: #94a3b8;
}

.sidebar .logout-link:hover {
    background: #162033;
    color: #ffffff;
}

.sidebar .workspace-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sidebar .workspace-list::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

.main-area {
    min-width: 0;
    grid-column: 2;
    padding: 18px;
}

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

.topbar-left {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.back-link {
    color: var(--muted);
    background: transparent;
    padding: 7px 0;
    font-weight: 700;
    white-space: nowrap;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(20px, 2vw, 26px);
    letter-spacing: -.04em;
}

.topbar p,
.board-info p,
.section-head p,
.setting-card p,
.login-card p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

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

.search-box {
    height: 40px;
    min-width: min(320px, 46vw);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.search-box span {
    color: var(--muted-2);
}

.search-box input {
    border: 0;
    outline: 0;
    width: 100%;
    background: transparent;
    color: var(--text);
}

.primary-btn,
.soft-btn,
.danger-btn,
.icon-btn,
.text-btn {
    border-radius: 12px;
    min-height: 40px;
    padding: 0 14px;
    font-weight: 750;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
}

.primary-btn.full {
    width: 100%;
}

.soft-btn {
    background: #fff;
    color: #384152;
    border: 1px solid var(--line);
}

.soft-btn.small {
    min-height: 34px;
    padding: 0 11px;
    margin-top: 12px;
}

.workspace-manage-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.workspace-manage-buttons .soft-btn.small,
.workspace-manage-buttons .danger-btn.small {
    margin-top: 0;
    min-height: 34px;
    padding: 0 11px;
}


.danger-btn {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #ffd4da;
}

.icon-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
    font-size: 22px;
    line-height: 1;
    text-align: center;
}

.modal-header .icon-btn {
    margin-top: 0;
    transform: translateY(0);
}

.close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.close-btn span {
    display: inline-block;
    position: relative;
    top: -1.5px;
    line-height: 1;
}

.text-btn {
    background: transparent;
    color: var(--primary);
    padding: 0 4px;
}

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

.tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    min-width: 0;
}

.tab {
    background: transparent;
    color: var(--muted);
    padding: 11px 12px 10px;
    border-bottom: 2px solid transparent;
    font-weight: 800;
}

.tab:hover,
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tabs[data-tab-order-ready="1"] .tab {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.tabs.is-tab-reordering .tab {
    transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease, background .16s ease;
}

.tab-drop-placeholder {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed rgba(37, 99, 235, .45);
    border-radius: 12px 12px 0 0;
    background: rgba(37, 99, 235, .08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

.tab.is-tab-dragging {
    position: fixed;
    z-index: 9999;
    cursor: grabbing;
    opacity: .96;
    transform: scale(1.02);
    border: 1px solid rgba(37, 99, 235, .20);
    border-radius: 12px;
    border-bottom-color: rgba(37, 99, 235, .20);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
    pointer-events: none;
}

.month-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.month-picker select,
.month-picker input,
.filters-panel select,
.task-form input,
.task-form select,
.task-form textarea,
.login-form input {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    outline: 0;
    padding: 0 12px;
}

.month-picker input {
    width: 88px;
}

.month-picker select {
    padding-right: 42px;
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23202739' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 12px 12px;
}

.month-picker select::-ms-expand {
    display: none;
}

.month-picker .month-arrow {
    width: 42px;
    height: 42px;
    min-height: 42px;
    flex: 0 0 42px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 1;
}



.month-picker .report-io-actions {
    display: none;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

body[data-view="marketing-report"] .month-picker .report-io-actions,
body[data-view="report-account"] .month-picker .report-io-actions {
    display: inline-flex;
}

.report-io-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 850;
}

.month-picker .month-arrow span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    font-size: 18px;
    font-weight: 700;
    transform: none;
}

.today-month-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

@media (min-width: 641px) {
    #statsPanel.stats-empty-desktop {
        display: none !important;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 640px) {
    #statsPanel.stats-empty-mobile {
        display: none !important;
        margin-bottom: 0 !important;
    }
}

.stat-card {
    text-align: left;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow-soft);
}

.stat-card-static {
    cursor: default;
}

.stat-card-static:hover {
    transform: none;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 5px;
    font-size: 24px;
    letter-spacing: -.04em;
}

.filters-panel {
    display: none;
    align-items: end;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
}

.filters-panel.show {
    display: flex;
}

.filters-panel label {
    display: grid;
    gap: 5px;
}

.filters-panel label span,
.task-form label span,
.login-form label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.view-panel {
    display: none;
}

.view-panel.active {
    display: block;
}


body.app-booting .board-toolbar .tabs,
body.app-booting .sidebar-view-list.tabs {
    visibility: hidden;
}


body.app-booting[data-view="table"] #timelineView,
body.app-booting[data-view="pinned"] #timelineView,
body.app-booting[data-view="calendar"] #timelineView,
body.app-booting[data-view="holiday-list"] #timelineView,
body.app-booting[data-view="pdf-library"] #timelineView,
body.app-booting[data-view="video-library"] #timelineView,
body.app-booting[data-view="sticky-board"] #timelineView,
body.app-booting[data-view="attendance"] #timelineView,
body.app-booting[data-view="marketing-report"] #timelineView,
body.app-booting[data-view="report-account"] #timelineView,
body.app-booting[data-view="log"] #timelineView,
body.app-booting[data-view="deleted"] #timelineView {
    display: none;
}

body.app-booting[data-view="table"] #tableView,
body.app-booting[data-view="pinned"] #pinnedView,
body.app-booting[data-view="calendar"] #calendarView,
body.app-booting[data-view="holiday-list"] #holidayListView,
body.app-booting[data-view="pdf-library"] #pdfLibraryView,
body.app-booting[data-view="video-library"] #videoLibraryView,
body.app-booting[data-view="sticky-board"] #stickyBoardView,
body.app-booting[data-view="attendance"] #attendanceView,
body.app-booting[data-view="marketing-report"] #marketingReportView,
body.app-booting[data-view="report-account"] #accountReportView,
body.app-booting[data-view="log"] #logView,
body.app-booting[data-view="deleted"] #deletedView {
    display: block;
}

body.is-month-changing .main-area {
    min-height: 100vh;
}

/* Report Marketing must stay visible during boot; hiding it caused a blank screen before JS finished rendering. */

.board-info,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 15px 0 12px;
}

.board-info h2,
.section-head h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.03em;
}

.legend {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.pending { background: var(--orange); }
.dot.progress { background: var(--primary); }
.dot.completed { background: var(--green); }

.busy-wrap {
    position: relative;
}

.local-loader {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(246, 247, 251, .72);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 18px;
    color: #384152;
    font-weight: 800;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #cdd4e3;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.board-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
}

.timeline-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(246px, 270px);
    gap: 10px;
    min-height: 560px;
}

.day-column {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.day-column.today {
    border-color: #c6cdfc;
    background: #f5f6ff;
}

.day-column.today-focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .16) inset;
}

.day-column.drag-over {
    border-color: var(--primary);
    background: #f1f3ff;
}

.day-header {
    height: 57px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .58);
}

.day-header strong,
.day-header span {
    display: block;
}

.day-header strong {
    font-size: 18px;
    line-height: 1;
}

.day-header span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.day-date-block {
    min-width: 0;
}

.day-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.day-job-count {
    min-height: 26px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid #e4e8f2;
    background: #ffffff;
    color: #667085 !important;
    font-size: 11px !important;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .04);
}

.day-job-count.has-jobs {
    border-color: #dfe3ff;
    background: #eef2ff;
    color: var(--primary) !important;
}

.mini-add {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 36px;
}

.mini-add span {
    display: inline-block;
    position: relative;
    top: -2px;
    line-height: 1;
}

.day-task-list {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 12px;
    box-shadow: var(--shadow-soft);
    cursor: grab;
}

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

.task-card.dragging {
    opacity: .56;
    border-style: dashed;
    transform: scale(.985);
}

.day-column.drag-over .day-task-list {
    outline: 1px dashed rgba(255, 149, 0, .45);
    outline-offset: 3px;
    border-radius: 14px;
}

.task-card.completed {
    opacity: .78;
    background: #fbfffc;
}


.task-card.status-in_progress {
    border-color: rgba(245, 158, 11, .44);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, .12), var(--shadow-soft);
}

.task-card.status-stuck {
    border-color: rgba(239, 68, 68, .44);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .12), var(--shadow-soft);
}

.task-card.status-completed {
    border-color: rgba(34, 197, 94, .42);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .11), var(--shadow-soft);
}

.task-card h3 {
    margin: 9px 0 5px;
    font-size: 14px;
    line-height: 1.35;
    letter-spacing: -.02em;
}

.task-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.task-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.team-sales-tag {
    max-width: 96px;
    flex: 0 1 auto;
    border-radius: 999px;
    padding: 4px 8px;
    background: #f4f6fb;
    border: 1px solid #e8ecf4;
    color: #485064;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.badge {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
}

.badge.pending { background: var(--orange-soft); color: var(--orange); }
.badge.in_progress { background: var(--orange-soft); color: var(--orange); }
.badge.stuck { background: var(--danger-soft); color: var(--danger); }
.badge.completed { background: var(--green-soft); color: var(--green); }

.task-progress {
    margin: 8px 0 7px;
}

.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 800;
    color: #727b8e;
    letter-spacing: .01em;
}

.progress-head strong {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 2px 6px;
    background: #f4f6fb;
    border: 1px solid #e8ecf4;
    color: #3b4354;
    font-size: 10px;
    line-height: 1.1;
}

.progress-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    min-height: 20px;
}

.progress-segment {
    min-width: 0;
    min-height: 20px;
    border-radius: 999px;
    background: #e8edf4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    overflow: hidden;
}

.progress-segment em {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    font-size: 8px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .02em;
    white-space: nowrap;
}

.progress-segment.pending {
    background: var(--orange);
}

.progress-segment.in_progress {
    background: #7f8df6;
}

.progress-segment.created,
.progress-segment.completed,
.progress-segment.done {
    background: #37a56e;
}

.progress-segment.stuck {
    background: var(--danger);
}


.process-badges {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    margin: 8px 0 7px;
}

.process-pill {
    min-width: 0;
    border-radius: 10px;
    padding: 5px 6px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f3f5f9;
    color: #596174;
    border: 1px solid #e7eaf0;
}

.process-pill strong {
    font-weight: 900;
    letter-spacing: .02em;
}

.process-pill.pending { background: var(--orange-soft); color: var(--orange); border-color: #ffe3b8; }
.process-pill.stuck { background: var(--danger-soft); color: var(--danger); border-color: #ffd4da; }
.process-pill.done { background: var(--green-soft); color: var(--green); border-color: #ccefdc; }

.task-sales {
    color: #485064 !important;
    font-weight: 750;
}

.total-sales-line {
    color: #2f5f49 !important;
}

.task-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
}

.task-desc {
    margin-top: 9px !important;
}

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

.task-action {
    min-height: 30px;
    border-radius: 10px;
    background: #f7f8fb;
    border: 1px solid var(--line);
    color: #3e4655;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
}

.task-action.complete {
    background: var(--green-soft);
    color: var(--green);
    border-color: #d2f0dd;
}

.task-action.delete {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #ffd4da;
}

.task-action.invoice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-soft);
    color: var(--primary);
    border-color: #dbe5ff;
}

.empty-state {
    min-height: 48px;
    display: grid;
    place-items: center;
    border: 1px dashed #d7dce8;
    border-radius: 13px;
    color: var(--muted-2);
    font-size: 12px;
}


.calendar-shell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

body[data-view="calendar"] {
    overflow: hidden;
}

body[data-view="calendar"] .app-shell {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

body[data-view="calendar"] .main-area {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
}

body[data-view="calendar"] .topbar {
    margin-bottom: 10px;
}

body[data-view="calendar"] .board-toolbar {
    margin-bottom: 8px;
}

body[data-view="calendar"] .stats-grid {
    display: none;
}

body[data-view="calendar"] #calendarView.active {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body[data-view="calendar"] .calendar-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

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

.calendar-weekdays span {
    padding: 11px 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

body[data-view="calendar"] .calendar-weekdays span {
    padding: 7px 8px;
    font-size: 11px;
}

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

body[data-view="calendar"] .calendar-grid {
    flex: 1;
    min-height: 0;
    grid-template-rows: repeat(6, minmax(0, 1fr));
}

.calendar-cell {
    position: relative;
    min-height: 138px;
    background: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background .16s ease;
}

body[data-view="calendar"] .calendar-cell {
    min-height: 0;
    overflow: hidden;
    padding: 7px 8px;
    gap: 5px;
}

.calendar-cell:hover {
    background: #fbfcff;
}

.calendar-cell.today {
    background: #f5f6ff;
}

.calendar-cell.has-jobs {
    background: #ffffff;
}

.calendar-cell.muted-cell {
    background: #fafbfe;
}

.calendar-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.calendar-date-btn,
.calendar-add-btn {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.calendar-date-btn {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-weight: 850;
}

body[data-view="calendar"] .calendar-date-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 12px;
}

.calendar-cell.today .calendar-date-btn {
    background: var(--primary);
    color: #fff;
}

.calendar-add-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    line-height: 1;
}

body[data-view="calendar"] .calendar-add-btn {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-size: 17px;
}

.calendar-add-btn span {
    position: relative;
    top: -1px;
    line-height: 1;
}

.calendar-summary {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 23px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

body[data-view="calendar"] .calendar-summary {
    min-height: 18px;
    font-size: 10px;
}

.calendar-summary strong {
    color: var(--text);
    font-size: 14px;
}

.calendar-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.job-icon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

body[data-view="calendar"] .job-icon {
    width: 16px;
    height: 16px;
    font-size: 9px;
}

.job-icon.progress { background: var(--primary-soft); color: var(--primary); }
.job-icon.pending { background: var(--orange-soft); color: var(--orange); }
.job-icon.completed { background: var(--green-soft); color: var(--green); }

.calendar-empty-mini {
    color: var(--muted-2);
    font-size: 11px;
    min-height: 23px;
}

body[data-view="calendar"] .calendar-empty-mini {
    min-height: 16px;
    font-size: 10px;
}

.calendar-job-list {
    display: grid;
    gap: 6px;
    margin-top: auto;
}

body[data-view="calendar"] .calendar-job-list {
    gap: 4px;
    margin-top: 0;
    overflow: hidden;
}

body[data-view="calendar"] .calendar-cell.expanded {
    overflow-y: auto;
    overscroll-behavior: contain;
}

body[data-view="calendar"] .calendar-cell.expanded .calendar-job-list {
    overflow: visible;
    padding-bottom: 4px;
}

body[data-view="calendar"] .calendar-cell.expanded::-webkit-scrollbar {
    width: 6px;
}

body[data-view="calendar"] .calendar-cell.expanded::-webkit-scrollbar-thumb {
    background: #d8deeb;
    border-radius: 999px;
}

.calendar-job {
    width: 100%;
    min-height: 29px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f9fafc;
    color: #313847;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    cursor: grab;
    font-size: 11px;
    font-weight: 800;
    text-align: left;
    user-select: none;
}

body[data-view="calendar"] .calendar-job {
    min-height: 22px;
    border-radius: 8px;
    padding: 0 6px;
    gap: 5px;
    font-size: 10px;
}

.calendar-job:hover {
    border-color: #ccd3e3;
    background: #fff;
}

.calendar-job.in_progress {
    border-color: #ffdca8;
    background: var(--orange-soft);
    color: var(--orange);
}

.calendar-job.stuck {
    border-color: #ffd4da;
    background: var(--danger-soft);
    color: var(--danger);
}

.calendar-job.completed {
    border-color: #ccefdc;
    background: var(--green-soft);
    color: var(--green);
    opacity: .86;
}

.calendar-job span {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 7px;
}

.calendar-status-dot.pending { background: var(--orange); }
.calendar-status-dot.in_progress { background: var(--primary); }
.calendar-status-dot.stuck { background: var(--danger); }
.calendar-status-dot.completed { background: var(--green); }

.calendar-more {
    width: fit-content;
    border: 0;
    background: #f2f4ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 850;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
}

.calendar-more:hover {
    background: #e8ebff;
}

body[data-view="calendar"] .calendar-more {
    font-size: 10px;
    padding: 3px 7px;
}

.calendar-drop-hint {
    min-height: 24px;
    border: 1px dashed #d9deea;
    border-radius: 10px;
    color: var(--muted-2);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
}

.calendar-cell.drag-over {
    background: #f3f6ff;
    outline: 2px solid rgba(77, 91, 255, .22);
    outline-offset: -2px;
}

.calendar-cell.sticky-drop-over {
    background: #fffbea;
    outline-color: rgba(245, 158, 11, .32);
}

.calendar-cell.drag-over .calendar-drop-hint {
    display: flex;
}

.calendar-cell.sticky-drop-over::after {
    content: 'Drop sticky note here';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-height: 24px;
    border: 1px dashed rgba(245, 158, 11, .55);
    border-radius: 10px;
    background: rgba(255, 251, 235, .94);
    color: #92400e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 850;
    pointer-events: none;
}

.calendar-job.dragging {
    opacity: .55;
    cursor: grabbing;
}

.list-card,
.settings-grid,
.overview-grid {
    display: grid;
    gap: 10px;
}

.list-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
}

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

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

.list-row h3 {
    margin: 8px 0 4px;
    font-size: 15px;
}

.list-row p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

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

.empty-list {
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

.empty-list strong {
    display: block;
    color: var(--text);
    margin-bottom: 6px;
}

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

.overview-card,
.setting-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.overview-card.wide,
.setting-card.actions-card {
    grid-column: span 2;
}

.overview-card span,
.setting-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.overview-card strong,
.setting-card strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
    letter-spacing: -.04em;
}

.actions-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(22, 28, 39, .42);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 18px;
}

.modal-card {
    width: min(760px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 18px 46px rgba(16, 24, 40, .18);
}

.small-modal {
    width: min(520px, 100%);
}

#confirmModal {
    z-index: 10020;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.04em;
}

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

.task-form {
    padding: 18px;
}

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

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

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

.task-form label,
.login-form label {
    display: grid;
    gap: 6px;
}

.task-form textarea {
    resize: vertical;
    min-height: 98px;
    padding-top: 10px;
}


.invoice-upload-label {
    align-self: center;
}

.task-form input[type="file"] {
    width: 100%;
    min-height: 40px;
    padding: 7px 12px;
    line-height: 1.45;
}

.task-form input[type="file"]::file-selector-button {
    min-height: 24px;
    margin: 0 10px 0 0;
    border: 0;
    border-radius: 8px;
    padding: 0 10px;
    font-weight: 800;
    cursor: pointer;
}

.invoice-upload-label small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.current-invoice {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
    font-size: 12px;
}

.current-invoice span {
    color: var(--muted);
    font-weight: 800;
}

.current-invoice a {
    color: var(--primary);
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.combo-label {
    position: relative;
}

.search-select {
    position: relative;
}

.search-select input {
    width: 100%;
    padding-right: 38px;
}

.search-select::after {
    content: "⌕";
    position: absolute;
    right: 13px;
    top: 11px;
    color: var(--muted-2);
    font-size: 13px;
    line-height: 1;
    pointer-events: none;
}

.search-select.invalid input {
    border-color: var(--danger);
    background: #fff8f9;
}

.search-select-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 75;
    max-height: 230px;
    overflow: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(16, 24, 40, .14);
}

.search-select-option {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
}

.search-select-option:hover {
    background: #f6f7fb;
}

.search-select-option strong {
    font-size: 13px;
    font-weight: 800;
}

.search-select-option small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.search-select-empty {
    padding: 11px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

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

.report-io-modal-card {
    width: min(900px, 100%);
}

.report-io-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-soft);
}

.report-io-summary strong {
    display: block;
    font-size: 14px;
}

.report-io-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-align: right;
}

.report-io-month-field {
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(180px, 240px) 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.report-io-month-field[hidden] {
    display: none !important;
}

.report-io-month-field label {
    font-size: 12px;
    font-weight: 850;
    color: var(--ink);
}

.report-io-month-field input {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 8px 10px;
    font: inherit;
    font-weight: 750;
    color: var(--ink);
    background: var(--panel-soft);
}

.report-io-month-field small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

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

.report-io-table-option {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
}

.report-io-table-option:hover {
    border-color: var(--primary-soft);
    background: #f8fbff;
}

.report-io-table-option.disabled {
    opacity: .55;
    cursor: not-allowed;
}

.report-io-table-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.report-io-table-option span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.report-io-table-option strong {
    font-size: 13px;
    letter-spacing: -.02em;
}

.report-io-table-option small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.report-io-empty {
    grid-column: 1 / -1;
    padding: 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 15px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.report-io-preview-wrap {
    margin-top: 14px;
}

.report-io-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.report-io-preview-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.report-io-preview-table-wrap {
    max-height: 310px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.report-io-preview-table {
    min-width: 680px;
}

.report-io-preview-table th,
.report-io-preview-table td {
    white-space: nowrap;
}


.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    max-width: 360px;
    background: #141a25;
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .22);
    font-weight: 750;
}

.toast.error {
    background: #821d2b;
}

.page-loader {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 80;
    overflow: hidden;
    background: #e7eaff;
}

.page-loader span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--primary);
    animation: loadingBar .85s ease-in-out infinite;
}

.workspace-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(248, 250, 252, .62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity .16s ease, visibility .16s ease;
}

.workspace-transition-card {
    width: min(360px, 100%);
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 22px 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 22px 55px rgba(15, 23, 42, .18);
    text-align: center;
}

.workspace-transition-card strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
}

.workspace-transition-card small {
    max-width: 280px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.45;
}

.workspace-transition-spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(79, 70, 229, .16);
    border-top-color: var(--primary);
    animation: workspaceSpin .75s linear infinite;
}

body.app-booting .workspace-transition-overlay,
body.workspace-page-loading .workspace-transition-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.app-booting .app-shell,
body.workspace-page-loading .app-shell {
    filter: blur(7px);
    opacity: .42;
    transform: scale(.998);
    pointer-events: none;
    transition: filter .16s ease, opacity .16s ease, transform .16s ease;
}

@keyframes workspaceSpin {
    to {
        transform: rotate(360deg);
    }
}

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

.login-shell {
    width: min(430px, 100%);
}

.login-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.login-card h1 {
    margin: 28px 0 0;
    font-size: 28px;
    letter-spacing: -.05em;
}

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.alert-error {
    margin-top: 16px;
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #ffd4da;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 750;
}

.login-hint {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes loadingBar {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(260%); }
}


/* Smartboard sticky notes panel */
.sticky-notes-panel {
    grid-column: 3;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 324px;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 16px;
    border-left: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
    z-index: 15;
}

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

.sticky-notes-kicker {
    display: inline-flex;
    margin-bottom: 4px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.sticky-notes-head h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.04em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sticky-notes-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}

.sticky-notes-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.sticky-notes-close {
    display: none;
}

.sticky-add-btn {
    width: 100%;
    border: 1px dashed #b8c0d5;
    border-radius: 16px;
    min-height: 44px;
    background: #ffffff;
    color: #334155;
    font-weight: 850;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform .12s ease, border-color .16s ease, background .16s ease;
}

.sticky-add-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.sticky-notes-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overflow-x: visible;
    padding: 2px 6px 28px 2px;
    min-height: 0;
    scroll-padding-top: 24px;
    scroll-padding-bottom: 28px;
    overscroll-behavior: contain;
}

.sticky-notes-list::-webkit-scrollbar {
    width: 8px;
}

.sticky-notes-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.sticky-note-card {
    position: relative;
    flex: 0 0 auto;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 20px;
    padding: 13px;
    box-shadow: none;
    overflow: hidden;
    transition: transform .16s ease, opacity .16s ease;
}

.sticky-note-card.is-pinned {
    box-shadow: none;
}

.sticky-note-card.is-dragging {
    opacity: .55;
    transform: rotate(-1deg) scale(.98);
    box-shadow: none;
}

.sticky-note-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 34px;
    background: rgba(255, 255, 255, .22);
    pointer-events: none;
}

.sticky-note-card[data-note-color="yellow"] { background: #ffef9f; }
.sticky-note-card[data-note-color="pink"] { background: #ffcbe0; }
.sticky-note-card[data-note-color="blue"] { background: #cbe5ff; }
.sticky-note-card[data-note-color="green"] { background: #d2f2cc; }
.sticky-note-card[data-note-color="purple"] { background: #e0ccff; }

.sticky-note-top {
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 30px 28px;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.sticky-note-title {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .38);
    color: rgba(15, 23, 42, .78);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: -.01em;
    padding: 7px 8px;
    cursor: text;
    user-select: text;
}

.sticky-note-title:focus {
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, .10);
}

.sticky-drag-handle {
    width: 30px;
    height: 28px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .62);
    color: rgba(15, 23, 42, .66);
    cursor: grab;
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
}

.sticky-drag-handle:hover,
.sticky-drag-handle:active {
    cursor: grabbing;
    background: rgba(255, 255, 255, .92);
    color: rgba(15, 23, 42, .86);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.sticky-note-pin,
.sticky-note-delete {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .58);
    color: rgba(15, 23, 42, .62);
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sticky-note-pin {
    font-size: 14px;
    transform: rotate(-18deg);
}

.sticky-note-pin.is-active {
    background: rgba(255, 255, 255, .95);
    color: #b45309;
    box-shadow: inset 0 0 0 1px rgba(180, 83, 9, .18);
}

.sticky-note-delete {
    font-size: 18px;
}

.sticky-note-pin:hover,
.sticky-note-delete:hover {
    background: rgba(255, 255, 255, .9);
}

.sticky-note-delete:hover {
    color: var(--danger);
}

.sticky-note-text {
    position: relative;
    width: 100%;
    min-height: 96px;
    border: 0;
    outline: 0;
    resize: none;
    overflow: hidden;
    background: transparent;
    color: #182131;
    font-size: 14px;
    line-height: 1.5;
    padding: 2px 0;
    cursor: text;
    user-select: text;
}

.sticky-note-text::placeholder {
    color: rgba(15, 23, 42, .42);
}

.sticky-note-bottom {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.sticky-note-colors {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sticky-note-order-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.sticky-note-order-btn {
    width: 28px;
    height: 26px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, .62);
    color: rgba(15, 23, 42, .68);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .14s ease, transform .14s ease, opacity .14s ease;
}

.sticky-note-order-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, .94);
    transform: translateY(-1px);
}

.sticky-note-order-btn:disabled {
    opacity: .34;
    cursor: not-allowed;
}

.sticky-color-btn {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .82);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
    cursor: pointer;
    padding: 0;
}

.sticky-color-btn.is-active {
    box-shadow: 0 0 0 2px rgba(15, 23, 42, .62);
}

.sticky-color-btn[data-color="yellow"] { background: #ffef9f; }
.sticky-color-btn[data-color="pink"] { background: #ffcbe0; }
.sticky-color-btn[data-color="blue"] { background: #cbe5ff; }
.sticky-color-btn[data-color="green"] { background: #d2f2cc; }
.sticky-color-btn[data-color="purple"] { background: #e0ccff; }

.sticky-empty-state {
    border: 1px dashed var(--line-strong);
    border-radius: 18px;
    background: rgba(255, 255, 255, .7);
    padding: 18px;
    color: var(--muted);
    text-align: center;
    line-height: 1.45;
}

.sticky-empty-state strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.sticky-notes-foot {
    margin-top: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: #ffffff;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.sticky-notes-foot strong,
.sticky-notes-foot span {
    display: block;
}

.sticky-notes-foot strong {
    color: var(--text);
    margin-bottom: 2px;
}

.sticky-notes-float {
    display: none;
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 18px;
    background: var(--primary);
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 16px 30px rgba(69, 87, 230, .28);
    cursor: pointer;
}

body[data-view="calendar"] .sticky-notes-panel {
    height: 100vh;
    height: 100dvh;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 238px minmax(0, 1fr) 300px;
    }

    .sidebar {
        width: 238px;
    }

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

@media (max-width: 980px) {
    body[data-view="calendar"] {
        overflow: auto;
    }

    body[data-view="calendar"] .app-shell,
    body[data-view="calendar"] .main-area {
        height: auto;
        overflow: visible;
    }

    body[data-view="calendar"] #calendarView.active,
    body[data-view="calendar"] .calendar-shell {
        display: block;
    }

    .calendar-shell {
        overflow-x: auto;
    }

    .calendar-weekdays,
    .calendar-grid {
        min-width: 860px;
    }

    body[data-view="calendar"] .calendar-cell {
        min-height: 96px;
    }
}

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

    .sidebar {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        z-index: auto;
        width: auto;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid #1e293b;
    }

    .main-area {
        grid-column: auto;
    }

    .side-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        margin-top: 18px;
    }

    .nav-item {
        justify-content: center;
        padding: 9px 6px;
        font-size: 12px;
    }

    .nav-icon {
        display: none;
    }

    .workspace-list {
        grid-auto-flow: column;
        grid-auto-columns: minmax(190px, 1fr);
        overflow-x: auto;
        max-height: none;
    }

    .sidebar-footer {
        display: none;
    }

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

    .topbar-actions,
    .month-picker,
    .tabs {
        width: 100%;
    }

    .search-box {
        min-width: 100%;
    }

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

    .filters-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .timeline-board {
        grid-auto-columns: minmax(235px, 82vw);
    }

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

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


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

    .list-actions {
        justify-content: flex-start;
    }
}

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

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

    .stats-grid,
    .overview-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .overview-card.wide,
    .setting-card.actions-card {
        grid-column: span 1;
    }

    .month-picker {
        flex-wrap: wrap;
    }

    .month-picker select {
        flex: 1;
    }

    .today-month-btn {
        flex: 1 0 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* Global dashboard refinements */
.dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-card.table-card {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-list {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.dashboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f9fafc;
    color: var(--text);
    text-decoration: none;
}

.dashboard-row:hover {
    background: #f3f5fb;
    border-color: #dbe1ee;
}

.dashboard-row.static-row:hover {
    background: #f9fafc;
}

.dashboard-row span {
    min-width: 0;
}

.dashboard-row strong,
.dashboard-row small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-row strong {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0;
}

.dashboard-row small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.dashboard-row em {
    flex: 0 0 auto;
    font-style: normal;
    font-size: 12px;
    font-weight: 850;
    color: var(--primary);
    background: #eef1ff;
    border-radius: 999px;
    padding: 5px 8px;
}





.dashboard-empty {
    margin-top: 6px;
    border: 1px dashed var(--line);
    border-radius: 13px;
    padding: 16px;
    color: var(--muted);
    background: #fafbfe;
    font-size: 13px;
}

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

@media (max-width: 640px) {
    .dashboard-grid,
    .overview-card.table-card {
        grid-template-columns: 1fr;
    }

    .overview-card.table-card {
        grid-column: span 1;
    }
}

.confirm-card {
    width: min(430px, 100%);
    padding: 22px;
    overflow: visible;
    text-align: left;
}

.confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 900;
    margin-bottom: 14px;
}

.confirm-copy h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.04em;
}

.confirm-copy p {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.confirm-actions {
    margin-top: 18px;
}

.confirm-actions .danger-btn {
    min-height: 40px;
    border-radius: 12px;
    padding: 0 14px;
    font-weight: 850;
}

.workspace-section {
    margin-top: 20px;
}

/* Modern Job Modal */
.job-modal-card {
    width: min(920px, 100%);
    border-radius: 28px;
    border: 1px solid #e8ebf3;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.job-modal-header {
    align-items: center;
    padding: 22px 24px 16px;
    background: radial-gradient(circle at top left, rgba(69, 87, 230, .11), transparent 36%), #ffffff;
    border-bottom: 1px solid var(--line);
}

.modal-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 7px;
    border: 1px solid rgba(69, 87, 230, .16);
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.job-modal-header h2 {
    font-size: 24px;
}

.job-form {
    padding: 0;
}

.job-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 14px;
    padding: 18px 24px 20px;
}

.form-section {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .86);
    box-shadow: var(--shadow-soft);
    padding: 14px;
}

.form-section.primary-section,
.form-section.notes-section {
    grid-column: 1;
}

.form-section.process-section,
.form-section.compact-section {
    grid-column: 2;
}

.form-section.process-section {
    grid-row: span 2;
}

.form-section.notes-section {
    padding: 12px;
}

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

.form-section-head strong {
    display: block;
    font-size: 13px;
    color: #1f2937;
    letter-spacing: -.01em;
}

.form-section-head span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.job-form .form-grid {
    gap: 10px;
}

.field-card {
    min-width: 0;
    display: grid;
    gap: 7px;
    border: 1px solid #eef1f6;
    border-radius: 16px;
    background: #fff;
    padding: 10px;
}

.field-card.important-field {
    background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.job-form .task-form label span,
.job-form label span,
.job-form .field-card > span,
.job-form .notes-card > span {
    color: #4b5563;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.required-star {
    display: inline-block;
    margin-left: 3px;
    color: #ef4444;
    font-style: normal;
    font-size: 12px;
    line-height: 1;
    vertical-align: top;
}

.job-form input,
.job-form select,
.job-form textarea {
    border-color: #e8ebf2;
    background-color: #fbfcff;
}

.job-form input:focus,
.job-form select:focus,
.job-form textarea:focus,
.search-select.invalid input:focus {
    border-color: rgba(69, 87, 230, .55);
    box-shadow: 0 0 0 4px rgba(69, 87, 230, .10);
}

.process-tracker {
    display: grid;
    gap: 10px;
}

.process-step {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    border: 1px solid #edf0f6;
    border-radius: 18px;
    background: #fff;
    padding: 11px;
}

.process-step::before {
    content: "";
    position: absolute;
    left: 27px;
    top: 47px;
    bottom: -14px;
    width: 2px;
    background: #eef1f6;
}

.process-step:last-child::before {
    display: none;
}

.process-node {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #f3f4f6;
    color: #64748b;
    font-weight: 900;
    font-size: 12px;
    z-index: 1;
}

.process-step-copy strong,
.process-step-copy small {
    display: block;
}

.process-step-copy strong {
    font-size: 13px;
    color: #111827;
}

.process-step-copy small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.process-chip {
    align-self: start;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    color: #667085;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.process-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.process-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 9px;
}

.process-options button {
    border: 1px solid #e8ebf2;
    border-radius: 999px;
    background: #f9fafb;
    color: #64748b;
    min-height: 30px;
    padding: 0 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}

.process-options button:hover {
    transform: translateY(-1px);
}

.process-options button.active {
    background: var(--primary-soft);
    border-color: rgba(69, 87, 230, .24);
    color: var(--primary);
}

.process-step.status-done {
    border-color: rgba(47, 155, 98, .18);
    background: linear-gradient(180deg, #ffffff, #f8fffb);
}

.process-step.status-done .process-node,
.process-step.status-done .process-chip,
.process-step.status-done .process-options button.active {
    background: var(--green-soft);
    border-color: rgba(47, 155, 98, .22);
    color: var(--green);
}

.process-step.status-stuck {
    border-color: rgba(220, 61, 76, .18);
    background: linear-gradient(180deg, #ffffff, #fffafa);
}

.process-step.status-stuck .process-node,
.process-step.status-stuck .process-chip,
.process-step.status-stuck .process-options button.active {
    background: var(--danger-soft);
    border-color: rgba(220, 61, 76, .22);
    color: var(--danger);
}

.process-step.status-pending .process-node,
.process-step.status-pending .process-chip,
.process-step.status-pending .process-options button.active {
    background: var(--orange-soft);
    border-color: rgba(217, 119, 6, .22);
    color: var(--orange);
}

.modern-file-row {
    grid-template-columns: minmax(130px, .8fr) minmax(0, 1.2fr);
    gap: 10px;
    align-items: stretch;
}

.modern-file-row .invoice-upload-label {
    justify-content: center;
}

.job-form input[type="file"] {
    min-height: 42px;
    border: 1px dashed #d7ddea;
    background: #fbfcff;
}

.job-form input[type="file"]::file-selector-button {
    background: var(--primary);
    color: #fff;
}

.current-invoice {
    margin-top: 2px;
    border-style: dashed;
}

.notes-card {
    border: 0;
    padding: 0;
    background: transparent;
}

.notes-card textarea {
    min-height: 112px;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 14px 24px;
    margin-top: 0;
}

@media (max-width: 980px) {
    .job-modal-card {
        width: min(760px, 100%);
    }

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

    .form-section.primary-section,
    .form-section.notes-section,
    .form-section.process-section,
    .form-section.compact-section {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 720px) {
    .job-modal-header {
        padding: 18px 16px 14px;
    }

    .job-form-layout {
        padding: 14px 16px 16px;
    }

    .job-form .form-grid,
    .modern-file-row {
        grid-template-columns: 1fr;
    }

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

    .process-step {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .process-step .process-chip {
        grid-column: 2;
        justify-self: start;
        margin-top: 4px;
    }

    .process-options {
        grid-template-columns: 1fr;
    }

    .sticky-actions {
        padding: 12px 16px;
    }
}

/* Refined Job Modal: compact invoice beside pickup date */
.job-form-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    grid-template-rows: auto auto;
    align-items: stretch;
}

.form-section.primary-section {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.form-section.process-section {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.form-section.notes-section {
    grid-column: 1 / -1;
    grid-row: 2;
}

.form-section.compact-section {
    display: none;
}

.job-form .primary-section .form-grid {
    flex: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(76px, auto);
    align-content: stretch;
}

.invoice-compact-field {
    align-self: stretch;
    justify-content: center;
    gap: 6px;
}

.invoice-compact-field input[type="file"] {
    min-height: 36px;
    padding: 5px 8px;
    border-radius: 11px;
    font-size: 12px;
}

.invoice-compact-field input[type="file"]::file-selector-button {
    min-height: 24px;
    margin-right: 7px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 11px;
}

.invoice-compact-field .current-invoice {
    margin-top: 0;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.25;
}

.invoice-compact-field .current-invoice span {
    display: none;
}

.invoice-compact-field .current-invoice a {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-tracker {
    flex: 1;
    grid-template-rows: repeat(4, minmax(76px, 1fr));
}

.process-step {
    align-items: center;
}

@media (max-width: 980px) {
    .job-form-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        align-items: stretch;
    }

    .form-section.primary-section,
    .form-section.process-section,
    .form-section.notes-section {
        grid-column: 1;
        grid-row: auto;
        height: auto;
    }
}

@media (max-width: 720px) {
    .invoice-compact-field {
        justify-content: start;
    }
}

/* Notes chat view inside Job Modal */
.job-modal-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.notes-toggle-btn {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #344054;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    font-weight: 850;
    cursor: pointer;
    transition: transform .12s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

.notes-toggle-btn span {
    font-size: 15px;
    line-height: 1;
}

.notes-toggle-btn small {
    font-size: 12px;
    font-weight: 850;
}

.notes-toggle-btn:hover,
.notes-toggle-btn.active {
    transform: translateY(-1px);
    background: var(--primary-soft);
    border-color: rgba(69, 87, 230, .25);
    color: var(--primary);
}

.job-form-layout .notes-chat-section {
    display: none;
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 430px;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #fbfcff, #ffffff);
}

.job-form-layout.show-notes-chat {
    grid-template-columns: 1fr;
}

.job-form-layout.show-notes-chat .primary-section,
.job-form-layout.show-notes-chat .process-section {
    display: none;
}

.job-form-layout.show-notes-chat .notes-chat-section {
    display: flex;
    flex-direction: column;
}

.notes-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.notes-chat-head > div {
    min-width: 0;
}

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

.notes-chat-head strong {
    font-size: 14px;
    color: #111827;
}

.notes-chat-head span {
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}

.notes-back-btn {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.notes-chat-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background:
        radial-gradient(circle at 12% 10%, rgba(69, 87, 230, .08), transparent 28%),
        linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

.chat-bubble-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    max-width: 78%;
}

.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    flex: 0 0 auto;
}

.chat-bubble {
    border: 1px solid #e6e9f2;
    border-radius: 18px 18px 18px 5px;
    background: #ffffff;
    color: #344054;
    padding: 11px 13px;
    box-shadow: var(--shadow-soft);
}

.chat-bubble strong {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
    color: #111827;
}

.chat-bubble p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

.chat-compose-card {
    margin-top: auto;
    margin-left: auto;
    width: min(680px, 92%);
    display: grid;
    gap: 7px;
    border: 1px solid rgba(69, 87, 230, .16);
    border-radius: 22px 22px 6px 22px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 12px 26px rgba(16, 24, 40, .07);
}

.chat-compose-card > span {
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.chat-compose-card textarea {
    min-height: 190px;
    resize: vertical;
    border-radius: 16px;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .job-modal-tools {
        gap: 6px;
    }

    .notes-toggle-btn {
        min-height: 36px;
        padding: 0 9px;
    }

    .notes-toggle-btn small {
        display: none;
    }

    .job-form-layout .notes-chat-section {
        min-height: 400px;
    }

    .notes-chat-head {
        align-items: flex-start;
        padding: 12px;
    }

    .notes-chat-wrap {
        padding: 14px;
    }

    .chat-bubble-row,
    .chat-compose-card {
        max-width: 100%;
        width: 100%;
    }

    .chat-compose-card textarea {
        min-height: 160px;
    }
}


@media (min-width: 1281px) {
    .sticky-notes-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 324px;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        box-shadow: none;
    }
}

@media (max-width: 1280px) {
    .app-shell {
        grid-template-columns: 238px minmax(0, 1fr);
    }

    .sticky-notes-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(360px, 92vw);
        height: auto;
        transform: translateX(105%);
        transition: transform .2s ease;
        box-shadow: -18px 0 40px rgba(15, 23, 42, .16);
    }

    .sticky-notes-panel.is-open {
        transform: translateX(0);
    }

    .sticky-notes-close,
    .sticky-notes-float {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 820px) {
    .sticky-notes-panel {
        width: min(390px, 94vw);
        border-left: 1px solid var(--line);
        border-bottom: 0;
        overflow: hidden;
    }
}

/* Drag and sticky-note visibility refinements */
.app-shell.notes-hidden,
body.sticky-notes-hidden .app-shell {
    grid-template-columns: 274px minmax(0, 1fr);
}

.sticky-notes-panel.is-hidden,
body.sticky-notes-hidden .sticky-notes-panel {
    display: none;
}

.app-shell.notes-hidden .sticky-notes-float,
body.sticky-notes-hidden .sticky-notes-float {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sticky-notes-hide {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 12px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 850;
}


.board-scroll {
    scroll-padding-inline: 120px;
    overscroll-behavior-x: contain;
}

@media (max-width: 1100px) {
    .app-shell.notes-hidden,
    body.sticky-notes-hidden .app-shell {
        grid-template-columns: 238px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .app-shell.notes-hidden,
    body.sticky-notes-hidden .app-shell {
        display: block;
    }
}


/* Floating horizontal control for wide timeline board */
.kanban-scroll-control {
    position: fixed;
    left: calc(274px + 24px);
    right: calc(324px + 24px);
    bottom: 18px;
    z-index: 18;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(217, 222, 233, .92);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .10);
}

.kanban-scroll-btn {
    width: 38px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(69, 87, 230, .22);
}

.kanban-scroll-btn:hover {
    filter: brightness(.96);
}

.kanban-scroll-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
    box-shadow: none;
}

.kanban-scroll-track {
    position: relative;
    flex: 1;
    height: 14px;
    min-width: 140px;
    border-radius: 999px;
    background: #e8ebf3;
    overflow: hidden;
    cursor: pointer;
}

.kanban-scroll-thumb {
    position: absolute;
    left: 0;
    top: 2px;
    width: 60px;
    height: 10px;
    border-radius: 999px;
    background: #8992a8;
    cursor: grab;
    touch-action: none;
}

.kanban-scroll-control.is-dragging .kanban-scroll-thumb {
    cursor: grabbing;
    background: var(--primary);
}

.app-shell.notes-hidden .kanban-scroll-control,
    body.sticky-notes-hidden .app-shell .kanban-scroll-control {
    right: 24px;
}

@media (max-width: 1280px) {
    .kanban-scroll-control {
        left: calc(238px + 18px);
        right: 18px;
        bottom: 16px;
    }
}

@media (max-width: 820px) {
    .kanban-scroll-control {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 7px 8px;
    }

    .kanban-scroll-btn {
        width: 36px;
        height: 32px;
    }
}

/* Kanban floating scrollbar refinements: no old scrollbar, no overlap, easier click-through */
.board-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 72px;
}

.board-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.timeline-board {
    padding-bottom: 72px;
}

.kanban-scroll-control {
    bottom: 20px;
    pointer-events: none;
    z-index: 55;
}

.kanban-scroll-btn,
.kanban-scroll-track {
    pointer-events: auto;
}

.app-shell.notes-hidden .kanban-scroll-control,
    body.sticky-notes-hidden .app-shell .kanban-scroll-control {
    right: 92px;
}

@media (max-width: 1280px) {
    .kanban-scroll-control {
        right: 92px;
        bottom: 18px;
    }
}

@media (max-width: 820px) {
    .kanban-scroll-control {
        left: 12px;
        right: 76px;
        bottom: 12px;
    }
}


/* Kanban floating scrollbar closer to board/cards */
.board-scroll {
    padding-bottom: 32px;
}

.timeline-board {
    padding-bottom: 28px;
}

.kanban-scroll-control {
    bottom: 14px;
}

@media (min-width: 1281px) {
    .timeline-board,
    .day-column {
        min-height: max(560px, calc(100vh - 230px));
    }
}

@media (max-width: 1280px) {
    .board-scroll {
        padding-bottom: 28px;
    }

    .timeline-board {
        padding-bottom: 24px;
    }

    .kanban-scroll-control {
        bottom: 12px;
    }
}

@media (max-width: 820px) {
    .board-scroll {
        padding-bottom: 24px;
    }

    .timeline-board {
        padding-bottom: 20px;
    }
}


/* Fix: keep Edit Job invoice upload compact even with long filenames */
.invoice-compact-field {
    min-width: 0;
    overflow: hidden;
    align-content: center;
}

.invoice-compact-field input[type="file"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    color: transparent;
    font-size: 0;
}

.invoice-compact-field input[type="file"]::file-selector-button {
    font-size: 11px;
    color: #fff;
}

.selected-invoice-name,
.invoice-compact-field .current-invoice {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.selected-invoice-name {
    display: block;
    padding: 6px 8px;
    border-radius: 10px;
    background: #f5f7ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.selected-invoice-name[hidden],
.invoice-compact-field .current-invoice[hidden] {
    display: none !important;
}

.invoice-compact-field .current-invoice {
    display: block;
    padding: 6px 8px;
}

.invoice-compact-field .current-invoice a {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* Edit Job invoice upload: match Pickup Date field layout */
.invoice-compact-field {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
    justify-content: stretch;
    gap: 7px;
    min-width: 0;
    overflow: visible;
}

.invoice-compact-field > span {
    text-align: left;
}

.invoice-file-native {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.invoice-file-control {
    width: 100%;
    min-height: 58px;
    border: 1px solid #e8ebf2;
    border-radius: 12px;
    background: #fbfcff;
    color: var(--text);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    cursor: pointer;
}

.invoice-compact-field:hover .invoice-file-control {
    border-color: #d9deea;
    background: #ffffff;
}

.invoice-compact-field:focus-within .invoice-file-control {
    border-color: rgba(69, 87, 230, .55);
    box-shadow: 0 0 0 4px rgba(69, 87, 230, .10);
}

.invoice-file-button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.invoice-file-control .selected-invoice-name {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    display: block;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #667085;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
    letter-spacing: normal;
}

.invoice-file-control .selected-invoice-name[hidden] {
    display: block !important;
}

.invoice-compact-field .current-invoice {
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 10px;
    box-sizing: border-box;
}

.invoice-compact-field .current-invoice[hidden] {
    display: none !important;
}

.invoice-compact-field .current-invoice a {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .invoice-file-control {
        min-height: 54px;
        padding: 8px 10px;
    }

    .invoice-file-button {
        padding: 0 12px;
        font-size: 12px;
    }

    .invoice-file-control .selected-invoice-name {
        font-size: 13px;
    }
}

/* Fix: keep Invoice File control inside its field card */
.invoice-compact-field {
    overflow: hidden !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.invoice-compact-field * {
    box-sizing: border-box;
}

.invoice-file-control {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.invoice-file-button {
    min-width: 0 !important;
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invoice-file-control .selected-invoice-name {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
}

.invoice-compact-field .current-invoice {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

@media (max-width: 720px) {
    .invoice-file-control {
        grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
        gap: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .invoice-file-button {
        max-width: 116px;
    }
}

/* Professional floating Sticky Notes button */
.sticky-notes-float {
    right: 22px;
    bottom: 22px;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .55);
    background: linear-gradient(135deg, #4557e6 0%, #6d5dfc 100%);
    color: #ffffff;
    font-size: 0;
    box-shadow: 0 18px 38px rgba(69, 87, 230, .30), 0 4px 12px rgba(15, 23, 42, .12);
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.sticky-notes-float::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
    pointer-events: none;
}

.sticky-notes-float::after {
    content: "+";
    position: absolute;
    top: 9px;
    right: 9px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 999px;
    background: #ffffff;
    color: #4557e6;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .14);
    pointer-events: none;
}

.sticky-notes-float:hover {
    transform: translateY(-2px);
    filter: saturate(1.06);
    box-shadow: 0 22px 44px rgba(69, 87, 230, .36), 0 7px 16px rgba(15, 23, 42, .14);
}

.sticky-notes-float:active {
    transform: translateY(0) scale(.97);
}

.sticky-notes-float:focus-visible {
    outline: 4px solid rgba(69, 87, 230, .22);
    outline-offset: 3px;
}

.sticky-notes-float-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.sticky-notes-float-icon svg {
    display: block;
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, .16));
}

@media (max-width: 820px) {
    .sticky-notes-float {
        right: 16px;
        bottom: 16px;
    }
}

/* ==========================================================
   Responsive device polish
   Makes the dashboard safer for desktop, smartboard, tablet,
   and mobile without changing the PHP/data structure.
   ========================================================== */
:root {
    --rt-sidebar-lg: 274px;
    --rt-sidebar-md: 238px;
    --rt-notes-lg: 324px;
    --rt-mobile-gap: 12px;
}

html,
body {
    width: 100%;
    max-width: 100%;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.app-shell,
.main-area,
.topbar,
.topbar-left,
.topbar-actions,
.board-toolbar,
.board-info,
.board-scroll,
.timeline-board,
.day-column,
.task-card,
.modal-card,
.job-modal-card,
.form-section,
.sticky-notes-panel,
.sticky-note,
.calendar-shell,
.calendar-grid,
.calendar-cell {
    min-width: 0;
}

.app-shell {
    width: 100%;
    max-width: 100vw;
}

.main-area {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.topbar-actions,
.board-toolbar,
.board-info,
.legend,
.filters-panel,
.month-picker,
.tabs {
    flex-wrap: wrap;
}

.topbar-actions {
    min-width: 0;
    justify-content: flex-end;
}

.search-box {
    min-width: min(280px, 100%);
    flex: 1 1 280px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.filters-panel label {
    min-width: min(210px, 100%);
    flex: 1 1 210px;
}

.board-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

.timeline-board {
    width: max-content;
    max-width: none;
}

.day-column {
    contain: layout paint;
}

.task-card,
.calendar-job,
.workspace-link,
.dashboard-row,
.current-invoice,
.selected-invoice-name {
    overflow-wrap: anywhere;
}

.task-title,
.task-meta,
.calendar-job span,
.workspace-copy strong,
.workspace-copy small,
.dashboard-row strong,
.dashboard-row small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop and smartboard */
@media (min-width: 1281px) {
    .app-shell {
        grid-template-columns: var(--rt-sidebar-lg) minmax(0, 1fr) var(--rt-notes-lg);
    }

    .app-shell.notes-hidden,
    body.sticky-notes-hidden .app-shell {
        grid-template-columns: var(--rt-sidebar-lg) minmax(0, 1fr);
    }

    .sidebar {
        width: var(--rt-sidebar-lg);
    }

    .sticky-notes-panel {
        width: var(--rt-notes-lg);
    }

    .main-area {
        padding: clamp(14px, 1vw, 20px);
    }

    .timeline-board,
    .day-column {
        min-height: clamp(560px, calc(100dvh - 230px), 920px);
    }
}

/* Small laptop / tablet landscape */
@media (max-width: 1280px) {
    .app-shell {
        grid-template-columns: var(--rt-sidebar-md) minmax(0, 1fr);
    }

    .app-shell.notes-hidden,
    body.sticky-notes-hidden .app-shell {
        grid-template-columns: var(--rt-sidebar-md) minmax(0, 1fr);
    }

    .sidebar {
        width: var(--rt-sidebar-md);
    }

    .main-area {
        grid-column: 2;
        padding: clamp(12px, 1.5vw, 18px);
    }

    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar-actions {
        width: 100%;
    }

    .board-toolbar {
        gap: 12px;
    }

    .tabs,
    .month-picker {
        flex: 1 1 auto;
    }

    .sticky-notes-panel {
        max-width: 100vw;
    }
}

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

    .timeline-board {
        grid-auto-columns: minmax(230px, 30vw);
    }

    .job-modal-card {
        width: min(960px, calc(100vw - 24px));
    }
}

/* Tablet portrait and below: stack sidebar above content */
@media (max-width: 900px) {
    .app-shell,
    .app-shell.notes-hidden {
        display: block;
        max-width: 100%;
    }

    .sidebar {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        min-height: 0;
        height: auto;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid #1e293b;
    }

    .main-area {
        grid-column: auto;
        width: 100%;
        overflow: visible;
    }

    .workspace-list {
        grid-auto-flow: column;
        grid-auto-columns: minmax(190px, 1fr);
        overflow-x: auto;
        max-height: none;
        padding-bottom: 4px;
    }

    .topbar,
    .board-toolbar,
    .board-info,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions,
    .month-picker,
    .tabs {
        width: 100%;
    }

    .kanban-scroll-control {
        left: 12px;
        right: 76px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    body {
        font-size: 13px;
    }

    .sidebar {
        padding: 14px 12px;
    }

    .sidebar-brand strong {
        font-size: 14px;
    }

    .sidebar-brand span {
        font-size: 11px;
    }

    .main-area {
        padding: 10px;
    }

    .topbar {
        gap: 12px;
        margin-bottom: 12px;
    }

    .topbar h1 {
        font-size: 21px;
    }

    .topbar p,
    .board-info p {
        font-size: 12px;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .search-box {
        min-width: 0;
        width: 100%;
    }

    .soft-btn,
    .primary-btn,
    .icon-btn,
    .text-btn,
    .danger-btn,
    .tab,
    .stat-card,
    .task-action {
        min-height: 42px;
    }

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

    .tab {
        padding-left: 8px;
        padding-right: 8px;
        white-space: nowrap;
    }

    .month-picker {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) minmax(76px, .55fr) 42px;
        gap: 7px;
    }

    .month-picker select,
    .month-picker input,
    .month-picker button {
        width: 100%;
    }

    .today-month-btn {
        grid-column: 1 / -1;
    }

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

    .stat-card {
        padding: 12px;
    }

    .stat-card strong {
        font-size: 24px;
    }

    .filters-panel {
        gap: 8px;
        padding: 10px;
    }

    .timeline-board {
        grid-auto-columns: minmax(220px, 88vw);
        min-height: 520px;
        gap: 8px;
    }

    .day-column {
        min-height: 520px;
        border-radius: 16px;
    }

    .day-header {
        height: auto;
        min-height: 54px;
        padding: 10px 12px;
    }

    .task-list {
        padding: 10px;
    }

    .task-card {
        padding: 11px;
    }

    .task-actions {
        flex-wrap: wrap;
    }

    .kanban-scroll-control {
        left: 10px;
        right: 74px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        gap: 7px;
        padding: 7px;
    }

    .kanban-scroll-track {
        min-width: 72px;
    }

    .kanban-scroll-btn {
        width: 34px;
        height: 32px;
        font-size: 16px;
    }

    .sticky-notes-float {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: 52px;
        height: 52px;
    }

    .sticky-notes-panel {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }

    .sticky-notes-list {
        padding: 12px;
    }

    .sticky-note {
        border-radius: 15px;
    }

    .modal-backdrop {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .modal-card,
    .job-modal-card {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .modal-header,
    .job-modal-header {
        padding: 15px 14px 12px;
    }

    .task-form,
    .job-form-layout {
        padding: 12px;
    }

    .form-grid,
    .job-form .form-grid,
    .basic-two-col,
    .modern-file-row {
        grid-template-columns: 1fr !important;
    }

    .form-grid .span-2,
    .job-form .form-grid .span-2 {
        grid-column: span 1;
    }

    .form-section {
        border-radius: 18px;
        padding: 14px;
    }

    .process-step {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 10px;
    }

    .process-options {
        grid-template-columns: 1fr;
    }

    .sticky-actions,
    .modal-actions {
        gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .modal-actions,
    .sticky-actions {
        flex-direction: column-reverse;
    }

    .modal-actions button,
    .sticky-actions button {
        width: 100%;
    }

    .invoice-file-control {
        min-height: 54px;
        grid-template-columns: minmax(98px, auto) minmax(0, 1fr);
    }

    body[data-view="calendar"] .calendar-shell {
        overflow: visible;
    }

    .calendar-weekdays {
        display: none;
    }

    .calendar-weekdays,
    .calendar-grid {
        min-width: 0 !important;
    }

    .calendar-grid,
    body[data-view="calendar"] .calendar-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .calendar-cell,
    body[data-view="calendar"] .calendar-cell {
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    .calendar-job-list,
    body[data-view="calendar"] .calendar-job-list {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 420px) {
    .main-area {
        padding: 8px;
    }

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

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

    .month-picker {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
    }

    .month-picker #yearInput {
        grid-column: 1 / -1;
    }

    .today-month-btn {
        grid-column: 1 / -1;
    }

    .timeline-board {
        grid-auto-columns: minmax(210px, 92vw);
    }

    .kanban-scroll-control {
        right: 68px;
    }

    .invoice-file-button {
        max-width: 104px;
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .task-card,
    .calendar-job,
    .sticky-note,
    .workspace-link,
    .task-action,
    .tab,
    .soft-btn,
    .primary-btn,
    .icon-btn {
        -webkit-tap-highlight-color: transparent;
    }

    .task-action,
    .soft-btn,
    .primary-btn,
    .icon-btn,
    .tab,
    .calendar-more,
    .sticky-note-btn,
    .sticky-notes-float {
        min-height: 44px;
        min-width: 44px;
    }
}


/* Mobile hamburger sidebar cleanup */
.mobile-menu-toggle,
.mobile-menu-close,
.mobile-sidebar-backdrop {
    display: none;
}

@media (max-width: 900px) {
    .mobile-menu-toggle {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border: 1px solid #dfe4f1;
        border-radius: 14px;
        background: #ffffff;
        color: #1f2937;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        cursor: pointer;
    }

    .mobile-menu-toggle span {
        width: 18px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        display: block;
    }

    .mobile-menu-toggle:active {
        transform: scale(0.97);
    }

    .mobile-menu-close {
        margin-left: auto;
        width: 38px;
        height: 38px;
        border: 1px solid rgba(148, 163, 184, 0.22);
        border-radius: 13px;
        background: rgba(255, 255, 255, 0.08);
        color: #e5e7eb;
        display: grid;
        place-items: center;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
    }

    .mobile-menu-close:hover,
    .mobile-menu-close:focus-visible {
        background: rgba(255, 255, 255, 0.14);
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1190;
        display: block;
        background: rgba(15, 23, 42, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        backdrop-filter: blur(2px);
    }

    body.mobile-sidebar-open {
        overflow: hidden;
    }

    body.mobile-sidebar-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell,
    .app-shell.notes-hidden {
        display: block !important;
        width: 100%;
        max-width: 100vw;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        width: min(86vw, 330px) !important;
        max-width: 330px;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        padding: 18px 14px calc(18px + env(safe-area-inset-bottom)) !important;
        border-right: 1px solid rgba(148, 163, 184, 0.18) !important;
        border-bottom: 0 !important;
        border-radius: 0 !important;
        box-shadow: 22px 0 60px rgba(15, 23, 42, 0.34);
        transform: translateX(-108%);
        transition: transform 0.24s ease;
        z-index: 1200;
        overflow-y: auto;
        overflow-x: hidden;
    }

    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-brand {
        align-items: center;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    }

    .sidebar-section {
        margin-top: 18px;
    }

    .workspace-list {
        display: grid;
        grid-auto-flow: row !important;
        grid-auto-columns: initial !important;
        grid-template-columns: 1fr;
        gap: 8px;
        max-height: none;
        overflow: visible;
        padding-bottom: 0;
    }

    .workspace-link {
        min-height: 58px;
    }

    .sidebar-footer {
        margin-top: auto;
        padding-top: 16px;
    }

    .main-area {
        grid-column: auto !important;
        width: 100% !important;
        padding: 12px !important;
        overflow: visible;
    }

    .topbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    }

    .topbar-left {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        min-width: 0;
    }

    .topbar-left > div {
        min-width: 0;
        flex: 1;
    }

    .topbar h1 {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .topbar-actions .search-box {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .topbar-actions .soft-btn,
    .topbar-actions .primary-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .board-toolbar {
        padding: 10px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.78);
        border: 1px solid var(--line);
    }
}

@media (max-width: 640px) {
    .main-area {
        padding: 10px !important;
    }

    .topbar {
        padding: 12px;
        border-radius: 18px;
    }

    .mobile-menu-toggle {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .topbar h1 {
        font-size: 19px;
        line-height: 1.18;
    }

    .topbar p {
        font-size: 11.5px;
        margin-top: 4px;
    }

    .topbar-actions {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-actions .soft-btn,
    .topbar-actions .primary-btn {
        min-height: 42px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .sidebar {
        width: min(88vw, 320px) !important;
        border-radius: 0 !important;
    }
}

@media (max-width: 420px) {
    .topbar-actions {
        grid-template-columns: 1fr;
    }
}

/* Compact mobile toolbar and stats */
.mobile-month-display {
    display: none;
}

@media (max-width: 640px) {
    .board-toolbar {
        gap: 8px !important;
        padding: 8px !important;
        margin-bottom: 8px !important;
        border-radius: 18px !important;
    }

    .board-toolbar .tabs {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 4px !important;
        width: 100% !important;
        padding: 3px !important;
        border: 1px solid var(--line) !important;
        border-radius: 14px !important;
        background: #f8fafc !important;
    }

    .board-toolbar .tab {
        min-height: 34px !important;
        height: 34px !important;
        padding: 0 6px !important;
        border: 0 !important;
        border-radius: 10px !important;
        font-size: 12px !important;
        line-height: 1 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .board-toolbar .tab.active {
        background: #ffffff !important;
        color: var(--primary) !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
    }

    .month-picker {
        display: grid !important;
        grid-template-columns: 38px minmax(0, 1fr) 38px 72px !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .mobile-month-display {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 0 !important;
        width: 100% !important;
        height: 38px !important;
        padding: 0 10px !important;
        border: 1px solid var(--line) !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        color: var(--text) !important;
        font-size: 13px !important;
        font-weight: 900 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .month-picker select,
    .month-picker #yearInput {
        display: none !important;
    }

    .month-picker .month-arrow {
        width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        flex-basis: 38px !important;
        border-radius: 12px !important;
    }

    .month-picker .month-arrow span {
        font-size: 16px !important;
    }

    .today-month-btn {
        grid-column: auto !important;
        width: 100% !important;
        min-height: 38px !important;
        height: 38px !important;
        padding: 0 8px !important;
        border-radius: 12px !important;
        font-size: 12px !important;
    }

    .stats-grid {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 8px !important;
        margin: 0 -10px 8px !important;
        padding: 0 10px 2px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x proximity !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .stats-grid::-webkit-scrollbar {
        display: none !important;
    }

    .stat-card {
        flex: 0 0 86px !important;
        min-width: 86px !important;
        min-height: 58px !important;
        padding: 9px 10px !important;
        border-radius: 14px !important;
        scroll-snap-align: start !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05) !important;
    }

    .stat-card span {
        font-size: 10.5px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .stat-card strong {
        margin-top: 4px !important;
        font-size: 20px !important;
        line-height: 1 !important;
    }

    .board-info {
        margin-top: 2px !important;
        margin-bottom: 8px !important;
        gap: 6px !important;
    }

    .board-info h2 {
        font-size: 16px !important;
    }

    .board-info p {
        display: none !important;
    }
}

@media (max-width: 420px) {
    .month-picker {
        grid-template-columns: 36px minmax(0, 1fr) 36px 66px !important;
        gap: 5px !important;
    }

    .month-picker .month-arrow,
    .today-month-btn,
    .mobile-month-display {
        height: 36px !important;
        min-height: 36px !important;
        border-radius: 11px !important;
    }

    .month-picker .month-arrow {
        width: 36px !important;
        flex-basis: 36px !important;
    }

    .mobile-month-display {
        font-size: 12.5px !important;
        padding: 0 8px !important;
    }

    .today-month-btn {
        font-size: 11.5px !important;
        padding: 0 6px !important;
    }

    .stat-card {
        flex-basis: 78px !important;
        min-width: 78px !important;
        padding: 8px !important;
    }
}

/* Mobile: keep status summary inside Filter panel to save vertical space */
.filter-stats-grid {
    display: none;
}

@media (max-width: 640px) {
    #statsPanel {
        display: none !important;
    }

    .filters-panel.show {
        gap: 10px !important;
        margin-bottom: 8px !important;
        padding: 10px !important;
        border-radius: 16px !important;
    }

    .filters-panel .filter-stats-grid {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
        margin: 0 0 2px !important;
        padding: 0 !important;
    }

    .filter-stat-card {
        min-width: 0 !important;
        min-height: 54px !important;
        padding: 8px 6px !important;
        border-radius: 13px !important;
        box-shadow: none !important;
        background: #f8fafc !important;
    }

    .filter-stat-card span {
        font-size: 10px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .filter-stat-card strong {
        margin-top: 4px !important;
        font-size: 18px !important;
        line-height: 1 !important;
    }
}

@media (max-width: 380px) {
    .filters-panel .filter-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .filter-stat-card {
        min-height: 50px !important;
    }
}

/* Mobile compact filter + easier Create/Edit Job modal */
@media (max-width: 640px) {
    .filters-panel.show {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: end !important;
        gap: 8px !important;
        padding: 8px !important;
        margin-bottom: 8px !important;
        border-radius: 15px !important;
    }

    .filters-panel .filter-stats-grid {
        grid-column: 1 / -1 !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 5px !important;
        margin-bottom: 0 !important;
    }

    .filter-stat-card {
        min-height: 46px !important;
        padding: 6px 6px !important;
        border-radius: 11px !important;
    }

    .filter-stat-card span {
        font-size: 9.5px !important;
        line-height: 1.05 !important;
    }

    .filter-stat-card strong {
        font-size: 16px !important;
        margin-top: 3px !important;
    }

    .filters-panel label {
        min-width: 0 !important;
        width: 100% !important;
        gap: 4px !important;
    }

    .filters-panel label span {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .filters-panel select {
        width: 100% !important;
        min-height: 34px !important;
        height: 34px !important;
        border-radius: 10px !important;
        padding: 0 28px 0 10px !important;
        font-size: 12px !important;
        font-weight: 750 !important;
        background-position: right 10px center !important;
    }

    .filters-panel #resetFilters {
        grid-column: 1 / -1 !important;
        min-height: 34px !important;
        height: 34px !important;
        border-radius: 10px !important;
        font-size: 12px !important;
        justify-content: center !important;
    }

    .modal-backdrop {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .modal-card,
    .job-modal-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        overflow: hidden !important;
    }

    .job-modal-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 5 !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        padding: 12px 12px 10px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(14px) !important;
    }

    .job-modal-header .modal-kicker,
    .job-modal-header p {
        display: none !important;
    }

    .job-modal-header h2 {
        font-size: 20px !important;
        line-height: 1.15 !important;
    }

    .job-modal-tools {
        gap: 7px !important;
        flex: 0 0 auto !important;
    }

    .notes-toggle-btn {
        min-height: 38px !important;
        height: 38px !important;
        padding: 0 11px !important;
        border-radius: 12px !important;
    }

    .notes-toggle-btn small {
        font-size: 11px !important;
    }

    .close-btn {
        width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        border-radius: 12px !important;
    }

    .job-form {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .job-form-layout {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: block !important;
        overflow-y: auto !important;
        padding: 10px 10px 96px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .form-section {
        padding: 10px !important;
        border-radius: 16px !important;
        margin-bottom: 10px !important;
        box-shadow: none !important;
    }

    .form-section-head {
        margin-bottom: 8px !important;
    }

    .form-section-head strong {
        font-size: 13px !important;
    }

    .form-section-head span {
        display: none !important;
    }

    .job-form .form-grid,
    .form-grid,
    .basic-two-col,
    .modern-file-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .field-card {
        padding: 8px !important;
        border-radius: 13px !important;
        gap: 5px !important;
    }

    .job-form label span,
    .job-form .field-card > span,
    .job-form .notes-card > span {
        font-size: 10px !important;
        line-height: 1.1 !important;
    }

    .job-form input,
    .job-form select,
    .job-form textarea,
    .search-select input {
        min-height: 42px !important;
        border-radius: 12px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        font-size: 15px !important;
    }

    .job-form textarea {
        min-height: 140px !important;
        padding-top: 10px !important;
    }

    .invoice-file-control {
        min-height: 44px !important;
        border-radius: 12px !important;
        grid-template-columns: minmax(98px, auto) minmax(0, 1fr) !important;
        padding: 6px !important;
    }

    .invoice-file-button {
        min-height: 34px !important;
        border-radius: 10px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }

    .selected-invoice-name {
        font-size: 12px !important;
    }

    .process-tracker {
        gap: 8px !important;
    }

    .process-step {
        grid-template-columns: 28px minmax(0, 1fr) !important;
        gap: 8px !important;
        padding: 9px !important;
        border-radius: 15px !important;
    }

    .process-step::before {
        display: none !important;
    }

    .process-node {
        width: 28px !important;
        height: 28px !important;
        border-radius: 10px !important;
        font-size: 11px !important;
    }

    .process-step-copy strong {
        font-size: 13px !important;
        padding-right: 66px !important;
    }

    .process-step-copy small {
        display: none !important;
    }

    .process-step .process-chip {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        grid-column: auto !important;
        margin-top: 0 !important;
        padding: 4px 7px !important;
        font-size: 9px !important;
    }

    .process-options {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px !important;
        margin-top: 8px !important;
    }

    .process-options button {
        min-height: 32px !important;
        padding: 0 6px !important;
        font-size: 11px !important;
        border-radius: 999px !important;
    }

    .sticky-actions,
    .modal-actions {
        position: sticky !important;
        bottom: 0 !important;
        z-index: 6 !important;
        flex: 0 0 auto !important;
        display: grid !important;
        grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr) !important;
        gap: 8px !important;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom)) !important;
        background: rgba(255, 255, 255, 0.96) !important;
        border-top: 1px solid var(--line) !important;
        backdrop-filter: blur(14px) !important;
    }

    .modal-actions button,
    .sticky-actions button {
        width: 100% !important;
        min-height: 44px !important;
        border-radius: 13px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 380px) {
    .filters-panel .filter-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 4px !important;
    }

    .filter-stat-card {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .filter-stat-card span {
        font-size: 9px !important;
    }

    .process-options button {
        font-size: 10px !important;
        padding: 0 4px !important;
    }
}

/* Mobile daily sticky-note timeline view */
.mobile-day-board {
    display: none;
}

@media (max-width: 640px) {
    #timelineView .board-info {
        display: none !important;
    }

    #timelineView .busy-wrap {
        display: none !important;
    }

    .kanban-scroll-control {
        display: none !important;
    }

    .mobile-day-board {
        display: block;
        margin-top: 8px;
    }

    .mobile-day-card {
        width: 100%;
        min-width: 0;
        border: 1px solid #e5e9f2;
        border-radius: 22px;
        padding: 12px;
        background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
        box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
        overflow: hidden;
        touch-action: pan-y;
    }

    .mobile-day-nav {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        align-items: stretch;
        gap: 8px;
    }

    .mobile-day-arrow,
    .mobile-day-title,
    .mobile-day-add {
        border: 1px solid #e2e7f0;
        background: #fff;
        color: #1f2937;
        font-family: inherit;
        font-weight: 900;
        min-height: 42px;
        border-radius: 15px;
    }

    .mobile-day-arrow {
        font-size: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-day-arrow:disabled {
        opacity: .42;
        color: #9aa3b2;
        background: #f6f7fb;
    }

    .mobile-day-title {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 10px;
        padding: 8px 12px;
        text-align: left;
        background: #f7f7ff;
        border-color: #dfe3ff;
        color: #111827;
    }

    .mobile-day-title strong {
        grid-row: 1 / 3;
        font-size: 28px;
        line-height: 1;
        letter-spacing: -.04em;
        color: var(--primary);
    }

    .mobile-day-title span {
        font-size: 14px;
        line-height: 1.05;
    }

    .mobile-day-title em {
        color: #697386;
        font-size: 11px;
        font-style: normal;
        font-weight: 800;
    }

    .mobile-day-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin: 10px 0 12px;
    }

    .mobile-day-meta span {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        padding: 0 12px;
        border-radius: 999px;
        background: #eef2ff;
        color: #4f46e5;
        font-size: 12px;
        font-weight: 900;
    }

    .mobile-day-add {
        padding: 0 14px;
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
        box-shadow: 0 8px 18px rgba(79, 70, 229, .22);
    }

    .mobile-day-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-height: calc(100vh - 280px);
        min-height: 210px;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 2px;
        scroll-padding-bottom: 18px;
    }

    .mobile-day-list::-webkit-scrollbar {
        width: 5px;
    }

    .mobile-day-list::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 999px;
    }

    .mobile-day-list .task-card {
        position: relative;
        padding: 12px !important;
        border-radius: 18px !important;
        border: 1px solid rgba(148, 163, 184, .32) !important;
        box-shadow: none !important;
        cursor: default !important;
        overflow: hidden;
    }

    .mobile-day-list .task-card:nth-child(5n + 1) {
        background: #fff7d6 !important;
    }

    .mobile-day-list .task-card:nth-child(5n + 2) {
        background: #e8f7ff !important;
    }

    .mobile-day-list .task-card:nth-child(5n + 3) {
        background: #edfbe7 !important;
    }

    .mobile-day-list .task-card:nth-child(5n + 4) {
        background: #fff0f6 !important;
    }

    .mobile-day-list .task-card:nth-child(5n + 5) {
        background: #f1ecff !important;
    }


    .mobile-day-list .task-card.status-in_progress {
        border-color: rgba(245, 158, 11, .5) !important;
        box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .12) !important;
    }

    .mobile-day-list .task-card.status-stuck {
        border-color: rgba(239, 68, 68, .5) !important;
        box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .12) !important;
    }

    .mobile-day-list .task-card.status-completed {
        border-color: rgba(34, 197, 94, .48) !important;
        box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .11) !important;
    }

    .mobile-day-list .task-card h3 {
        font-size: 15px !important;
        margin: 8px 0 5px !important;
    }

    .mobile-day-list .task-progress {
        margin-top: 8px;
    }

    .mobile-day-list .progress-head,
    .mobile-day-list .progress-bar {
        max-width: 100%;
    }

    .mobile-day-list .task-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-top: 10px;
    }

    .mobile-day-list .task-actions .invoice {
        grid-column: 1 / -1;
    }

    .mobile-day-empty {
        min-height: 190px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: 1px dashed #d8deeb;
        border-radius: 18px;
        background: #ffffffa8;
        text-align: center;
        padding: 22px;
        color: #697386;
    }

    .mobile-day-empty strong {
        color: #1f2937;
        font-size: 15px;
    }

    .mobile-day-empty span {
        font-size: 12px;
        line-height: 1.4;
    }

    .mobile-day-swipe-hint {
        margin-top: 10px;
        color: #8a94a6;
        font-size: 11px;
        font-weight: 800;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .mobile-day-card {
        padding: 10px;
        border-radius: 18px;
    }

    .mobile-day-nav {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        gap: 6px;
    }

    .mobile-day-title strong {
        font-size: 24px;
    }

    .mobile-day-title span {
        font-size: 13px;
    }

    .mobile-day-list {
        max-height: calc(100vh - 265px);
    }
}

/* Mobile day view: prevent cropped cards and compact centered date title */
@media (max-width: 640px) {
    .mobile-day-card {
        overflow: visible !important;
        padding-bottom: 14px !important;
    }

    .mobile-day-nav {
        grid-template-columns: 40px minmax(0, 1fr) 40px !important;
        align-items: center !important;
    }

    .mobile-day-title {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 0 10px !important;
        min-height: 42px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .mobile-day-title-line {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
        font-weight: 950;
        letter-spacing: -.01em;
        color: #111827;
    }

    .mobile-day-title strong,
    .mobile-day-title span:not(.mobile-day-title-line),
    .mobile-day-title em {
        display: none !important;
    }

    .mobile-day-list {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 2px 18px 2px !important;
        box-sizing: border-box !important;
    }

    .mobile-day-list .task-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        transform: none !important;
    }

    .mobile-day-list .task-card-top,
    .mobile-day-list .badges,
    .mobile-day-list .task-actions,
    .mobile-day-list .progress-head,
    .mobile-day-list .progress-bar,
    .mobile-day-list .process-badges {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .mobile-day-list .task-actions {
        padding-bottom: 2px !important;
    }

    .mobile-day-list .team-sales-tag {
        max-width: 46% !important;
    }
}

/* Mobile calendar: make each date look like a proper card, not a squeezed row */
@media (max-width: 820px) {
    body[data-view="calendar"] {
        overflow: auto !important;
    }

    body[data-view="calendar"] .app-shell,
    body[data-view="calendar"] .main-area,
    body[data-view="calendar"] #calendarView.active,
    body[data-view="calendar"] .calendar-shell {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        display: block !important;
    }

    body[data-view="calendar"] .calendar-shell {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        border-radius: 0 !important;
    }

    body[data-view="calendar"] .calendar-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: none !important;
        gap: 12px !important;
        background: transparent !important;
        min-height: 0 !important;
        padding-bottom: 18px !important;
    }

    body[data-view="calendar"] .calendar-cell {
        min-height: 136px !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        border: 1px solid #e5e9f2 !important;
        border-radius: 20px !important;
        padding: 13px !important;
        gap: 9px !important;
        background: #fff !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06) !important;
    }

    body[data-view="calendar"] .calendar-cell.today {
        border-color: rgba(79, 70, 229, .25) !important;
        background: #f7f7ff !important;
    }

    body[data-view="calendar"] .calendar-cell.muted-cell {
        display: none !important;
    }

    body[data-view="calendar"] .calendar-date-row {
        align-items: center !important;
    }

    body[data-view="calendar"] .calendar-date-btn {
        width: 36px !important;
        height: 36px !important;
        border-radius: 12px !important;
        font-size: 15px !important;
        background: #f6f7fb !important;
    }

    body[data-view="calendar"] .calendar-cell.today .calendar-date-btn {
        background: var(--primary) !important;
        color: #fff !important;
    }

    body[data-view="calendar"] .calendar-add-btn {
        width: 34px !important;
        height: 34px !important;
        border-radius: 12px !important;
        font-size: 20px !important;
    }

    body[data-view="calendar"] .calendar-summary {
        min-height: 24px !important;
        font-size: 12px !important;
    }

    body[data-view="calendar"] .calendar-summary strong {
        font-size: 15px !important;
    }

    body[data-view="calendar"] .calendar-job-list {
        gap: 7px !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-job {
        min-height: 36px !important;
        border-radius: 13px !important;
        padding: 0 10px !important;
        gap: 8px !important;
        font-size: 12px !important;
        background: #f9fafc !important;
    }

    body[data-view="calendar"] .calendar-more {
        font-size: 11px !important;
        padding: 6px 10px !important;
        margin-top: 2px !important;
    }
}

@media (max-width: 380px) {
    .mobile-day-title-line {
        font-size: 13px;
    }

    body[data-view="calendar"] .calendar-cell {
        min-height: 128px !important;
        padding: 11px !important;
        border-radius: 18px !important;
    }
}

/* Mobile top action cleanup: hide duplicate New Job and make Filter an icon button */
.filter-icon-btn .filter-icon {
    display: none;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.filter-icon-btn .filter-label {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 640px) {
    .topbar {
        position: relative;
    }

    .topbar-left {
        padding-right: 52px;
    }

    .topbar-actions {
        grid-template-columns: 1fr !important;
    }

    .topbar-actions #createTaskBtn {
        display: none !important;
    }

    .topbar-actions #filterToggle.filter-icon-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 !important;
        border-radius: 14px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        z-index: 6;
        background: #ffffff;
        color: var(--primary);
        border: 1px solid rgba(99, 102, 241, .22);
        box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    }

    .topbar-actions #filterToggle.filter-icon-btn .filter-label {
        display: none !important;
    }

    .topbar-actions #filterToggle.filter-icon-btn .filter-icon {
        display: block !important;
    }

    .topbar-actions #filterToggle.filter-icon-btn:active {
        transform: translateY(1px);
    }
}

/* Mobile day view: make the last job card fully reachable when scrolling */
@media (max-width: 640px) {
    body[data-view="timeline"],
    body:not([data-view]) {
        overflow-y: auto !important;
        min-height: 100dvh !important;
        height: auto !important;
    }

    body[data-view="timeline"] .app-shell,
    body[data-view="timeline"] .main-area,
    body[data-view="timeline"] #timelineView.active,
    body[data-view="timeline"] .mobile-day-board,
    body:not([data-view]) .app-shell,
    body:not([data-view]) .main-area,
    body:not([data-view]) #timelineView.active,
    body:not([data-view]) .mobile-day-board {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .mobile-day-board {
        padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    }

    .mobile-day-card {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin-bottom: 0 !important;
    }

    .mobile-day-list {
        max-height: none !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 20px !important;
        overscroll-behavior: auto !important;
    }

    .mobile-day-list .task-card:last-child {
        margin-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }

    body[data-view="calendar"] .calendar-grid {
        padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    }
}

/* Table View */
.table-view-shell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.table-view-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.table-view-head h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.03em;
}

.table-view-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.table-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.job-table-wrap {
    width: 100%;
    overflow: auto;
    max-height: calc(100vh - 260px);
    max-height: calc(100dvh - 260px);
}

.job-table {
    width: 100%;
    min-width: 1240px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.job-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fc;
    color: var(--muted);
    text-align: left;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.job-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: var(--text);
}

.job-table-row:hover td {
    background: #fbfcff;
}

.table-title {
    display: grid;
    gap: 4px;
    min-width: 210px;
}

.table-title strong {
    font-size: 14px;
    letter-spacing: -.02em;
}

.table-title span,
.table-muted {
    color: var(--muted);
    font-size: 12px;
}

.table-date-btn {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.table-date-btn:hover {
    border-color: rgba(69, 87, 230, .35);
    color: var(--primary);
    background: var(--primary-soft);
}

.table-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.table-status-pill.pending {
    color: var(--orange);
    background: var(--orange-soft);
}

.table-status-pill.in_progress {
    color: var(--orange);
    background: var(--orange-soft);
}

.table-status-pill.stuck {
    color: var(--danger);
    background: var(--danger-soft);
}

.table-status-pill.completed {
    color: var(--green);
    background: var(--green-soft);
}

.table-process-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(82px, 1fr));
    gap: 6px;
    min-width: 520px;
}

.table-process-control {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.table-process-control span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.table-process-select {
    width: 100%;
    min-width: 82px;
    min-height: 32px;
    padding: 0 24px 0 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: #fff;
    color: var(--text);
    font-size: 11px;
    font-weight: 850;
    outline: none;
    cursor: pointer;
}

.table-process-select:focus {
    border-color: rgba(69, 87, 230, .45);
    box-shadow: 0 0 0 3px rgba(69, 87, 230, .10);
}

.table-process-select.pending {
    color: var(--orange);
    background-color: var(--orange-soft);
    border-color: #ffe3b8;
}

.table-process-select.stuck {
    color: var(--danger);
    background-color: var(--danger-soft);
    border-color: #ffd4da;
}

.table-process-select.done {
    color: var(--green);
    background-color: var(--green-soft);
    border-color: #ccefdc;
}





.table-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef7ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
}

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

.table-action-btn {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
}

.table-action-btn:hover {
    border-color: rgba(69, 87, 230, .28);
    color: var(--primary);
}

.table-action-btn.danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(220, 61, 76, .16);
}

.job-table-empty-row td {
    padding: 0;
}

.job-table-empty {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 180px;
    text-align: center;
    color: var(--muted);
}

.job-table-empty strong {
    color: var(--text);
    font-size: 16px;
}

@media (max-width: 720px) {
    .table-view-shell {
        border-radius: 18px;
        overflow: hidden;
        background: #fff;
        border: 1px solid var(--line);
        box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    }

    .table-view-head {
        position: sticky;
        top: var(--mobile-sticky-top, 0px);
        z-index: 6;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        margin-bottom: 0;
        padding: 10px 12px;
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(12px);
    }

    .table-view-head h2 {
        font-size: 15px;
    }

    .table-view-head p {
        display: none;
    }

    .table-count-pill {
        min-height: 28px;
        padding: 0 10px;
        font-size: 11px;
    }

    .job-table-wrap {
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        background: #fff;
        padding-bottom: 10px;
    }

    .job-table {
        display: table;
        width: max-content;
        min-width: 980px;
        table-layout: fixed;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 11px;
    }

    .job-table thead {
        display: table-header-group;
    }

    .job-table tbody {
        display: table-row-group;
    }

    .job-table tr {
        display: table-row;
        width: auto;
        min-width: 0;
        margin: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .job-table th,
    .job-table td {
        display: table-cell;
        width: auto;
        min-width: 0;
        padding: 9px 8px;
        border-bottom: 1px solid var(--line);
        text-align: left;
        vertical-align: middle;
        white-space: nowrap;
    }

    .job-table th {
        position: sticky;
        top: 0;
        z-index: 4;
        font-size: 9px;
        background: #f8f9fc;
    }

    .job-table td::before {
        content: none;
    }

    .job-table th:nth-child(1),
    .job-table td:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 5;
        width: 92px;
        min-width: 92px;
        max-width: 92px;
        background: #fff;
        box-shadow: 1px 0 0 var(--line);
    }

    .job-table th:nth-child(1) {
        z-index: 7;
        background: #f8f9fc;
    }

    .job-table th:nth-child(2),
    .job-table td:nth-child(2) {
        width: 150px;
        min-width: 150px;
        max-width: 150px;
    }

    .job-table th:nth-child(3),
    .job-table td:nth-child(3),
    .job-table th:nth-child(4),
    .job-table td:nth-child(4),
    .job-table th:nth-child(5),
    .job-table td:nth-child(5) {
        width: 95px;
        min-width: 95px;
        max-width: 95px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .job-table th:nth-child(6),
    .job-table td:nth-child(6) {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
    }

    .job-table th:nth-child(7),
    .job-table td:nth-child(7) {
        width: 214px;
        min-width: 214px;
        max-width: 214px;
    }

    .job-table th:nth-child(8),
    .job-table td:nth-child(8),
    .job-table th:nth-child(9),
    .job-table td:nth-child(9) {
        width: 82px;
        min-width: 82px;
        max-width: 82px;
    }

    .job-table th:nth-child(10),
    .job-table td:nth-child(10) {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }

    .job-table th:nth-child(11),
    .job-table td:nth-child(11) {
        width: 108px;
        min-width: 108px;
        max-width: 108px;
    }

    .job-table td:nth-child(1) {
        background: #fff;
    }

    .job-table-row:hover td,
    .job-table-row:hover td:nth-child(1) {
        background: #fbfcff;
    }

    .table-title {
        display: block;
        min-width: 0;
        text-align: left;
        overflow: hidden;
    }

    .table-title strong {
        display: block;
        font-size: 12px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .table-title span {
        display: none;
    }

    .table-date-btn {
        min-height: 28px;
        max-width: 78px;
        padding: 0 8px;
        font-size: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .table-status-pill,
    .table-link {
        min-height: 26px;
        padding: 0 8px;
        font-size: 9px;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .table-process-grid {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(112px, 1fr));
        gap: 4px;
    }

    .table-process-control {
        gap: 3px;
    }

    .table-process-control span {
        font-size: 8px;
        line-height: 1;
    }

    .table-process-select {
        min-width: 112px;
        min-height: 28px;
        padding: 0 18px 0 6px;
        font-size: 9px;
        border-radius: 8px;
    }

    .table-actions {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .table-action-btn {
        min-height: 28px;
        padding: 0 8px;
        font-size: 10px;
        border-radius: 8px;
    }

    .job-table-empty-row td {
        position: static !important;
        display: table-cell;
        width: auto;
        max-width: none;
        background: #fff;
        box-shadow: none;
    }

    .job-table-empty {
        min-height: 140px;
    }
}

/* Calendar layout stability fix
   Keep Calendar using the same page layout flow as Timeline/Table so the header,
   toolbar and content do not jump/shift when switching tabs on desktop. */
@media (min-width: 821px) {
    body[data-view="calendar"] {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body[data-view="calendar"] .app-shell {
        height: auto !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .main-area {
        display: block !important;
        height: auto !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
        padding-bottom: 18px !important;
    }

    body[data-view="calendar"] .topbar {
        margin-bottom: 16px !important;
    }

    body[data-view="calendar"] .board-toolbar {
        margin-bottom: 14px !important;
    }

    body[data-view="calendar"] .stats-grid {
        display: grid !important;
    }

    body[data-view="calendar"] #calendarView.active,
    body[data-view="calendar"] .calendar-shell {
        display: block !important;
        flex: none !important;
        min-height: 0 !important;
        height: auto !important;
    }

    body[data-view="calendar"] .calendar-grid {
        display: grid !important;
        flex: none !important;
        min-height: 0 !important;
        grid-template-rows: none !important;
    }

    body[data-view="calendar"] .calendar-cell {
        min-height: 138px !important;
        overflow: hidden !important;
    }
}

/* Team Sales filter dropdown */
.team-sales-filter-label {
    min-width: 190px;
}

.team-sales-filter-label select {
    min-width: 190px;
}

@media (max-width: 640px) {
    .filters-panel .team-sales-filter-label {
        grid-column: 1 / -1 !important;
    }

    .filters-panel .team-sales-filter-label select {
        min-width: 0 !important;
        width: 100% !important;
    }
}


/* Remove Settings tab cleanly + keep Pickup Date compact */
.job-form .date-field,
.job-form label.date-field {
    align-self: start !important;
    min-height: 0 !important;
    height: auto !important;
    align-content: start !important;
}

.job-form .date-field input[type="date"] {
    min-height: 44px !important;
    height: 44px !important;
}

@media (max-width: 640px) {
    .job-form .date-field,
    .job-form label.date-field {
        min-height: 0 !important;
        height: auto !important;
    }

    .job-form .date-field input[type="date"] {
        min-height: 42px !important;
        height: 42px !important;
    }
}

/* Desktop: keep Search + Filter beside + New Job in one neat action group */
@media (min-width: 641px) {
    .topbar {
        align-items: center;
    }

    .topbar-left {
        flex: 1 1 auto;
        min-width: 260px;
    }

    .topbar-actions {
        margin-left: auto;
        flex: 0 0 auto;
        width: auto !important;
        max-width: min(560px, 48vw);
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap !important;
        gap: 8px;
    }

    .topbar-actions .search-box {
        flex: 0 1 clamp(220px, 22vw, 320px) !important;
        width: clamp(220px, 22vw, 320px) !important;
        min-width: 220px !important;
    }

    .topbar-actions #filterToggle,
    .topbar-actions #createTaskBtn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* Medium screens: keep the controls grouped, but allow the whole group to move under title if space is tight */
@media (min-width: 641px) and (max-width: 980px) {
    .topbar {
        flex-wrap: wrap;
    }

    .topbar-actions {
        width: 100% !important;
        max-width: none;
    }

    .topbar-actions .search-box {
        flex: 1 1 220px !important;
        width: auto !important;
        min-width: 180px !important;
    }
}

/* Workspace item quick manage buttons */
.workspace-item {
    position: relative;
    min-width: 0;
}

.workspace-item .workspace-link {
    width: 100%;
    padding-right: 72px;
}

.workspace-quick-actions {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transform: translateY(-50%);
    z-index: 2;
    opacity: 0.55;
    transition: opacity .16s ease, transform .16s ease;
}

.workspace-item:hover .workspace-quick-actions,
.workspace-item:focus-within .workspace-quick-actions,
.workspace-item.active .workspace-quick-actions {
    opacity: 1;
}

.workspace-mini-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.92);
    color: #64748b;
    display: inline-grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}

.workspace-mini-btn svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
    display: block;
}

.workspace-mini-btn:hover,
.workspace-mini-btn:focus-visible {
    transform: translateY(-1px);
    background: #ffffff;
    color: var(--primary);
    border-color: rgba(79, 93, 247, 0.35);
    outline: 0;
}


.sidebar .workspace-mini-btn {
    background: rgba(17, 28, 51, 0.92);
    border-color: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    box-shadow: none;
}

.sidebar .workspace-mini-btn:hover,
.sidebar .workspace-mini-btn:focus-visible {
    background: #1f2a44;
    color: #ffffff;
    border-color: rgba(79, 93, 247, 0.42);
}


.workspace-modal-actions {
    align-items: center;
}

.workspace-modal-actions .modal-action-spacer {
    flex: 1 1 auto;
}

.workspace-modal-delete[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .workspace-item .workspace-link {
        min-height: 58px;
        padding-right: 76px;
    }

    .workspace-quick-actions {
        opacity: 1;
        right: 10px;
    }

    .workspace-mini-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        border-radius: 10px;
    }

    .workspace-modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .workspace-modal-actions .modal-action-spacer {
        display: none;
    }

    .workspace-modal-actions button {
        width: 100%;
    }
}

/* Table index + pinned jobs */
.table-view-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 16px;
}

.table-view-body .job-table-wrap {
    min-width: 0;
}

.job-table {
    min-width: 1500px;
}

.table-index-col,
.table-pin-col,
.table-index-cell,
.table-pin-cell {
    text-align: center !important;
}

.table-index-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.table-bookmark-btn,
.table-pinned-unpin {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #ffffff;
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
}

.table-bookmark-btn:hover,
.table-bookmark-btn:focus-visible,
.table-pinned-unpin:hover,
.table-pinned-unpin:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(245, 158, 11, .38);
    background: #fffbeb;
    color: #f59e0b;
    box-shadow: 0 8px 18px rgba(245, 158, 11, .12);
    outline: 0;
}

.table-bookmark-btn.is-active,
.table-pinned-unpin {
    border-color: rgba(245, 158, 11, .32);
    background: #fffbeb;
    color: #f59e0b;
}

.job-table-row.is-pinned td {
    background: #fffdf5;
}

.job-table-row.is-pinned:hover td {
    background: #fff8e6;
}

.table-pinned-panel {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 270px);
    max-height: calc(100dvh - 270px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .07);
}

.table-pinned-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--line);
}

.table-pinned-head span {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 950;
    letter-spacing: -.02em;
}

.table-pinned-head small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.table-pinned-head strong {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border-radius: 999px;
    background: #fffbeb;
    color: #d97706;
    font-size: 13px;
    font-weight: 950;
}

.table-pinned-list {
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 350px);
    max-height: calc(100dvh - 350px);
    overflow: auto;
    padding: 12px;
    scrollbar-width: thin;
}

.table-pinned-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    padding: 10px;
    border: 1px solid #fde68a;
    border-radius: 16px;
    background: #fffbeb;
}

.table-pinned-main {
    display: grid;
    gap: 4px;
    min-width: 0;
    border: 0;
    padding: 0;
    background: transparent;
    text-align: left;
    color: var(--text);
    cursor: pointer;
}

.table-pinned-main:focus-visible {
    outline: 2px solid rgba(245, 158, 11, .35);
    outline-offset: 3px;
    border-radius: 10px;
}

.table-pinned-date {
    color: #d97706;
    font-size: 11px;
    font-weight: 950;
}

.table-pinned-main strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 950;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-pinned-main small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-pinned-status {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    font-style: normal;
    font-weight: 950;
}

.table-pinned-status.pending {
    color: var(--orange);
    background: var(--orange-soft);
}

.table-pinned-status.in_progress {
    color: var(--primary);
    background: var(--primary-soft);
}

.table-pinned-status.completed {
    color: var(--green);
    background: var(--green-soft);
}

.table-pinned-empty {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 150px;
    padding: 18px;
    text-align: center;
    color: var(--muted);
}

.table-pinned-empty span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #f8fafc;
    color: #cbd5e1;
    font-size: 20px;
}

.table-pinned-empty strong {
    color: var(--text);
    font-size: 14px;
}

.table-pinned-empty small {
    max-width: 190px;
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    .table-view-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .table-pinned-panel {
        position: static;
        max-height: none;
        order: -1;
    }

    .table-pinned-list {
        grid-auto-flow: column;
        grid-auto-columns: minmax(220px, 260px);
        grid-template-columns: none;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
    }
}

@media (max-width: 720px) {
    .table-view-body {
        gap: 10px;
    }

    .table-pinned-panel {
        border-radius: 16px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    }

    .table-pinned-head {
        padding: 10px 12px;
    }

    .table-pinned-head span {
        font-size: 13px;
    }

    .table-pinned-head small {
        display: none;
    }

    .table-pinned-head strong {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .table-pinned-list {
        grid-auto-columns: minmax(190px, 220px);
        gap: 8px;
        padding: 10px;
    }

    .table-pinned-card {
        border-radius: 14px;
        padding: 9px;
    }

    .table-bookmark-btn,
    .table-pinned-unpin {
        width: 28px;
        height: 28px;
        border-radius: 10px;
        font-size: 15px;
    }

    .job-table {
        min-width: 1210px;
    }

    .job-table th:nth-child(1),
    .job-table td:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 5;
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        background: #fff;
        box-shadow: 1px 0 0 var(--line);
        text-align: center;
    }

    .job-table th:nth-child(1) {
        z-index: 8;
        background: #f8f9fc;
    }

    .job-table th:nth-child(2),
    .job-table td:nth-child(2) {
        position: sticky;
        left: 42px;
        z-index: 5;
        width: 50px;
        min-width: 50px;
        max-width: 50px;
        background: #fff;
        box-shadow: 1px 0 0 var(--line);
        text-align: center;
    }

    .job-table th:nth-child(2) {
        z-index: 8;
        background: #f8f9fc;
    }

    .job-table th:nth-child(3),
    .job-table td:nth-child(3) {
        position: sticky;
        left: 92px;
        z-index: 5;
        width: 92px;
        min-width: 92px;
        max-width: 92px;
        background: #fff;
        box-shadow: 1px 0 0 var(--line);
    }

    .job-table th:nth-child(3) {
        z-index: 8;
        background: #f8f9fc;
    }

    .job-table th:nth-child(4),
    .job-table td:nth-child(4) {
        width: 150px;
        min-width: 150px;
        max-width: 150px;
    }

    .job-table th:nth-child(5),
    .job-table td:nth-child(5),
    .job-table th:nth-child(6),
    .job-table td:nth-child(6),
    .job-table th:nth-child(7),
    .job-table td:nth-child(7) {
        width: 95px;
        min-width: 95px;
        max-width: 95px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .job-table th:nth-child(8),
    .job-table td:nth-child(8) {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
    }

    .job-table th:nth-child(9),
    .job-table td:nth-child(9) {
        width: 214px;
        min-width: 214px;
        max-width: 214px;
    }

    .job-table th:nth-child(10),
    .job-table td:nth-child(10),
    .job-table th:nth-child(11),
    .job-table td:nth-child(11) {
        width: 82px;
        min-width: 82px;
        max-width: 82px;
    }

    .job-table th:nth-child(12),
    .job-table td:nth-child(12) {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }

    .job-table th:nth-child(13),
    .job-table td:nth-child(13) {
        width: 108px;
        min-width: 108px;
        max-width: 108px;
    }

    .job-table td:nth-child(1),
    .job-table td:nth-child(2),
    .job-table td:nth-child(3) {
        background: #fff;
    }

    .job-table-row:hover td,
    .job-table-row:hover td:nth-child(1),
    .job-table-row:hover td:nth-child(2),
    .job-table-row:hover td:nth-child(3) {
        background: #fbfcff;
    }

    .job-table-row.is-pinned td,
    .job-table-row.is-pinned td:nth-child(1),
    .job-table-row.is-pinned td:nth-child(2),
    .job-table-row.is-pinned td:nth-child(3) {
        background: #fffdf5;
    }

    .table-index-badge {
        width: 24px;
        height: 24px;
        border-radius: 8px;
        font-size: 10px;
    }
}

/* Pinned as a tab table, not a side box */
.table-view-body,
.pinned-table-body {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
}

.pinned-table-shell .table-view-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pinned-table-shell .table-view-head h2::before {
    content: '★';
    color: #f59e0b;
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 720px) {
    .tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tabs .tab {
        min-width: 0;
        padding-inline: 8px;
        font-size: 12px;
    }

    .pinned-table-shell .table-view-head p {
        display: none;
    }
}


/* Pinned column keeps star icon, only the column label changes */
.table-pin-col {
    min-width: 64px;
}

.table-pin-cell {
    white-space: nowrap;
}

.table-bookmark-btn span {
    display: inline-block;
    transform: translateY(-.5px);
}

@media (max-width: 720px) {
    .table-bookmark-btn,
    .table-pinned-unpin {
        width: 28px;
        height: 28px;
        border-radius: 10px;
        font-size: 15px;
    }
}

/* Admin Panel button at sidebar bottom */
.sidebar-admin-panel-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 11px;
    margin-bottom: 10px;
    border-radius: 14px;
    border: 1px solid rgba(79, 93, 247, 0.28);
    background: linear-gradient(135deg, rgba(79, 93, 247, 0.18), rgba(14, 165, 233, 0.12));
    color: #eef2ff;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sidebar-admin-panel-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(129, 140, 248, 0.54);
    background: linear-gradient(135deg, rgba(79, 93, 247, 0.28), rgba(14, 165, 233, 0.2));
    color: #ffffff;
}

.admin-panel-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-panel-icon svg {
    width: 19px;
    height: 19px;
}

.sidebar-admin-panel-btn strong,
.sidebar-admin-panel-btn small {
    display: block;
    line-height: 1.15;
}

.sidebar-admin-panel-btn strong {
    font-size: 13px;
    font-weight: 800;
}

.sidebar-admin-panel-btn small {
    margin-top: 3px;
    font-size: 11px;
    color: #bfdbfe;
}

@media (max-width: 780px) {
    .sidebar-admin-panel-btn {
        margin-top: 6px;
    }
}

/* Simple Admin Panel page */
.admin-page-shell {
    min-height: 100vh;
    background: #f6f7fb;
    padding: 28px;
}

.admin-page-card {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e6e9f2;
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid #e6e9f2;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
}

.admin-page-header h1 {
    margin: 0;
    font-size: 22px;
}

.admin-page-header p {
    margin: 4px 0 0;
    color: #cbd5e1;
    font-size: 13px;
}

.admin-page-body {
    padding: 24px;
}

.admin-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.admin-metric {
    border: 1px solid #e6e9f2;
    border-radius: 18px;
    padding: 16px;
    background: #f8fafc;
}

.admin-metric span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-metric strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    color: #0f172a;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid #e6e9f2;
    border-radius: 18px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e6e9f2;
    font-size: 13px;
}

.admin-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.admin-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    padding: 10px 13px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
}

.admin-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 780px) {
    .admin-page-shell {
        padding: 12px;
    }

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

    .admin-page-body {
        padding: 14px;
    }

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

/* Admin Panel full app layout */
.admin-layout-shell .sidebar-admin-panel-btn.active {
    border-color: rgba(129, 140, 248, 0.7);
    background: linear-gradient(135deg, rgba(79, 93, 247, 0.36), rgba(14, 165, 233, 0.26));
}

.admin-main-area {
    min-width: 0;
}

.admin-topbar {
    align-items: center;
}

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

.admin-top-actions .soft-btn,
.admin-top-actions .primary-btn {
    text-decoration: none;
    white-space: nowrap;
}

.admin-open-create-user-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    font-weight: 900;
}

.admin-content-grid {
    display: grid;
    gap: 18px;
    padding: 0 22px 30px;
}

.admin-metrics-grid-compact {
    margin: 0;
}

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

.admin-panel-grid-single {
    grid-template-columns: 1fr;
}

.admin-card {
    background: #ffffff;
    border: 1px solid #e6e9f2;
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
    padding: 18px;
    min-width: 0;
}

.admin-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.admin-section-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.admin-section-heading p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.admin-user-form {
    display: grid;
    gap: 12px;
}

.admin-user-form label {
    display: grid;
    gap: 6px;
}

.admin-user-form label span {
    color: #475569;
    font-size: 12px;
    font-weight: 850;
}

.admin-user-form input,
.admin-user-form select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #dfe4ee;
    border-radius: 13px;
    background: #fff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 650;
    outline: none;
    padding: 0 12px;
}

.admin-user-form input:focus,
.admin-user-form select:focus {
    border-color: rgba(79, 93, 247, 0.75);
    box-shadow: 0 0 0 4px rgba(79, 93, 247, 0.12);
}

.admin-alert {
    margin-bottom: 14px;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 750;
}

.admin-alert.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #bbf7d0;
}

.admin-alert.error {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.role-badge.admin {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.role-badge.staff {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.admin-users-table-wrap {
    max-height: 430px;
    overflow: auto;
}

.admin-users-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-role-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.admin-access-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #e6e9f2;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.admin-access-summary span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-access-summary strong {
    color: #334155;
    font-weight: 900;
}

.admin-workspace-card {
    overflow: hidden;
}

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

@media (max-width: 780px) {
    .admin-content-grid {
        padding: 0 12px 24px;
        gap: 14px;
    }

    .admin-topbar {
        align-items: flex-start;
    }

    .admin-top-actions {
        width: 100%;
        justify-content: stretch;
    }

    .admin-top-actions .soft-btn,
    .admin-top-actions .primary-btn {
        flex: 1 1 180px;
        justify-content: center;
    }

    .admin-card {
        padding: 14px;
        border-radius: 18px;
    }

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

    .admin-metric {
        padding: 12px;
        border-radius: 16px;
    }

    .admin-metric strong {
        font-size: 22px;
    }

    .admin-user-form input,
    .admin-user-form select {
        min-height: 40px;
        font-size: 13px;
    }

    .admin-table {
        min-width: 720px;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 11px;
        font-size: 12px;
    }
}

/* Role access + locked Team Sales */
.role-badge.leader {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.team-sales-field.is-locked {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.team-sales-field .field-note {
    display: block;
    margin-top: -2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.job-form input.locked-input,
.job-form input[readonly][data-locked-team-sales="1"] {
    color: #334155;
    background: #f1f5f9;
    border-color: #dbe3ee;
    cursor: not-allowed;
}

/* Admin role management + login as user */
.admin-inline-role-form,
.admin-inline-action-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-width: 0;
}

.admin-inline-role-form select {
    min-width: 96px;
    height: 34px;
    border: 1px solid #dfe4ee;
    border-radius: 11px;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    padding: 0 28px 0 10px;
    outline: none;
}

.admin-inline-role-form select:focus {
    border-color: rgba(79, 93, 247, 0.72);
    box-shadow: 0 0 0 3px rgba(79, 93, 247, 0.12);
}

.mini-action-btn {
    height: 34px;
    border: 1px solid #d7ddec;
    border-radius: 11px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    padding: 0 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.mini-action-btn:hover {
    transform: translateY(-1px);
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.mini-action-btn.login-as {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
}

.mini-action-btn.login-as:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.admin-muted-action {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.impersonation-return-btn {
    border-color: rgba(251, 191, 36, 0.46);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.14));
}

.impersonation-return-btn:hover {
    border-color: rgba(251, 191, 36, 0.72);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.32), rgba(245, 158, 11, 0.22));
}

.user-chip.impersonating {
    border: 1px solid rgba(251, 191, 36, 0.28);
    background: rgba(251, 191, 36, 0.08);
    border-radius: 14px;
    padding: 8px;
}

@media (max-width: 780px) {
    .admin-inline-role-form {
        gap: 6px;
    }

    .admin-inline-role-form select {
        min-width: 86px;
        height: 31px;
        font-size: 11px;
    }

    .mini-action-btn {
        height: 31px;
        padding: 0 9px;
        font-size: 11px;
    }
}


/* Clean locked Team Sales + consistent form control sizes */
.team-sales-field .field-note {
    display: none !important;
}

.job-form input:not([type="file"]),
.job-form select,
.job-form .search-select input,
.login-form input,
.admin-user-form input,
.admin-user-form select,
.filters-panel select,
.month-picker select,
.month-picker input {
    width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    box-sizing: border-box;
    line-height: 1.2;
}

.job-form textarea {
    width: 100%;
    min-height: 112px;
    box-sizing: border-box;
}

.job-form .field-card {
    align-content: start;
    box-sizing: border-box;
}

.job-form .field-card:not(.notes-card) {
    min-height: 82px;
}

.job-form .date-field,
.job-form .team-sales-field,
.job-form .invoice-compact-field {
    min-height: 82px;
}

.invoice-file-control {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    box-sizing: border-box;
}

.invoice-file-button {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    box-sizing: border-box;
}

.primary-btn,
.soft-btn,
.danger-btn,
.text-btn,
.notes-toggle-btn,
.admin-inline-role-form select,
.mini-action-btn,
.workspace-manage-buttons .soft-btn.small,
.workspace-manage-buttons .danger-btn.small {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary-btn,
.soft-btn,
.danger-btn,
.text-btn,
.notes-toggle-btn {
    min-height: 44px;
    height: 44px;
}

.icon-btn {
    box-sizing: border-box;
}

.process-options button {
    min-height: 32px;
    height: 32px;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .job-form input:not([type="file"]),
    .job-form select,
    .job-form .search-select input,
    .login-form input,
    .admin-user-form input,
    .admin-user-form select,
    .filters-panel select,
    .month-picker select,
    .month-picker input {
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }

    .invoice-file-control {
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }

    .primary-btn,
    .soft-btn,
    .danger-btn,
    .text-btn,
    .notes-toggle-btn {
        min-height: 42px !important;
        height: 42px !important;
    }
}

/* Fix desktop layout restored after control-size update */
@media (min-width: 641px) {
    .board-toolbar {
        align-items: center !important;
        justify-content: space-between !important;
        gap: 14px !important;
    }

    .board-toolbar .tabs {
        flex: 0 1 auto !important;
    }

    .board-toolbar .month-picker {
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }

    .board-toolbar .month-picker select {
        width: 136px !important;
        min-width: 136px !important;
        max-width: 136px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        flex: 0 0 136px !important;
        padding-left: 12px !important;
        padding-right: 34px !important;
        background-position: right 14px center !important;
    }

    .board-toolbar .month-picker input,
    .board-toolbar .month-picker #yearInput {
        width: 88px !important;
        min-width: 88px !important;
        max-width: 88px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        flex: 0 0 88px !important;
    }

    .board-toolbar .month-picker .month-arrow {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        flex: 0 0 42px !important;
    }

    .board-toolbar .month-picker .today-month-btn {
        width: auto !important;
        min-width: 82px !important;
        max-width: none !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }
}

/* Keep form control equal size without forcing the month picker to become full-width */
@media (max-width: 640px) {
    .board-toolbar .month-picker select,
    .board-toolbar .month-picker input,
    .board-toolbar .month-picker #yearInput {
        max-height: none !important;
    }
}

/* Activity Log tab */
.log-view-shell .table-view-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.log-view-shell .table-view-head h2::before {
    content: '↺';
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 9px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 15px;
    line-height: 1;
}

.log-table-wrap {
    max-height: calc(100vh - 260px);
    max-height: calc(100dvh - 260px);
}

.activity-log-table {
    min-width: 1080px;
}

.activity-log-table .log-account {
    display: grid;
    gap: 3px;
    min-width: 140px;
}

.activity-log-table .log-account strong,
.activity-log-table .log-job-title,
.activity-log-table .log-detail-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.activity-log-table .log-account span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.log-time-pill,
.log-action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.log-time-pill {
    background: #f1f5f9;
    color: #475569;
}

.log-action-pill {
    background: #eef2ff;
    color: var(--primary);
}

.log-action-pill.deleted {
    background: #fff1f2;
    color: #e11d48;
}

.log-action-pill.created {
    background: #ecfdf5;
    color: #059669;
}

.log-action-pill.process,
.log-action-pill.status,
.log-action-pill.moved {
    background: #fff7ed;
    color: #d97706;
}

.log-action-pill.pinned {
    background: #fffbeb;
    color: #f59e0b;
}

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

    .tabs .tab[data-view-target="log"] {
        font-size: 12px;
    }

    .log-view-shell .table-view-head p {
        display: none;
    }

    .activity-log-table {
        min-width: 820px;
    }

    .activity-log-table th:nth-child(1),
    .activity-log-table td:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 5;
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        background: #fff;
        box-shadow: 1px 0 0 var(--line);
        text-align: center;
    }

    .activity-log-table th:nth-child(1) {
        z-index: 8;
        background: #f8f9fc;
    }

    .activity-log-table th:nth-child(2),
    .activity-log-table td:nth-child(2),
    .activity-log-table th:nth-child(3),
    .activity-log-table td:nth-child(3),
    .activity-log-table th:nth-child(4),
    .activity-log-table td:nth-child(4),
    .activity-log-table th:nth-child(5),
    .activity-log-table td:nth-child(5),
    .activity-log-table th:nth-child(6),
    .activity-log-table td:nth-child(6),
    .activity-log-table th:nth-child(7),
    .activity-log-table td:nth-child(7),
    .activity-log-table th:nth-child(8),
    .activity-log-table td:nth-child(8) {
        position: static;
        left: auto;
        width: auto;
        min-width: 90px;
        max-width: none;
        background: inherit;
        box-shadow: none;
    }

    .activity-log-table td:nth-child(1) {
        background: #fff;
    }

    .activity-log-table .log-detail-text {
        max-width: 220px;
    }
}

/* Deleted jobs view + restore */
.deleted-view-shell .table-view-head p {
    max-width: 560px;
}

.deleted-job-table {
    min-width: 1080px;
}

.deleted-job-row td {
    background: #fff;
}

.deleted-at-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.deleted-at-cell strong {
    color: var(--text);
    font-size: 13px;
}

.deleted-at-cell span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.table-action-btn.success {
    background: #ecfdf5;
    color: #059669;
    border-color: #bbf7d0;
}

.table-action-btn.success:hover {
    background: #d1fae5;
    border-color: #86efac;
}

.deleted-job-modal-card {
    width: min(760px, calc(100vw - 28px));
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.deleted-job-modal-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.deleted-job-modal-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.deleted-job-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 20px 2px 4px;
    overflow: auto;
}

.deleted-job-detail-item {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8fafc;
    padding: 14px 16px;
    min-width: 0;
}

.deleted-job-detail-item.full {
    grid-column: 1 / -1;
}

.deleted-job-detail-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.deleted-job-detail-item strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.deleted-process-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.deleted-process-pills span {
    margin: 0;
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
}

.deleted-job-modal-actions {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 16px;
}

.log-action-pill.restored {
    background: #ecfdf5;
    color: #059669;
}

.log-action-pill.deleted {
    background: #fff1f2;
    color: #e11d48;
}

@media (max-width: 720px) {
    .tabs {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .tabs .tab[data-view-target="deleted"] {
        font-size: 12px;
    }

    .deleted-view-shell .table-view-head p {
        display: none;
    }

    .deleted-job-table {
        min-width: 980px;
    }

    .deleted-job-modal-card {
        width: calc(100vw - 18px);
        max-height: calc(100dvh - 24px);
        border-radius: 24px;
    }

    .deleted-job-detail-grid {
        grid-template-columns: 1fr;
        padding-right: 0;
    }

    .deleted-job-modal-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        z-index: 2;
    }
}

/* Deleted job view modal spacing fix */
.deleted-job-modal-card {
    width: min(860px, calc(100vw - 48px));
    max-height: calc(100dvh - 72px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.deleted-job-modal-head {
    flex-shrink: 0;
    padding: 24px 26px 20px;
}

.deleted-job-detail-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 24px 26px 28px;
    gap: 14px;
}

.deleted-job-modal-actions {
    flex-shrink: 0;
    margin-top: 0;
    padding: 18px 26px 22px;
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 -10px 24px rgba(15, 23, 42, .04);
}

.deleted-job-detail-item {
    padding: 16px 18px;
}

@media (max-width: 720px) {
    .deleted-job-modal-card {
        width: calc(100vw - 22px);
        max-height: calc(100dvh - 28px);
        border-radius: 24px;
    }

    .deleted-job-modal-head {
        padding: 18px 18px 16px;
    }

    .deleted-job-detail-grid {
        grid-template-columns: 1fr;
        padding: 18px 18px 22px;
        gap: 12px;
    }

    .deleted-job-modal-actions {
        position: static;
        padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
        gap: 10px;
    }

    .deleted-job-modal-actions button {
        min-height: 46px;
    }
}

/* Sticky notes as calendar-only items */
.calendar-sticky-note {
    width: 100%;
    min-height: 29px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 10px;
    color: #182131;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    cursor: grab;
    font-size: 11px;
    font-weight: 850;
    text-align: left;
    user-select: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}

body[data-view="calendar"] .calendar-sticky-note {
    min-height: 22px;
    border-radius: 8px;
    padding: 0 6px;
    gap: 5px;
    font-size: 10px;
}

.calendar-sticky-note:hover {
    filter: brightness(1.02);
    border-color: rgba(15, 23, 42, .18);
}

.calendar-sticky-note.dragging {
    opacity: .55;
    cursor: grabbing;
}

.calendar-sticky-note span:last-child {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-sticky-pin {
    flex: 0 0 auto;
    font-size: 8px;
    line-height: 1;
    color: rgba(15, 23, 42, .48);
}

.calendar-sticky-note[data-note-color="yellow"] { background: #ffef9f; }
.calendar-sticky-note[data-note-color="pink"] { background: #ffcbe0; }
.calendar-sticky-note[data-note-color="blue"] { background: #cbe5ff; }
.calendar-sticky-note[data-note-color="green"] { background: #d2f2cc; }
.calendar-sticky-note[data-note-color="purple"] { background: #e0ccff; }

.sticky-note-calendar-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 8px 0 0;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .58);
    color: rgba(15, 23, 42, .68);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
}

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

.sticky-note-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(8px);
}

.sticky-note-popup-card {
    width: min(460px, 100%);
    max-height: min(720px, calc(100vh - 44px));
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .10);
}

.sticky-note-popup-card[data-note-color="yellow"] { background: #ffef9f; }
.sticky-note-popup-card[data-note-color="pink"] { background: #ffcbe0; }
.sticky-note-popup-card[data-note-color="blue"] { background: #cbe5ff; }
.sticky-note-popup-card[data-note-color="green"] { background: #d2f2cc; }
.sticky-note-popup-card[data-note-color="purple"] { background: #e0ccff; }

.sticky-note-popup-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.sticky-note-popup-kicker {
    display: inline-flex;
    margin-bottom: 4px;
    color: rgba(15, 23, 42, .58);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.sticky-note-popup-head h2 {
    margin: 0;
    color: rgba(15, 23, 42, .86);
    font-size: 21px;
    letter-spacing: -.04em;
}

.sticky-note-popup-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .66);
    color: rgba(15, 23, 42, .72);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.sticky-note-popup-close:hover {
    background: rgba(255, 255, 255, .92);
}

.sticky-note-popup-title,
.sticky-note-popup-text {
    width: 100%;
    border: 0;
    outline: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, .52);
    color: #182131;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.sticky-note-popup-title {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -.02em;
}

.sticky-note-popup-text {
    min-height: 220px;
    margin-top: 12px;
    padding: 14px;
    resize: vertical;
    font-size: 14px;
    line-height: 1.55;
}

.sticky-note-popup-title:focus,
.sticky-note-popup-text:focus {
    background: rgba(255, 255, 255, .82);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12), 0 0 0 3px rgba(255, 255, 255, .42);
}

.sticky-note-popup-colors {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.sticky-note-popup-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.sticky-note-popup-date {
    color: rgba(15, 23, 42, .68);
    font-size: 12px;
    font-weight: 850;
}

.sticky-note-popup-remove[hidden] {
    display: none;
}

.sticky-note-popup-remove {
    flex: 0 0 auto;
}

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

    .sticky-note-popup-card {
        max-height: calc(100vh - 24px);
        border-radius: 22px;
    }

    .sticky-note-popup-foot {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Sticky-note owner labels and owner-only editing */
.sticky-note-owner-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: -2px 0 8px;
}

.sticky-note-owner-label,
.sticky-note-readonly-badge,
.sticky-note-popup-owner {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, .52);
    color: rgba(15, 23, 42, .62);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.sticky-note-owner-label {
    min-width: 0;
    padding: 5px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sticky-note-readonly-badge {
    flex: 0 0 auto;
    padding: 5px 7px;
    background: rgba(15, 23, 42, .08);
}

.sticky-note-popup-title,
.sticky-note-popup-text {
    cursor: text;
    user-select: text;
}

.sticky-note-card.is-readonly {
    opacity: .88;
}

.sticky-note-card.is-readonly .sticky-note-title,
.sticky-note-card.is-readonly .sticky-note-text,
.sticky-note-popup-card.is-readonly .sticky-note-popup-title,
.sticky-note-popup-card.is-readonly .sticky-note-popup-text {
    cursor: default;
}

.sticky-note-card.is-readonly .sticky-drag-handle,
.sticky-note-card.is-readonly .sticky-note-pin,
.sticky-note-card.is-readonly .sticky-note-delete,
.sticky-note-card.is-readonly .sticky-color-btn,
.sticky-note-card.is-readonly .sticky-note-order-btn,
.sticky-note-popup-card.is-readonly .sticky-color-btn,
.sticky-note-popup-card.is-readonly .sticky-note-popup-remove {
    opacity: .36;
    cursor: not-allowed;
}

.calendar-sticky-note.is-readonly {
    cursor: pointer;
    opacity: .9;
}

.calendar-sticky-copy {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.05;
}

.calendar-sticky-title {
    min-width: 0;
    max-width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-sticky-copy small {
    min-width: 0;
    max-width: 100%;
    color: rgba(15, 23, 42, .54);
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sticky-note-popup-owner {
    margin-top: 7px;
    padding: 6px 9px;
}

/* Calendar button long-title fix: keep pill shape stable and ellipsis the text */
.calendar-job-list {
    min-width: 0;
    max-width: 100%;
}

.calendar-job,
.calendar-sticky-note,
body[data-view="calendar"] .calendar-job,
body[data-view="calendar"] .calendar-sticky-note {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    justify-content: flex-start;
}

.calendar-job > span,
body[data-view="calendar"] .calendar-job > span {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-sticky-note .calendar-sticky-pin,
body[data-view="calendar"] .calendar-sticky-note .calendar-sticky-pin {
    flex: 0 0 auto;
    min-width: 0;
}

.calendar-sticky-note .calendar-sticky-copy,
body[data-view="calendar"] .calendar-sticky-note .calendar-sticky-copy {
    flex: 1 1 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    gap: 1px;
    width: auto;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: normal;
}

.calendar-sticky-note .calendar-sticky-title,
.calendar-sticky-note .calendar-sticky-copy small,
body[data-view="calendar"] .calendar-sticky-note .calendar-sticky-title,
body[data-view="calendar"] .calendar-sticky-note .calendar-sticky-copy small {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sticky Notes Board tab */
body[data-view="sticky-board"] #statsPanel,
body[data-view="sticky-board"] #filtersPanel .filter-stats-grid {
    display: none;
}

.sticky-board-shell {
    min-height: 680px;
}

.sticky-board-head {
    align-items: center;
}

.sticky-board-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.sticky-board-add {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.sticky-board-wrap {
    position: relative;
    overflow: auto;
    background:
        radial-gradient(circle at 18px 18px, rgba(148, 163, 184, .18) 1.3px, transparent 1.3px),
        linear-gradient(180deg, #f8fafc 0%, #eef3ff 100%);
    background-size: 28px 28px, auto;
    min-height: 620px;
    max-height: calc(100vh - 260px);
    max-height: calc(100dvh - 260px);
}

.sticky-board-canvas {
    position: relative;
    min-height: 620px;
    min-width: 100%;
    padding: 18px;
}

.sticky-board-empty {
    position: absolute;
    inset: 28px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    min-height: 240px;
    border: 1px dashed var(--line-strong);
    border-radius: 22px;
    background: rgba(255, 255, 255, .68);
    color: var(--muted);
    text-align: center;
}

.sticky-board-empty strong {
    color: var(--text);
    font-size: 18px;
}

.sticky-board-note {
    position: absolute;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 3px 8px rgba(15, 23, 42, .035);
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}

.sticky-board-note::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 34px;
    background: rgba(255, 255, 255, .22);
    pointer-events: none;
}

.sticky-board-note[data-note-color="yellow"] { background: #ffef9f; }
.sticky-board-note[data-note-color="pink"] { background: #ffcbe0; }
.sticky-board-note[data-note-color="blue"] { background: #cbe5ff; }
.sticky-board-note[data-note-color="green"] { background: #d2f2cc; }
.sticky-board-note[data-note-color="purple"] { background: #e0ccff; }

.sticky-board-note.is-board-dragging {
    opacity: .92;
    transform: rotate(-1deg) scale(1.015);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .06);
}

.sticky-board-note.is-readonly {
    opacity: .82;
}

.sticky-board-note.is-move-only {
    opacity: .95;
}

.sticky-board-note.is-move-only .sticky-board-drag-handle {
    background: rgba(255, 255, 255, .9);
    color: rgba(15, 23, 42, .82);
}

.sticky-board-note-top {
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 30px 28px;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.sticky-board-drag-handle,
.sticky-board-icon-btn {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .62);
    color: rgba(15, 23, 42, .66);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.sticky-board-drag-handle {
    width: 30px;
    cursor: grab;
    font-size: 17px;
    font-weight: 900;
    touch-action: none;
    user-select: none;
}

.sticky-board-drag-handle:hover,
.sticky-board-drag-handle:active {
    cursor: grabbing;
    background: rgba(255, 255, 255, .92);
    color: rgba(15, 23, 42, .86);
}

.sticky-board-icon-btn {
    cursor: pointer;
    font-size: 14px;
}

.sticky-board-icon-btn.is-active {
    background: rgba(255, 255, 255, .95);
    color: #b45309;
    box-shadow: inset 0 0 0 1px rgba(180, 83, 9, .18);
}

.sticky-board-icon-btn.danger {
    font-size: 18px;
}

.sticky-board-icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, .9);
}

.sticky-board-icon-btn.danger:hover:not(:disabled) {
    color: var(--danger);
}

.sticky-board-title {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .38);
    color: rgba(15, 23, 42, .78);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: -.01em;
    padding: 7px 8px;
}

.sticky-board-title:focus {
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, .10);
}

.sticky-board-owner-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: rgba(15, 23, 42, .58);
    font-size: 11px;
    font-weight: 800;
}

.sticky-board-owner-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sticky-board-owner-row em {
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    padding: 3px 7px;
    color: rgba(15, 23, 42, .56);
    font-style: normal;
    font-size: 10px;
}

.sticky-board-text {
    position: relative;
    width: 100%;
    min-height: 110px;
    border: 0;
    outline: 0;
    resize: none;
    overflow: hidden;
    background: transparent;
    color: #182131;
    font-size: 14px;
    line-height: 1.5;
    padding: 2px 0;
}

.sticky-board-text::placeholder {
    color: rgba(15, 23, 42, .42);
}

.sticky-board-note-foot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.sticky-board-note-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}

.sticky-board-badge {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    padding: 4px 7px;
    color: rgba(15, 23, 42, .62);
    font-size: 10px;
    font-weight: 900;
}

.sticky-board-open {
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: rgba(15, 23, 42, .68);
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.sticky-board-open:hover {
    background: rgba(255, 255, 255, .96);
    color: var(--primary);
}

body.sticky-board-dragging {
    user-select: none;
    cursor: grabbing;
}

@media (max-width: 720px) {
    .sticky-board-head {
        align-items: flex-start;
    }

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

    .sticky-board-wrap,
    .sticky-board-canvas {
        min-height: 540px;
    }

    .sticky-board-note {
        border-radius: 18px;
    }
}

/* Sticky Notes type chooser and to-do list */
.sticky-note-type-modal[hidden] {
    display: none;
}

.sticky-note-type-modal {
    position: fixed;
    inset: 0;
    z-index: 92;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(8px);
}

.sticky-note-type-card {
    width: min(440px, 100%);
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .14);
    padding: 18px;
}

.sticky-note-type-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.sticky-note-type-head h2 {
    margin: 0;
    color: rgba(15, 23, 42, .86);
    font-size: 22px;
    letter-spacing: -.04em;
}

.sticky-note-type-head p {
    margin: 4px 0 0;
    color: rgba(15, 23, 42, .56);
    font-size: 13px;
    font-weight: 700;
}

.sticky-note-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sticky-note-type-option {
    min-height: 120px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 18px;
    background: #fff;
    color: rgba(15, 23, 42, .78);
    padding: 16px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.sticky-note-type-option:hover,
.sticky-note-type-option:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .26);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
    outline: none;
}

.sticky-note-type-option strong {
    display: block;
    margin-bottom: 8px;
    color: rgba(15, 23, 42, .88);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -.02em;
}

.sticky-note-type-option span {
    display: block;
    color: rgba(15, 23, 42, .56);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.sticky-note-owner-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}

.sticky-note-type-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    color: rgba(15, 23, 42, .56);
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .01em;
    white-space: nowrap;
}

.sticky-todo-list {
    position: relative;
    display: grid;
    align-content: start;
    justify-items: stretch;
    gap: 7px;
    margin-top: 4px;
}

.sticky-todo-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 7px;
    min-height: 34px;
}

.sticky-todo-check-wrap {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sticky-todo-check-wrap input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sticky-todo-check-wrap span {
    width: 18px;
    height: 18px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .58);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sticky-todo-check-wrap span::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid rgba(15, 23, 42, .82);
    border-bottom: 2px solid rgba(15, 23, 42, .82);
    transform: rotate(-45deg) translate(1px, -1px);
    opacity: 0;
}

.sticky-todo-check-wrap input:checked + span {
    background: rgba(255, 255, 255, .92);
}

.sticky-todo-check-wrap input:checked + span::after {
    opacity: 1;
}

.sticky-todo-input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .34);
    color: #182131;
    padding: 7px 9px;
    font-size: 13px;
    font-weight: 750;
}

.sticky-todo-input:focus {
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, .09);
}

.sticky-todo-item.is-done .sticky-todo-input {
    color: rgba(15, 23, 42, .46);
    text-decoration: line-through;
}

.sticky-todo-delete,
.sticky-todo-add {
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .58);
    color: rgba(15, 23, 42, .62);
    cursor: pointer;
    font-weight: 900;
}

.sticky-todo-delete {
    width: 26px;
    height: 26px;
    font-size: 17px;
    line-height: 1;
}

.sticky-todo-delete:hover:not(:disabled) {
    color: var(--danger);
    background: rgba(255, 255, 255, .9);
}

.sticky-todo-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    align-self: start;
    width: auto;
    min-width: 0;
    max-width: max-content;
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1;
}

.sticky-todo-add:hover:not(:disabled) {
    background: rgba(255, 255, 255, .94);
    color: var(--primary);
}

.sticky-todo-empty {
    border-radius: 12px;
    background: rgba(255, 255, 255, .34);
    color: rgba(15, 23, 42, .46);
    padding: 10px;
    font-size: 12px;
    font-weight: 750;
}

.sticky-note-popup-body {
    margin-top: 12px;
}

.sticky-note-popup-body .sticky-todo-list {
    border-radius: 16px;
    background: rgba(255, 255, 255, .34);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
    padding: 12px;
}

.sticky-board-note .sticky-todo-list {
    min-height: 110px;
}

@media (max-width: 560px) {
    .sticky-note-type-options {
        grid-template-columns: 1fr;
    }
}

/* Sales status update */
.table-view-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.table-add-job-btn {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}


.dot.progress {
    background: var(--danger);
}

/* Compact Job Details modal spacing */
@media (min-width: 901px) {
    .job-modal-card {
        width: min(860px, calc(100vw - 72px));
        border-radius: 24px;
    }

    .job-modal-header {
        padding: 16px 22px 12px;
    }

    .modal-kicker {
        margin-bottom: 5px;
        padding: 3px 9px;
        font-size: 10px;
    }

    .job-modal-header h2 {
        font-size: 22px;
        line-height: 1.15;
    }

    .job-modal-header p {
        margin-top: 4px;
        font-size: 13px;
        line-height: 1.35;
    }

    .job-form-layout {
        grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
        gap: 12px;
        padding: 14px 22px 16px;
    }

    .form-section {
        border-radius: 19px;
        padding: 12px;
    }

    .form-section-head {
        margin-bottom: 9px;
    }

    .form-section-head strong {
        font-size: 12px;
    }

    .form-section-head span {
        margin-top: 2px;
        font-size: 11px;
        line-height: 1.25;
    }

    .job-form .form-grid {
        gap: 8px;
    }

    .field-card {
        gap: 5px;
        border-radius: 14px;
        padding: 8px;
    }

    .job-form .field-card:not(.notes-card),
    .job-form .date-field,
    .job-form .team-sales-field,
    .job-form .invoice-compact-field {
        min-height: 72px;
    }

    .job-form .primary-section .form-grid {
        grid-auto-rows: minmax(70px, auto);
    }

    .job-form input:not([type="file"]),
    .job-form select,
    .job-form .search-select input {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        border-radius: 12px;
        font-size: 13px;
    }

    .process-tracker {
        gap: 8px;
        grid-template-rows: repeat(5, minmax(62px, auto));
    }

    .process-step {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 8px;
        border-radius: 16px;
        padding: 9px;
    }

    .process-step::before {
        left: 24px;
        top: 42px;
        bottom: -12px;
    }

    .process-node {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        font-size: 11px;
    }

    .process-step-copy strong {
        font-size: 12px;
    }

    .process-step-copy small {
        font-size: 10.5px;
        line-height: 1.25;
    }

    .process-chip {
        padding: 3px 7px;
        font-size: 9.5px;
    }

    .process-options {
        gap: 4px;
        margin-top: 7px;
    }

    .process-options button {
        min-height: 26px;
        padding: 0 7px;
        font-size: 10.5px;
    }

    .sticky-actions {
        padding: 11px 22px;
    }
}

/* Invoice File control: keep Choose File vertically centered inside the upload box */
.invoice-compact-field .invoice-file-control {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 5px 10px !important;
    display: grid !important;
    grid-template-columns: minmax(102px, auto) minmax(0, 1fr) !important;
    align-items: center !important;
    justify-items: start !important;
    line-height: 1 !important;
}

.invoice-compact-field .invoice-file-button {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    line-height: 1 !important;
}

.invoice-compact-field .selected-invoice-name,
.invoice-file-control .selected-invoice-name {
    height: 32px !important;
    min-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
    line-height: 1.2 !important;
}

.invoice-file-control .selected-invoice-name[hidden] {
    display: flex !important;
}

/* Multi-check Status filter dropdown */
.filters-panel .filter-field {
    display: grid;
    gap: 5px;
    min-width: 150px;
}

.filters-panel .filter-field > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.status-filter-label {
    position: relative;
}

.status-filter-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    max-height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.status-filter-dropdown {
    position: relative;
    min-width: 160px;
}

.status-filter-toggle {
    width: 100%;
    height: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.status-filter-toggle:hover,
.status-filter-dropdown.open .status-filter-toggle {
    border-color: rgba(37, 99, 235, .35);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.status-filter-toggle span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-filter-caret {
    color: var(--muted);
    flex: 0 0 auto;
    transition: transform .16s ease;
}

.status-filter-dropdown.open .status-filter-caret {
    transform: rotate(180deg);
}

.status-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 2500;
    display: none;
    width: max-content;
    min-width: 100%;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .36);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
}

.status-filter-dropdown.open .status-filter-menu {
    display: grid;
    gap: 4px;
}

.status-filter-option {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px !important;
    width: 100%;
    min-width: 132px;
    padding: 8px 9px;
    border-radius: 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    box-sizing: border-box;
}

.status-filter-option:hover {
    background: #f8fafc;
}

.status-filter-option input {
    width: 16px;
    height: 16px;
    min-width: 16px;
    accent-color: var(--primary);
    margin: 0;
}

.status-filter-option span {
    color: var(--text) !important;
    font-size: 13px !important;
    font-weight: 750 !important;
}

.stat-card.active,
.filter-stat-card.active {
    border-color: rgba(37, 99, 235, .34);
    background: linear-gradient(135deg, rgba(37, 99, 235, .09), rgba(255, 255, 255, .95));
}

@media (max-width: 720px) {
    .filters-panel .filter-field {
        min-width: 0 !important;
        width: 100% !important;
        gap: 4px !important;
    }

    .filters-panel .filter-field > span {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .status-filter-dropdown {
        min-width: 0 !important;
        width: 100% !important;
    }

    .status-filter-toggle {
        width: 100% !important;
        min-height: 34px !important;
        height: 34px !important;
        border-radius: 10px !important;
        padding: 0 10px !important;
        font-size: 12px !important;
        font-weight: 750 !important;
    }

    .status-filter-menu {
        width: 100%;
        min-width: 100%;
        left: 0;
        right: auto;
        padding: 6px;
    }

    .status-filter-option {
        min-width: 0;
        padding: 7px 8px;
        font-size: 12px;
    }

    .status-filter-option span {
        font-size: 12px !important;
    }
}

.workspace-access-box {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.72);
}

.workspace-access-head span,
.workspace-invite-tag-field > span {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.workspace-access-head p {
    margin: 4px 0 0;
    font-size: 0.83rem;
    color: var(--muted);
}

.workspace-access-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.workspace-access-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
}

.workspace-access-option input {
    accent-color: var(--primary);
}

.workspace-invite-tag-field {
    position: relative;
    display: grid;
    gap: 7px;
}

.workspace-tag-input {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 44px;
    padding: 7px 9px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.workspace-tag-input:focus-within {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}

.workspace-tag-input.is-disabled {
    background: rgba(241, 245, 249, 0.78);
    cursor: default;
}

.workspace-tag-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.workspace-tag-input input {
    flex: 1 1 150px;
    min-width: 120px;
    border: 0;
    outline: 0;
    padding: 5px 2px;
    background: transparent;
    font: inherit;
    color: var(--text);
}

.workspace-tag-input input:disabled {
    cursor: default;
}

.workspace-user-tag,
.workspace-invite-all-pill,
.workspace-invite-empty {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #f3f4f6;
    color: #111827;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.workspace-user-tag {
    background: #f3f4f6;
    color: #111827;
}

.workspace-user-tag button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #6b7280;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.workspace-user-tag button:hover,
.workspace-user-tag button:focus-visible {
    background: rgba(17, 24, 39, 0.08);
    color: #111827;
    outline: none;
}

.workspace-invite-all-pill {
    background: #f3f4f6;
    color: #111827;
}

.workspace-invite-empty {
    background: #f8fafc;
    color: var(--muted);
}

.workspace-invite-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    display: grid;
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

.workspace-invite-suggestions[hidden] {
    display: none;
}

.workspace-invite-suggestions button,
.workspace-invite-suggestion-empty {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
}

.workspace-invite-suggestions button {
    display: grid;
    gap: 2px;
    cursor: pointer;
}

.workspace-invite-suggestions button:hover,
.workspace-invite-suggestions button:focus-visible {
    background: rgba(37, 99, 235, 0.08);
    outline: none;
}

.workspace-invite-suggestions strong {
    color: var(--text);
    font-size: 0.86rem;
}

.workspace-invite-suggestions span,
.workspace-invite-suggestion-empty {
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 640px) {
    .workspace-access-options {
        grid-template-columns: 1fr;
    }
}

.workspace-invite-grid {
    margin-top: 12px;
}

.workspace-invite-grid .workspace-invite-tag-field {
    gap: 6px;
}

.workspace-invite-grid .workspace-tag-input {
    min-height: 44px;
    padding: 7px 10px;
    border-radius: 12px;
    background: #fff;
}

.workspace-invite-grid .workspace-tag-input input {
    min-height: 28px;
    padding: 4px 2px;
}

.workspace-invite-grid .workspace-invite-suggestions {
    z-index: 90;
}

/* No workspace access state: keep the page clean when the account has no invited workspace. */
body.no-workspace .topbar-actions,
body.no-workspace .board-toolbar,
body.no-workspace .stats-grid,
body.no-workspace .filters-panel,
body.no-workspace .view-panel,
body.no-workspace .sticky-notes-panel,
body.no-workspace .sticky-notes-float {
    display: none !important;
}

body.no-workspace .topbar {
    align-items: flex-start;
    border-bottom: 0;
    margin-bottom: 0;
}

body.no-workspace .main-area {
    min-height: 100vh;
}

body.no-workspace .topbar-left h1 {
    margin-bottom: 6px;
}

/* View-only workspace access */
.workspace-readonly #createTaskBtn,
.workspace-readonly #tableCreateTaskBtn,
.workspace-readonly #stickyBoardAddBtn,
.workspace-readonly #addStickyNoteBtn,
.workspace-readonly .mini-add,
.workspace-readonly .calendar-add-btn {
    display: none !important;
}

.workspace-readonly .calendar-date-static {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 26px;
    font-weight: 800;
    color: var(--text);
}

.workspace-readonly .task-card,
.workspace-readonly .calendar-job,
.workspace-readonly .calendar-sticky-note {
    cursor: pointer;
}

.workspace-readonly .task-card.is-readonly {
    cursor: default;
}

.workspace-readonly .table-process-select:disabled,
.workspace-readonly .table-bookmark-btn:disabled {
    cursor: default;
    opacity: 0.7;
}


/* Attendance tab */
#attendanceTopStatsPanel {
    display: none;
}

body[data-view="attendance"] #filtersPanel,
body[data-view="attendance"] .topbar-actions {
    display: none;
}

body[data-view="attendance"] #statsPanel {
    display: grid;
}

.attendance-view-shell {
    margin-top: 0;
}

.attendance-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 0 14px 12px;
}

.attendance-stat-card {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 12px 13px;
    box-shadow: var(--shadow-soft);
}

.attendance-stat-card span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attendance-stat-card strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.04em;
}

.attendance-table-body {
    display: block;
}

.attendance-table-wrap {
    max-height: calc(100vh - 230px);
    max-height: calc(100dvh - 230px);
    overflow: auto;
}

.attendance-table {
    min-width: max(980px, 100%);
    table-layout: fixed;
}

.attendance-table th,
.attendance-table td {
    text-align: center;
    padding: 10px 8px;
}

.attendance-table .attendance-index-col,
.attendance-table .attendance-index-cell {
    position: sticky;
    left: 0;
    z-index: 4;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    background: #fff;
    box-shadow: 1px 0 0 var(--line);
}

.attendance-table th.attendance-index-col {
    z-index: 7;
    background: #f8f9fc;
}

.attendance-table .attendance-name-col,
.attendance-table .attendance-name-cell {
    position: sticky;
    left: 54px;
    z-index: 4;
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    background: #fff;
    text-align: left;
    box-shadow: 1px 0 0 var(--line);
}

.attendance-table th.attendance-name-col {
    z-index: 7;
    background: #f8f9fc;
}

.attendance-day-col,
.attendance-day-cell {
    width: 66px;
    min-width: 66px;
    max-width: 66px;
}

.attendance-name-cell strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.attendance-name-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.attendance-name-text {
    min-width: 0;
    flex: 1 1 auto;
}

.attendance-stop-badge {
    display: block;
    margin-top: 3px;
    color: #ef4444;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attendance-name-edit {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.attendance-name-edit:hover {
    border-color: rgba(66, 77, 211, .38);
    background: rgba(66, 77, 211, .08);
    color: #3338a8;
    box-shadow: 0 8px 20px rgba(66, 77, 211, .12);
}

.attendance-select {
    width: 56px;
    min-height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    background-image: none;
    color: var(--text);
    font-size: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-weight: 900;
    text-align: center;
    text-align-last: center;
    outline: none;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.attendance-select::-ms-expand {
    display: none;
}

.attendance-select:focus {
    border-color: rgba(66, 77, 211, .55);
    box-shadow: 0 0 0 3px rgba(66, 77, 211, .12);
}

.attendance-select.al {
    border-color: rgba(66, 77, 211, .26);
    background: rgba(66, 77, 211, .10);
    color: #3338a8;
}

.attendance-select.mc {
    border-color: rgba(16, 185, 129, .28);
    background: rgba(16, 185, 129, .10);
    color: #047857;
}

.attendance-select.ul {
    border-color: rgba(245, 158, 11, .34);
    background: rgba(245, 158, 11, .13);
    color: #b45309;
}

.attendance-select.el {
    border-color: rgba(239, 68, 68, .30);
    background: rgba(239, 68, 68, .10);
    color: #b91c1c;
}

.attendance-select:disabled {
    cursor: not-allowed;
    opacity: .72;
}

.attendance-profile-modal-backdrop[hidden] {
    display: none !important;
}

.attendance-profile-modal-card {
    width: min(100%, 460px);
    max-height: min(92vh, 680px);
    overflow: auto;
}

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

.attendance-profile-form .form-label {
    display: grid;
    gap: 7px;
    margin: 0;
}

.attendance-profile-form .form-label span {
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

.attendance-profile-form .form-label input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 750;
    outline: none;
    padding: 10px 12px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.attendance-profile-form .form-label input:focus {
    border-color: rgba(66, 77, 211, .55);
    box-shadow: 0 0 0 3px rgba(66, 77, 211, .12);
}

.attendance-profile-form .form-label small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.attendance-profile-actions {
    margin-top: 2px;
}

.attendance-row:hover .attendance-index-cell,
.attendance-row:hover .attendance-name-cell {
    background: #fbfcff;
}

@media (max-width: 720px) {
    .attendance-table {
        display: table;
        min-width: max-content;
        width: max-content;
    }

    .attendance-table th,
    .attendance-table td {
        display: table-cell;
        padding: 8px 7px;
        white-space: nowrap;
    }

    .attendance-table th:nth-child(1),
    .attendance-table td:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 6;
        width: 46px;
        min-width: 46px;
        max-width: 46px;
        background: #fff;
        text-align: center;
    }

    .attendance-table th:nth-child(1) {
        z-index: 9;
        background: #f8f9fc;
    }

    .attendance-table th:nth-child(2),
    .attendance-table td:nth-child(2) {
        position: sticky;
        left: 46px;
        z-index: 6;
        width: 160px;
        min-width: 160px;
        max-width: 160px;
        background: #fff;
        text-align: left;
    }

    .attendance-table th:nth-child(2) {
        z-index: 9;
        background: #f8f9fc;
    }

    .attendance-table th:nth-child(n+3),
    .attendance-table td:nth-child(n+3) {
        width: 58px;
        min-width: 58px;
        max-width: 58px;
    }

    .attendance-stats-grid {
        display: flex;
        gap: 8px;
        padding: 0 12px 10px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .attendance-stats-grid::-webkit-scrollbar {
        height: 0;
    }

    .attendance-stat-card {
        flex: 0 0 126px;
        border-radius: 13px;
        padding: 10px 11px;
        scroll-snap-align: start;
    }

    .attendance-stat-card span {
        font-size: 10px;
    }

    .attendance-stat-card strong {
        margin-top: 5px;
        font-size: 19px;
    }

    .attendance-select {
        width: 50px;
        min-height: 32px;
        border-radius: 10px;
        font-size: 11px;
    }
}

/* Admin user edit action */
.admin-action-stack {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-muted-action.compact {
    min-height: 0;
    font-size: 11px;
    line-height: 1.2;
}

.admin-user-edit-modal[hidden] {
    display: none !important;
}

.admin-user-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.admin-user-edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
}

.admin-user-edit-card {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    max-height: min(92vh, 720px);
    overflow: auto;
    border: 1px solid #e6e9f2;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    padding: 18px;
}

.admin-user-edit-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-user-edit-head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.admin-user-edit-head p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.admin-user-edit-close {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}


.admin-password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-password-input-wrap input {
    width: 100%;
    padding-right: 46px;
}

.admin-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.admin-password-toggle:hover,
.admin-password-toggle[aria-pressed="true"] {
    background: #f1f5f9;
    color: #0f172a;
}

.admin-edit-user-form input[readonly] {
    color: #64748b;
    background: #f8fafc;
    cursor: not-allowed;
}

.admin-edit-user-form select:disabled {
    color: #64748b;
    background: #f8fafc;
    cursor: not-allowed;
}

.admin-edit-user-note {
    margin: -3px 0 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.admin-edit-user-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 2px;
}

.admin-edit-user-actions .soft-btn,
.admin-edit-user-actions .primary-btn {
    min-height: 38px;
    padding: 0 14px;
}

body.admin-user-edit-open,
body.admin-create-user-open,
body.admin-activation-popup-open {
    overflow: hidden;
}


.admin-create-user-card {
    width: min(100%, 480px);
}

.admin-create-user-backdrop {
    cursor: default;
}

@media (max-width: 560px) {
    .admin-user-edit-modal {
        align-items: end;
        padding: 10px;
    }

    .admin-user-edit-card {
        width: 100%;
        border-radius: 20px;
        padding: 15px;
    }

    .admin-edit-user-actions {
        flex-direction: column-reverse;
    }

    .admin-edit-user-actions .soft-btn,
    .admin-edit-user-actions .primary-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Admin user delete action */
.mini-action-btn.delete-user {
    border-color: #fecaca;
    background: #fff1f2;
    color: #be123c;
}

.mini-action-btn.delete-user:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #9f1239;
}

/* Admin user Active URL */
.mini-action-btn.active-url {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
}

.mini-action-btn.active-url:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    color: #3730a3;
}

.admin-activation-popup-card {
    width: min(100%, 540px);
}

.admin-activation-link-box {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #eff6ff;
    padding: 12px;
}

.admin-activation-popup-box {
    margin-bottom: 12px;
}

.admin-activation-link-copy {
    display: grid;
    gap: 3px;
}

.admin-activation-link-copy strong {
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 900;
}

.admin-activation-link-copy span {
    color: #475569;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
}

.admin-activation-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-activation-url-row input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 36px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    padding: 0 11px;
    outline: none;
}

.activation-card {
    max-width: 440px;
}

.activation-form input[readonly] {
    color: #475569;
    background: #f8fafc;
    border-color: #e2e8f0;
    cursor: default;
}

.activation-success {
    margin: 0 0 14px;
}

@media (max-width: 560px) {
    .admin-activation-popup-card {
        width: 100%;
    }

    .admin-activation-url-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-activation-url-row .mini-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================
   Adaptive comfort density polish
   Keeps the UI balanced across laptop, desktop, smartboard,
   tablet and mobile displays without changing PHP/JS logic.
   ========================================================== */
:root {
    --rt-sidebar-lg: 248px;
    --rt-sidebar-md: 226px;
    --rt-notes-lg: 300px;
    --rt-content-gap: clamp(10px, 0.8vw, 16px);
    --rt-control-h: 36px;
    --rt-control-radius: 10px;
    --rt-card-radius: 14px;
    --rt-board-col: clamp(218px, 14vw, 248px);
}

@media (min-width: 821px) {
    body {
        font-size: 13px;
    }

    .app-shell {
        grid-template-columns: var(--rt-sidebar-lg) minmax(0, 1fr) var(--rt-notes-lg);
    }

    .app-shell.notes-hidden {
        grid-template-columns: var(--rt-sidebar-lg) minmax(0, 1fr);
    }

    .sidebar {
        width: var(--rt-sidebar-lg);
        padding: 14px 12px;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .sidebar-brand,
    .login-brand {
        gap: 9px;
    }

    .sidebar-brand strong,
    .login-brand strong {
        font-size: 14px;
    }

    .sidebar-brand span,
    .login-brand span,
    .workspace-copy small,
    .user-chip small {
        font-size: 11px;
    }

    .side-nav,
    .sidebar-section {
        margin-top: 18px;
    }

    .nav-item,
    .workspace-link,
    .side-create,
    .sidebar-admin-panel-btn,
    .user-chip {
        border-radius: 12px;
        padding: 8px 9px;
    }

    .workspace-avatar,
    .user-chip > span,
    .admin-panel-icon {
        width: 29px;
        height: 29px;
        border-radius: 10px;
        flex-basis: 29px;
    }

    .main-area {
        padding: var(--rt-content-gap);
    }

    .topbar,
    .board-toolbar,
    .board-info,
    .section-head {
        gap: 10px;
        margin-bottom: 10px;
    }

    .topbar h1 {
        font-size: clamp(18px, 1.35vw, 23px);
        letter-spacing: -.035em;
    }

    .topbar p,
    .board-info p,
    .section-head p,
    .setting-card p,
    .login-card p {
        font-size: 12px;
        line-height: 1.38;
    }

    .topbar-actions,
    .month-picker,
    .legend,
    .sticky-board-actions,
    .admin-top-actions {
        gap: 8px;
    }

    .search-box {
        height: var(--rt-control-h);
        min-width: min(260px, 100%);
        flex-basis: 260px;
        border-radius: var(--rt-control-radius);
        padding-inline: 10px;
    }

    .primary-btn,
    .soft-btn,
    .danger-btn,
    .icon-btn,
    .text-btn,
    .task-action,
    .mini-action-btn,
    .table-action-btn,
    .table-date-btn,
    .table-link,
    .status-filter-toggle,
    .month-picker select,
    .month-picker input,
    .filters-panel select,
    .task-form input,
    .task-form select,
    .task-form textarea,
    .login-form input,
    .admin-user-form input,
    .admin-user-form select {
        min-height: var(--rt-control-h);
        border-radius: var(--rt-control-radius);
    }

    .primary-btn,
    .soft-btn,
    .danger-btn,
    .text-btn {
        padding-inline: 12px;
    }

    .icon-btn {
        width: var(--rt-control-h);
        height: var(--rt-control-h);
        min-height: var(--rt-control-h);
        flex-basis: var(--rt-control-h);
        font-size: 19px;
    }

    .board-toolbar {
        align-items: flex-start;
        margin-bottom: 10px;
    }

    .tabs {
        gap: 2px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tab {
        min-height: 36px;
        padding: 8px 10px 7px;
        font-size: 12px;
        white-space: nowrap;
    }

    .month-picker .month-arrow,
    .today-month-btn {
        width: 38px;
        height: 38px;
        min-height: 38px;
        flex-basis: 38px;
        border-radius: 10px;
    }

    .today-month-btn {
        width: auto;
        padding-inline: 12px;
    }

    .stats-grid,
    .admin-metrics-grid {
        gap: 8px;
    }

    .stat-card,
    .overview-card,
    .setting-card,
    .admin-metric,
    .admin-card {
        border-radius: var(--rt-card-radius);
        padding: 11px 12px;
    }

    .stat-card span,
    .overview-card span,
    .setting-card span,
    .admin-metric span {
        font-size: 11px;
    }

    .stat-card strong,
    .overview-card strong,
    .setting-card strong,
    .admin-metric strong {
        margin-top: 4px;
        font-size: clamp(19px, 1.45vw, 22px);
    }

    .filters-panel {
        gap: 8px;
        padding: 10px;
        border-radius: var(--rt-card-radius);
    }

    .filters-panel label span,
    .filters-panel .filter-field > span,
    .task-form label span,
    .login-form label span {
        font-size: 11px;
    }

    .board-info,
    .section-head {
        margin: 10px 0 9px;
    }

    .board-info h2,
    .section-head h2,
    .table-view-head h2 {
        font-size: 16px;
    }

    .timeline-board {
        grid-auto-columns: var(--rt-board-col);
        gap: 8px;
        min-height: clamp(500px, calc(100dvh - 210px), 760px);
        padding-bottom: 22px;
    }

    .day-column {
        min-height: clamp(500px, calc(100dvh - 210px), 760px);
        border-radius: var(--rt-card-radius);
    }

    .day-header {
        min-height: 49px;
        height: auto;
        padding: 9px 10px;
    }

    .day-header strong {
        font-size: 16px;
    }

    .day-header span,
    .task-card p,
    .table-title span,
    .table-muted {
        font-size: 11.5px;
    }

    .day-job-count {
        min-height: 23px;
        padding-inline: 8px;
        font-size: 10px !important;
    }

    .mini-add {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        border-radius: 10px;
        font-size: 22px;
    }

    .day-task-list {
        gap: 8px;
        padding: 8px;
    }

    .task-card {
        border-radius: 13px;
        padding: 10px;
    }

    .task-card h3 {
        margin: 7px 0 4px;
        font-size: 13px;
        line-height: 1.32;
    }

    .badge,
    .team-sales-tag,
    .process-pill,
    .task-action,
    .table-status-pill,
    .role-badge {
        font-size: 10px;
    }

    .task-meta,
    .calendar-summary,
    .calendar-empty-mini,
    .calendar-job,
    .calendar-sticky-note {
        font-size: 10.5px;
    }

    .task-actions {
        gap: 5px;
        margin-top: 9px;
        flex-wrap: wrap;
    }

    .task-action {
        min-height: 28px;
        padding-inline: 8px;
        border-radius: 9px;
    }

    .calendar-weekdays span {
        padding: 8px 9px;
        font-size: 11px;
    }

    .calendar-cell,
    body[data-view="calendar"] .calendar-cell {
        min-height: 120px !important;
        padding: 8px !important;
        gap: 6px !important;
    }

    .calendar-date-btn {
        width: 28px;
        height: 28px;
        border-radius: 9px;
    }

    .calendar-add-btn {
        width: 26px;
        height: 26px;
        border-radius: 8px;
        font-size: 17px;
    }

    .calendar-job,
    .calendar-sticky-note,
    body[data-view="calendar"] .calendar-job,
    body[data-view="calendar"] .calendar-sticky-note {
        min-height: 24px;
        border-radius: 8px;
        padding-inline: 6px;
    }

    .sticky-notes-panel {
        width: var(--rt-notes-lg);
        padding: 14px 12px;
        gap: 10px;
    }

    .sticky-notes-head h2 {
        font-size: 18px;
    }

    .sticky-notes-head p,
    .sticky-notes-foot,
    .sticky-note-title {
        font-size: 11px;
    }

    .sticky-add-btn {
        min-height: 40px;
        border-radius: 13px;
    }

    .sticky-note-card,
    .sticky-board-note {
        border-radius: 16px;
        padding: 11px;
    }

    .sticky-note-text {
        min-height: 78px;
        font-size: 13px;
        line-height: 1.42;
    }

    .sticky-notes-float {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    .modal-backdrop {
        padding: 14px;
    }

    .modal-card {
        width: min(700px, calc(100vw - 28px));
        border-radius: 18px;
    }

    .job-modal-card {
        width: min(860px, calc(100vw - 28px));
        border-radius: 22px;
    }

    .modal-header,
    .job-modal-header {
        padding: 15px 16px 12px;
    }

    .modal-header h2,
    .confirm-copy h2 {
        font-size: 18px;
    }

    .job-modal-header h2 {
        font-size: 21px;
    }

    .task-form,
    .job-form-layout {
        padding: 14px 16px 16px;
    }

    .job-form-layout {
        grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
        gap: 10px;
    }

    .form-grid,
    .job-form .form-grid {
        gap: 9px;
    }

    .form-section,
    .field-card {
        border-radius: var(--rt-card-radius);
        padding: 10px;
    }

    .form-section-head {
        gap: 9px;
        margin-bottom: 9px;
    }

    .job-form .field-card:not(.notes-card),
    .job-form .date-field,
    .job-form .team-sales-field,
    .job-form .invoice-compact-field {
        min-height: 68px;
    }

    .job-form input:not([type="file"]),
    .job-form select,
    .job-form .search-select input,
    .invoice-compact-field .invoice-file-control {
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        font-size: 12.5px;
    }

    .invoice-compact-field .invoice-file-button,
    .invoice-compact-field .selected-invoice-name,
    .invoice-file-control .selected-invoice-name {
        height: 28px !important;
        min-height: 28px !important;
        font-size: 11px !important;
    }

    .process-tracker {
        gap: 7px;
        grid-template-rows: repeat(5, minmax(58px, auto));
    }

    .process-step {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        gap: 8px;
        border-radius: 14px;
        padding: 8px;
    }

    .process-node {
        width: 28px;
        height: 28px;
        border-radius: 9px;
        font-size: 10.5px;
    }

    .process-step-copy strong {
        font-size: 12px;
    }

    .process-step-copy small {
        font-size: 10px;
    }

    .process-options button {
        min-height: 26px;
        padding-inline: 6px;
        font-size: 10px;
    }

    .sticky-actions,
    .modal-actions {
        padding: 11px 16px;
    }

    .table-view-head {
        padding: 12px 14px;
    }

    .job-table th,
    .job-table td,
    .admin-table th,
    .admin-table td {
        padding: 9px 10px;
        font-size: 12px;
    }

    .admin-content-grid {
        gap: 14px;
        padding: 0 16px 22px;
    }
}

@media (min-width: 1281px) {
    .app-shell {
        grid-template-columns: var(--rt-sidebar-lg) minmax(0, 1fr) var(--rt-notes-lg);
    }

    .app-shell.notes-hidden {
        grid-template-columns: var(--rt-sidebar-lg) minmax(0, 1fr);
    }

    .kanban-scroll-control {
        left: calc(var(--rt-sidebar-lg) + 18px);
        right: calc(var(--rt-notes-lg) + 18px);
    }

    .app-shell.notes-hidden .kanban-scroll-control,
    body.sticky-notes-hidden .app-shell .kanban-scroll-control {
        right: 76px;
    }
}

@media (min-width: 1600px) {
    :root {
        --rt-board-col: clamp(220px, 12vw, 242px);
    }

    .main-area {
        padding-inline: clamp(14px, 1vw, 18px);
    }

    .timeline-board,
    .day-column {
        min-height: clamp(540px, calc(100dvh - 220px), 820px);
    }
}

@media (max-width: 1280px) and (min-width: 821px) {
    .app-shell,
    .app-shell.notes-hidden {
        grid-template-columns: var(--rt-sidebar-md) minmax(0, 1fr);
    }

    .sidebar {
        width: var(--rt-sidebar-md);
    }

    .main-area {
        grid-column: 2;
    }

    .topbar-actions {
        width: 100%;
    }

    .timeline-board {
        grid-auto-columns: minmax(214px, 28vw);
    }

    .kanban-scroll-control {
        left: calc(var(--rt-sidebar-md) + 14px);
        right: 78px;
    }
}

@media (max-width: 980px) and (min-width: 821px) {
    .stats-grid,
    .overview-grid,
    .settings-grid,
    .admin-metrics-grid,
    .admin-metrics-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .timeline-board {
        grid-auto-columns: minmax(210px, 36vw);
    }
}

@media (max-width: 900px) {
    .topbar,
    .board-toolbar {
        border-radius: 18px;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .topbar-left {
        gap: 9px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 12.5px;
    }

    .main-area {
        padding: 8px !important;
    }

    .topbar {
        padding: 10px !important;
        gap: 9px !important;
        border-radius: 16px !important;
    }

    .topbar-left {
        padding-right: 48px;
    }

    .mobile-menu-toggle,
    .topbar-actions #filterToggle.filter-icon-btn {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        border-radius: 12px !important;
    }

    .topbar-actions #filterToggle.filter-icon-btn {
        top: 10px;
        right: 10px;
    }

    .topbar h1 {
        font-size: 18px !important;
        line-height: 1.15;
    }

    .topbar p {
        font-size: 11px !important;
    }

    .search-box,
    .topbar-actions .soft-btn,
    .topbar-actions .primary-btn,
    .month-picker .month-arrow,
    .today-month-btn,
    .mobile-month-display {
        min-height: 36px !important;
        height: 36px !important;
        border-radius: 11px !important;
    }

    .board-toolbar {
        padding: 7px !important;
        gap: 7px !important;
        border-radius: 15px !important;
    }

    .board-toolbar .tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 4px !important;
        padding: 3px !important;
    }

    .board-toolbar .tab {
        min-height: 32px !important;
        height: 32px !important;
        padding: 0 5px !important;
        font-size: 11px !important;
        border-radius: 9px !important;
    }

    .month-picker {
        grid-template-columns: 36px minmax(0, 1fr) 36px 64px !important;
    }

    .mobile-month-display {
        font-size: 12px !important;
    }

    .today-month-btn {
        font-size: 11px !important;
    }

    .filters-panel.show {
        padding: 7px !important;
        gap: 7px !important;
    }

    .filters-panel select,
    .status-filter-toggle,
    .filters-panel #resetFilters {
        min-height: 32px !important;
        height: 32px !important;
        font-size: 11px !important;
    }

    .filter-stat-card {
        min-height: 42px !important;
        padding: 5px !important;
    }

    .filter-stat-card span {
        font-size: 8.8px !important;
    }

    .filter-stat-card strong {
        font-size: 15px !important;
    }

    .mobile-day-board {
        margin-top: 6px;
    }

    .mobile-day-card {
        border-radius: 18px;
        padding: 10px;
        box-shadow: 0 10px 22px rgba(15, 23, 42, .07);
    }

    .mobile-day-nav {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        gap: 7px;
    }

    .mobile-day-arrow,
    .mobile-day-title,
    .mobile-day-add {
        min-height: 38px;
        border-radius: 13px;
    }

    .mobile-day-title {
        padding: 7px 10px;
    }

    .mobile-day-title strong {
        font-size: 24px;
    }

    .mobile-day-title span {
        font-size: 13px;
    }

    .mobile-day-meta {
        margin: 8px 0 10px;
    }

    .mobile-day-list {
        gap: 8px;
    }

    .mobile-day-list .task-card {
        padding: 10px !important;
        border-radius: 15px !important;
    }

    .mobile-day-list .task-card h3 {
        font-size: 14px !important;
    }

    .mobile-day-list .task-actions {
        gap: 6px;
    }

    .mobile-day-list .task-action {
        min-height: 36px !important;
        border-radius: 11px !important;
    }

    .sticky-notes-float {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    .sticky-notes-panel {
        padding: 12px 10px;
    }

    .job-modal-header h2 {
        font-size: 18px !important;
    }

    .job-form-layout {
        padding: 8px 8px 84px !important;
    }

    .form-section,
    .field-card {
        padding: 8px !important;
        border-radius: 14px !important;
    }

    .job-form input,
    .job-form select,
    .job-form textarea,
    .search-select input {
        min-height: 40px !important;
        font-size: 14px !important;
    }

    .job-form textarea {
        min-height: 120px !important;
    }

    .process-step {
        padding: 8px !important;
        border-radius: 13px !important;
    }

    .process-options button {
        min-height: 30px !important;
        font-size: 10.5px !important;
    }

    .sticky-actions,
    .modal-actions {
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important;
    }

    .modal-actions button,
    .sticky-actions button {
        min-height: 40px !important;
        border-radius: 12px !important;
    }

    body[data-view="calendar"] .calendar-cell {
        min-height: 118px !important;
        border-radius: 16px !important;
        padding: 10px !important;
        gap: 7px !important;
    }

    body[data-view="calendar"] .calendar-date-btn,
    body[data-view="calendar"] .calendar-add-btn {
        width: 32px !important;
        height: 32px !important;
        border-radius: 10px !important;
    }

    body[data-view="calendar"] .calendar-job,
    body[data-view="calendar"] .calendar-sticky-note {
        min-height: 32px !important;
        border-radius: 11px !important;
        font-size: 11px !important;
    }

    .table-view-head {
        padding: 9px 10px;
    }

    .table-view-head h2 {
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .main-area {
        padding: 6px !important;
    }

    .topbar {
        padding: 9px !important;
    }

    .board-toolbar .tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .month-picker {
        grid-template-columns: 34px minmax(0, 1fr) 34px 58px !important;
        gap: 5px !important;
    }

    .month-picker .month-arrow,
    .today-month-btn,
    .mobile-month-display {
        min-height: 34px !important;
        height: 34px !important;
    }

    .mobile-day-title strong {
        font-size: 22px;
    }

    .invoice-file-button {
        max-width: 98px;
    }
}

/* ==========================================================
   2K / QHD comfort normaliser
   Makes 2560x1440 desktops render with the same working
   density as Full HD, so the board does not feel too far away.
   ========================================================== */
@media (min-width: 2200px) and (max-width: 2800px) and (min-height: 1200px) and (max-height: 1700px) {
    :root {
        --rt-2k-scale: 1.333333;
        --rt-2k-base-width: 75vw;
        --rt-2k-base-height: 75vh;
    }

    body {
        min-height: var(--rt-2k-base-height);
        overflow-x: hidden;
    }

    .app-shell {
        width: var(--rt-2k-base-width);
        max-width: none;
        min-height: var(--rt-2k-base-height);
        zoom: var(--rt-2k-scale);
    }

    body[data-view="calendar"] .app-shell,
    body[data-view="calendar"] .main-area,
    body[data-view="calendar"] .sticky-notes-panel,
    .app-shell .sidebar,
    .app-shell .sticky-notes-panel {
        height: var(--rt-2k-base-height);
        min-height: var(--rt-2k-base-height);
        max-height: var(--rt-2k-base-height);
    }

    .modal-backdrop,
    .sticky-note-modal,
    .sticky-note-type-modal,
    .admin-user-edit-modal {
        top: 0;
        left: 0;
        right: auto;
        bottom: auto;
        width: var(--rt-2k-base-width);
        max-width: none;
        height: var(--rt-2k-base-height);
        min-height: var(--rt-2k-base-height);
        zoom: var(--rt-2k-scale);
    }

    .page-loader {
        width: var(--rt-2k-base-width);
        zoom: var(--rt-2k-scale);
    }

    .toast {
        zoom: var(--rt-2k-scale);
    }

    .login-page {
        min-height: var(--rt-2k-base-height);
    }

    .login-shell {
        zoom: var(--rt-2k-scale);
    }

    .modal-card {
        max-height: calc(var(--rt-2k-base-height) - 36px);
    }

    .deleted-job-modal-card {
        max-height: calc(var(--rt-2k-base-height) - 72px);
    }

    .sticky-note-popup-card {
        max-height: min(720px, calc(var(--rt-2k-base-height) - 44px));
    }

    .job-table-wrap,
    .log-table-wrap,
    .sticky-board-wrap {
        max-height: calc(var(--rt-2k-base-height) - 260px);
    }

    .table-pinned-panel {
        max-height: calc(var(--rt-2k-base-height) - 270px);
    }

    .table-pinned-list {
        max-height: calc(var(--rt-2k-base-height) - 350px);
    }

    .attendance-table-wrap {
        max-height: calc(var(--rt-2k-base-height) - 230px);
    }

    @supports not (zoom: 1) {
        .app-shell,
        .modal-backdrop,
        .sticky-note-modal,
        .sticky-note-type-modal,
        .admin-user-edit-modal,
        .page-loader,
        .login-shell {
            transform: scale(var(--rt-2k-scale));
            transform-origin: top left;
        }

        .toast {
            transform: scale(var(--rt-2k-scale));
            transform-origin: bottom right;
        }
    }
}

/* ==========================================================
   Sub-Full-HD comfort normaliser
   Renders desktop/laptop resolutions below 1920px with a
   Full-HD-like working density, so the UI does not feel too
   close while keeping it fitted to the available screen.
   ========================================================== */
@media (min-width: 1180px) and (max-width: 1919px) and (min-height: 650px) {
    :root {
        --rt-subfhd-scale: .75;
        --rt-subfhd-base-width: 133.333333vw;
        --rt-subfhd-base-height: 133.333333vh;
    }

    body {
        min-height: var(--rt-subfhd-base-height);
        overflow-x: hidden;
    }

    .app-shell {
        width: var(--rt-subfhd-base-width);
        max-width: none;
        min-height: var(--rt-subfhd-base-height);
        zoom: var(--rt-subfhd-scale);
    }

    body[data-view="calendar"] .app-shell,
    body[data-view="calendar"] .main-area,
    body[data-view="calendar"] .sticky-notes-panel,
    .app-shell .sidebar,
    .app-shell .sticky-notes-panel {
        height: var(--rt-subfhd-base-height);
        min-height: var(--rt-subfhd-base-height);
        max-height: var(--rt-subfhd-base-height);
    }

    .modal-backdrop,
    .sticky-note-modal,
    .sticky-note-type-modal,
    .admin-user-edit-modal {
        top: 0;
        left: 0;
        right: auto;
        bottom: auto;
        width: var(--rt-subfhd-base-width);
        max-width: none;
        height: var(--rt-subfhd-base-height);
        min-height: var(--rt-subfhd-base-height);
        zoom: var(--rt-subfhd-scale);
    }

    .page-loader,
    .toast,
    .login-shell {
        zoom: var(--rt-subfhd-scale);
    }

    .page-loader {
        width: var(--rt-subfhd-base-width);
    }

    .login-page {
        min-height: var(--rt-subfhd-base-height);
    }

    .modal-card {
        max-height: calc(var(--rt-subfhd-base-height) - 36px);
    }

    .deleted-job-modal-card {
        max-height: calc(var(--rt-subfhd-base-height) - 72px);
    }

    .sticky-note-popup-card {
        max-height: min(720px, calc(var(--rt-subfhd-base-height) - 44px));
    }

    .job-table-wrap,
    .log-table-wrap,
    .sticky-board-wrap {
        max-height: calc(var(--rt-subfhd-base-height) - 260px);
    }

    .table-pinned-panel {
        max-height: calc(var(--rt-subfhd-base-height) - 270px);
    }

    .table-pinned-list {
        max-height: calc(var(--rt-subfhd-base-height) - 350px);
    }

    .attendance-table-wrap {
        max-height: calc(var(--rt-subfhd-base-height) - 230px);
    }

    @supports not (zoom: 1) {
        .app-shell,
        .modal-backdrop,
        .sticky-note-modal,
        .sticky-note-type-modal,
        .admin-user-edit-modal,
        .page-loader,
        .login-shell {
            transform: scale(var(--rt-subfhd-scale));
            transform-origin: top left;
        }

        .toast {
            transform: scale(var(--rt-subfhd-scale));
            transform-origin: bottom right;
        }
    }
}

@media (min-width: 1800px) and (max-width: 1919px) and (min-height: 650px) {
    :root {
        --rt-subfhd-scale: .95;
        --rt-subfhd-base-width: 105.263158vw;
        --rt-subfhd-base-height: 105.263158vh;
    }
}

@media (min-width: 1680px) and (max-width: 1799px) and (min-height: 650px) {
    :root {
        --rt-subfhd-scale: .875;
        --rt-subfhd-base-width: 114.285714vw;
        --rt-subfhd-base-height: 114.285714vh;
    }
}

@media (min-width: 1600px) and (max-width: 1679px) and (min-height: 650px) {
    :root {
        --rt-subfhd-scale: .833333;
        --rt-subfhd-base-width: 120vw;
        --rt-subfhd-base-height: 120vh;
    }
}

@media (min-width: 1536px) and (max-width: 1599px) and (min-height: 650px) {
    :root {
        --rt-subfhd-scale: .8;
        --rt-subfhd-base-width: 125vw;
        --rt-subfhd-base-height: 125vh;
    }
}

@media (min-width: 1360px) and (max-width: 1439px) and (min-height: 650px) {
    :root {
        --rt-subfhd-scale: .711458;
        --rt-subfhd-base-width: 140.557185vw;
        --rt-subfhd-base-height: 140.557185vh;
    }
}

@media (min-width: 1280px) and (max-width: 1359px) and (min-height: 650px) {
    :root {
        --rt-subfhd-scale: .666667;
        --rt-subfhd-base-width: 150vw;
        --rt-subfhd-base-height: 150vh;
    }
}

@media (min-width: 1180px) and (max-width: 1279px) and (min-height: 650px) {
    :root {
        --rt-subfhd-scale: .625;
        --rt-subfhd-base-width: 160vw;
        --rt-subfhd-base-height: 160vh;
    }
}


/* ==========================================================
   Typography comfort pass
   Softer reading weight for normal text. Stronger weight is
   kept only for headings, actions, badges, and real highlights.
   ========================================================== */
:root {
    --text: #1f2937;
    --muted: #647084;
    --muted-2: #8b95a7;
}

body {
    font-weight: 400;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font-weight: 400;
}

.app-shell :where(p, small, span, em, td, li, input, select, textarea),
.login-shell :where(p, small, span, em, input, select, textarea),
.modal-card :where(p, small, span, em, input, select, textarea),
.sticky-note-modal :where(p, small, span, em, input, select, textarea),
.sticky-note-type-modal :where(p, small, span, em, input, select, textarea),
.admin-user-edit-modal :where(p, small, span, em, input, select, textarea) {
    font-weight: 400 !important;
}

.app-shell :where(.topbar p, .board-info p, .section-head p, .task-card p, .task-meta, .list-meta, .table-muted, .calendar-summary, .calendar-empty-mini, .dashboard-row small, .admin-page-header p, .admin-section-heading p, .sticky-notes-foot, .sticky-board-owner-row, .sticky-note-popup-date),
.login-shell :where(.login-card p, .login-hint),
.modal-card :where(.modal-header p, .confirm-copy p) {
    color: var(--muted) !important;
    line-height: 1.45;
}

.app-shell :where(label, th, .nav-item, .workspace-link, .soft-btn, .icon-btn, .text-btn, .tab, .task-action, .logout-link, .back-link, .workspace-mini-btn, .table-action-btn, .mobile-day-arrow, .status-filter-toggle, .status-filter-option, .process-options button),
.login-shell :where(label, button),
.modal-card :where(label, button, .search-select-option),
.sticky-note-modal :where(label, button),
.sticky-note-type-modal :where(button),
.admin-user-edit-modal :where(label, button) {
    font-weight: 500 !important;
}

.app-shell :where(.filters-panel label span, .task-form label span, .login-form label span, .field-card > span, .notes-card > span, .section-label-row span, .table-process-control span, .workspace-invite-tag-field > span, .workspace-access-head span),
.login-shell :where(.login-form label span),
.modal-card :where(.invoice-upload-label small) {
    font-weight: 500 !important;
    letter-spacing: .005em;
}

.app-shell :where(h1, h2, h3, h4, h5, h6, strong, b, .sidebar-brand strong, .login-brand strong, .workspace-copy strong, .user-chip strong, .stat-card strong, .day-header strong, .task-card h3, .calendar-summary strong, .overview-card strong, .setting-card strong, .table-title strong, .table-pinned-main strong, .admin-metric strong, .admin-section-heading h2, .sticky-board-title, .sticky-note-popup-head h2, .sticky-note-type-head h2, .empty-list strong, .sticky-empty-state strong),
.login-shell :where(h1, h2, h3, h4, h5, h6, strong, b),
.modal-card :where(h1, h2, h3, h4, h5, h6, strong, b) {
    font-weight: 600 !important;
}

.app-shell :where(.primary-btn, .danger-btn, .side-create, .today-month-btn, .mini-add, .brand-icon, .workspace-avatar, .user-chip > span, .badge, .team-sales-tag, .day-job-count, .process-pill, .process-pill strong, .progress-head strong, .progress-segment em, .table-count-pill, .table-index-badge, .table-status-pill, .table-pinned-status, .role-badge, .log-time-pill, .log-action-pill, .calendar-more, .calendar-sticky-note, .sticky-note-calendar-badge, .sticky-board-badge, .sticky-note-type-badge, .nav-item.active, .workspace-link.active, .tab.active, .status-filter-option.is-selected, .process-options button.active),
.login-shell :where(.primary-btn, .brand-icon),
.modal-card :where(.primary-btn, .danger-btn, .badge) {
    font-weight: 600 !important;
}

.app-shell :where(.local-loader, .sidebar-section p, .stat-card span, .legend, .progress-head, .admin-access-summary, .team-sales-field .field-note, .sticky-notes-kicker, .modal-kicker) {
    font-weight: 500 !important;
    letter-spacing: .03em;
}

.sidebar :where(.nav-item, .workspace-link, .logout-link, .sidebar-section p, .section-label-row span, .workspace-copy small, .user-chip small) {
    font-weight: 500 !important;
}

.sidebar :where(.sidebar-brand strong, .workspace-copy strong, .user-chip strong, .sidebar-admin-panel-btn strong) {
    font-weight: 600 !important;
}

/* ==========================================================
   Tab weight + Calendar layout text stability
   Keep tab text slightly stronger without changing width between
   active/inactive states, and keep Calendar toolbar flow aligned
   with the other views.
   ========================================================== */
.app-shell .board-toolbar .tabs {
    align-items: stretch !important;
}

.app-shell .board-toolbar .tab {
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-align: center !important;
    letter-spacing: 0 !important;
}

.app-shell .board-toolbar .tab:hover,
.app-shell .board-toolbar .tab.active {
    font-weight: 600 !important;
}

@media (min-width: 641px) {
    .app-shell .board-toolbar .tab {
        min-height: 42px !important;
        height: 42px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important;
    }
}

@media (min-width: 821px) {
    body[data-view="calendar"] .topbar {
        margin-bottom: 16px !important;
    }

    body[data-view="calendar"] .board-toolbar {
        align-items: center !important;
        margin-bottom: 14px !important;
    }

    body[data-view="calendar"] .board-toolbar .tabs {
        flex: 0 1 auto !important;
    }

    body[data-view="calendar"] .stats-grid {
        display: grid !important;
        margin-bottom: 12px !important;
    }
}

.calendar-job,
.calendar-job span,
.calendar-summary,
.calendar-empty-mini,
.calendar-more {
    line-height: 1.2 !important;
}

.calendar-job span {
    display: block !important;
    font-weight: 500 !important;
}

/* ==========================================================
   Calendar tab vertical alignment fix
   Prevent the Calendar tab from dropping lower than the other
   view tabs when the toolbar wraps or when Calendar is active.
   ========================================================== */
@media (min-width: 641px) {
    .app-shell .board-toolbar {
        align-items: center !important;
    }

    .app-shell .board-toolbar .tabs {
        align-items: center !important;
        flex-wrap: nowrap !important;
        min-height: 42px !important;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .app-shell .board-toolbar .tabs::-webkit-scrollbar {
        display: none;
    }

    .app-shell .board-toolbar .tab,
    .app-shell .board-toolbar .tab[data-view-target="calendar"] {
        align-self: center !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 12px !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        line-height: 1 !important;
        position: relative !important;
        top: 0 !important;
        transform: none !important;
        vertical-align: middle !important;
    }

    body[data-view="calendar"] .board-toolbar,
    body[data-view="calendar"] .board-toolbar .tabs,
    body[data-view="calendar"] .board-toolbar .tab {
        align-items: center !important;
    }
}

@media (min-width: 821px) {
    body[data-view="calendar"] .topbar {
        margin-bottom: 10px !important;
    }

    body[data-view="calendar"] .board-toolbar {
        margin-bottom: 8px !important;
    }

    body[data-view="calendar"] .stats-grid {
        display: none !important;
    }
}

/* ==========================================================
   Scroll bottom whitespace fix
   Keeps the scaled Sub-Full-HD density from making the real
   document taller than the visible viewport, which caused a
   long empty scroll area at the bottom.
   ========================================================== */
@media (min-width: 1180px) and (max-width: 1919px) and (min-height: 650px) {
    html,
    body {
        min-height: 100vh !important;
        min-height: 100dvh !important;
    }

    body {
        height: auto !important;
        overflow-x: hidden !important;
    }

    body:not([data-view="calendar"]) .app-shell {
        min-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
    }

    body[data-view="calendar"] {
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
    }

    body[data-view="calendar"] .app-shell,
    body[data-view="calendar"] .main-area {
        height: calc(100dvh / var(--rt-subfhd-scale)) !important;
        min-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
        max-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
    }

    body[data-view="calendar"] .sticky-notes-panel,
    .app-shell .sidebar,
    .app-shell .sticky-notes-panel {
        height: calc(100dvh / var(--rt-subfhd-scale)) !important;
        min-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
        max-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
    }

    .login-page {
        min-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
    }
}

/* ==========================================================
   Calendar viewport fill + bottom whitespace final fix
   Restores Calendar to a true full-height flex layout after
   the density normalisers, so the month grid fills the visible
   area and no empty page scroll remains below it.
   ========================================================== */
@media (min-width: 821px) {
    body[data-view="calendar"] {
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
    }

    body[data-view="calendar"] .app-shell {
        overflow: hidden !important;
    }

    body[data-view="calendar"] .main-area {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        padding-bottom: 10px !important;
    }

    body[data-view="calendar"] #calendarView.active {
        display: flex !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden !important;
        flex-direction: column !important;
    }

    body[data-view="calendar"] .calendar-shell {
        display: flex !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden !important;
        flex-direction: column !important;
    }

    body[data-view="calendar"] .calendar-grid {
        display: grid !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        grid-template-rows: repeat(6, minmax(0, 1fr)) !important;
        overflow: hidden !important;
    }

    body[data-view="calendar"] .calendar-cell {
        min-height: 0 !important;
        overflow: hidden !important;
    }
}

@media (min-width: 1180px) and (max-width: 1919px) and (min-height: 650px) {
    body[data-view="calendar"] .app-shell,
    body[data-view="calendar"] .main-area,
    body[data-view="calendar"] .sticky-notes-panel,
    body[data-view="calendar"] .sidebar {
        height: calc(100dvh / var(--rt-subfhd-scale)) !important;
        min-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
        max-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
    }

    @supports not (zoom: 1) {
        html,
        body[data-view="calendar"] {
            width: 100vw !important;
            height: 100vh !important;
            height: 100dvh !important;
            min-height: 100vh !important;
            min-height: 100dvh !important;
            max-height: 100vh !important;
            max-height: 100dvh !important;
            overflow: hidden !important;
        }

        body[data-view="calendar"] .app-shell {
            position: fixed !important;
            inset: 0 auto auto 0 !important;
            transform: scale(var(--rt-subfhd-scale)) !important;
            transform-origin: top left !important;
            will-change: transform;
        }
    }
}

/* ==========================================================
   Calendar scroll restore / clipped content fix
   The previous fill-height pass removed the bottom whitespace by
   locking Calendar overflow. This keeps that clean viewport but
   puts the scroll back on the main Calendar content area, so the
   month grid can extend naturally instead of being cut off.
   ========================================================== */
@media (min-width: 821px) {
    body[data-view="calendar"] {
        overflow: hidden !important;
    }

    body[data-view="calendar"] .app-shell {
        overflow: hidden !important;
    }

    body[data-view="calendar"] .main-area {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding-bottom: 18px !important;
        overscroll-behavior: contain !important;
    }

    body[data-view="calendar"] #calendarView.active {
        display: flex !important;
        flex: 1 0 auto !important;
        flex-direction: column !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-shell {
        display: flex !important;
        flex: 1 0 auto !important;
        flex-direction: column !important;
        min-height: calc(100dvh - 178px) !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-grid {
        display: grid !important;
        flex: 1 0 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        grid-template-rows: repeat(6, minmax(118px, 1fr)) !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-cell {
        min-height: 118px !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-job-list {
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (min-width: 1180px) and (max-width: 1919px) and (min-height: 650px) {
    body[data-view="calendar"] .main-area {
        height: calc(100dvh / var(--rt-subfhd-scale)) !important;
        max-height: calc(100dvh / var(--rt-subfhd-scale)) !important;
    }

    body[data-view="calendar"] .calendar-shell {
        min-height: calc((100dvh - 178px) / var(--rt-subfhd-scale)) !important;
    }
}

@media (min-width: 2200px) and (max-width: 2800px) and (min-height: 1200px) and (max-height: 1700px) {
    body[data-view="calendar"] .main-area {
        height: var(--rt-2k-base-height) !important;
        max-height: var(--rt-2k-base-height) !important;
    }

    body[data-view="calendar"] .calendar-shell {
        min-height: calc((100dvh - 178px) / var(--rt-2k-scale)) !important;
    }
}

/* ==========================================================
   Calendar scroll final 2K-safe override
   Keep the calendar in normal document flow so it can scroll on
   2K/QHD and browser-zoomed desktops, while still filling the
   visible screen when the month has fewer rows/jobs.
   ========================================================== */
@media (min-width: 821px) {
    body[data-view="calendar"] {
        height: auto !important;
        max-height: none !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body[data-view="calendar"] .app-shell {
        height: auto !important;
        max-height: none !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: visible !important;
        align-items: stretch !important;
    }

    body[data-view="calendar"] .main-area {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: visible !important;
        padding-bottom: 18px !important;
        overscroll-behavior: auto !important;
    }

    body[data-view="calendar"] #calendarView.active {
        display: flex !important;
        flex: 1 1 auto !important;
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-shell {
        display: flex !important;
        flex: 1 1 auto !important;
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        min-height: calc(100dvh - 178px) !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-grid {
        display: grid !important;
        flex: 1 1 auto !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        grid-template-rows: repeat(6, minmax(118px, 1fr)) !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-cell {
        height: auto !important;
        max-height: none !important;
        min-height: 118px !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-job-list,
    body[data-view="calendar"] .calendar-job {
        max-height: none !important;
    }
}

@media (min-width: 2200px) and (max-width: 2800px) and (min-height: 1200px) and (max-height: 1700px) {
    body[data-view="calendar"] {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
    }

    body[data-view="calendar"] .app-shell,
    body[data-view="calendar"] .main-area {
        height: auto !important;
        max-height: none !important;
        min-height: var(--rt-2k-base-height) !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-shell {
        height: auto !important;
        max-height: none !important;
        min-height: calc((100dvh - 178px) / var(--rt-2k-scale)) !important;
        overflow: visible !important;
    }
}

@media (min-width: 1180px) and (max-width: 1919px) and (min-height: 650px) {
    body[data-view="calendar"] {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
    }

    body[data-view="calendar"] .app-shell,
    body[data-view="calendar"] .main-area {
        height: auto !important;
        max-height: none !important;
        min-height: var(--rt-subfhd-base-height) !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-shell {
        height: auto !important;
        max-height: none !important;
        min-height: calc((100dvh - 178px) / var(--rt-subfhd-scale)) !important;
        overflow: visible !important;
    }
}

/* ==========================================================
   Desktop viewport edge balance
   Adds a small right-side safety gutter so full-screen content
   does not sit too close to the browser scrollbar when the
   sticky notes side panel is hidden.
   ========================================================== */
@media (min-width: 821px) {
    :root {
        --rt-page-edge-balance: clamp(6px, 0.45vw, 10px);
    }

    .main-area {
        padding-inline-end: calc(var(--rt-content-gap, clamp(10px, 0.8vw, 16px)) + var(--rt-page-edge-balance));
    }
}

@media (min-width: 1600px) {
    .main-area {
        padding-inline-end: calc(clamp(14px, 1vw, 18px) + var(--rt-page-edge-balance, 10px));
    }
}

@media (min-width: 1180px) and (max-width: 1919px) and (min-height: 650px) {
    :root {
        --rt-page-edge-balance: 12px;
    }
}

/* Mobile Table View column alignment fix
   Current job/pinned tables have 12 columns. This override keeps the mobile
   widths and sticky offsets matched so cells do not crop or layer incorrectly. */
@media (max-width: 720px) {
    #tableView .job-table-wrap,
    #pinnedView .job-table-wrap {
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 14px !important;
    }

    #tableView .job-table,
    #pinnedView .job-table {
        width: max-content !important;
        min-width: 1460px !important;
        table-layout: fixed !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    #tableView .job-table th,
    #tableView .job-table td,
    #pinnedView .job-table th,
    #pinnedView .job-table td {
        box-sizing: border-box !important;
        position: static !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 9px 8px !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }

    #tableView .job-table thead th,
    #pinnedView .job-table thead th {
        position: sticky !important;
        top: 0 !important;
        z-index: 6 !important;
        background: #f8f9fc !important;
    }

    #tableView .job-table th:nth-child(1),
    #tableView .job-table td:nth-child(1),
    #pinnedView .job-table th:nth-child(1),
    #pinnedView .job-table td:nth-child(1) {
        position: sticky !important;
        left: 0 !important;
        z-index: 9 !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        text-align: center !important;
        background: #fff !important;
        box-shadow: 1px 0 0 var(--line) !important;
    }

    #tableView .job-table th:nth-child(1),
    #pinnedView .job-table th:nth-child(1) {
        top: 0 !important;
        z-index: 13 !important;
        background: #f8f9fc !important;
    }

    #tableView .job-table th:nth-child(2),
    #tableView .job-table td:nth-child(2),
    #pinnedView .job-table th:nth-child(2),
    #pinnedView .job-table td:nth-child(2) {
        position: sticky !important;
        left: 44px !important;
        z-index: 9 !important;
        width: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
        text-align: center !important;
        background: #fff !important;
        box-shadow: 1px 0 0 var(--line) !important;
    }

    #tableView .job-table th:nth-child(2),
    #pinnedView .job-table th:nth-child(2) {
        top: 0 !important;
        z-index: 13 !important;
        background: #f8f9fc !important;
    }

    #tableView .job-table th:nth-child(3),
    #tableView .job-table td:nth-child(3),
    #pinnedView .job-table th:nth-child(3),
    #pinnedView .job-table td:nth-child(3) {
        position: sticky !important;
        left: 98px !important;
        z-index: 9 !important;
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        background: #fff !important;
        box-shadow: 1px 0 0 var(--line) !important;
    }

    #tableView .job-table th:nth-child(3),
    #pinnedView .job-table th:nth-child(3) {
        top: 0 !important;
        z-index: 13 !important;
        background: #f8f9fc !important;
    }

    #tableView .job-table th:nth-child(4),
    #tableView .job-table td:nth-child(4),
    #pinnedView .job-table th:nth-child(4),
    #pinnedView .job-table td:nth-child(4) {
        width: 170px !important;
        min-width: 170px !important;
        max-width: 170px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #tableView .job-table th:nth-child(5),
    #tableView .job-table td:nth-child(5),
    #pinnedView .job-table th:nth-child(5),
    #pinnedView .job-table td:nth-child(5) {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #tableView .job-table th:nth-child(6),
    #tableView .job-table td:nth-child(6),
    #pinnedView .job-table th:nth-child(6),
    #pinnedView .job-table td:nth-child(6) {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #tableView .job-table th:nth-child(7),
    #tableView .job-table td:nth-child(7),
    #pinnedView .job-table th:nth-child(7),
    #pinnedView .job-table td:nth-child(7) {
        width: 125px !important;
        min-width: 125px !important;
        max-width: 125px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #tableView .job-table th:nth-child(8),
    #tableView .job-table td:nth-child(8),
    #pinnedView .job-table th:nth-child(8),
    #pinnedView .job-table td:nth-child(8) {
        width: 108px !important;
        min-width: 108px !important;
        max-width: 108px !important;
    }

    #tableView .job-table th:nth-child(9),
    #tableView .job-table td:nth-child(9),
    #pinnedView .job-table th:nth-child(9),
    #pinnedView .job-table td:nth-child(9) {
        width: 282px !important;
        min-width: 282px !important;
        max-width: 282px !important;
        overflow: visible !important;
    }

    #tableView .job-table th:nth-child(10),
    #tableView .job-table td:nth-child(10),
    #pinnedView .job-table th:nth-child(10),
    #pinnedView .job-table td:nth-child(10) {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
    }

    #tableView .job-table th:nth-child(11),
    #tableView .job-table td:nth-child(11),
    #pinnedView .job-table th:nth-child(11),
    #pinnedView .job-table td:nth-child(11) {
        width: 92px !important;
        min-width: 92px !important;
        max-width: 92px !important;
    }

    #tableView .job-table th:nth-child(12),
    #tableView .job-table td:nth-child(12),
    #pinnedView .job-table th:nth-child(12),
    #pinnedView .job-table td:nth-child(12) {
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
    }

    #tableView .table-title,
    #pinnedView .table-title {
        display: block !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    #tableView .table-title strong,
    #pinnedView .table-title strong {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #tableView .table-date-btn,
    #pinnedView .table-date-btn {
        max-width: 104px !important;
    }

    #tableView .table-process-grid,
    #pinnedView .table-process-grid {
        width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    #tableView .table-process-control,
    #pinnedView .table-process-control {
        min-width: 0 !important;
    }

    #tableView .table-process-select,
    #pinnedView .table-process-select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding-right: 18px !important;
        font-size: 10px !important;
    }

    #tableView .table-actions,
    #pinnedView .table-actions {
        width: 100% !important;
        min-width: 0 !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }

    #tableView .table-action-btn,
    #pinnedView .table-action-btn {
        white-space: nowrap !important;
        padding-inline: 8px !important;
    }

    #tableView .job-table-row:hover td,
    #pinnedView .job-table-row:hover td {
        background: #fbfcff !important;
    }

    #tableView .job-table-row:hover td:nth-child(1),
    #tableView .job-table-row:hover td:nth-child(2),
    #tableView .job-table-row:hover td:nth-child(3),
    #pinnedView .job-table-row:hover td:nth-child(1),
    #pinnedView .job-table-row:hover td:nth-child(2),
    #pinnedView .job-table-row:hover td:nth-child(3) {
        background: #fbfcff !important;
    }

    #tableView .job-table-empty-row td,
    #pinnedView .job-table-empty-row td {
        position: static !important;
        left: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        background: #fff !important;
        box-shadow: none !important;
    }
}

/* Mobile: replace title/description area with compact search row */
@media (max-width: 640px) {
    .topbar {
        display: grid !important;
        grid-template-columns: 38px minmax(0, 1fr) 38px !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px !important;
        margin-bottom: 8px !important;
    }

    .topbar-left,
    .topbar-actions {
        display: contents !important;
    }

    .topbar-left > div {
        display: none !important;
    }

    .topbar-left {
        padding-right: 0 !important;
    }

    .mobile-menu-toggle {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        border-radius: 11px !important;
    }

    .topbar-actions .search-box {
        grid-column: 2 !important;
        grid-row: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 38px !important;
        min-height: 38px !important;
        flex: none !important;
        flex-basis: auto !important;
        border-radius: 11px !important;
        padding-inline: 10px !important;
    }

    .topbar-actions .search-box input {
        font-size: 12.5px !important;
    }

    .topbar-actions #filterToggle.filter-icon-btn {
        position: static !important;
        grid-column: 3 !important;
        grid-row: 1 !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        border-radius: 11px !important;
        justify-self: end !important;
    }

    .topbar-actions #createTaskBtn {
        display: none !important;
    }
}

/* Mobile: only outer compact top search bar uses dark sidebar tone */
@media (max-width: 640px) {
    .topbar {
        background: #0f172a !important;
        border-color: #1e293b !important;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18) !important;
    }
}

/* Mobile: grey square header bar with balanced top/bottom spacing */
@media (max-width: 640px) {
    .main-area {
        padding-top: 8px !important;
    }

    .topbar {
        background: #f3f4f6 !important;
        border: 0 !important;
        border-bottom: 1px solid #e5e7eb !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 -10px 8px -10px !important;
        padding: 8px 10px !important;
    }
}


/* Mobile timeline card: balanced card spacing and thicker progress status boxes */
@media (max-width: 640px) {
    .mobile-day-list {
        gap: 12px !important;
        padding: 1px 2px 20px 2px !important;
    }

    .mobile-day-list .task-card {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        min-height: 168px !important;
        padding: 14px !important;
        border-radius: 16px !important;
    }

    .mobile-day-list .task-card-top {
        align-items: center !important;
        gap: 8px !important;
        min-height: 30px !important;
    }

    .mobile-day-list .badges {
        flex: 1 1 auto !important;
    }

    .mobile-day-list .badge,
    .mobile-day-list .team-sales-tag {
        min-height: 28px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 10px !important;
        border-radius: 10px !important;
        font-size: 10.5px !important;
        line-height: 1 !important;
    }

    .mobile-day-list .team-sales-tag {
        max-width: 44% !important;
        text-align: center !important;
    }

    .mobile-day-list .task-progress {
        margin: 0 !important;
        padding: 9px !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, .58) !important;
        border: 1px solid rgba(226, 232, 240, .78) !important;
    }

    .mobile-day-list .progress-head {
        min-height: 22px !important;
        margin-bottom: 7px !important;
        align-items: center !important;
        font-size: 10.5px !important;
    }

    .mobile-day-list .progress-head strong {
        min-height: 22px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 8px !important;
        font-size: 10.5px !important;
    }

    .mobile-day-list .progress-bar {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 5px !important;
        min-height: 28px !important;
    }

    .mobile-day-list .progress-segment {
        min-height: 28px !important;
        border-radius: 9px !important;
        padding: 0 3px !important;
    }

    .mobile-day-list .progress-segment em {
        font-size: 8.5px !important;
        letter-spacing: 0 !important;
    }

    .mobile-day-list .task-card h3 {
        min-height: 40px !important;
        margin: 0 !important;
        line-height: 1.35 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .mobile-day-list .task-sales,
    .mobile-day-list .total-sales-line {
        margin-top: -4px !important;
    }

    .mobile-day-list .task-actions {
        margin-top: auto !important;
        gap: 8px !important;
    }

    .mobile-day-list .task-action {
        min-height: 36px !important;
        border-radius: 11px !important;
    }
}

/* Mobile Edit Job popup: single vertical scroll, no horizontal overflow */
@media (max-width: 640px) {
    body:has(#taskModal:not([hidden])) {
        width: 100% !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    #taskModal.modal-backdrop {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 100dvh !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        overscroll-behavior: contain !important;
    }

    #taskModal .job-modal-card {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        overscroll-behavior: contain !important;
    }

    #taskModal .job-modal-header {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #taskModal .job-modal-header > div:first-child {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    #taskModal .job-form {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    #taskModal .job-form-layout {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: block !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #taskModal .sticky-actions,
    #taskModal .modal-actions.sticky-actions {
        position: static !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    #taskModal .form-section,
    #taskModal .form-grid,
    #taskModal .field-card,
    #taskModal .process-tracker,
    #taskModal .process-step,
    #taskModal .process-step-copy,
    #taskModal .process-options,
    #taskModal .search-select,
    #taskModal .invoice-file-control,
    #taskModal .current-invoice,
    #taskModal .notes-chat-section,
    #taskModal .notes-chat-wrap,
    #taskModal .chat-compose-card,
    #taskModal .chat-bubble-row,
    #taskModal .chat-bubble {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    #taskModal input,
    #taskModal select,
    #taskModal textarea,
    #taskModal button {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #taskModal .search-select-list {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    #taskModal .process-options {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    #taskModal .process-options button {
        min-width: 0 !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
        white-space: nowrap !important;
    }

    #taskModal .current-invoice,
    #taskModal .selected-invoice-name,
    #taskModal .chat-bubble p,
    #taskModal textarea {
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }
}

/* Mobile timeline cards: match desktop style - white card with coloured outline only */
@media (max-width: 640px) {
    .mobile-day-list .task-card,
    .mobile-day-list .task-card:nth-child(5n + 1),
    .mobile-day-list .task-card:nth-child(5n + 2),
    .mobile-day-list .task-card:nth-child(5n + 3),
    .mobile-day-list .task-card:nth-child(5n + 4),
    .mobile-day-list .task-card:nth-child(5n + 5) {
        background: #ffffff !important;
    }

    .mobile-day-list .task-card {
        border: 1px solid var(--line) !important;
        box-shadow: var(--shadow-soft) !important;
    }

    .mobile-day-list .task-card.status-in_progress {
        border-color: rgba(245, 158, 11, .44) !important;
        box-shadow: 0 0 0 1px rgba(245, 158, 11, .12), var(--shadow-soft) !important;
    }

    .mobile-day-list .task-card.status-stuck {
        border-color: rgba(239, 68, 68, .44) !important;
        box-shadow: 0 0 0 1px rgba(239, 68, 68, .12), var(--shadow-soft) !important;
    }

    .mobile-day-list .task-card.status-completed {
        border-color: rgba(34, 197, 94, .42) !important;
        box-shadow: 0 0 0 1px rgba(34, 197, 94, .11), var(--shadow-soft) !important;
    }
}

/* Mobile timeline: show the whole month in one vertical scroll */
@media (max-width: 640px) {
    .mobile-day-card {
        border-radius: 16px !important;
        padding: 10px !important;
        background: #ffffff !important;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .06) !important;
        touch-action: pan-y !important;
    }

    .mobile-day-nav {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0 !important;
        margin-bottom: 10px !important;
    }

    .mobile-day-arrow,
    .mobile-day-swipe-hint {
        display: none !important;
    }

    .mobile-day-title {
        width: 100% !important;
        min-height: 38px !important;
        border-radius: 12px !important;
        pointer-events: none !important;
        background: #f8fafc !important;
        border-color: #e2e8f0 !important;
    }

    .mobile-day-meta {
        margin: 0 0 10px !important;
    }

    .mobile-day-meta span {
        background: #f1f5f9 !important;
        color: #334155 !important;
    }

    .mobile-day-list {
        gap: 10px !important;
        padding: 0 0 18px !important;
    }

    .mobile-day-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 16px !important;
        background: #ffffff !important;
        padding: 9px !important;
        overflow: visible !important;
    }

    .mobile-day-section.is-today {
        border-color: rgba(79, 70, 229, .38) !important;
        box-shadow: 0 0 0 1px rgba(79, 70, 229, .08) !important;
    }

    .mobile-day-section-header {
        display: grid !important;
        grid-template-columns: 44px minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 9px !important;
        min-width: 0 !important;
    }

    .mobile-day-section-date {
        width: 44px !important;
        height: 44px !important;
        border-radius: 13px !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
        overflow: hidden !important;
    }

    .mobile-day-section-date strong {
        font-size: 17px !important;
        font-weight: 950 !important;
        color: #0f172a !important;
        line-height: 1 !important;
    }

    .mobile-day-section-date span {
        margin-top: 3px !important;
        font-size: 9.5px !important;
        font-weight: 900 !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        letter-spacing: .02em !important;
    }

    .mobile-day-section-copy {
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
    }

    .mobile-day-section-copy b {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: #111827 !important;
        font-size: 13px !important;
        font-weight: 950 !important;
        line-height: 1.15 !important;
    }

    .mobile-day-section-copy small {
        color: #64748b !important;
        font-size: 11px !important;
        font-weight: 850 !important;
        line-height: 1.1 !important;
    }

    .mobile-day-section-add {
        appearance: none !important;
        border: 1px solid #dbe3ef !important;
        background: #ffffff !important;
        color: #334155 !important;
        min-height: 34px !important;
        border-radius: 11px !important;
        padding: 0 10px !important;
        font-size: 11px !important;
        font-weight: 950 !important;
        font-family: inherit !important;
        white-space: nowrap !important;
    }

    .mobile-day-section-jobs {
        display: flex !important;
        flex-direction: column !important;
        gap: 9px !important;
        margin-top: 9px !important;
        min-width: 0 !important;
    }

    .mobile-day-section-empty {
        margin-top: 8px !important;
        min-height: 34px !important;
        border-radius: 12px !important;
        border: 1px dashed #e2e8f0 !important;
        background: #f8fafc !important;
        color: #94a3b8 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 11.5px !important;
        font-weight: 850 !important;
    }

    .mobile-day-section .task-card {
        margin: 0 !important;
    }

    .mobile-day-list .mobile-day-section .task-card:last-child {
        margin-bottom: 0 !important;
    }

    .mobile-day-list .mobile-day-section:last-child {
        margin-bottom: calc(22px + env(safe-area-inset-bottom)) !important;
    }
}


/* Mobile timeline header: remove large month box, keep month as small chip beside job count */
@media (max-width: 640px) {
    .mobile-day-card .mobile-day-nav {
        display: none !important;
    }

    .mobile-day-card .mobile-day-meta {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 8px !important;
        margin: 0 0 10px !important;
    }

    .mobile-day-card #mobileDayCount {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 36px !important;
        padding: 5px 7px 5px 10px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        background: #f8fafc !important;
        color: #111827 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .mobile-day-card #mobileDayCount .mobile-job-count-text,
    .mobile-day-card #mobileDayCount .mobile-month-chip {
        min-height: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        display: inline-flex !important;
        align-items: center !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    .mobile-day-card #mobileDayCount .mobile-job-count-text {
        min-width: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #111827 !important;
        font-size: 12px !important;
        font-weight: 950 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .mobile-day-card #mobileDayCount .mobile-month-chip {
        flex: 0 0 auto !important;
        margin-left: auto !important;
        max-width: 88px !important;
        min-height: 24px !important;
        padding: 0 8px !important;
        border-radius: 8px !important;
        background: #e2e8f0 !important;
        color: #475569 !important;
        font-size: 10.5px !important;
        font-weight: 950 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .mobile-day-card .mobile-day-add {
        min-height: 36px !important;
        height: 36px !important;
        border-radius: 12px !important;
        padding: 0 12px !important;
        white-space: nowrap !important;
    }
}

/* Sidebar menu + compact workspace switcher */
.sidebar-menu-section {
    margin-top: 20px;
}

.sidebar-view-list.tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    border-bottom: 0;
}

.sidebar-view-list .tab.sidebar-view-btn {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.1;
    text-align: left;
    box-shadow: none;
}

.sidebar-view-list .tab.sidebar-view-btn:hover,
.sidebar-view-list .tab.sidebar-view-btn.active {
    background: rgba(79, 93, 247, 0.16);
    border-color: rgba(99, 102, 241, 0.22);
    color: #ffffff;
}

.sidebar-view-list .tab.sidebar-view-btn.active {
    box-shadow: inset 3px 0 0 #4f5df7;
}

.sidebar-view-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 28px;
    border-radius: 9px;
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .02em;
}

.sidebar-view-list .tab.sidebar-view-btn.active .sidebar-view-icon,
.sidebar-view-list .tab.sidebar-view-btn:hover .sidebar-view-icon {
    background: rgba(79, 93, 247, 0.24);
    color: #ffffff;
}

.workspace-switch-card {
    border: 1px solid #26344d;
    border-radius: 15px;
    background: #111c33;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.workspace-switch-label {
    display: block;
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.workspace-switch-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.workspace-switch-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
}

.workspace-switcher {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #0f172a;
    color: #f8fafc;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    padding: 0 32px 0 11px;
    outline: 0;
    cursor: pointer;
}

.workspace-switcher:focus {
    border-color: rgba(99, 102, 241, 0.72);
    box-shadow: 0 0 0 3px rgba(79, 93, 247, 0.18);
}

.workspace-active-settings {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
}

.workspace-switch-desc {
    display: block;
    color: #94a3b8;
    font-size: 11.5px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.board-toolbar .month-picker {
    margin-left: auto;
}

@media (max-width: 900px) {
    .sidebar-view-list.tabs {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .sidebar-view-list .tab.sidebar-view-btn {
        min-height: 42px;
    }

    .workspace-switch-card {
        padding: 10px;
    }

    .workspace-list {
        grid-auto-flow: row !important;
        grid-auto-columns: initial !important;
        grid-template-columns: 1fr !important;
    }

    .board-toolbar {
        align-items: stretch;
    }

    .board-toolbar .month-picker {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .sidebar-menu-section {
        margin-top: 16px;
    }

    .sidebar-view-list.tabs {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 7px !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
    }

    .sidebar-view-list .tab.sidebar-view-btn {
        min-height: 41px !important;
        height: auto !important;
        padding: 9px 10px !important;
        border: 1px solid transparent !important;
        border-radius: 13px !important;
        font-size: 13px !important;
        justify-content: flex-start !important;
        line-height: 1.1 !important;
        white-space: normal !important;
        box-shadow: none !important;
    }

    .sidebar-view-list .tab.sidebar-view-btn.active {
        background: rgba(79, 93, 247, 0.18) !important;
        color: #ffffff !important;
        box-shadow: inset 3px 0 0 #4f5df7 !important;
    }

    .workspace-switch-row {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        gap: 7px;
    }

    .workspace-switcher {
        height: 37px;
        font-size: 12.5px;
    }
}

/* Desktop restore + mobile-only sidebar navigation/workspace switcher */
.workspace-mobile-switch {
    display: none;
}

@media (min-width: 901px) {
    .sidebar-menu-section {
        display: none !important;
    }

    .workspace-mobile-switch {
        display: none !important;
    }

    .workspace-list-desktop {
        display: grid !important;
    }

    .board-toolbar {
        justify-content: space-between !important;
        align-items: center !important;
    }

    .board-toolbar > .tabs {
        display: flex !important;
    }

    .board-toolbar .month-picker {
        margin-left: auto !important;
    }
}

@media (max-width: 900px) {
    .sidebar-menu-section {
        display: block !important;
    }

    .workspace-mobile-switch {
        display: block !important;
    }

    .workspace-list-desktop {
        display: none !important;
    }

    .workspace-list-desktop.is-mobile-visible {
        display: grid !important;
    }

    .board-toolbar {
        justify-content: flex-end !important;
        align-items: stretch !important;
    }

    .board-toolbar > .tabs {
        display: none !important;
    }

    .board-toolbar .month-picker {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Mobile workspace dropdown: match the normal active workspace card style */
.workspace-switch-picker {
    position: relative;
    min-width: 0;
}

.workspace-switch-picker .workspace-switch-card {
    width: 100%;
    min-height: 52px;
    padding: 9px;
    padding-right: 38px;
    border: 1px solid #26344d;
    border-radius: 14px;
    background: #162033;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: none;
    outline: 1px solid rgba(79, 93, 247, 0.28);
}

.workspace-switch-picker .workspace-switch-card .workspace-avatar {
    background: #4f5df7;
    color: #ffffff;
}

.workspace-switch-picker .workspace-switch-card .workspace-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.workspace-switch-picker .workspace-switch-card .workspace-copy strong {
    color: #f8fafc;
    font-size: 13px;
}

.workspace-switch-picker .workspace-switch-card .workspace-copy small {
    color: #94a3b8;
    font-size: 11px;
    margin-top: 2px;
}

.workspace-dropdown-caret {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    transform: translateY(-50%);
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.workspace-dropdown-caret svg {
    width: 16px;
    height: 16px;
    display: block;
}

.workspace-switch-picker .workspace-switcher {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    min-height: 52px;
    border: 0;
    opacity: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.workspace-mobile-switch .workspace-switch-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
}

.workspace-mobile-switch .workspace-active-settings {
    width: 42px;
    min-width: 42px;
    height: 52px;
    min-height: 52px;
    border-radius: 14px;
    align-self: stretch;
}

@media (max-width: 640px) {
    .workspace-mobile-switch .workspace-switch-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px;
    }

    .workspace-switch-picker .workspace-switch-card {
        min-height: 50px;
        border-radius: 13px;
        padding: 8px 36px 8px 8px;
    }

    .workspace-switch-picker .workspace-switcher {
        min-height: 50px;
    }

    .workspace-mobile-switch .workspace-active-settings {
        width: 40px;
        min-width: 40px;
        height: 50px;
        min-height: 50px;
        border-radius: 13px;
    }
}


.workspace-form [hidden],
.workspace-settings-section[hidden] {
    display: none !important;
}

.workspace-settings-main {
    display: grid;
    gap: 0;
}

.workspace-section-switch-btn {
    width: 100%;
    margin-top: 14px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 15px;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease, background 0.16s ease;
}

.workspace-section-switch-btn:hover,
.workspace-section-switch-btn:focus-visible {
    border-color: rgba(79, 93, 247, 0.35);
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    outline: none;
}

.workspace-section-switch-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #eef2ff;
    color: #4f5df7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 950;
    flex: 0 0 auto;
}

.workspace-section-switch-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
    flex: 1 1 auto;
}

.workspace-section-switch-copy strong {
    color: #0f172a;
    font-size: 13px;
    font-weight: 950;
}

.workspace-section-switch-copy small {
    color: #64748b;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
}

.workspace-section-switch-arrow {
    color: #94a3b8;
    font-size: 26px;
    line-height: 1;
    flex: 0 0 auto;
}

.workspace-tab-back-btn {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 11px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.workspace-tab-back-btn:hover,
.workspace-tab-back-btn:focus-visible {
    background: #f1f5f9;
    border-color: rgba(79, 93, 247, 0.28);
    outline: none;
}

/* Workspace tab visibility settings */
.workspace-tab-settings {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
    padding: 14px;
    margin-top: 14px;
}

.workspace-tab-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.workspace-tab-settings-head > div {
    min-width: 0;
    flex: 1 1 auto;
}

.workspace-tab-settings-head strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 950;
}

.workspace-tab-settings-head span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

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

.workspace-tab-device-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    padding: 10px;
    display: grid;
    gap: 7px;
}

.workspace-tab-device-title {
    color: #111827;
    font-size: 12px;
    font-weight: 950;
    margin-bottom: 2px;
}

.workspace-tab-check {
    min-height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    background: #ffffff;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    user-select: none;
}

.workspace-tab-check input {
    width: 16px;
    height: 16px;
    accent-color: #4f5df7;
    flex: 0 0 auto;
}

.workspace-tab-check:has(input:checked) {
    border-color: rgba(79, 93, 247, 0.34);
    background: #eef2ff;
    color: #1e1b4b;
}

@supports not selector(:has(*)) {
    .workspace-tab-check input:checked + span {
        color: #1e1b4b;
        font-weight: 950;
    }
}

@media (max-width: 640px) {
    .workspace-section-switch-btn {
        min-height: 56px;
        border-radius: 13px;
        padding: 9px 10px;
    }

    .workspace-section-switch-icon {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }

    .workspace-tab-settings {
        border-radius: 14px;
        padding: 12px;
    }

    .workspace-tab-settings-head {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
    }

    .workspace-tab-back-btn {
        width: 100%;
    }

    .workspace-tab-settings-grid {
        grid-template-columns: 1fr;
    }

    .workspace-tab-device-card {
        border-radius: 12px;
        padding: 9px;
    }

    .workspace-tab-check {
        min-height: 36px;
    }
}

/* Compact workspace tab visibility redesign */
.workspace-modal-title-copy {
    min-width: 0;
}

.workspace-modal-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.workspace-header-back-btn {
    min-height: 40px;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    border-radius: 12px;
    white-space: nowrap;
}

.workspace-header-back-btn[hidden] {
    display: none !important;
}

.workspace-tab-settings {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin-top: 0;
}

.workspace-tab-settings-head {
    display: block;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.workspace-tab-settings-head strong {
    font-size: 13px;
}

.workspace-tab-settings-head span {
    margin-top: 1px;
    font-size: 11px;
    line-height: 1.25;
}

.workspace-tab-compact-list {
    display: grid;
    gap: 7px;
}

.workspace-tab-compact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 7px 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: #ffffff;
}

.workspace-tab-name {
    min-width: 0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-tab-pill {
    min-height: 28px;
    padding: 0 9px 0 7px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
}

.workspace-tab-pill input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #4f5df7;
    flex: 0 0 auto;
}

.workspace-tab-pill:has(input:checked) {
    border-color: rgba(79, 93, 247, 0.34);
    background: #eef2ff;
    color: #312e81;
}

@supports not selector(:has(*)) {
    .workspace-tab-pill input:checked + span {
        color: #312e81;
        font-weight: 950;
    }
}

@media (max-width: 640px) {
    .workspace-modal-header {
        align-items: center;
        gap: 8px;
    }

    .workspace-modal-header-actions {
        gap: 7px;
    }

    .workspace-header-back-btn {
        min-height: 38px;
        height: 38px;
        max-width: 190px;
        padding: 0 10px;
        border-radius: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .workspace-tab-settings {
        padding: 0;
        margin-top: 0;
    }

    .workspace-tab-settings-head {
        padding: 9px 10px;
        margin-bottom: 8px;
        border-radius: 12px;
    }

    .workspace-tab-compact-list {
        gap: 6px;
    }

    .workspace-tab-compact-row {
        min-height: 38px;
        padding: 5px 6px 5px 9px;
        border-radius: 12px;
        gap: 5px;
    }

    .workspace-tab-name {
        font-size: 11.5px;
    }

    .workspace-tab-pill {
        min-height: 26px;
        padding: 0 7px 0 6px;
        font-size: 10.5px;
        gap: 4px;
    }

    .workspace-tab-pill input {
        width: 13px;
        height: 13px;
    }
}

/* Compact polish for Workspace Tab Visibility */
.workspace-tab-settings-head {
    margin-bottom: 7px;
    padding: 7px 10px;
    border-radius: 11px;
}

.workspace-tab-settings-head strong {
    font-size: 12px;
    line-height: 1.15;
}

.workspace-tab-settings-head span {
    margin-top: 0;
    font-size: 10.5px;
    line-height: 1.2;
}

.workspace-tab-compact-list {
    gap: 5px;
}

.workspace-tab-compact-row {
    min-height: 34px;
    grid-template-columns: minmax(0, 1fr) 68px 58px;
    gap: 5px;
    padding: 4px 5px 4px 8px;
    border-radius: 10px;
}

.workspace-tab-name {
    font-size: 11.2px;
    line-height: 1.15;
}

.workspace-tab-pill {
    width: 100%;
    min-height: 24px;
    padding: 0 6px;
    border-radius: 9px;
    gap: 4px;
    font-size: 10px;
    line-height: 1;
}

.workspace-tab-pill input {
    width: 12px;
    height: 12px;
}

.workspace-header-back-btn {
    min-height: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 11.5px;
}

@media (max-width: 640px) {
    .workspace-modal-header {
        gap: 6px;
        padding-bottom: 9px;
    }

    .workspace-modal-header-actions {
        gap: 6px;
    }

    .workspace-header-back-btn {
        min-height: 34px;
        height: 34px;
        max-width: 112px;
        padding: 0 8px;
        border-radius: 9px;
        font-size: 11px;
    }

    .workspace-tab-settings-head {
        padding: 6px 8px;
        margin-bottom: 6px;
        border-radius: 10px;
    }

    .workspace-tab-settings-head strong {
        font-size: 11.5px;
    }

    .workspace-tab-settings-head span {
        font-size: 10px;
    }

    .workspace-tab-compact-list {
        gap: 5px;
    }

    .workspace-tab-compact-row {
        min-height: 32px;
        grid-template-columns: minmax(0, 1fr) 62px 54px;
        gap: 4px;
        padding: 3px 4px 3px 7px;
        border-radius: 9px;
    }

    .workspace-tab-name {
        font-size: 10.8px;
    }

    .workspace-tab-pill {
        min-height: 23px;
        padding: 0 5px;
        border-radius: 8px;
        font-size: 9.8px;
        gap: 3px;
    }

    .workspace-tab-pill input {
        width: 11.5px;
        height: 11.5px;
    }
}


/* Per-tab option from Workspace Settings: hide stat cards on selected view tabs */
body.hide-view-stat-cards #statsPanel,
body.hide-view-stat-cards #filtersPanel .filter-stats-grid {
    display: none !important;
}

/* Final compact alignment for Workspace Tab Visibility checkbox boxes */
.workspace-tab-compact-list {
    gap: 5px !important;
}

.workspace-tab-compact-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px 54px 78px !important;
    align-items: center !important;
    column-gap: 5px !important;
    min-height: 34px !important;
    padding: 4px 5px 4px 8px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
}

.workspace-tab-name {
    display: flex !important;
    align-items: center !important;
    min-height: 24px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
}

.workspace-tab-pill {
    width: 54px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 6px !important;
    margin: 0 !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.workspace-tab-pill input[type="checkbox"] {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
    flex: 0 0 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.workspace-tab-pill span {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 9.5px !important;
    line-height: 1 !important;
}

.workspace-tab-pill-stat {
    width: 78px !important;
}

.workspace-tab-pill-stat span {
    font-size: 9px !important;
}

@media (max-width: 640px) {
    .workspace-tab-compact-row {
        grid-template-columns: minmax(0, 1fr) 50px 50px 70px !important;
        min-height: 32px !important;
        column-gap: 4px !important;
        padding: 3px 4px 3px 7px !important;
        border-radius: 9px !important;
    }

    .workspace-tab-name {
        min-height: 22px !important;
        font-size: 10.5px !important;
    }

    .workspace-tab-pill {
        width: 50px !important;
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        padding: 0 5px !important;
        gap: 3px !important;
        border-radius: 8px !important;
    }

    .workspace-tab-pill-stat {
        width: 70px !important;
        padding: 0 4px !important;
    }

    .workspace-tab-pill-stat span {
        font-size: 8px !important;
    }

    .workspace-tab-pill input[type="checkbox"] {
        width: 11px !important;
        height: 11px !important;
        min-width: 11px !important;
        min-height: 11px !important;
        flex-basis: 11px !important;
    }

    .workspace-tab-pill span {
        font-size: 9px !important;
    }
}

/* Mobile Workspace Settings actions: keep Delete, Cancel and Save in one neat line */
@media (max-width: 640px) {
    #workspaceModal .workspace-modal-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr) !important;
        align-items: center !important;
        gap: 7px !important;
        width: 100% !important;
        margin-top: 12px !important;
        padding-top: 10px !important;
        border-top: 1px solid rgba(226, 232, 240, 0.9) !important;
        flex-direction: unset !important;
    }

    #workspaceModal .workspace-modal-actions:has(.workspace-modal-delete:not([hidden])) {
        grid-template-columns: minmax(0, 0.78fr) minmax(0, 0.78fr) minmax(0, 1.15fr) !important;
    }

    #workspaceModal .workspace-modal-actions .modal-action-spacer {
        display: none !important;
    }

    #workspaceModal .workspace-modal-actions button {
        width: 100% !important;
        min-width: 0 !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 8px !important;
        border-radius: 11px !important;
        font-size: 11.2px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    #workspaceModal #saveWorkspaceBtn {
        padding-inline: 9px !important;
        font-size: 11px !important;
    }
}

/* Mobile filter: keep stats in one centered row and filters side-by-side */
@media (max-width: 640px) {
    #filtersPanel.filters-panel.show {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 8px !important;
        padding: 8px !important;
    }

    #filtersPanel .filter-stats-grid {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        justify-content: center !important;
        align-items: stretch !important;
        gap: 4px !important;
        width: 100% !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    #filtersPanel .filter-stat-card,
    #filtersPanel .stat-card.filter-stat-card {
        min-width: 0 !important;
        width: 100% !important;
        min-height: 42px !important;
        height: 42px !important;
        padding: 5px 3px !important;
        border-radius: 10px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 2px !important;
        box-shadow: none !important;
    }

    #filtersPanel .filter-stat-card span {
        width: 100% !important;
        margin: 0 !important;
        font-size: 8.4px !important;
        line-height: 1 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #filtersPanel .filter-stat-card strong {
        width: 100% !important;
        margin: 1px 0 0 !important;
        font-size: clamp(11px, 3.1vw, 14px) !important;
        line-height: 1 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #filtersPanel .status-filter-label,
    #filtersPanel .filter-field.status-filter-label {
        grid-column: 1 / 2 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        gap: 4px !important;
    }

    #filtersPanel .team-sales-filter-label {
        grid-column: 2 / 3 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        gap: 4px !important;
    }

    #filtersPanel .status-filter-dropdown,
    #filtersPanel .team-sales-filter-label select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #filtersPanel .status-filter-toggle,
    #filtersPanel .team-sales-filter-label select {
        height: 34px !important;
        min-height: 34px !important;
        border-radius: 10px !important;
        font-size: 11.5px !important;
        padding-left: 10px !important;
    }

    #filtersPanel .filters-panel label span,
    #filtersPanel .filter-field > span,
    #filtersPanel .team-sales-filter-label > span {
        font-size: 9.5px !important;
        line-height: 1 !important;
    }

    #filtersPanel #resetFilters {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        height: 34px !important;
        min-height: 34px !important;
        margin-top: 0 !important;
        justify-content: center !important;
    }
}

@media (max-width: 380px) {
    #filtersPanel .filter-stats-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 3px !important;
    }

    #filtersPanel .filter-stat-card,
    #filtersPanel .stat-card.filter-stat-card {
        min-height: 40px !important;
        height: 40px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    #filtersPanel .filter-stat-card span {
        font-size: 7.8px !important;
    }

    #filtersPanel .filter-stat-card strong {
        font-size: clamp(10px, 3vw, 13px) !important;
    }
}

/* Thin vertical column lines for Table and Pinned views */
#tableView .job-table th,
#tableView .job-table td,
#pinnedView .job-table th,
#pinnedView .job-table td {
    border-right: 1px solid rgba(226, 232, 240, .95);
}

#tableView .job-table th:last-child,
#tableView .job-table td:last-child,
#pinnedView .job-table th:last-child,
#pinnedView .job-table td:last-child {
    border-right: 0;
}

@media (max-width: 720px) {
    #tableView .job-table th,
    #tableView .job-table td,
    #pinnedView .job-table th,
    #pinnedView .job-table td {
        border-right: 1px solid rgba(226, 232, 240, .95);
    }

    #tableView .job-table th:nth-child(1),
    #tableView .job-table td:nth-child(1),
    #tableView .job-table th:nth-child(2),
    #tableView .job-table td:nth-child(2),
    #tableView .job-table th:nth-child(3),
    #tableView .job-table td:nth-child(3),
    #pinnedView .job-table th:nth-child(1),
    #pinnedView .job-table td:nth-child(1),
    #pinnedView .job-table th:nth-child(2),
    #pinnedView .job-table td:nth-child(2),
    #pinnedView .job-table th:nth-child(3),
    #pinnedView .job-table td:nth-child(3) {
        box-shadow: none;
    }
}

/* Mobile calendar month grid + selected date list */
.mobile-calendar-count,
.mobile-calendar-selected {
    display: none;
}

@media (max-width: 820px) {
    body[data-view="calendar"] .calendar-shell {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    body[data-view="calendar"] .calendar-weekdays {
        display: grid !important;
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: 4px !important;
        padding: 0 2px 6px !important;
        background: transparent !important;
        min-width: 0 !important;
    }

    body[data-view="calendar"] .calendar-weekdays span {
        min-width: 0 !important;
        text-align: center !important;
        font-size: 10px !important;
        font-weight: 850 !important;
        color: #748094 !important;
    }

    body[data-view="calendar"] .calendar-grid {
        display: grid !important;
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        gap: 4px !important;
        background: transparent !important;
        min-height: 0 !important;
        padding: 8px !important;
        border: 1px solid #e5e9f2 !important;
        border-radius: 14px !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .05) !important;
        background-color: #fff !important;
    }

    body[data-view="calendar"] .calendar-cell,
    body[data-view="calendar"] .calendar-cell.today,
    body[data-view="calendar"] .calendar-cell.has-jobs {
        aspect-ratio: 1 / 1 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: hidden !important;
        border: 1px solid #e8edf5 !important;
        border-radius: 10px !important;
        padding: 4px !important;
        gap: 0 !important;
        background: #f9fafc !important;
        box-shadow: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }

    body[data-view="calendar"] .calendar-cell.muted-cell {
        display: block !important;
        aspect-ratio: 1 / 1 !important;
        min-height: 0 !important;
        height: auto !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        pointer-events: none !important;
        padding: 0 !important;
    }

    body[data-view="calendar"] .calendar-cell.today {
        background: #f5f6ff !important;
        border-color: rgba(79, 70, 229, .32) !important;
    }

    body[data-view="calendar"] .calendar-cell.selected {
        background: #eef2ff !important;
        border-color: var(--primary) !important;
        box-shadow: inset 0 0 0 1px var(--primary) !important;
    }

    body[data-view="calendar"] .calendar-date-row {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    body[data-view="calendar"] .calendar-date-btn,
    body[data-view="calendar"] .calendar-date-readonly {
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        border-radius: 8px !important;
        border: 0 !important;
        background: transparent !important;
        color: #1f2937 !important;
        font-size: 12px !important;
        font-weight: 900 !important;
        padding: 0 !important;
    }

    body[data-view="calendar"] .calendar-cell.today .calendar-date-btn,
    body[data-view="calendar"] .calendar-cell.today .calendar-date-readonly {
        background: transparent !important;
        color: var(--primary) !important;
    }

    body[data-view="calendar"] .calendar-cell.selected .calendar-date-btn,
    body[data-view="calendar"] .calendar-cell.selected .calendar-date-readonly {
        color: var(--primary) !important;
    }

    body[data-view="calendar"] .calendar-add-btn,
    body[data-view="calendar"] .calendar-job-list,
    body[data-view="calendar"] .calendar-drop-hint,
    body[data-view="calendar"] .calendar-more {
        display: none !important;
    }

    body[data-view="calendar"] .mobile-calendar-count {
        position: absolute !important;
        right: 4px !important;
        bottom: 4px !important;
        min-width: 15px !important;
        height: 15px !important;
        padding: 0 4px !important;
        border-radius: 999px !important;
        background: var(--primary) !important;
        color: #fff !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 9px !important;
        line-height: 1 !important;
        font-weight: 900 !important;
        box-shadow: 0 2px 6px rgba(79, 70, 229, .22) !important;
    }

    body[data-view="calendar"] .mobile-calendar-count.empty {
        display: none !important;
    }

    body[data-view="calendar"] .mobile-calendar-selected {
        display: block !important;
        margin-top: 10px !important;
        border: 1px solid #e5e9f2 !important;
        border-radius: 14px !important;
        background: #fff !important;
        padding: 10px !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .05) !important;
    }

    .mobile-calendar-selected-head {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    .mobile-calendar-selected-date {
        width: 44px !important;
        height: 44px !important;
        border-radius: 12px !important;
        background: #f3f4f6 !important;
        border: 1px solid #e5e7eb !important;
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
    }

    .mobile-calendar-selected-date strong {
        font-size: 16px !important;
        font-weight: 950 !important;
        color: #111827 !important;
    }

    .mobile-calendar-selected-date span {
        margin-top: 3px !important;
        font-size: 9px !important;
        font-weight: 850 !important;
        color: #6b7280 !important;
        text-transform: uppercase !important;
    }

    .mobile-calendar-selected-copy {
        min-width: 0 !important;
        display: grid !important;
        gap: 2px !important;
    }

    .mobile-calendar-selected-copy b {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 14px !important;
        font-weight: 900 !important;
        color: #111827 !important;
    }

    .mobile-calendar-selected-copy small {
        font-size: 11px !important;
        font-weight: 750 !important;
        color: #6b7280 !important;
    }

    .mobile-calendar-add {
        height: 34px !important;
        border: 0 !important;
        border-radius: 10px !important;
        background: var(--primary) !important;
        color: #fff !important;
        font-size: 12px !important;
        font-weight: 900 !important;
        padding: 0 12px !important;
        white-space: nowrap !important;
    }

    .mobile-calendar-selected-list {
        display: grid !important;
        gap: 10px !important;
    }

    .mobile-calendar-selected-list .task-card {
        width: 100% !important;
        margin: 0 !important;
    }

    .mobile-calendar-note {
        width: 100% !important;
        border: 1px solid #e5e9f2 !important;
        border-radius: 13px !important;
        background: #fffbea !important;
        color: #1f2937 !important;
        padding: 10px !important;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) !important;
        gap: 8px !important;
        align-items: center !important;
        text-align: left !important;
    }

    .mobile-calendar-note-pin {
        color: #b45309 !important;
        font-size: 12px !important;
    }

    .mobile-calendar-note span:last-child {
        min-width: 0 !important;
        display: grid !important;
        gap: 2px !important;
    }

    .mobile-calendar-note strong,
    .mobile-calendar-note small {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .mobile-calendar-note strong {
        font-size: 13px !important;
        font-weight: 900 !important;
    }

    .mobile-calendar-note small {
        font-size: 10px !important;
        font-weight: 750 !important;
        color: #6b7280 !important;
    }

    .mobile-calendar-empty {
        min-height: 84px !important;
        border: 1px dashed #d9deea !important;
        border-radius: 13px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 4px !important;
        color: #6b7280 !important;
        background: #f9fafc !important;
        padding: 12px !important;
    }

    .mobile-calendar-empty strong {
        color: #1f2937 !important;
        font-size: 13px !important;
        font-weight: 900 !important;
    }

    .mobile-calendar-empty span {
        font-size: 11px !important;
        font-weight: 700 !important;
    }
}

@media (max-width: 380px) {
    body[data-view="calendar"] .calendar-grid {
        gap: 3px !important;
        padding: 6px !important;
        border-radius: 12px !important;
    }

    body[data-view="calendar"] .calendar-cell,
    body[data-view="calendar"] .calendar-cell.today,
    body[data-view="calendar"] .calendar-cell.has-jobs,
    body[data-view="calendar"] .calendar-cell.muted-cell {
        border-radius: 8px !important;
    }

    body[data-view="calendar"] .calendar-date-btn,
    body[data-view="calendar"] .calendar-date-readonly {
        font-size: 11px !important;
    }

    .mobile-calendar-selected-head {
        gap: 8px !important;
    }

    .mobile-calendar-selected-date {
        width: 40px !important;
        height: 40px !important;
    }

    .mobile-calendar-add {
        padding: 0 10px !important;
        font-size: 11px !important;
    }
}

/* Floating sticky note button: keep original purple color, clean solid plus badge */
.sticky-notes-float {
    background: linear-gradient(135deg, #4557e6 0%, #6d5dfc 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, .55) !important;
    box-shadow: 0 18px 38px rgba(69, 87, 230, .30), 0 4px 12px rgba(15, 23, 42, .12) !important;
    overflow: hidden !important;
}

.sticky-notes-float::before {
    display: none !important;
}

.sticky-notes-float::after {
    content: "+" !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 3 !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #4557e6 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 18px !important;
    text-align: center !important;
    opacity: 1 !important;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .14) !important;
    pointer-events: none !important;
}

.sticky-notes-float:hover {
    filter: saturate(1.06) !important;
    box-shadow: 0 22px 44px rgba(69, 87, 230, .36), 0 7px 16px rgba(15, 23, 42, .14) !important;
}

.sticky-notes-float:focus-visible {
    outline: 4px solid rgba(69, 87, 230, .22) !important;
    outline-offset: 3px !important;
}

.sticky-notes-float-icon {
    position: relative !important;
    z-index: 2 !important;
}

/* Calendar desktop sticky note: keep title and account on one line with normal dashboard font */
@media (min-width: 981px) {
    body[data-view="calendar"] .calendar-sticky-note {
        font-family: inherit;
        font-weight: 600;
        line-height: 1;
    }

    body[data-view="calendar"] .calendar-sticky-note .calendar-sticky-copy {
        flex: 1 1 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 5px;
        width: auto;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        line-height: 1;
    }

    body[data-view="calendar"] .calendar-sticky-note .calendar-sticky-title {
        flex: 1 1 auto;
        display: block;
        width: auto;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-family: inherit;
        font-size: inherit;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0;
    }

    body[data-view="calendar"] .calendar-sticky-note .calendar-sticky-copy small {
        flex: 0 1 auto;
        display: block;
        width: auto;
        max-width: 48%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: rgba(15, 23, 42, .58);
        font-family: inherit;
        font-size: 9px;
        font-weight: 500;
        line-height: 1;
        letter-spacing: 0;
    }
}


/* Thin vertical column lines for Attendance, Log and Deleted views */
#attendanceView .attendance-table th,
#attendanceView .attendance-table td,
#logView .activity-log-table th,
#logView .activity-log-table td,
#deletedView .deleted-job-table th,
#deletedView .deleted-job-table td {
    border-right: 1px solid rgba(226, 232, 240, .95);
}

#attendanceView .attendance-table th:last-child,
#attendanceView .attendance-table td:last-child,
#logView .activity-log-table th:last-child,
#logView .activity-log-table td:last-child,
#deletedView .deleted-job-table th:last-child,
#deletedView .deleted-job-table td:last-child {
    border-right: 0;
}

@media (max-width: 720px) {
    #attendanceView .attendance-table th,
    #attendanceView .attendance-table td,
    #logView .activity-log-table th,
    #logView .activity-log-table td,
    #deletedView .deleted-job-table th,
    #deletedView .deleted-job-table td {
        border-right: 1px solid rgba(226, 232, 240, .95);
    }

    #attendanceView .attendance-table th:last-child,
    #attendanceView .attendance-table td:last-child,
    #logView .activity-log-table th:last-child,
    #logView .activity-log-table td:last-child,
    #deletedView .deleted-job-table th:last-child,
    #deletedView .deleted-job-table td:last-child {
        border-right: 0;
    }
}


/* Attendance today highlight - outline only */
.attendance-table th.attendance-today-col,
.attendance-table td.attendance-today-col {
    background: inherit;
    box-shadow: inset 2px 0 0 rgba(69, 87, 230, .58), inset -2px 0 0 rgba(69, 87, 230, .58);
}

.attendance-table th.attendance-today-col {
    color: var(--primary);
    background: inherit;
    box-shadow: inset 2px 0 0 var(--primary), inset -2px 0 0 var(--primary), inset 0 2px 0 var(--primary), inset 0 -2px 0 var(--primary);
}

.attendance-table tbody tr:last-child td.attendance-today-col {
    box-shadow: inset 2px 0 0 rgba(69, 87, 230, .58), inset -2px 0 0 rgba(69, 87, 230, .58), inset 0 -2px 0 rgba(69, 87, 230, .58);
}

.attendance-table td.attendance-today-col .attendance-select {
    border-color: rgba(69, 87, 230, .40);
}

@media (max-width: 720px) {
    .attendance-table th.attendance-today-col,
    .attendance-table td.attendance-today-col {
        background: inherit;
    }

    .attendance-table th.attendance-today-col {
        color: var(--primary);
        box-shadow: inset 2px 0 0 var(--primary), inset -2px 0 0 var(--primary), inset 0 2px 0 var(--primary), inset 0 -2px 0 var(--primary);
    }
}

/* Workspace Stat Cards settings */
.workspace-section-switch-icon-stat {
    background: #f0fdf4;
    color: #15803d;
}

.workspace-stat-settings {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin-top: 0;
}

.workspace-stat-settings-head {
    display: block;
    margin-bottom: 7px;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
}

.workspace-stat-settings-head strong {
    display: block;
    color: #0f172a;
    font-size: 12px;
    font-weight: 950;
    line-height: 1.15;
}

.workspace-stat-settings-head span {
    display: block;
    margin-top: 0;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
}

.workspace-stat-compact-list {
    display: grid;
    gap: 5px;
}

.workspace-stat-compact-row {
    display: grid;
    grid-template-columns: minmax(92px, 0.78fr) minmax(0, 1.22fr);
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 5px 6px 5px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.workspace-stat-key {
    min-width: 0;
    color: #64748b;
    font-size: 10.7px;
    font-weight: 900;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-stat-input {
    width: 100%;
    min-width: 0;
    height: 28px;
    min-height: 28px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    padding: 0 9px !important;
    font-size: 11px !important;
    font-weight: 800;
    outline: 0;
}

.workspace-stat-input:focus {
    background: #ffffff !important;
    border-color: rgba(79, 93, 247, 0.45) !important;
    box-shadow: 0 0 0 2px rgba(79, 93, 247, 0.1);
}

@media (max-width: 640px) {
    .workspace-stat-settings-head {
        padding: 6px 8px;
        margin-bottom: 6px;
        border-radius: 10px;
    }

    .workspace-stat-settings-head strong {
        font-size: 11.5px;
    }

    .workspace-stat-settings-head span {
        font-size: 10px;
    }

    .workspace-stat-compact-list {
        gap: 5px;
    }

    .workspace-stat-compact-row {
        grid-template-columns: 76px minmax(0, 1fr);
        min-height: 32px;
        gap: 5px;
        padding: 3px 4px 3px 7px;
        border-radius: 9px;
    }

    .workspace-stat-key {
        font-size: 10px;
    }

    .workspace-stat-input {
        height: 26px;
        min-height: 26px !important;
        border-radius: 8px !important;
        padding: 0 7px !important;
        font-size: 10.5px !important;
    }
}

/* Workspace stat card calculation dropdown */
.workspace-stat-compact-row {
    grid-template-columns: minmax(78px, .62fr) minmax(92px, .95fr) minmax(118px, 1.22fr);
}

.workspace-stat-input,
.workspace-stat-metric-select {
    width: 100%;
    min-width: 0;
}

.workspace-stat-metric-select {
    height: 28px;
    min-height: 28px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    color: #334155 !important;
    padding: 0 26px 0 8px !important;
    font-size: 10.7px !important;
    font-weight: 800;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 11px 11px;
}

.workspace-stat-metric-select:focus {
    background-color: #ffffff !important;
    border-color: rgba(79, 93, 247, 0.45) !important;
    box-shadow: 0 0 0 2px rgba(79, 93, 247, 0.1);
}

@media (max-width: 640px) {
    .workspace-stat-compact-row {
        grid-template-columns: 54px minmax(72px, .85fr) minmax(96px, 1.15fr);
        gap: 4px;
        min-height: 32px;
        padding: 4px 4px 4px 6px;
    }

    .workspace-stat-input,
    .workspace-stat-metric-select {
        height: 25px;
        min-height: 25px !important;
        font-size: 9.8px !important;
    }

    .workspace-stat-input {
        padding: 0 6px !important;
    }

    .workspace-stat-metric-select {
        padding: 0 22px 0 6px !important;
        background-position: right 6px center;
        background-size: 10px 10px;
    }
}

/* Workspace Stat Cards custom metric dropdown: show 5 options, then scroll */
.workspace-stat-metric-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

.workspace-stat-metric-native {
    display: none !important;
}

.workspace-stat-metric-dropdown {
    position: relative;
    width: 100%;
    min-width: 0;
}

.workspace-stat-metric-toggle {
    width: 100%;
    min-width: 0;
    height: 28px;
    min-height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0 7px 0 8px;
    font-size: 10.7px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    text-align: left;
}

.workspace-stat-metric-toggle span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-stat-metric-caret {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 12px;
    line-height: 1;
    transform: translateY(-1px);
}

.workspace-stat-metric-dropdown.is-open .workspace-stat-metric-toggle,
.workspace-stat-metric-toggle:focus {
    background: #ffffff;
    border-color: rgba(79, 93, 247, 0.45);
    box-shadow: 0 0 0 2px rgba(79, 93, 247, 0.1);
    outline: 0;
}

.workspace-stat-metric-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 10030;
    max-height: 155px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    border: 1px solid #dbe2ee;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
}

.workspace-stat-metric-menu::-webkit-scrollbar {
    width: 7px;
}

.workspace-stat-metric-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.workspace-stat-metric-option {
    width: 100%;
    min-height: 29px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 10.8px;
    font-weight: 800;
    line-height: 1.15;
    text-align: left;
    cursor: pointer;
}

.workspace-stat-metric-option:hover,
.workspace-stat-metric-option[aria-selected="true"] {
    background: #eef1ff;
    color: #4557e6;
}

@media (max-width: 640px) {
    .workspace-stat-metric-toggle {
        height: 25px;
        min-height: 25px;
        border-radius: 8px;
        padding: 0 6px;
        font-size: 9.8px;
    }

    .workspace-stat-metric-menu {
        max-height: 145px;
        padding: 4px;
        border-radius: 9px;
    }

    .workspace-stat-metric-option {
        min-height: 27px;
        border-radius: 7px;
        padding: 0 7px;
        font-size: 9.9px;
    }
}

/* Workspace Stat Cards: desktop/mobile visibility controls */
@media (min-width: 641px) {
    .stat-hidden-desktop {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .stat-hidden-mobile {
        display: none !important;
    }

    #filtersPanel .filter-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)) !important;
    }
}

.workspace-stat-compact-row {
    grid-template-columns: minmax(58px, .52fr) minmax(78px, .76fr) minmax(108px, 1.15fr) 54px 54px !important;
    align-items: center !important;
    column-gap: 5px !important;
}

.workspace-stat-device-pill {
    width: 54px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 6px !important;
    margin: 0 !important;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #ffffff;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    color: #475569;
    font-size: 10px !important;
    font-weight: 900;
    line-height: 1 !important;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box !important;
}

.workspace-stat-device-pill input {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    margin: 0 !important;
    accent-color: #4f5df7;
    flex: 0 0 auto !important;
}

.workspace-stat-device-pill span {
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
    transform: translateY(.2px);
}

.workspace-stat-device-pill:has(input:checked) {
    border-color: rgba(79, 93, 247, 0.34);
    background: #eef2ff;
    color: #312e81;
}

@supports not selector(:has(*)) {
    .workspace-stat-device-pill input:checked + span {
        color: #312e81;
        font-weight: 950;
    }
}

@media (max-width: 640px) {
    .workspace-stat-compact-row {
        grid-template-columns: 42px minmax(58px, .74fr) minmax(82px, 1fr) 43px 43px !important;
        gap: 4px !important;
        padding: 4px 4px 4px 6px !important;
    }

    .workspace-stat-key {
        font-size: 9.3px !important;
    }

    .workspace-stat-device-pill {
        width: 43px !important;
        height: 25px !important;
        min-height: 25px !important;
        max-height: 25px !important;
        padding: 0 4px !important;
        gap: 3px !important;
        border-radius: 8px !important;
        font-size: 8.9px !important;
    }

    .workspace-stat-device-pill input {
        width: 10.5px !important;
        height: 10.5px !important;
        min-width: 10.5px !important;
    }
}

/* Company Holiday List */
.holiday-dashboard-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 2px 0 20px;
}

.holiday-side-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.holiday-visual-card,
.holiday-highlight-card,
.holiday-list-shell {
    border: 1px solid rgba(226, 232, 240, .9);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
}

.holiday-visual-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

.holiday-visual-edit-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 8;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(226, 232, 240, .9);
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 950;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
    backdrop-filter: blur(10px);
}

.holiday-visual-edit-btn:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.holiday-visual-art {
    position: relative;
    aspect-ratio: 16 / 10;
    min-height: 245px;
    overflow: hidden;
    background: linear-gradient(180deg, #f2f7ff 0%, #ffffff 100%);
}


.holiday-visual-image {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.holiday-visual-art.has-custom-image::before,
.holiday-visual-art.has-custom-image::after {
    content: none;
}

.holiday-visual-art.has-custom-image > :not(.holiday-visual-image) {
    display: none;
}

.holiday-visual-art::before {
    content: '';
    position: absolute;
    left: -28%;
    right: -24%;
    bottom: -60px;
    height: 155px;
    border-radius: 50% 50% 0 0;
    background: #dceafe;
}

.holiday-visual-art::after {
    content: '';
    position: absolute;
    inset: 18px 24px auto auto;
    width: 46px;
    height: 18px;
    border-radius: 999px;
    background: rgba(191, 219, 254, .7);
    box-shadow: -150px 32px 0 -5px rgba(191, 219, 254, .5), -112px 10px 0 -7px rgba(147, 197, 253, .42);
}

.holiday-sun {
    position: absolute;
    left: 34px;
    top: 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fef3c7;
    box-shadow: 0 0 0 14px rgba(254, 243, 199, .38);
}

.holiday-calendar-illus {
    position: absolute;
    left: 50%;
    top: 54px;
    width: 138px;
    height: 118px;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    padding: 26px 18px 18px;
    border-radius: 34px 34px 18px 18px;
    background: #dbeafe;
    border: 1px solid rgba(147, 197, 253, .62);
    box-shadow: inset 0 16px 20px rgba(255, 255, 255, .35);
}

.holiday-calendar-illus::before {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    top: 14px;
    height: 8px;
    border-radius: 999px;
    background: rgba(96, 165, 250, .35);
}

.holiday-calendar-illus span {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #64748b;
    opacity: .55;
    justify-self: center;
    align-self: center;
}

.holiday-calendar-illus span.active {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #e11d48;
    opacity: .9;
}

.holiday-person {
    position: absolute;
    left: calc(50% + 6px);
    bottom: 52px;
    width: 20px;
    height: 52px;
    border-radius: 14px 14px 6px 6px;
    background: #e11d48;
    box-shadow: 0 44px 0 -8px #1e3a8a, -9px -15px 0 -4px #f8b4b4;
}

.holiday-person::before {
    content: '';
    position: absolute;
    left: 2px;
    top: -24px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f8b4b4;
}

.holiday-person::after {
    content: '';
    position: absolute;
    left: -13px;
    top: 26px;
    width: 46px;
    height: 7px;
    border-radius: 999px;
    background: #fca5a5;
    transform: rotate(-10deg);
}

.holiday-bag {
    position: absolute;
    bottom: 45px;
    width: 28px;
    height: 34px;
    border-radius: 7px;
    background: #fb7185;
    border: 2px solid rgba(190, 18, 60, .28);
}

.holiday-bag::before {
    content: '';
    position: absolute;
    left: 6px;
    top: -8px;
    width: 12px;
    height: 10px;
    border: 2px solid rgba(190, 18, 60, .28);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}

.holiday-bag-one {
    left: 82px;
}

.holiday-bag-two {
    right: 82px;
    height: 28px;
    background: #93c5fd;
    border-color: rgba(37, 99, 235, .25);
}

.holiday-palm {
    position: absolute;
    bottom: 62px;
    width: 8px;
    height: 70px;
    border-radius: 999px;
    background: #93c5fd;
    transform-origin: bottom;
}

.holiday-palm::before,
.holiday-palm::after {
    content: '';
    position: absolute;
    top: -12px;
    width: 42px;
    height: 18px;
    border-radius: 100% 0 100% 0;
    background: rgba(147, 197, 253, .72);
}

.holiday-palm::before {
    left: -34px;
    transform: rotate(-30deg);
}

.holiday-palm::after {
    left: 0;
    transform: rotate(24deg) scaleX(-1);
}

.holiday-palm-left {
    left: 50px;
    transform: rotate(-12deg);
}

.holiday-palm-right {
    right: 50px;
    transform: rotate(12deg);
}

.holiday-visual-copy {
    display: grid;
    gap: 4px;
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(226, 232, 240, .72);
}

.holiday-visual-copy strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 950;
}

#holidayVisualDescription {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
    font-weight: 750;
}

.holiday-visual-desc-line {
    display: block;
    overflow-wrap: anywhere;
}

.holiday-visual-desc-line.is-numbered {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 6px;
    align-items: start;
}

.holiday-visual-desc-number {
    text-align: right;
    white-space: nowrap;
}

.holiday-visual-desc-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.holiday-visual-description-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
}

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

.holiday-highlight-card {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 92px;
    padding: 14px 15px;
    border-radius: 20px;
}

.holiday-highlight-dot {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 999px;
    background: #0f172a;
    box-shadow: 0 0 0 5px rgba(15, 23, 42, .08);
}

.holiday-highlight-upcoming .holiday-highlight-dot {
    background: #dc2626;
    box-shadow: 0 0 0 5px rgba(220, 38, 38, .10);
}

.holiday-highlight-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.holiday-highlight-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 850;
}

.holiday-highlight-meta strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 950;
}

.holiday-highlight-copy h3 {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.25;
    font-weight: 950;
    letter-spacing: -.02em;
}

.holiday-highlight-copy p {
    margin: 0;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.38;
    font-weight: 720;
}

.holiday-month-copy {
    gap: 9px;
}

.holiday-month-list {
    display: grid;
    gap: 7px;
}

.holiday-month-item {
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 13px;
    background: rgba(248, 250, 252, .86);
}

.holiday-month-date {
    color: #64748b;
    font-size: 10.5px;
    line-height: 1.2;
    font-weight: 900;
}

.holiday-month-item strong {
    color: var(--text);
    font-size: 12.5px;
    line-height: 1.25;
    font-weight: 950;
    letter-spacing: -.01em;
}

.holiday-month-item small {
    color: #64748b;
    font-size: 10.8px;
    line-height: 1.28;
    font-weight: 720;
}

.holiday-list-shell {
    overflow: hidden;
    border-radius: 24px;
}

.holiday-list-head {
    align-items: flex-start;
    padding: 15px 17px;
}

.holiday-list-head h2 {
    font-size: 17px;
}

.holiday-list-head p {
    max-width: 520px;
    font-size: 12px;
}

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

.holiday-add-btn,
.holiday-list-actions .table-count-pill {
    min-height: 32px;
}

.holiday-form {
    margin: 14px 16px 0;
    padding: 14px;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.holiday-form-grid {
    display: grid;
    grid-template-columns: minmax(140px, .8fr) minmax(210px, 1.3fr) minmax(160px, .9fr);
    gap: 10px;
    align-items: end;
}

.holiday-note-field {
    grid-column: 1 / -1;
}

.holiday-form label {
    display: grid;
    gap: 6px;
}

.holiday-form label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.holiday-form input,
.holiday-form select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    padding: 0 12px;
    font: inherit;
    font-weight: 750;
    outline: none;
}

.holiday-form input:focus,
.holiday-form select:focus {
    border-color: rgba(37, 99, 235, .42);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.holiday-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.holiday-year-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 16px 0;
    padding: 10px 12px;
    border-radius: 15px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.holiday-year-bar span {
    color: var(--text);
    font-size: 12.5px;
    font-weight: 900;
}

.holiday-year-bar small {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 750;
}

.holiday-list-body {
    padding: 16px;
}

.holiday-list-root {
    min-width: 0;
}

.holiday-table-wrap {
    width: 100%;
    overflow: auto;
    max-height: calc(100vh - 310px);
    max-height: calc(100dvh - 310px);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 18px;
    background: #ffffff;
}

.holiday-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.8px;
}

.holiday-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fbfcff;
    color: #64748b;
    text-align: left;
    font-size: 10.8px;
    font-weight: 950;
    letter-spacing: .045em;
    text-transform: uppercase;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    white-space: nowrap;
}

.holiday-table td {
    padding: 13px 18px;
    border-bottom: 1px solid rgba(226, 232, 240, .68);
    color: var(--text);
    vertical-align: middle;
}

.holiday-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.holiday-table tbody tr:hover td {
    background: #f8fbff;
}

.holiday-table tbody tr:last-child td {
    border-bottom: 0;
}

.holiday-table-title {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.holiday-table-title strong {
    color: var(--text);
    font-size: 13px;
    line-height: 1.25;
    font-weight: 950;
}

.holiday-table-title small {
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.25;
    font-weight: 750;
}

.holiday-table-note {
    min-width: 160px;
    max-width: 260px;
    color: #64748b;
    font-size: 12.2px;
    font-weight: 720;
    line-height: 1.35;
}

.holiday-type-badge,
.holiday-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .24);
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    white-space: nowrap;
}

.holiday-type-public-holiday {
    background: #eef7ff;
    color: #2563eb;
    border-color: rgba(37, 99, 235, .16);
}

.holiday-type-company-holiday {
    background: #eefaf3;
    color: #15803d;
    border-color: rgba(21, 128, 61, .16);
}

.holiday-type-replacement-leave {
    background: #fff7e6;
    color: #b45309;
    border-color: rgba(180, 83, 9, .18);
}

.holiday-type-special-leave {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: rgba(109, 40, 217, .16);
}

.holiday-status-upcoming {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: rgba(29, 78, 216, .16);
}

.holiday-status-this-month {
    background: #ecfdf5;
    color: #047857;
    border-color: rgba(4, 120, 87, .16);
}

.holiday-status-past {
    background: #f8fafc;
    color: #64748b;
    border-color: rgba(100, 116, 139, .18);
}

.holiday-table-action-col {
    width: 150px;
}

.holiday-table-actions {
    white-space: nowrap;
}

.holiday-table-actions .holiday-mini-btn {
    margin-right: 6px;
}

.holiday-mini-btn {
    min-height: 30px;
    padding: 0 9px;
    border-radius: 10px;
    font-size: 11.5px;
}

.holiday-empty-state {
    display: grid;
    gap: 6px;
    place-items: center;
    min-height: 220px;
    padding: 28px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: #f8fafc;
    text-align: center;
}

.holiday-empty-state strong {
    color: var(--text);
    font-size: 16px;
    font-weight: 950;
}

.holiday-empty-state span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.calendar-holiday-item,
body[data-view="calendar"] .calendar-holiday-item {
    width: 100%;
    min-height: 22px;
    border: 1px solid rgba(217, 119, 6, .20);
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 6px;
    font-size: 10px;
    font-weight: 900;
    text-align: left;
}

.calendar-holiday-pin,
.mobile-calendar-holiday-pin {
    flex: 0 0 auto;
    color: #d97706;
    font-size: 9px;
    line-height: 1;
}

.calendar-holiday-copy {
    display: grid;
    min-width: 0;
    line-height: 1.1;
}

.calendar-holiday-title,
.calendar-holiday-copy small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-holiday-copy small {
    opacity: .72;
    font-size: 9px;
}

.mobile-calendar-holiday {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(217, 119, 6, .20);
    border-radius: 14px;
    background: #fffbeb;
    color: #92400e;
}

.mobile-calendar-holiday span:last-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.mobile-calendar-holiday strong,
.mobile-calendar-holiday small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-calendar-holiday strong {
    font-size: 13px;
    font-weight: 950;
}

.mobile-calendar-holiday small {
    font-size: 11px;
    font-weight: 800;
    opacity: .75;
}

@media (max-width: 1180px) {
    .holiday-dashboard-shell {
        width: 100%;
        grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    }
}

@media (max-width: 980px) {
    .holiday-dashboard-shell {
        grid-template-columns: 1fr;
    }

    .holiday-side-panel {
        grid-template-columns: minmax(0, .95fr) minmax(260px, .9fr);
        align-items: stretch;
    }

    .holiday-visual-art {
        min-height: 220px;
    }

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

    .holiday-note-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .holiday-dashboard-shell,
    .holiday-side-panel {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .holiday-visual-art {
        min-height: 200px;
    }

    .holiday-list-head,
    .holiday-year-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .holiday-list-actions,
    .holiday-form-actions {
        justify-content: stretch;
    }

    .holiday-list-actions > *,
    .holiday-form-actions > * {
        width: 100%;
    }

    .holiday-form {
        margin: 12px;
        padding: 12px;
    }

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

    .holiday-list-body {
        padding: 12px;
    }

    .holiday-table {
        min-width: 560px;
    }
}

/* Calendar + Sticky Notes stat cards
   The old layout forced stats to be hidden on these tabs.
   Stats are now visible by default and can be hidden per tab from Workspace Settings > Tab Visibility > Hide Stats. */
body[data-view="calendar"]:not(.hide-view-stat-cards) #statsPanel,
body[data-view="calendar"]:not(.hide-view-stat-cards) .stats-grid,
body[data-view="sticky-board"]:not(.hide-view-stat-cards) #statsPanel,
body[data-view="sticky-board"]:not(.hide-view-stat-cards) .stats-grid {
    display: grid !important;
}

body[data-view="calendar"]:not(.hide-view-stat-cards) #statsPanel,
body[data-view="sticky-board"]:not(.hide-view-stat-cards) #statsPanel {
    margin-bottom: 12px !important;
    flex: 0 0 auto !important;
}

body[data-view="calendar"]:not(.hide-view-stat-cards) #calendarView.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

body[data-view="calendar"]:not(.hide-view-stat-cards) .calendar-shell {
    min-height: 0 !important;
}

body[data-view="sticky-board"]:not(.hide-view-stat-cards) .sticky-board-shell {
    margin-top: 0 !important;
}

/* Holiday bulk popup */
.holiday-modal-backdrop {
    padding: 18px;
    align-items: center;
    justify-content: center;
}

.holiday-modal-card {
    width: min(1180px, calc(100vw - 28px));
    max-height: min(88vh, 820px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 26px;
}

.holiday-modal-header {
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid rgba(226, 232, 240, .9);
}

.holiday-modal-header p {
    max-width: 760px;
}

.holiday-bulk-form,
.holiday-modal-card .holiday-form {
    margin: 0;
    padding: 16px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    overflow: auto;
    flex: 1 1 auto;
}

.holiday-bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 18px;
    background: #f8fafc;
}

.holiday-bulk-toolbar > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.holiday-bulk-toolbar strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 950;
}

.holiday-bulk-toolbar span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.holiday-bulk-head,
.holiday-bulk-row {
    display: grid;
    grid-template-columns: 30px minmax(180px, 1.35fr) minmax(138px, .82fr) minmax(138px, .82fr) minmax(150px, .82fr) minmax(150px, .82fr) 44px;
    gap: 8px;
    align-items: end;
}

.holiday-bulk-head {
    padding: 0 12px 7px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.holiday-bulk-head span:nth-child(7) {
    text-align: center;
}

.holiday-bulk-rows {
    display: grid;
    gap: 10px;
}

.holiday-bulk-row {
    position: relative;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
}

.holiday-bulk-index {
    width: 28px;
    height: 28px;
    align-self: center;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 950;
}

.holiday-bulk-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.holiday-bulk-field span {
    display: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.holiday-bulk-field input,
.holiday-bulk-field select,
.holiday-bulk-field textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    padding: 0 11px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 780;
    outline: none;
    box-sizing: border-box;
}

.holiday-bulk-field textarea {
    min-height: 98px;
    padding-top: 10px;
    padding-bottom: 10px;
    resize: vertical;
    line-height: 1.45;
}

.holiday-bulk-field input:focus,
.holiday-bulk-field select:focus,
.holiday-bulk-field textarea:focus {
    border-color: rgba(37, 99, 235, .42);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.holiday-bulk-more {
    grid-column: 2 / 7;
    margin-top: 2px;
    min-width: 0;
}

.holiday-bulk-more summary {
    width: max-content;
    cursor: pointer;
    color: #2563eb;
    font-size: 11.5px;
    font-weight: 900;
    user-select: none;
    list-style: none;
}

.holiday-bulk-more summary::-webkit-details-marker {
    display: none;
}

.holiday-bulk-more summary::before {
    content: '+ ';
}

.holiday-bulk-more[open] summary::before {
    content: '- ';
}

.holiday-bulk-more-grid {
    display: grid;
    grid-template-columns: minmax(150px, .5fr) minmax(240px, 1.5fr);
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid rgba(226, 232, 240, .82);
    border-radius: 14px;
    background: #f8fafc;
}

.holiday-bulk-more-grid .holiday-bulk-field span {
    display: inline;
}

.holiday-row-remove {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 13px;
    align-self: center;
    color: #dc2626;
    background: #fff1f2;
    border-color: rgba(220, 38, 38, .18);
}

.holiday-row-remove:hover {
    background: #ffe4e6;
    color: #b91c1c;
}

.holiday-modal-actions {
    position: sticky;
    bottom: -16px;
    z-index: 2;
    margin: 14px -16px -16px;
    padding: 12px 16px;
    border-top: 1px solid rgba(226, 232, 240, .9);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
}

.holiday-visual-modal-card {
    width: min(780px, calc(100vw - 28px));
}

.holiday-visual-form-grid {
    display: grid;
    grid-template-columns: minmax(240px, .9fr) minmax(0, 1.1fr);
    gap: 14px;
    align-items: stretch;
}

.holiday-visual-preview {
    align-self: start;
    aspect-ratio: 16 / 10;
    min-height: 0;
    width: 100%;
    border: 1px dashed rgba(148, 163, 184, .78);
    border-radius: 22px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    padding: 16px;
}

.holiday-visual-preview img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
}

.holiday-visual-fields {
    display: grid;
    gap: 12px;
    align-content: start;
    min-width: 0;
}

.holiday-visual-upload-box {
    display: grid;
    gap: 9px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 16px;
    background: #f8fafc;
    overflow: hidden;
}

.holiday-visual-upload-box > span,
.holiday-visual-remove-row span {
    color: var(--text);
    font-size: 12px;
    font-weight: 950;
}

.holiday-visual-upload-box input[type="file"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(203, 213, 225, .95);
    border-radius: 13px;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
}

.holiday-visual-upload-box input[type="file"]::file-selector-button {
    max-width: 128px;
    margin-right: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: 10px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 900;
    cursor: pointer;
}

.holiday-visual-upload-box input[type="file"]::-webkit-file-upload-button {
    max-width: 128px;
    margin-right: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: 10px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 900;
    cursor: pointer;
}

.holiday-visual-upload-box small {
    display: block;
    max-width: 100%;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 740;
}

.holiday-visual-remove-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 2px 1px 0;
    color: #475569;
    font-size: 12px;
    font-weight: 820;
}

.holiday-visual-remove-row input {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.holiday-table {
    min-width: 1080px;
}

.holiday-table td:nth-child(2),
.holiday-table td:nth-child(3),
.holiday-table td:nth-child(4),
.holiday-table td:nth-child(5),
.holiday-table td:nth-child(6) {
    white-space: nowrap;
}

@media (max-width: 980px) {
    .holiday-modal-card {
        width: min(760px, calc(100vw - 24px));
    }

    .holiday-bulk-head {
        display: none;
    }

    .holiday-bulk-row {
        grid-template-columns: 30px 1fr 1fr;
        align-items: end;
    }

    .holiday-bulk-title-field {
        grid-column: 2 / -1;
    }

    .holiday-bulk-more {
        grid-column: 2 / -1;
    }

    .holiday-row-remove {
        grid-column: 3;
        justify-self: end;
    }

    .holiday-bulk-field span {
        display: inline;
    }
}

@media (max-width: 640px) {
    .holiday-modal-backdrop {
        padding: 8px;
        align-items: stretch;
    }

    .holiday-modal-card {
        width: 100%;
        max-height: calc(100dvh - 16px);
        border-radius: 22px;
    }

    .holiday-modal-header {
        padding: 14px;
    }

    .holiday-bulk-form,
    .holiday-modal-card .holiday-form {
        padding: 12px;
    }

    .holiday-bulk-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .holiday-bulk-toolbar .holiday-add-more-btn {
        width: 100%;
    }

    .holiday-bulk-row {
        grid-template-columns: 26px 1fr;
        gap: 9px;
        padding: 10px;
    }

    .holiday-bulk-title-field,
    .holiday-bulk-field,
    .holiday-bulk-more,
    .holiday-row-remove {
        grid-column: 2 / -1;
    }

    .holiday-bulk-more-grid {
        grid-template-columns: 1fr;
    }

    .holiday-row-remove {
        width: 100%;
    }

    .holiday-modal-actions {
        margin: 12px -12px -12px;
        padding: 10px 12px;
        flex-direction: column;
    }

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

    .holiday-visual-preview,
    .holiday-visual-preview img {
        min-height: 0;
    }

    .holiday-modal-actions button {
        width: 100%;
    }
}

/* Memo PDF Library */
.pdf-library-shell {
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, .9);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
}

.pdf-library-head {
    align-items: flex-start;
    padding: 15px 17px;
}

.pdf-library-head h2 {
    font-size: 17px;
}

.pdf-library-head p {
    max-width: 560px;
    font-size: 12px;
}

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

.pdf-add-btn,
.pdf-library-actions .table-count-pill {
    min-height: 32px;
}

.pdf-library-body {
    padding: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    min-height: 360px;
}

.pdf-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
    gap: 14px;
    align-items: start;
}

.pdf-card {
    position: relative;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: transform .18s ease;
}

.pdf-card:hover {
    transform: translateY(-2px);
}

.pdf-card-open {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-thumbnail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    aspect-ratio: auto;
    width: 100%;
    padding: 10px 10px 2px;
    background: transparent;
    overflow: visible;
    border-bottom: 0;
}

.pdf-thumbnail::after {
    display: none;
}

.pdf-thumbnail-static > * {
    position: relative;
    z-index: 2;
}

.pdf-file-preview {
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
}

.pdf-file-svg-icon {
    width: min(66%, 112px);
    height: auto;
    display: block;
    object-fit: contain;
}






.pdf-thumbnail-filename {
    width: 100%;
    max-width: 100%;
    display: block;
    margin-top: 2px;
    color: #4f6488;
    font-size: 11.8px;
    line-height: 1.3;
    font-weight: 500;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-thumbnail canvas,
.pdf-thumbnail-loading,
.pdf-thumbnail-fallback {
    display: none !important;
}

.pdf-card-copy {
    display: grid;
    gap: 4px;
    padding: 8px 0 0;
    min-width: 0;
    width: 100%;
    background: transparent;
    color: #0f172a;
    text-align: center;
}

.pdf-card-copy strong {
    color: #0f172a;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -.01em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pdf-card-copy small {
    color: #5c6f91;
    font-size: 12.2px;
    line-height: 1.4;
    font-weight: 500;
    overflow-wrap: anywhere;
}


.pdf-library-grid .pdf-card {
    width: 190px;
}

.pdf-card-actions {
    position: absolute;
    top: 6px;
    right: 0;
    z-index: 6;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
    pointer-events: none;
}

.pdf-card-edit {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    min-height: 32px;
    max-height: 32px;
    flex: 0 0 32px;
    aspect-ratio: 1 / 1;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    text-indent: -9999px;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    font-size: 0;
    line-height: 1;
    font-weight: 950;
    letter-spacing: 0;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(203, 213, 225, .9);
    color: #334155;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .045);
    backdrop-filter: blur(6px);
    pointer-events: auto;
}

.pdf-card-edit::before {
    content: "✎";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-indent: 0;
    font-size: 14px;
    line-height: 1;
    transform: translateY(-.5px);
}

.pdf-card-edit:hover {
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, .35);
    background: rgba(239, 246, 255, .96);
}

.pdf-card-delete {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    line-height: 1;
    font-weight: 850;
    box-shadow: 0 4px 10px rgba(239, 68, 68, .08);
    pointer-events: auto;
}

.pdf-card-delete span {
    transform: translateY(-1px);
}

.pdf-edit-actions {
    align-items: center;
}

.pdf-edit-action-spacer {
    flex: 1 1 auto;
}

.pdf-edit-delete-btn {
    min-height: 40px;
    border-radius: 12px;
    padding: 0 14px;
}

.pdf-empty-state {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 28px 18px;
    border: 1px dashed rgba(148, 163, 184, .65);
    border-radius: 20px;
    background: rgba(248, 250, 252, .82);
}

.pdf-empty-state strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
}

.pdf-empty-state span {
    color: #64748b;
    font-size: 12px;
    font-weight: 760;
    line-height: 1.45;
}

.pdf-modal-backdrop,
.pdf-viewer-backdrop {
    padding: 18px;
    align-items: center;
    justify-content: center;
}

.pdf-upload-modal-card {
    width: min(620px, calc(100vw - 28px));
    max-height: min(88vh, 760px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 26px;
}

.pdf-modal-header,
.pdf-viewer-header {
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid rgba(226, 232, 240, .9);
}

.pdf-modal-header p,
.pdf-viewer-header p {
    max-width: 720px;
}

.pdf-upload-form {
    margin: 0;
    padding: 16px;
    background: #ffffff;
    display: grid;
    gap: 13px;
    overflow: auto;
}

.pdf-field,
.pdf-upload-box {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.pdf-field span,
.pdf-upload-box > span {
    color: var(--text);
    font-size: 12px;
    font-weight: 950;
}

.pdf-field input,
.pdf-field textarea,
.pdf-upload-box input[type="file"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #ffffff;
    color: var(--text);
    padding: 0 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 780;
    outline: none;
    box-sizing: border-box;
}

.pdf-field textarea {
    min-height: 92px;
    padding: 11px 12px;
    line-height: 1.45;
    resize: vertical;
}

.pdf-upload-box {
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 16px;
    background: #f8fafc;
    overflow: hidden;
}

.pdf-upload-box input[type="file"] {
    padding: 8px 10px;
    color: #475569;
    font-size: 12px;
    line-height: 1.2;
}

.pdf-upload-box input[type="file"]::file-selector-button {
    max-width: 128px;
    margin-right: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: 10px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 900;
    cursor: pointer;
}

.pdf-upload-box input[type="file"]::-webkit-file-upload-button {
    max-width: 128px;
    margin-right: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: 10px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 900;
    cursor: pointer;
}

.pdf-upload-box small {
    display: block;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 740;
}

.pdf-field input:focus,
.pdf-field textarea:focus,
.pdf-upload-box input[type="file"]:focus {
    border-color: rgba(37, 99, 235, .42);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.pdf-modal-actions {
    margin-top: 4px;
}

.pdf-viewer-modal-card {
    width: min(1080px, calc(100vw - 20px));
    height: min(96dvh, 980px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
}

.pdf-viewer-frame-wrap {
    flex: 1 1 auto;
    min-height: 0;
    background: #f1f5f9;
}

.pdf-viewer-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
    display: block;
}

/* Video Library */
.video-library-shell {
    border-color: rgba(199, 210, 254, .75);
}

.video-library-body {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.video-card .video-thumbnail {
    padding: 10px 10px 2px;
}

.video-thumbnail-art {
    --video-thumb-ratio: 16 / 9;
    position: relative;
    width: min(100%, 178px);
    aspect-ratio: var(--video-thumb-ratio);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 28%),
        linear-gradient(135deg, #111827 0%, #1d4ed8 52%, #7c3aed 100%);
    box-shadow: 0 16px 32px rgba(37, 99, 235, .18);
    transition: transform .16s ease;
}

.video-thumbnail-art.video-ratio-portrait {
    width: min(72%, 132px);
}

.video-thumbnail-art.video-ratio-square {
    width: min(86%, 158px);
}

.video-thumbnail-art.has-media {
    background: #020617;
}

.video-thumb-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #020617;
}

.video-thumbnail-art::before {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: 3;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .28);
    pointer-events: none;
}

.video-thumbnail-art::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    height: 42%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, .58));
    pointer-events: none;
}

.video-play-mark {
    position: relative;
    z-index: 4;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    color: #0f172a;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 26px rgba(15, 23, 42, .22);
    font-size: 22px;
    line-height: 1;
    transition: transform .16s ease;
}

.video-source-badge {
    position: absolute;
    z-index: 3;
    right: 12px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .82);
    color: #ffffff;
    font-size: 10px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .08em;
}

.video-card-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #475569;
}

.video-card:hover .video-play-mark {
    transform: scale(1.04);
}

.video-viewer-description {
    margin-top: 6px;
    white-space: pre-wrap;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.45;
    font-weight: 720;
}

.video-viewer-frame-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #020617;
}

.video-viewer-iframe,
.video-viewer-player {
    width: 100%;
    height: 100%;
    border: 0;
    background: #020617;
    display: block;
}

.video-viewer-player {
    object-fit: contain;
}

.video-upload-box input[type="file"]::file-selector-button,
.video-upload-box input[type="file"]::-webkit-file-upload-button {
    max-width: 140px;
}

@media (max-width: 760px) {
    .pdf-library-head,
    .pdf-library-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .pdf-library-actions > * {
        width: 100%;
        justify-content: center;
    }

    .pdf-library-body {
        padding: 12px;
    }

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

    .pdf-card {
        border-radius: 16px;
    }

    .pdf-card-copy {
        padding: 10px 10px 9px;
    }

    .pdf-card-copy strong {
        font-size: 12.5px;
    }

    .pdf-card-copy small {
        font-size: 10.5px;
    }

    .pdf-card-actions {
        top: 7px;
        right: 7px;
    }

    .pdf-card-edit {
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
        min-height: 28px;
        max-height: 28px;
        flex: 0 0 28px;
        aspect-ratio: 1 / 1;
        padding: 0;
        border-radius: 999px;
        font-size: 0;
    }

    .pdf-card-edit::before {
        font-size: 12.5px;
    }

    .pdf-modal-backdrop,
    .pdf-viewer-backdrop,
    .video-modal-backdrop,
    .video-viewer-backdrop {
        padding: 8px;
        align-items: stretch;
    }

    .pdf-upload-modal-card,
    .pdf-viewer-modal-card,
    .video-upload-modal-card,
    .video-viewer-modal-card {
        width: 100%;
        height: auto;
        max-height: calc(100dvh - 16px);
        border-radius: 22px;
    }

    .pdf-viewer-modal-card,
    .video-viewer-modal-card {
        height: calc(100dvh - 16px);
    }

    .pdf-modal-header,
    .pdf-viewer-header,
    .video-modal-header,
    .video-viewer-header {
        padding: 14px;
    }

    .pdf-upload-form {
        padding: 12px;
    }

    .pdf-modal-actions,
    .video-modal-actions {
        flex-direction: column;
    }

    .pdf-modal-actions button,
    .video-modal-actions button {
        width: 100%;
    }

    .pdf-edit-actions {
        align-items: stretch;
    }

    .pdf-edit-action-spacer {
        display: none;
    }
}

/* Responsive internal Memo PDF viewer */
:root {
    --pdf-viewer-vw: 100vw;
    --pdf-viewer-vh: 100dvh;
}

.pdf-viewer-backdrop {
    padding: clamp(8px, 1.6vw, 20px);
    align-items: center;
    justify-content: center;
    min-height: var(--pdf-viewer-vh, 100dvh);
    box-sizing: border-box;
}

.pdf-viewer-modal-card {
    width: min(1180px, calc(var(--pdf-viewer-vw, 100vw) - clamp(16px, 3.2vw, 40px)));
    height: min(980px, calc(var(--pdf-viewer-vh, 100dvh) - clamp(16px, 3.2vw, 40px)));
    max-width: calc(var(--pdf-viewer-vw, 100vw) - clamp(16px, 3.2vw, 40px));
    max-height: calc(var(--pdf-viewer-vh, 100dvh) - clamp(16px, 3.2vw, 40px));
    border-radius: clamp(16px, 2vw, 24px);
    display: flex;
    flex-direction: column;
}

.pdf-viewer-header {
    flex: 0 0 auto;
    padding: clamp(12px, 1.5vw, 18px);
    gap: 10px;
}

.pdf-viewer-header > div {
    min-width: 0;
}

.pdf-viewer-header h2,
.pdf-viewer-header p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-viewer-frame-wrap {
    flex: 1 1 auto;
    min-height: 240px;
    height: 100%;
    overflow: hidden;
    background: #eef2f7;
}

.pdf-viewer-frame-wrap iframe {
    width: 100%;
    height: 100%;
    min-height: 240px;
}

@media (max-width: 1024px) {
    .pdf-viewer-backdrop {
        padding: 10px;
        align-items: stretch;
    }

    .pdf-viewer-modal-card {
        width: calc(var(--pdf-viewer-vw, 100vw) - 20px);
        height: calc(var(--pdf-viewer-vh, 100dvh) - 20px);
        max-width: calc(var(--pdf-viewer-vw, 100vw) - 20px);
        max-height: calc(var(--pdf-viewer-vh, 100dvh) - 20px);
    }
}

@media (max-width: 760px) {
    .pdf-viewer-backdrop {
        padding: 0;
        align-items: stretch;
    }

    .pdf-viewer-modal-card {
        width: var(--pdf-viewer-vw, 100vw);
        height: var(--pdf-viewer-vh, 100dvh);
        max-width: var(--pdf-viewer-vw, 100vw);
        max-height: var(--pdf-viewer-vh, 100dvh);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .pdf-viewer-header {
        padding: 10px 12px;
        min-height: 56px;
    }

    .pdf-viewer-header h2 {
        font-size: 14px;
        line-height: 1.2;
    }

    .pdf-viewer-header p {
        font-size: 11px;
    }

    .pdf-viewer-frame-wrap,
    .pdf-viewer-frame-wrap iframe {
        min-height: 0;
    }
}

@media (max-height: 560px) and (orientation: landscape) {
    .pdf-viewer-backdrop {
        padding: 0;
        align-items: stretch;
    }

    .pdf-viewer-modal-card {
        width: var(--pdf-viewer-vw, 100vw);
        height: var(--pdf-viewer-vh, 100dvh);
        max-width: var(--pdf-viewer-vw, 100vw);
        max-height: var(--pdf-viewer-vh, 100dvh);
        border-radius: 0;
    }

    .pdf-viewer-header {
        padding: 7px 10px;
        min-height: 44px;
    }

    .pdf-viewer-header p {
        display: none;
    }
}

/* Mobile Memo header actions: keep count and add button beside title */
@media (max-width: 760px) {
    .pdf-library-head {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .pdf-library-head > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    .pdf-library-head h2 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pdf-library-actions {
        flex: 0 0 auto;
        width: auto;
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        margin-left: auto;
    }

    .pdf-library-actions > * {
        width: auto;
        min-width: 0;
        justify-content: center;
        flex: 0 0 auto;
    }

    .pdf-library-actions .table-count-pill {
        min-height: 28px;
        padding: 0 9px;
        font-size: 10.5px;
        white-space: nowrap;
    }

    .pdf-add-btn {
        min-height: 28px;
        padding: 0 10px;
        border-radius: 10px;
        font-size: 10.5px;
        white-space: nowrap;
    }
}

/* Company Holiday List - thin vertical column lines */
.holiday-table th:not(:last-child),
.holiday-table td:not(:last-child) {
    border-right: 1px solid rgba(226, 232, 240, .78);
}

.holiday-table th:last-child,
.holiday-table td:last-child {
    border-right: 0;
}

/* Fix sticky notes closed-state layout shift on workspace/page change.
   Sticky notes is a fixed overlay, so the shell should not reserve a third column
   before JavaScript applies the saved hidden/open state. */
@media (min-width: 1101px) {
    .app-shell,
    .app-shell.notes-hidden {
        grid-template-columns: 274px minmax(0, 1fr) !important;
    }
}

@media (min-width: 821px) and (max-width: 1100px) {
    .app-shell,
    .app-shell.notes-hidden {
        grid-template-columns: 238px minmax(0, 1fr) !important;
    }
}

@media (max-width: 820px) {
    .app-shell,
    .app-shell.notes-hidden {
        display: block;
        grid-template-columns: none !important;
    }
}

/* Edit Job invoice remove button */
.invoice-compact-field .current-invoice {
    position: relative;
    padding-right: 34px;
}

.invoice-compact-field .current-invoice .invoice-remove-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
    box-shadow: none;
}

.invoice-compact-field .current-invoice .invoice-remove-btn:hover {
    background: #fff5f5;
    border-color: #fecaca;
    color: #dc2626;
}

.invoice-compact-field .current-invoice.is-marked-remove {
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    font-weight: 700;
}

.invoice-compact-field .current-invoice.is-marked-remove span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Fix: keep invoice delete/restore notice from collapsing when the X is clicked again */
.invoice-compact-field .current-invoice,
.invoice-compact-field .current-invoice.is-marked-remove {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 7px 36px 7px 10px !important;
    box-sizing: border-box !important;
}

.invoice-compact-field .current-invoice.is-marked-remove span {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.invoice-compact-field .current-invoice .invoice-remove-btn,
.invoice-compact-field .current-invoice.is-marked-remove .invoice-remove-btn {
    flex: 0 0 22px !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
}


/* Memo edit modal: keep Delete / Cancel / Save in one row on mobile */
@media (max-width: 640px) {
    .pdf-edit-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .pdf-edit-actions .pdf-edit-action-spacer {
        display: none !important;
    }

    .pdf-edit-actions .pdf-edit-delete-btn,
    .pdf-edit-actions .soft-btn,
    .pdf-edit-actions .primary-btn {
        width: 100% !important;
        min-width: 0 !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 8px !important;
        border-radius: 12px !important;
        font-size: 12px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        justify-content: center !important;
    }
}


/* Mobile calendar sticky note popup: center modal instead of bottom */
@media (max-width: 640px) {
    #stickyNoteModal,
    .sticky-note-modal,
    .sticky-modal,
    .sticky-note-popup,
    .calendar-sticky-note-modal {
        align-items: center !important;
        justify-content: center !important;
        padding: 18px !important;
    }

    #stickyNoteModal .modal-card,
    #stickyNoteModal .sticky-note-card,
    #stickyNoteModal .sticky-modal-card,
    .sticky-note-modal .modal-card,
    .sticky-note-modal .sticky-note-card,
    .sticky-note-popup .modal-card,
    .calendar-sticky-note-modal .modal-card {
        margin: auto !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        max-height: calc(100dvh - 36px) !important;
    }
}


/* Workspace Settings: per-workspace tab rename fields */
.workspace-tab-name-wrap {
    min-width: 0 !important;
    display: grid !important;
    gap: 4px !important;
    align-items: center !important;
}

.workspace-tab-name-wrap .workspace-tab-name {
    min-height: auto !important;
    line-height: 1.1 !important;
}

.workspace-tab-rename-input {
    width: 100% !important;
    min-width: 0 !important;
    height: 25px !important;
    min-height: 25px !important;
    padding: 0 8px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.workspace-tab-rename-input:focus {
    border-color: rgba(79, 93, 247, .45) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(79, 93, 247, .10) !important;
}

.workspace-tab-compact-row {
    min-height: 50px !important;
    grid-template-columns: minmax(0, 1fr) 54px 54px 78px !important;
}

@media (max-width: 640px) {
    .workspace-tab-compact-row {
        min-height: 48px !important;
        grid-template-columns: minmax(0, 1fr) 48px 48px 66px !important;
        column-gap: 4px !important;
    }

    .workspace-tab-rename-input {
        height: 23px !important;
        min-height: 23px !important;
        padding: 0 6px !important;
        font-size: 10.5px !important;
        border-radius: 7px !important;
    }
}


/* Company Holiday List index number column */
.holiday-index-col,
.holiday-index-cell {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    text-align: center !important;
    white-space: nowrap;
}

.holiday-index-cell {
    color: #64748b;
    font-weight: 800;
}


/* Add Memo: upload or paste link */
.pdf-link-field small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
}

.pdf-link-field input[type="url"] {
    width: 100%;
}


/* Fix Edit Holiday Image upload row after X remove button update */
.holiday-visual-upload-title {
    display: block;
    color: var(--text);
    font-size: 12px;
    font-weight: 950;
}

.holiday-visual-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.holiday-visual-file-row input[type="file"] {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.holiday-visual-remove-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    max-width: 34px;
    min-height: 34px;
    max-height: 34px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(203, 213, 225, .95);
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.holiday-visual-remove-btn:hover {
    background: #fff1f2;
    border-color: rgba(244, 63, 94, .42);
    color: #e11d48;
    transform: translateY(-1px);
}

.holiday-visual-remove-btn input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.holiday-visual-remove-btn span {
    display: block;
    color: currentColor;
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
    transform: translateY(-1px);
}

.holiday-visual-remove-btn:has(input:checked) {
    background: #fee2e2;
    border-color: rgba(239, 68, 68, .55);
    color: #dc2626;
}

@supports not selector(:has(*)) {
    .holiday-visual-remove-btn input[type="checkbox"]:checked + span {
        color: #dc2626;
    }
}

@media (max-width: 640px) {
    .holiday-visual-file-row {
        grid-template-columns: minmax(0, 1fr) 32px;
        gap: 7px;
    }

    .holiday-visual-remove-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        max-width: 32px;
        min-height: 32px;
        max-height: 32px;
        border-radius: 9px;
    }
}


/* Holiday visual layout lock: keep image/title/description position consistent between workspaces */
.holiday-visual-card {
    display: grid !important;
    grid-template-rows: 245px 148px !important;
    min-height: 393px !important;
}

.holiday-visual-art {
    height: 245px !important;
    min-height: 245px !important;
    max-height: 245px !important;
    aspect-ratio: auto !important;
}

.holiday-visual-copy {
    height: 148px !important;
    min-height: 148px !important;
    max-height: 148px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    align-content: start !important;
}

#holidayVisualDescription {
    max-height: 90px !important;
    overflow-y: auto !important;
    padding-right: 4px !important;
    overscroll-behavior: contain !important;
}

#holidayVisualDescription::-webkit-scrollbar {
    width: 4px;
}

#holidayVisualDescription::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .65);
    border-radius: 999px;
}

.holiday-visual-preview {
    height: 206px !important;
    min-height: 206px !important;
    max-height: 206px !important;
    aspect-ratio: auto !important;
    box-sizing: border-box !important;
}

.holiday-visual-preview img {
    object-fit: cover !important;
}

@media (max-width: 980px) {
    .holiday-visual-card {
        grid-template-rows: 220px 148px !important;
        min-height: 368px !important;
    }

    .holiday-visual-art {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
    }
}

@media (max-width: 640px) {
    .holiday-visual-card {
        grid-template-rows: 200px 142px !important;
        min-height: 342px !important;
    }

    .holiday-visual-art {
        height: 200px !important;
        min-height: 200px !important;
        max-height: 200px !important;
    }

    .holiday-visual-copy {
        height: 142px !important;
        min-height: 142px !important;
        max-height: 142px !important;
    }

    #holidayVisualDescription {
        max-height: 84px !important;
    }

    .holiday-visual-preview {
        height: 190px !important;
        min-height: 190px !important;
        max-height: 190px !important;
    }
}

/* Video Library visual tuning */
.video-library-head h2 {
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.video-library-head p {
    font-size: 10.8px;
    line-height: 1.32;
}

.video-library-grid .video-card {
    width: 216px;
}

.video-card .video-thumbnail {
    padding: 8px 8px 1px;
}

.video-thumbnail-art {
    width: min(100%, 200px);
    border-radius: 6px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .14);
}

.video-thumbnail-art.video-ratio-portrait {
    width: min(72%, 150px);
}

.video-thumbnail-art.video-ratio-square {
    width: min(86%, 182px);
}

.video-thumbnail-art::before {
    inset: 7px;
    border-radius: 4px;
    border-color: rgba(255, 255, 255, .22);
}

.video-play-mark {
    width: 44px;
    height: 44px;
    font-size: 18px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, .18);
}

.video-source-badge {
    right: 9px;
    bottom: 8px;
    min-width: 34px;
    min-height: 20px;
    padding: 0 7px;
    font-size: 9px;
}

.video-card-copy {
    gap: 3px;
    padding-top: 6px;
}

.video-card-copy strong {
    font-size: 15.2px;
    line-height: 1.22;
    font-weight: 820;
}

.video-card-copy small {
    font-size: 11.2px;
    line-height: 1.34;
}

.video-upload-modal-card {
    width: min(560px, calc(100vw - 32px));
    max-height: min(84dvh, 700px);
    border-radius: 20px;
}

.video-viewer-backdrop {
    padding: clamp(18px, 4vw, 42px);
    align-items: center;
    justify-content: center;
}

.video-viewer-modal-card {
    width: min(920px, calc(100vw - 48px));
    height: auto;
    max-width: calc(100vw - 48px);
    max-height: min(88dvh, 820px);
    border-radius: 18px;
}

.video-viewer-modal-card.video-viewer-portrait {
    width: min(390px, calc(100vw - 48px));
}

.video-viewer-modal-card.video-viewer-square {
    width: min(640px, calc(100vw - 48px));
}

.video-viewer-header {
    padding: 12px 14px;
    min-height: 58px;
}

.video-viewer-header h2 {
    font-size: 16px;
    line-height: 1.2;
}

.video-viewer-header p {
    font-size: 11.5px;
}

.video-viewer-frame-wrap {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 0 0 auto;
    aspect-ratio: var(--video-viewer-ratio, 16 / 9);
    max-height: min(72dvh, 620px);
}

@media (max-width: 760px) {
    .video-library-grid .video-card {
        width: 100%;
    }

    .video-thumbnail-art {
        width: min(100%, 186px);
        border-radius: 6px;
    }

    .video-thumbnail-art.video-ratio-portrait {
        width: min(70%, 138px);
    }

    .video-card-copy strong {
        font-size: 13.5px;
    }

    .video-card-copy small {
        font-size: 10.6px;
    }

    .video-upload-modal-card {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 18px;
    }

    .video-viewer-backdrop {
        padding: 14px;
        align-items: center;
        justify-content: center;
    }

    .video-viewer-modal-card,
    .video-viewer-modal-card.video-viewer-square {
        width: min(580px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        height: auto;
        max-height: calc(100dvh - 28px);
        border-radius: 18px;
        border-left: 1px solid var(--line);
        border-right: 1px solid var(--line);
    }

    .video-viewer-modal-card.video-viewer-portrait {
        width: min(380px, calc(100vw - 24px));
    }

    .video-viewer-frame-wrap {
        max-height: calc(100dvh - 104px);
    }
}

/* Memo text sizing: match Video card typography */
.pdf-library-head:not(.video-library-head) h2 {
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.pdf-library-head:not(.video-library-head) p {
    font-size: 10.8px;
    line-height: 1.32;
}

.pdf-thumbnail-filename {
    font-size: 11.2px;
    line-height: 1.34;
}

.pdf-card-copy strong {
    font-size: 15.2px;
    line-height: 1.22;
    font-weight: 820;
}

.pdf-card-copy small {
    font-size: 11.2px;
    line-height: 1.34;
}

@media (max-width: 760px) {
    .pdf-card-copy strong {
        font-size: 13.5px;
    }

    .pdf-card-copy small,
    .pdf-thumbnail-filename {
        font-size: 10.6px;
    }
}

/* Compact Google Sheet style for Report Marketing tables */
:is(#marketingReportView, #accountReportView) .marketing-report-shell {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 34px;
    margin-bottom: 10px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-shell::-webkit-scrollbar {
    width: 0;
    height: 0;
}

:is(#marketingReportView, #accountReportView) .marketing-report-shell::-webkit-scrollbar-track {
    background: transparent;
}

:is(#marketingReportView, #accountReportView) .marketing-report-shell::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .65);
    border-radius: 999px;
    border: 3px solid #ffffff;
}

:is(#marketingReportView, #accountReportView) .marketing-report-subsection {
    margin-top: 14px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head {
    min-width: max-content;
    padding: 10px 12px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-subhead {
    padding-top: 9px;
    padding-bottom: 8px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table-body {
    width: max-content;
    min-width: max-content;
    padding: 0;
    overflow: visible;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table-wrap {
    width: max-content;
    min-width: max-content;
    max-height: none;
    overflow: visible;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 10px;
    box-shadow: none;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table {
    min-width: max-content;
    width: max-content;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 11px;
    background: #ffffff;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th,
:is(#marketingReportView, #accountReportView) .marketing-report-table td {
    height: 31px;
    min-height: 31px;
    padding: 3px 5px;
    border-right: 1px solid rgba(226, 232, 240, .95);
    border-bottom: 1px solid rgba(226, 232, 240, .95);
    line-height: 1.25;
    vertical-align: middle;
    white-space: nowrap;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th {
    font-size: 10px;
    font-weight: 900;
    background: #f8fafc;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td {
    border-bottom: 0;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:last-child,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:last-child {
    border-right: 0;
}

:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-index-cell {
    left: 0;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    padding-left: 3px;
    padding-right: 3px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-name-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell {
    left: 38px;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    padding-left: 8px;
    padding-right: 8px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-name-cell strong {
    display: inline-block;
    font-size: 11px;
    line-height: 1.25;
    padding-bottom: 1px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-day-col,
:is(#marketingReportView, #accountReportView) .marketing-report-day-cell {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-total-col,
:is(#marketingReportView, #accountReportView) .marketing-report-row-total-cell,
:is(#marketingReportView, #accountReportView) .marketing-report-grand-total-cell {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    font-weight: 900;
    background: #f8fafc;
}

:is(#marketingReportView, #accountReportView) .marketing-report-total-row td {
    background: #f8fafc;
    font-weight: 900;
}

:is(#marketingReportView, #accountReportView) .marketing-report-input {
    width: 82px;
    height: 25px;
    min-height: 25px;
    padding: 2px 7px 3px;
    border: 1px solid rgba(203, 213, 225, .95);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: 700 11px/1.25 inherit;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    text-align: center;
    outline: none;
    box-shadow: none;
}

:is(#marketingReportView, #accountReportView) .marketing-report-input:focus {
    border-color: rgba(66, 77, 211, .6);
    box-shadow: 0 0 0 2px rgba(66, 77, 211, .10);
}

:is(#marketingReportView, #accountReportView) .marketing-report-input:disabled {
    background: #f8fafc;
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
    opacity: 1;
    cursor: not-allowed;
}

:is(#marketingReportView, #accountReportView) .table-index-badge {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 7px;
    font-size: 10px;
    line-height: 22px;
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-head {
        padding: 9px 10px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-table th,
    :is(#marketingReportView, #accountReportView) .marketing-report-table td {
        padding: 3px 5px;
        height: 30px;
        min-height: 30px;
        line-height: 1.25;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-index-col,
    :is(#marketingReportView, #accountReportView) .marketing-report-index-cell,
    :is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
    :is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1) {
        left: 0;
        width: 36px;
        min-width: 36px;
        max-width: 36px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-name-col,
    :is(#marketingReportView, #accountReportView) .marketing-report-name-cell,
    :is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
    :is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2) {
        left: 36px;
        width: 132px;
        min-width: 132px;
        max-width: 132px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-day-col,
    :is(#marketingReportView, #accountReportView) .marketing-report-day-cell,
    :is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(n+3),
    :is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(n+3) {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-total-col,
    :is(#marketingReportView, #accountReportView) .marketing-report-row-total-cell,
    :is(#marketingReportView, #accountReportView) .marketing-report-grand-total-cell {
        width: 104px;
        min-width: 104px;
        max-width: 104px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-input {
        width: 78px;
        height: 24px;
        min-height: 24px;
        font-size: 10.5px;
        line-height: 1.25;
        padding-bottom: 3px;
    }
}


/* Sticky native-style bottom scrollbar for all Report Marketing tables */
:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar {
    position: sticky;
    z-index: 8;
    bottom: 0;
    left: auto;
    width: 100%;
    height: 18px;
    display: block;
    visibility: hidden;
    pointer-events: none;
    margin-top: 10px;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: auto;
    scrollbar-color: auto;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar {
    height: initial;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar-track {
    background: initial;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar-thumb {
    background: initial;
    border: initial;
    border-radius: initial;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar-inner {
    height: 1px;
    min-width: 100%;
}

/* Thinner blue today highlight in Report Marketing */
:is(#marketingReportView, #accountReportView) .marketing-report-table th.marketing-report-today-col,
:is(#marketingReportView, #accountReportView) .marketing-report-table td.marketing-report-today-col {
    background: inherit;
    box-shadow: inset 1px 0 0 rgba(69, 87, 230, .35), inset -1px 0 0 rgba(69, 87, 230, .35);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th.marketing-report-today-col {
    color: var(--primary);
    background: inherit;
    box-shadow: inset 1px 0 0 rgba(69, 87, 230, .70), inset -1px 0 0 rgba(69, 87, 230, .70), inset 0 1px 0 rgba(69, 87, 230, .70), inset 0 -1px 0 rgba(69, 87, 230, .70);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td.marketing-report-today-col,
:is(#marketingReportView, #accountReportView) .marketing-report-total-row td.marketing-report-today-col {
    box-shadow: inset 1px 0 0 rgba(69, 87, 230, .35), inset -1px 0 0 rgba(69, 87, 230, .35), inset 0 -1px 0 rgba(69, 87, 230, .35);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table td.marketing-report-today-col .marketing-report-input {
    border-color: rgba(69, 87, 230, .26);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table .marketing-report-today-focus {
    animation: marketingTodayPulse 1.2s ease-out 1;
}

@keyframes marketingTodayPulse {
    0% { background-color: rgba(69, 87, 230, .11); }
    100% { background-color: inherit; }
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-shell {
        padding-bottom: 40px;
        margin-bottom: 12px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar {
        bottom: 0;
        height: 18px;
        padding: 0;
    }
}

/* Keep every Report Marketing box header fixed while horizontally scrolling tables */
:is(#marketingReportView, #accountReportView) .marketing-report-head {
    position: sticky;
    left: 0;
    z-index: 12;
    width: var(--marketing-report-fixed-head-width, 100%);
    min-width: var(--marketing-report-fixed-head-width, 0);
    max-width: var(--marketing-report-fixed-head-width, 100%);
    box-sizing: border-box;
    flex-shrink: 0;
}

:is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head {
    width: var(--marketing-report-fixed-head-width, 100%);
    min-width: var(--marketing-report-fixed-head-width, 0);
    max-width: var(--marketing-report-fixed-head-width, 100%);
}

:is(#marketingReportView, #accountReportView) .marketing-report-head > div {
    min-width: 0;
    max-width: calc(100% - 120px);
}

:is(#marketingReportView, #accountReportView) .marketing-report-head h2,
:is(#marketingReportView, #accountReportView) .marketing-report-head p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head .table-count-pill {
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: -30px;
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-head > div {
        max-width: calc(100% - 92px);
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-head .table-count-pill {
        margin-right: -18px;
    }
}


/* Hard-fix: keep Report Marketing headers fixed during horizontal scroll
   - Main header uses sticky only.
   - Subsection headers cancel the scroll movement because their parent section sits inside the wide scroll area. */
:is(#marketingReportView, #accountReportView) .marketing-report-shell > .marketing-report-head {
    transform: none;
    will-change: auto;
}

:is(#marketingReportView, #accountReportView) .marketing-report-subsection {
    width: var(--marketing-report-fixed-head-width, 100%);
    min-width: var(--marketing-report-fixed-head-width, 0);
    max-width: var(--marketing-report-fixed-head-width, 100%);
    overflow: visible;
}

:is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head {
    transform: translateX(var(--marketing-report-scroll-left, 0px));
    will-change: transform;
}

:is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-table-body {
    width: max-content;
    min-width: max-content;
}


/* Cost Per Lead table uses the same compact Report Marketing grid. */
:is(#marketingReportView, #accountReportView) .marketing-cost-per-lead-section .marketing-report-input {
    background: #ffffff;
}

:is(#marketingReportView, #accountReportView) .marketing-cost-per-lead-section .marketing-report-calculated-input {
    cursor: default;
    color: #111827;
    background: #f9fafb;
}

:is(#marketingReportView, #accountReportView) .marketing-cost-per-lead-section .marketing-report-calculated-input:focus {
    outline: none;
    box-shadow: none;
}

:is(#marketingReportView, #accountReportView) .marketing-cost-per-lead-total-row td {
    background: #f8fafc;
}

/* Cross-browser fix: keep Report Marketing count/tag aligned the same in Firefox/Brave/Chrome.
   Avoid negative margins because different browsers calculate overflow/scrollbar space differently. */
:is(#marketingReportView, #accountReportView) .marketing-report-head {
    position: sticky;
    left: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding-right: 18px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head > div {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 156px);
    padding-right: 12px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head .table-count-pill {
    flex: 0 0 auto;
    margin-left: auto !important;
    margin-right: 0 !important;
    transform: none !important;
    position: relative;
    right: 0;
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-head {
        gap: 10px;
        padding-right: 12px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-head > div {
        max-width: calc(100% - 112px);
        padding-right: 8px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-head .table-count-pill {
        margin-right: 0 !important;
    }
}

/* Cross-browser stable bottom scrollbar for Report Marketing.
   Uses a dedicated synced scrollbar so Brave/Chrome/Firefox all show the same control. */
:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar {
    position: -webkit-sticky;
    position: sticky;
    bottom: 0;
    z-index: 40;
    width: 100%;
    height: 18px;
    min-height: 18px;
    display: block !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    margin: 8px 0 0;
    padding: 0;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    background: #f8fafc;
    border-top: 1px solid rgba(226, 232, 240, .95);
    border-bottom: 1px solid rgba(226, 232, 240, .95);
    border-radius: 0;
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
    box-sizing: border-box;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar.is-visible {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar {
    height: 13px !important;
    display: block !important;
    background: #f8fafc !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc !important;
    border-radius: 0 !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1 !important;
    border: 3px solid #f8fafc !important;
    border-radius: 999px !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8 !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar-inner {
    height: 1px;
    min-height: 1px;
    min-width: 100%;
}

:is(#marketingReportView, #accountReportView) .marketing-report-shell {
    scrollbar-gutter: stable;
}


/* Final Report Marketing cross-browser header + tag alignment fix
   Use one method for Brave/Chrome/Firefox/mobile: every section header is counter-translated
   by the table scrollLeft and uses the visible shell width only. */
:is(#marketingReportView, #accountReportView) .marketing-report-shell {
    scrollbar-gutter: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head,
:is(#marketingReportView, #accountReportView) .marketing-report-shell > .marketing-report-head,
:is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    z-index: 30 !important;
    width: var(--marketing-report-fixed-head-width, 100%) !important;
    min-width: var(--marketing-report-fixed-head-width, 100%) !important;
    max-width: var(--marketing-report-fixed-head-width, 100%) !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding-right: 16px !important;
    transform: translate3d(var(--marketing-report-scroll-left, 0px), 0, 0) !important;
    will-change: transform !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head > div,
:is(#marketingReportView, #accountReportView) .marketing-report-shell > .marketing-report-head > div,
:is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head > div {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-right: 10px !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head h2,
:is(#marketingReportView, #accountReportView) .marketing-report-head p {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head .table-count-pill,
:is(#marketingReportView, #accountReportView) .marketing-report-shell > .marketing-report-head .table-count-pill,
:is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head .table-count-pill {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    position: static !important;
    right: auto !important;
    transform: none !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-subsection {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar {
    width: var(--marketing-report-fixed-head-width, 100%) !important;
    max-width: var(--marketing-report-fixed-head-width, 100%) !important;
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-head,
    :is(#marketingReportView, #accountReportView) .marketing-report-shell > .marketing-report-head,
    :is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head {
        gap: 10px !important;
        padding-right: 12px !important;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-head > div,
    :is(#marketingReportView, #accountReportView) .marketing-report-shell > .marketing-report-head > div,
    :is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head > div {
        padding-right: 8px !important;
    }
}

/* Report Marketing fixed first columns: make # and name columns solid while horizontally scrolling. */
:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-index-cell {
    position: sticky !important;
    left: 0 !important;
    z-index: 24 !important;
    background-color: #ffffff !important;
    background-clip: padding-box !important;
    isolation: isolate;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-name-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell {
    position: sticky !important;
    left: 38px !important;
    z-index: 25 !important;
    background-color: #ffffff !important;
    background-clip: padding-box !important;
    isolation: isolate;
    box-shadow: 1px 0 0 rgba(226, 232, 240, .95);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col {
    z-index: 36 !important;
    background-color: #f8fafc !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-total-row td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-total-row td:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td:nth-child(2) {
    background-color: #f8fafc !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table td.marketing-report-today-col:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table td.marketing-report-today-col:nth-child(2) {
    background-color: #ffffff !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th.marketing-report-today-col:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table th.marketing-report-today-col:nth-child(2) {
    background-color: #f8fafc !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-total-row td.marketing-report-today-col:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-total-row td.marketing-report-today-col:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td.marketing-report-today-col:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td.marketing-report-today-col:nth-child(2) {
    background-color: #f8fafc !important;
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
    :is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1),
    :is(#marketingReportView, #accountReportView) .marketing-report-index-col,
    :is(#marketingReportView, #accountReportView) .marketing-report-index-cell {
        left: 0 !important;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
    :is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2),
    :is(#marketingReportView, #accountReportView) .marketing-report-name-col,
    :is(#marketingReportView, #accountReportView) .marketing-report-name-cell {
        left: 36px !important;
    }
}

/* Final seam fix for Report Marketing sticky columns.
   Some browsers show a 1-2px moving layer behind sticky table cells when using collapsed
   borders + horizontal scroll. Keep the first two columns opaque and cover the seam edges. */
:is(#marketingReportView, #accountReportView) .marketing-report-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-index-cell,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell {
    --marketing-sticky-cell-bg: #ffffff;
    background: var(--marketing-sticky-cell-bg) !important;
    background-clip: border-box !important;
    overflow: visible !important;
    isolation: isolate !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col,
:is(#marketingReportView, #accountReportView) .marketing-report-table thead th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table thead th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-total-row td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-total-row td:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td:nth-child(2) {
    --marketing-sticky-cell-bg: #f8fafc;
    background: var(--marketing-sticky-cell-bg) !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-index-col::after,
:is(#marketingReportView, #accountReportView) .marketing-report-index-cell::after,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col::after,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell::after {
    content: "";
    position: absolute;
    top: -1px;
    right: -4px;
    bottom: -1px;
    width: 5px;
    background: var(--marketing-sticky-cell-bg) !important;
    pointer-events: none;
    z-index: 1;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col::after,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell::after {
    right: -6px;
    width: 7px;
    box-shadow: 1px 0 0 rgba(226, 232, 240, .95);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-index-cell {
    box-shadow: inset -1px 0 0 rgba(226, 232, 240, .95) !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-name-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell {
    box-shadow: inset -1px 0 0 rgba(226, 232, 240, .95), 2px 0 0 var(--marketing-sticky-cell-bg) !important;
}

/* Mobile/cross-browser final fix: keep every Report Marketing section header steady
   with native sticky instead of JS transform. This removes title/count jitter on mobile. */
:is(#marketingReportView, #accountReportView) .marketing-report-head,
:is(#marketingReportView, #accountReportView) .marketing-report-shell > .marketing-report-head,
:is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head {
    position: sticky !important;
    left: 0 !important;
    right: auto !important;
    top: auto !important;
    width: var(--marketing-report-fixed-head-width, 100%) !important;
    min-width: var(--marketing-report-fixed-head-width, 100%) !important;
    max-width: var(--marketing-report-fixed-head-width, 100%) !important;
    transform: none !important;
    will-change: auto !important;
    background: #ffffff !important;
    z-index: 80 !important;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

:is(#marketingReportView, #accountReportView) .marketing-report-head .table-count-pill,
:is(#marketingReportView, #accountReportView) .marketing-report-shell > .marketing-report-head .table-count-pill,
:is(#marketingReportView, #accountReportView) .marketing-report-subsection .marketing-report-head .table-count-pill {
    margin-left: auto !important;
    margin-right: 0 !important;
    transform: none !important;
}

/* Keep the first two sticky columns clean on mobile/desktop.
   A small seam mask follows scrollLeft behind the sticky cells so the 3rd column/input
   cannot peek through at the left edge while swiping horizontally. */
:is(#marketingReportView, #accountReportView) .marketing-report-shell {
    --marketing-report-index-width: 38px;
    --marketing-report-name-width: 150px;
    --marketing-report-sticky-cols-width: 188px;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table-wrap {
    position: relative !important;
    overflow: visible !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table-wrap::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--marketing-report-scroll-left, 0px);
    bottom: 0;
    width: var(--marketing-report-sticky-cols-width, 188px);
    background: #ffffff;
    pointer-events: none;
    z-index: 21;
    box-shadow: 1px 0 0 rgba(226, 232, 240, .95);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-index-cell {
    left: 0 !important;
    width: var(--marketing-report-index-width, 38px) !important;
    min-width: var(--marketing-report-index-width, 38px) !important;
    max-width: var(--marketing-report-index-width, 38px) !important;
    z-index: 32 !important;
    transform: translateZ(0);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-name-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell {
    left: var(--marketing-report-index-width, 38px) !important;
    width: var(--marketing-report-name-width, 150px) !important;
    min-width: var(--marketing-report-name-width, 150px) !important;
    max-width: var(--marketing-report-name-width, 150px) !important;
    z-index: 33 !important;
    transform: translateZ(0);
}

:is(#marketingReportView, #accountReportView) .marketing-report-table thead th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table thead th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col {
    z-index: 45 !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col::after,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell::after {
    right: -14px !important;
    width: 15px !important;
    z-index: 4 !important;
    background: var(--marketing-sticky-cell-bg, #ffffff) !important;
    box-shadow: 1px 0 0 rgba(226, 232, 240, .95) !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(n+3),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(n+3) {
    position: relative;
    z-index: 1;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(n+3) .marketing-report-input {
    position: relative;
    z-index: 1;
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-shell {
        --marketing-report-index-width: 36px;
        --marketing-report-name-width: 132px;
        --marketing-report-sticky-cols-width: 168px;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-table-wrap::before {
        width: var(--marketing-report-sticky-cols-width, 168px);
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2)::after,
    :is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2)::after,
    :is(#marketingReportView, #accountReportView) .marketing-report-name-col::after,
    :is(#marketingReportView, #accountReportView) .marketing-report-name-cell::after {
        right: -16px !important;
        width: 17px !important;
    }
}

/* Report Marketing final layer fix for day 1/2 columns.
   Previous wide seam masks were covering the first scrollable day columns in some browsers,
   especially on mobile. Use plain sticky cells with solid backgrounds instead. */
:is(#marketingReportView, #accountReportView) .marketing-report-table-wrap::before {
    display: none !important;
    content: none !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2)::after,
:is(#marketingReportView, #accountReportView) .marketing-report-index-col::after,
:is(#marketingReportView, #accountReportView) .marketing-report-index-cell::after,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col::after,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell::after {
    display: none !important;
    content: none !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: visible !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th,
:is(#marketingReportView, #accountReportView) .marketing-report-table td {
    background-clip: padding-box !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-index-cell {
    position: sticky !important;
    left: 0 !important;
    z-index: 42 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    transform: none !important;
    box-shadow: inset -1px 0 0 rgba(226, 232, 240, .95) !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-name-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-cell {
    position: sticky !important;
    left: var(--marketing-report-index-width, 38px) !important;
    z-index: 43 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    transform: none !important;
    box-shadow: inset -1px 0 0 rgba(226, 232, 240, .95), 1px 0 0 #ffffff !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table thead th:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table thead th:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-index-col,
:is(#marketingReportView, #accountReportView) .marketing-report-name-col {
    z-index: 55 !important;
    background: #f8fafc !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-total-row td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-total-row td:nth-child(2),
:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td:nth-child(1),
:is(#marketingReportView, #accountReportView) .marketing-report-table tbody tr:last-child td:nth-child(2) {
    background: #f8fafc !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(n+3),
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(n+3) {
    position: static !important;
    z-index: auto !important;
    transform: none !important;
    overflow: hidden !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(n+3) .marketing-report-input {
    position: static !important;
    z-index: auto !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th.marketing-report-today-col,
:is(#marketingReportView, #accountReportView) .marketing-report-table td.marketing-report-today-col {
    position: static !important;
    z-index: auto !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1).marketing-report-today-col,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1).marketing-report-today-col,
:is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2).marketing-report-today-col,
:is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2).marketing-report-today-col {
    position: sticky !important;
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(1),
    :is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(1),
    :is(#marketingReportView, #accountReportView) .marketing-report-index-col,
    :is(#marketingReportView, #accountReportView) .marketing-report-index-cell {
        left: 0 !important;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-table th:nth-child(2),
    :is(#marketingReportView, #accountReportView) .marketing-report-table td:nth-child(2),
    :is(#marketingReportView, #accountReportView) .marketing-report-name-col,
    :is(#marketingReportView, #accountReportView) .marketing-report-name-cell {
        left: var(--marketing-report-index-width, 36px) !important;
    }
}


/* Workspace Tab Visibility: add Option button only, keep existing controls visible */
.workspace-tab-option-btn {
    width: 100%;
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}

.workspace-tab-option-btn:hover,
.workspace-tab-option-btn:focus-visible {
    border-color: rgba(79, 93, 247, 0.34);
    background: #eef2ff;
    color: #312e81;
    outline: none;
}

.workspace-tab-compact-row {
    grid-template-columns: minmax(0, 1fr) 54px 54px 78px 62px !important;
}

@media (max-width: 640px) {
    .workspace-tab-compact-row {
        grid-template-columns: minmax(0, 1fr) 48px 48px 66px 54px !important;
    }

    .workspace-tab-option-btn {
        min-height: 23px;
        padding: 0 5px;
        border-radius: 7px;
        font-size: 9.5px;
    }
}

/* Workspace Tab Visibility final typography/crop fix
   Keep the Option button only, but make labels normal-weight and give descenders
   such as g, y and p enough vertical space so they are not clipped. */
.workspace-tab-settings-head strong,
.workspace-section-switch-copy strong {
    font-weight: 600 !important;
    line-height: 1.35 !important;
    padding-bottom: 1px !important;
}

.workspace-tab-settings-head span,
.workspace-section-switch-copy small {
    line-height: 1.35 !important;
    padding-bottom: 1px !important;
}

.workspace-tab-name-wrap .workspace-tab-name,
.workspace-tab-name {
    font-weight: 500 !important;
    line-height: 1.35 !important;
    min-height: 18px !important;
    padding-bottom: 1px !important;
    overflow: visible !important;
}

.workspace-tab-rename-input {
    height: 27px !important;
    min-height: 27px !important;
    line-height: 1.35 !important;
    font-weight: 500 !important;
    padding-top: 1px !important;
    padding-bottom: 2px !important;
}

.workspace-tab-pill,
.workspace-tab-option-btn {
    line-height: 1.25 !important;
    padding-top: 1px !important;
    padding-bottom: 2px !important;
}

.workspace-tab-pill span,
.workspace-tab-option-btn {
    line-height: 1.25 !important;
}

@media (max-width: 640px) {
    .workspace-tab-settings-head strong,
    .workspace-section-switch-copy strong {
        font-weight: 600 !important;
        line-height: 1.32 !important;
    }

    .workspace-tab-name-wrap .workspace-tab-name,
    .workspace-tab-name {
        font-weight: 500 !important;
        line-height: 1.32 !important;
        min-height: 17px !important;
    }

    .workspace-tab-rename-input {
        height: 26px !important;
        min-height: 26px !important;
        line-height: 1.32 !important;
    }
}

/* Report Marketing option panel in Workspace Settings */
.workspace-tab-option-panel {
    margin-top: 10px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 14px;
    background: #ffffff;
    padding: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.workspace-tab-option-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.workspace-tab-option-panel-head strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.workspace-tab-option-panel-head span,
.workspace-tab-option-help {
    display: block;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

.workspace-tab-option-close {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.workspace-tab-option-close:hover,
.workspace-tab-option-close:focus-visible {
    border-color: rgba(79, 93, 247, .34);
    background: #eef2ff;
    color: #312e81;
    outline: none;
}

.workspace-marketing-section-list {
    display: grid;
    gap: 7px;
}

.workspace-marketing-section-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 8px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 12px;
    background: #f8fafc;
}

.workspace-marketing-section-index {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid #e5e7eb;
}

.workspace-marketing-section-name {
    min-width: 0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-marketing-section-actions {
    display: inline-flex;
    gap: 5px;
}

.workspace-marketing-move-btn,
.workspace-marketing-reset-btn {
    min-height: 25px;
    padding: 0 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.workspace-marketing-move-btn:hover:not(:disabled),
.workspace-marketing-move-btn:focus-visible:not(:disabled),
.workspace-marketing-reset-btn:hover,
.workspace-marketing-reset-btn:focus-visible {
    border-color: rgba(79, 93, 247, .34);
    background: #eef2ff;
    color: #312e81;
    outline: none;
}

.workspace-marketing-move-btn:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.workspace-marketing-color-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-marketing-color-field input[type="color"] {
    width: 32px;
    height: 26px;
    padding: 2px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

/* Color set from Workspace Settings > Arrange Table Boxes applies to the table title/header row (#, table name and day columns). */
:is(#marketingReportView, #accountReportView) [data-marketing-section].has-custom-header-color .marketing-report-table thead th,
:is(#marketingReportView, #accountReportView) [data-account-section].has-custom-header-color .marketing-report-table thead th {
    --marketing-sticky-cell-bg: var(--marketing-report-section-head-bg, #f8fafc);
    background: var(--marketing-report-section-head-bg, #f8fafc) !important;
    background-color: var(--marketing-report-section-head-bg, #f8fafc) !important;
    border-color: rgba(15, 23, 42, .08) !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sections .marketing-report-subsection:first-child {
    margin-top: 0;
}

@media (max-width: 640px) {
    .workspace-marketing-section-row {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 7px;
    }

    .workspace-marketing-section-actions,
    .workspace-marketing-color-field,
    .workspace-marketing-reset-btn {
        grid-column: 2;
    }

    .workspace-marketing-section-actions {
        justify-content: flex-start;
    }
}

/* Report Marketing Option as its own Workspace Settings page */
.workspace-marketing-option-settings {
    display: grid;
    gap: 12px;
}

.workspace-marketing-option-card {
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 14px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.workspace-marketing-option-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.workspace-marketing-option-card-head strong,
.workspace-marketing-option-page-head strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600 !important;
    line-height: 1.35;
}

.workspace-marketing-option-card-head span,
.workspace-marketing-option-page-head span {
    display: block;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

.workspace-marketing-option-settings .workspace-marketing-section-list {
    gap: 8px;
}

.workspace-marketing-option-settings .workspace-marketing-section-row {
    grid-template-columns: 34px minmax(135px, 1fr) 116px 106px 62px;
    min-height: 42px;
    padding: 7px 8px;
    gap: 8px;
    align-items: center;
    border-radius: 12px;
}

.workspace-marketing-option-settings .workspace-marketing-section-index {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.workspace-marketing-option-settings .workspace-marketing-section-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.workspace-marketing-option-settings .workspace-marketing-section-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 116px;
}

.workspace-marketing-option-settings .workspace-marketing-move-btn,
.workspace-marketing-option-settings .workspace-marketing-reset-btn {
    width: 100%;
    height: 30px;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}

.workspace-marketing-option-settings .workspace-marketing-color-field {
    width: 106px;
    min-height: 30px;
    display: grid;
    grid-template-columns: 48px 44px;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
}

.workspace-marketing-option-settings .workspace-marketing-color-field input[type="color"] {
    width: 44px;
    height: 30px;
    min-width: 44px;
    padding: 2px;
    border-radius: 8px;
    box-sizing: border-box;
}

.workspace-marketing-option-settings .workspace-marketing-reset-btn {
    width: 62px;
}

.workspace-marketing-option-settings .workspace-tab-option-help {
    margin-top: 10px;
    font-size: 11px;
    line-height: 1.45;
}

.workspace-form[data-workspace-section="marketing-options"] .workspace-modal-title-copy p::after {
    content: "";
}

@media (max-width: 720px) {
    .workspace-marketing-option-card {
        padding: 10px;
    }

    .workspace-marketing-option-settings .workspace-marketing-section-row {
        grid-template-columns: 32px minmax(0, 1fr);
        min-height: 0;
        padding: 8px;
        gap: 7px 8px;
    }

    .workspace-marketing-option-settings .workspace-marketing-section-index {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .workspace-marketing-option-settings .workspace-marketing-section-actions {
        grid-column: 2;
        width: 116px;
    }

    .workspace-marketing-option-settings .workspace-marketing-color-field {
        grid-column: 2;
        width: 116px;
        grid-template-columns: 54px 56px;
    }

    .workspace-marketing-option-settings .workspace-marketing-color-field input[type="color"] {
        width: 56px;
    }

    .workspace-marketing-option-settings .workspace-marketing-reset-btn {
        grid-column: 2;
        width: 116px;
    }
}

/* Workspace Settings: Global Sync control for report table boxes */
.workspace-marketing-sync-control {
    display: grid;
    grid-template-columns: auto minmax(150px, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 210px;
}

.workspace-marketing-sync-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
}

.workspace-marketing-sync-check input {
    width: 13px;
    height: 13px;
    margin: 0;
}

.workspace-marketing-sync-select {
    width: 100%;
    min-height: 30px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 10.5px;
    font-weight: 700;
    padding: 0 8px;
    box-sizing: border-box;
}

.workspace-marketing-sync-select:disabled {
    opacity: .52;
    cursor: not-allowed;
    background: #f8fafc;
}

.workspace-marketing-option-settings .workspace-marketing-section-row {
    grid-template-columns: 34px minmax(120px, 1fr) 116px 106px 62px minmax(210px, 260px);
}

@media (max-width: 920px) {
    .workspace-marketing-option-settings .workspace-marketing-section-row {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .workspace-marketing-sync-control {
        grid-column: 2;
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(108px, auto) minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .workspace-marketing-sync-control {
        grid-template-columns: 1fr;
    }
}

/* Workspace sidebar scrollbar + sticky notes layer fix */
@media (min-width: 901px) {
    .sidebar,
    .sidebar .workspace-list {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sidebar::-webkit-scrollbar,
    .sidebar .workspace-list::-webkit-scrollbar {
        width: 0 !important;
        height: 0 !important;
        display: none;
    }

    .sidebar .workspace-list {
        padding-right: 0 !important;
    }
}

.sticky-notes-panel {
    z-index: 9000 !important;
}

.sticky-notes-float {
    z-index: 9001 !important;
}

/* Desktop workspace list: show max 8 workspaces, scroll for the rest */
@media (min-width: 901px) {
    .sidebar .workspace-list,
    .sidebar .workspace-list.workspace-list-desktop {
        max-height: calc((50px * 8) + (7px * 7)) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
    }
}

/* Report Account title case headings */
#accountReportView .marketing-report-table th,
#accountReportView .marketing-report-name-cell strong,
#accountReportView .marketing-report-head h2 {
    text-transform: none !important;
}


@media (max-width: 760px) {
    .month-picker .report-io-actions {
        order: 0;
        width: auto;
        justify-content: flex-start;
    }

    .report-io-btn {
        flex: 0 0 auto;
    }

    .report-io-month-field {
        grid-template-columns: 1fr;
    }

    .report-io-table-list {
        grid-template-columns: 1fr;
    }

    .report-io-summary {
        flex-direction: column;
    }

    .report-io-summary span {
        text-align: left;
    }
}

/* Apple glass workspace switch polish: keep sidebar visible, blur only the right workspace area */
@media (min-width: 901px) {
    .sidebar {
        isolation: isolate;
        background: linear-gradient(160deg, rgba(15, 23, 42, .88) 0%, rgba(17, 28, 51, .74) 48%, rgba(15, 23, 42, .84) 100%) !important;
        border-right: 1px solid rgba(148, 163, 184, .24) !important;
        box-shadow: inset -1px 0 0 rgba(255, 255, 255, .08), 16px 0 34px rgba(15, 23, 42, .10);
        backdrop-filter: blur(24px) saturate(170%);
        -webkit-backdrop-filter: blur(24px) saturate(170%);
    }

    .sidebar::before {
        content: "";
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--rt-sidebar-lg, 248px);
        pointer-events: none;
        z-index: -1;
        background:
            radial-gradient(circle at 18% 8%, rgba(99, 102, 241, .22), transparent 32%),
            radial-gradient(circle at 85% 26%, rgba(56, 189, 248, .12), transparent 30%),
            linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
    }

    .sidebar::after {
        content: "";
        position: fixed;
        top: 0;
        bottom: 0;
        left: var(--rt-sidebar-lg, 248px);
        width: 36px;
        pointer-events: none;
        z-index: 21;
        background: linear-gradient(90deg, rgba(15, 23, 42, .28) 0%, rgba(255, 255, 255, .10) 42%, rgba(255, 255, 255, 0) 100%);
        backdrop-filter: blur(14px) saturate(165%);
        -webkit-backdrop-filter: blur(14px) saturate(165%);
        mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .78) 52%, transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .78) 52%, transparent 100%);
    }

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

    .workspace-transition-overlay {
        inset: 0 0 0 var(--rt-sidebar-lg, 248px) !important;
        z-index: 9100 !important;
        background:
            radial-gradient(circle at 22% 16%, rgba(79, 93, 247, .12), transparent 34%),
            linear-gradient(135deg, rgba(255, 255, 255, .46), rgba(248, 250, 252, .24)) !important;
        backdrop-filter: blur(22px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(22px) saturate(180%) !important;
    }

    .workspace-transition-overlay::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background:
            linear-gradient(90deg, rgba(255, 255, 255, .36), rgba(255, 255, 255, 0) 28%),
            radial-gradient(circle at 72% 34%, rgba(255, 255, 255, .35), transparent 30%);
    }

    .workspace-transition-card {
        position: relative;
        z-index: 1;
        background: rgba(255, 255, 255, .58) !important;
        border: 1px solid rgba(255, 255, 255, .68) !important;
        box-shadow: 0 24px 70px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
        backdrop-filter: blur(28px) saturate(185%);
        -webkit-backdrop-filter: blur(28px) saturate(185%);
    }

    body.app-booting .app-shell,
    body.workspace-page-loading .app-shell {
        filter: none !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    body.app-booting .main-area,
    body.workspace-page-loading .main-area,
    body.app-booting .sticky-notes-panel,
    body.workspace-page-loading .sticky-notes-panel,
    body.app-booting .sticky-notes-float,
    body.workspace-page-loading .sticky-notes-float {
        filter: blur(6px) saturate(108%);
        opacity: .58;
        transform: scale(.998);
        pointer-events: none;
        transition: filter .18s ease, opacity .18s ease, transform .18s ease;
    }

    body.app-booting .sidebar,
    body.workspace-page-loading .sidebar {
        filter: none !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }
}

@media (max-width: 1280px) and (min-width: 901px) {
    .sidebar::before {
        width: var(--rt-sidebar-md, 226px);
    }

    .sidebar::after {
        left: var(--rt-sidebar-md, 226px);
    }

    .workspace-transition-overlay {
        inset: 0 0 0 var(--rt-sidebar-md, 226px) !important;
    }
}

@media (max-width: 900px) {
    .workspace-transition-overlay {
        inset: 0 !important;
        z-index: 1300 !important;
        background: rgba(248, 250, 252, .52) !important;
        backdrop-filter: blur(18px) saturate(175%) !important;
        -webkit-backdrop-filter: blur(18px) saturate(175%) !important;
    }

    body.app-booting .app-shell,
    body.workspace-page-loading .app-shell {
        filter: blur(6px) saturate(108%) !important;
        opacity: .5 !important;
        transform: scale(.998) !important;
        pointer-events: none !important;
    }
}

/* Sidebar color restore: keep original dark sidebar, glass effect only on the content edge */
@media (min-width: 901px) {
    .sidebar {
        background: #0f172a !important;
        border-right-color: #1e293b !important;
        color: #e5e7eb !important;
        box-shadow: none !important;
    }

    .sidebar::before {
        content: none !important;
        display: none !important;
    }

    .sidebar::after {
        width: 28px !important;
        background: linear-gradient(90deg, rgba(15, 23, 42, .22) 0%, rgba(15, 23, 42, .10) 38%, rgba(255, 255, 255, 0) 100%) !important;
        backdrop-filter: blur(12px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
        mask-image: linear-gradient(90deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .50) 50%, transparent 100%) !important;
        -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .50) 50%, transparent 100%) !important;
    }
}

/* Softer transparent glass: show more of the content behind while keeping the original sidebar color */
@media (min-width: 901px) {
    .workspace-transition-overlay {
        background:
            radial-gradient(circle at 22% 16%, rgba(79, 93, 247, .08), transparent 36%),
            linear-gradient(135deg, rgba(255, 255, 255, .24), rgba(248, 250, 252, .08)) !important;
        backdrop-filter: blur(16px) saturate(165%) !important;
        -webkit-backdrop-filter: blur(16px) saturate(165%) !important;
    }

    .workspace-transition-overlay::before {
        background:
            linear-gradient(90deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 30%),
            radial-gradient(circle at 72% 34%, rgba(255, 255, 255, .16), transparent 32%) !important;
    }

    .workspace-transition-card {
        background: rgba(255, 255, 255, .34) !important;
        border-color: rgba(255, 255, 255, .52) !important;
        box-shadow: 0 24px 70px rgba(15, 23, 42, .13), inset 0 1px 0 rgba(255, 255, 255, .48) !important;
        backdrop-filter: blur(18px) saturate(170%) !important;
        -webkit-backdrop-filter: blur(18px) saturate(170%) !important;
    }

    body.app-booting .main-area,
    body.workspace-page-loading .main-area,
    body.app-booting .sticky-notes-panel,
    body.workspace-page-loading .sticky-notes-panel,
    body.app-booting .sticky-notes-float,
    body.workspace-page-loading .sticky-notes-float {
        filter: blur(3.5px) saturate(104%) !important;
        opacity: .76 !important;
        transform: scale(.999) !important;
    }

    .sidebar::after {
        width: 34px !important;
        background: linear-gradient(90deg, rgba(15, 23, 42, .14) 0%, rgba(255, 255, 255, .08) 45%, rgba(255, 255, 255, 0) 100%) !important;
        backdrop-filter: blur(10px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(10px) saturate(145%) !important;
        mask-image: linear-gradient(90deg, rgba(0, 0, 0, .66) 0%, rgba(0, 0, 0, .34) 52%, transparent 100%) !important;
        -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .66) 0%, rgba(0, 0, 0, .34) 52%, transparent 100%) !important;
    }
}

@media (max-width: 900px) {
    .workspace-transition-overlay {
        background: rgba(248, 250, 252, .26) !important;
        backdrop-filter: blur(12px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
    }

    body.app-booting .app-shell,
    body.workspace-page-loading .app-shell {
        filter: blur(4px) saturate(104%) !important;
        opacity: .72 !important;
    }
}

/* Ultra transparent Apple-style glass: keep content visible behind the loading layer */
@media (min-width: 901px) {
    .workspace-transition-overlay {
        background: rgba(255, 255, 255, .055) !important;
        backdrop-filter: blur(14px) saturate(170%) contrast(104%) !important;
        -webkit-backdrop-filter: blur(14px) saturate(170%) contrast(104%) !important;
        border-left: 1px solid rgba(255, 255, 255, .22) !important;
        box-shadow: inset 1px 0 0 rgba(255, 255, 255, .18), inset 0 1px 0 rgba(255, 255, 255, .10) !important;
    }

    .workspace-transition-overlay::before {
        content: "" !important;
        position: absolute !important;
        inset: 0 !important;
        pointer-events: none !important;
        background:
            linear-gradient(115deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .045) 22%, rgba(255, 255, 255, 0) 46%),
            radial-gradient(circle at 26% 18%, rgba(255, 255, 255, .18), transparent 26%),
            radial-gradient(circle at 78% 36%, rgba(59, 130, 246, .055), transparent 32%) !important;
        opacity: .72 !important;
    }

    .workspace-transition-card {
        background: rgba(255, 255, 255, .18) !important;
        border: 1px solid rgba(255, 255, 255, .42) !important;
        box-shadow: 0 20px 55px rgba(15, 23, 42, .10), inset 0 1px 0 rgba(255, 255, 255, .48) !important;
        backdrop-filter: blur(16px) saturate(175%) !important;
        -webkit-backdrop-filter: blur(16px) saturate(175%) !important;
    }

    body.app-booting .main-area,
    body.workspace-page-loading .main-area,
    body.app-booting .sticky-notes-panel,
    body.workspace-page-loading .sticky-notes-panel,
    body.app-booting .sticky-notes-float,
    body.workspace-page-loading .sticky-notes-float {
        filter: blur(2px) saturate(102%) !important;
        opacity: .94 !important;
        transform: none !important;
    }

    .sidebar::after {
        width: 42px !important;
        background: linear-gradient(90deg, rgba(15, 23, 42, .10) 0%, rgba(255, 255, 255, .055) 45%, rgba(255, 255, 255, 0) 100%) !important;
        backdrop-filter: blur(8px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(8px) saturate(145%) !important;
        mask-image: linear-gradient(90deg, rgba(0, 0, 0, .56) 0%, rgba(0, 0, 0, .24) 56%, transparent 100%) !important;
        -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .56) 0%, rgba(0, 0, 0, .24) 56%, transparent 100%) !important;
    }
}

@media (max-width: 900px) {
    .workspace-transition-overlay {
        background: rgba(255, 255, 255, .08) !important;
        backdrop-filter: blur(10px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(10px) saturate(160%) !important;
    }

    body.app-booting .app-shell,
    body.workspace-page-loading .app-shell {
        filter: blur(2px) saturate(102%) !important;
        opacity: .9 !important;
    }
}

/* Admin Panel: global interface effect toggle */
.admin-interface-card {
    overflow: hidden;
}

.admin-interface-heading {
    align-items: center;
}

.admin-setting-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 28px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .05em;
}

.admin-setting-status.is-on {
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.admin-setting-status.is-off {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

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

.admin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #e6e9f2;
    background: #f8fafc;
    border-radius: 18px;
    padding: 14px;
    cursor: pointer;
}

.admin-toggle-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.admin-toggle-copy strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
}

.admin-toggle-copy small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.admin-switch {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    width: 54px;
    height: 30px;
}

.admin-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.admin-switch span {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
    transition: background .18s ease, box-shadow .18s ease;
}

.admin-switch span::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .18);
    transition: transform .18s ease;
}

.admin-switch input:checked + span {
    background: #4f5df7;
    box-shadow: inset 0 0 0 1px rgba(79, 93, 247, .24);
}

.admin-switch input:checked + span::before {
    transform: translateX(24px);
}

.admin-setting-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .admin-toggle-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-setting-actions,
    .admin-setting-actions .primary-btn {
        width: 100%;
    }
}

/* Disable Apple glass effect from Admin Panel while keeping the website usable */
body.glass-effect-disabled .sidebar::after,
body.glass-effect-disabled .workspace-transition-overlay::before {
    content: none !important;
    display: none !important;
}

body.glass-effect-disabled .workspace-transition-overlay {
    background: rgba(248, 250, 252, .88) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-left: 0 !important;
    box-shadow: none !important;
}

body.glass-effect-disabled .workspace-transition-card {
    background: #ffffff !important;
    border: 1px solid #e6e9f2 !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .10) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.glass-effect-disabled.app-booting .main-area,
body.glass-effect-disabled.workspace-page-loading .main-area,
body.glass-effect-disabled.app-booting .sticky-notes-panel,
body.glass-effect-disabled.workspace-page-loading .sticky-notes-panel,
body.glass-effect-disabled.app-booting .sticky-notes-float,
body.glass-effect-disabled.workspace-page-loading .sticky-notes-float {
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Balanced frosted glass: reduce visible movement behind workspace loading effect */
@media (min-width: 901px) {
    body:not(.glass-effect-disabled) .workspace-transition-overlay {
        background:
            radial-gradient(circle at 20% 16%, rgba(79, 93, 247, .08), transparent 34%),
            linear-gradient(135deg, rgba(255, 255, 255, .46), rgba(248, 250, 252, .34)) !important;
        backdrop-filter: blur(24px) saturate(150%) contrast(101%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(150%) contrast(101%) !important;
        border-left: 1px solid rgba(255, 255, 255, .30) !important;
        box-shadow: inset 1px 0 0 rgba(255, 255, 255, .24), inset 0 1px 0 rgba(255, 255, 255, .14) !important;
    }

    body:not(.glass-effect-disabled) .workspace-transition-overlay::before {
        background:
            linear-gradient(115deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .12) 24%, rgba(255, 255, 255, 0) 52%),
            radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .24), transparent 28%),
            radial-gradient(circle at 76% 36%, rgba(59, 130, 246, .07), transparent 34%) !important;
        opacity: .92 !important;
    }

    body:not(.glass-effect-disabled) .workspace-transition-card {
        background: rgba(255, 255, 255, .54) !important;
        border: 1px solid rgba(255, 255, 255, .62) !important;
        box-shadow: 0 22px 60px rgba(15, 23, 42, .13), inset 0 1px 0 rgba(255, 255, 255, .62) !important;
        backdrop-filter: blur(20px) saturate(165%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(165%) !important;
    }

    body:not(.glass-effect-disabled).app-booting .main-area,
    body:not(.glass-effect-disabled).workspace-page-loading .main-area,
    body:not(.glass-effect-disabled).app-booting .sticky-notes-panel,
    body:not(.glass-effect-disabled).workspace-page-loading .sticky-notes-panel,
    body:not(.glass-effect-disabled).app-booting .sticky-notes-float,
    body:not(.glass-effect-disabled).workspace-page-loading .sticky-notes-float {
        filter: blur(7px) saturate(100%) !important;
        opacity: .70 !important;
        transform: none !important;
    }

    body:not(.glass-effect-disabled) .sidebar::after {
        width: 36px !important;
        background: linear-gradient(90deg, rgba(15, 23, 42, .16) 0%, rgba(255, 255, 255, .10) 48%, rgba(255, 255, 255, 0) 100%) !important;
        backdrop-filter: blur(12px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(12px) saturate(145%) !important;
    }
}

@media (max-width: 900px) {
    body:not(.glass-effect-disabled) .workspace-transition-overlay {
        background: rgba(255, 255, 255, .34) !important;
        backdrop-filter: blur(18px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
    }

    body:not(.glass-effect-disabled).app-booting .app-shell,
    body:not(.glass-effect-disabled).workspace-page-loading .app-shell {
        filter: blur(5px) saturate(100%) !important;
        opacity: .76 !important;
        transform: none !important;
    }
}


/* Final fixed bottom scrollbar for Report Marketing + Report Account.
   Keep the horizontal scrollbar pinned to the viewport so it is usable without
   scrolling to the bottom of the long report tables. */
:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar {
    position: fixed !important;
    left: var(--marketing-report-fixed-scroll-left, 0px) !important;
    right: auto !important;
    bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
    width: var(--marketing-report-fixed-scroll-width, 100%) !important;
    max-width: calc(100vw - 16px) !important;
    z-index: 9990 !important;
    margin: 0 !important;
    height: 18px !important;
    min-height: 18px !important;
    display: block !important;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    background: #f8fafc !important;
    border: 1px solid rgba(226, 232, 240, .95) !important;
    border-radius: 999px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .18) !important;
    scrollbar-width: thin !important;
    scrollbar-color: #94a3b8 #f8fafc !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar.is-visible {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar {
    height: 13px !important;
    display: block !important;
    background: #f8fafc !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc !important;
    border-radius: 999px !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar::-webkit-scrollbar-thumb {
    background-color: #94a3b8 !important;
    border: 3px solid #f8fafc !important;
    border-radius: 999px !important;
}

:is(#marketingReportView, #accountReportView) .marketing-report-shell {
    padding-bottom: 48px !important;
}

@media (max-width: 720px) {
    :is(#marketingReportView, #accountReportView) .marketing-report-sticky-scrollbar {
        bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
        height: 18px !important;
    }

    :is(#marketingReportView, #accountReportView) .marketing-report-shell {
        padding-bottom: 52px !important;
    }
}

/* Report Marketing/Account: make table title/header row bold without forcing pure black text. */
:is(#marketingReportView, #accountReportView) .marketing-report-table thead th {
    font-weight: 800 !important;
    color: #334155 !important;
}

:is(#marketingReportView, #accountReportView) [data-marketing-section].has-custom-header-color .marketing-report-table thead th,
:is(#marketingReportView, #accountReportView) [data-account-section].has-custom-header-color .marketing-report-table thead th {
    font-weight: 800 !important;
    color: #334155 !important;
}

/* Workspace Stat Cards drag ordering */
.workspace-stat-sortable-list {
    user-select: none;
}

.workspace-stat-sortable-list.is-dragging-stat {
    cursor: grabbing;
}

.workspace-stat-compact-row {
    grid-template-columns: 26px minmax(58px, .52fr) minmax(78px, .76fr) minmax(108px, 1.15fr) 54px 54px !important;
}

.workspace-stat-drag-handle {
    width: 24px;
    height: 26px;
    min-width: 24px;
    min-height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
    cursor: grab;
}

.workspace-stat-drag-handle:hover,
.workspace-stat-drag-handle:focus {
    background: #eef2ff;
    border-color: rgba(79, 93, 247, .32);
    color: #4f5df7;
    outline: 0;
}

.workspace-stat-drag-handle:active {
    cursor: grabbing;
}

.workspace-stat-compact-row.is-dragging {
    opacity: .55;
    transform: scale(.995);
    box-shadow: 0 14px 26px rgba(15, 23, 42, .12);
}

@media (max-width: 640px) {
    .workspace-stat-compact-row {
        grid-template-columns: 22px 42px minmax(58px, .74fr) minmax(82px, 1fr) 43px 43px !important;
    }

    .workspace-stat-drag-handle {
        width: 20px;
        height: 25px;
        min-width: 20px;
        min-height: 25px;
        border-radius: 8px;
        font-size: 10px;
    }
}

/* Workspace global tab order settings */
.workspace-section-switch-icon-order {
    background: #f0fdf4;
    color: #16a34a;
}

.workspace-tab-order-settings {
    display: grid;
    gap: 12px;
}

.workspace-tab-order-list {
    display: grid;
    gap: 8px;
    user-select: none;
}

.workspace-tab-order-list.is-dragging-tab-order {
    cursor: grabbing;
}

.workspace-tab-order-row {
    display: grid;
    grid-template-columns: 28px 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 7px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.workspace-tab-order-row.is-dragging {
    opacity: .55;
    transform: scale(.995);
    box-shadow: 0 14px 26px rgba(15, 23, 42, .12);
}

.workspace-tab-order-drag-handle {
    width: 26px;
    height: 28px;
    min-width: 26px;
    min-height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
    cursor: grab;
}

.workspace-tab-order-drag-handle:hover,
.workspace-tab-order-drag-handle:focus {
    background: #eef2ff;
    border-color: rgba(79, 93, 247, .32);
    color: #4f5df7;
    outline: 0;
}

.workspace-tab-order-drag-handle:active {
    cursor: grabbing;
}

.workspace-tab-order-number {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.workspace-tab-order-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.workspace-tab-order-copy strong {
    min-width: 0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-tab-order-copy small {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

.workspace-tab-order-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.workspace-tab-order-move {
    width: 28px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
}

.workspace-tab-order-move:hover,
.workspace-tab-order-move:focus {
    background: #f8fafc;
    border-color: rgba(79, 93, 247, .32);
    color: #4f5df7;
    outline: 0;
}

.workspace-tab-order-move:disabled {
    opacity: .35;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .workspace-tab-order-row {
        grid-template-columns: 28px 24px minmax(0, 1fr);
    }

    .workspace-tab-order-actions {
        grid-column: 3 / 4;
        justify-self: start;
    }
}

/* Compact stat card text so custom stat labels and values stay in one line. */
.stat-card span {
    font-size: 11px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -.01em !important;
}

.stat-card strong {
    font-size: 22px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

@media (max-width: 640px) {
    .stat-card span {
        font-size: 9.8px !important;
    }

    .stat-card strong {
        font-size: 18px !important;
    }
}

/* Report table formula help icon + popup */
.report-formula-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: nowrap;
}

.report-formula-help-btn {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(100, 116, 139, 0.35);
    background: rgba(248, 250, 252, 0.85);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.report-formula-help-btn:hover,
.report-formula-help-btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.45);
    background: #eff6ff;
    color: #2563eb;
    outline: none;
}

.report-formula-modal-backdrop {
    z-index: 1700;
}

.report-formula-modal-card {
    width: min(520px, calc(100vw - 28px));
    max-height: min(80vh, 620px);
    overflow: hidden;
}

.report-formula-modal-header p {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.report-formula-modal-body {
    padding: 0 24px 18px;
    overflow: auto;
}

.report-formula-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.report-formula-list li {
    position: relative;
    padding: 11px 12px 11px 34px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.86);
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
}

.report-formula-list li::before {
    content: "ƒ";
    position: absolute;
    left: 11px;
    top: 11px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
}

.report-formula-modal-actions {
    padding-top: 12px;
}

@media (max-width: 640px) {
    .report-formula-help-btn {
        width: 17px;
        height: 17px;
        font-size: 10px;
    }

    .report-formula-modal-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .report-formula-list li {
        font-size: 12px;
        border-radius: 12px;
    }
}


/* Fix timeline card spacing after Sales follow-up was removed: 5 process steps fill full card width */
.task-card .progress-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.task-card .process-badges {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .mobile-day-list .task-card .progress-bar,
    .mobile-calendar-selected-list .task-card .progress-bar {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    .mobile-day-list .task-card .process-badges,
    .mobile-calendar-selected-list .task-card .process-badges {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

/* Auto Team Sales badge beside Notes button in Create Job modal */
.auto-team-sales-badge {
    min-height: 44px;
    max-width: 220px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    padding: 0 13px;
    box-sizing: border-box;
    white-space: nowrap;
}

.auto-team-sales-badge span {
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auto-team-sales-badge strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    color: #0f172a;
}

@media (max-width: 640px) {
    .auto-team-sales-badge {
        max-width: 160px;
        min-height: 38px;
        height: 38px;
        padding: 0 10px;
        gap: 6px;
    }

    .auto-team-sales-badge span {
        display: none;
    }

    .auto-team-sales-badge strong {
        font-size: 11px;
    }
}

/* Stronger status colours for Table and Pinned views */
#tableView .table-status-pill.pending,
#tableView .table-status-pill.in_progress,
#pinnedView .table-status-pill.pending,
#pinnedView .table-status-pill.in_progress,
#pinnedView .table-pinned-status.pending,
#pinnedView .table-pinned-status.in_progress {
    background: #fed7aa;
    color: #7c2d12;
    border: 1px solid #fb923c;
}

#tableView .table-status-pill.stuck,
#pinnedView .table-status-pill.stuck,
#pinnedView .table-pinned-status.stuck {
    background: #fecaca;
    color: #7f1d1d;
    border: 1px solid #ef4444;
}

#tableView .table-status-pill.completed,
#pinnedView .table-status-pill.completed,
#pinnedView .table-pinned-status.completed {
    background: #bbf7d0;
    color: #064e3b;
    border: 1px solid #22c55e;
}

#tableView .table-process-select.pending,
#pinnedView .table-process-select.pending {
    background-color: #fed7aa;
    color: #7c2d12;
    border-color: #fb923c;
}

#tableView .table-process-select.stuck,
#pinnedView .table-process-select.stuck {
    background-color: #fecaca;
    color: #7f1d1d;
    border-color: #ef4444;
}

#tableView .table-process-select.done,
#pinnedView .table-process-select.done {
    background-color: #bbf7d0;
    color: #064e3b;
    border-color: #22c55e;
}

/* Content details popup for Report Marketing */
.marketing-content-input-wrap,
.marketing-content-total-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.marketing-content-detail-btn {
    position: relative;
    width: 17px;
    height: 17px;
    min-width: 17px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .55);
    background: rgba(248, 250, 252, .95);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}

.marketing-content-detail-btn:hover,
.marketing-content-detail-btn:focus-visible,
.marketing-content-detail-btn.has-details {
    border-color: rgba(37, 99, 235, .48);
    background: #eff6ff;
    color: #2563eb;
    outline: none;
}

.marketing-content-detail-btn.has-details::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #2563eb;
    transform: translate(7px, -7px);
}

.marketing-content-details-backdrop {
    z-index: 1710;
}

.marketing-content-details-card {
    width: min(520px, calc(100vw - 28px));
    max-height: min(84vh, 680px);
    overflow: hidden;
}

.marketing-content-details-header p {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.marketing-content-details-body {
    padding: 0 24px 18px;
    overflow: auto;
    max-height: min(58vh, 440px);
}

.marketing-content-detail-grid {
    display: grid;
    gap: 9px;
}

.marketing-content-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 13px;
    background: rgba(248, 250, 252, .86);
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.marketing-content-detail-row input {
    width: 92px;
    height: 32px;
    border: 1px solid rgba(203, 213, 225, .95);
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    font: 800 13px/1.25 inherit;
    text-align: center;
    outline: none;
}

.marketing-content-detail-row input:focus {
    border-color: rgba(37, 99, 235, .45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.marketing-content-details-total {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
}

.marketing-content-details-hint {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.marketing-content-details-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .24);
}

.marketing-content-details-table th,
.marketing-content-details-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    font-size: 13px;
}

.marketing-content-details-table th:last-child,
.marketing-content-details-table td:last-child {
    text-align: right;
    font-weight: 900;
}

.marketing-content-details-table tr:last-child td {
    border-bottom: 0;
}

.marketing-content-details-empty {
    padding: 16px;
    border: 1px dashed rgba(148, 163, 184, .45);
    border-radius: 14px;
    color: #64748b;
    background: #f8fafc;
    font-size: 13px;
    text-align: center;
}

.marketing-content-daily-table-wrap {
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 14px;
    background: #fff;
}

.marketing-content-daily-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.marketing-content-daily-table th,
.marketing-content-daily-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
    vertical-align: top;
    text-align: left;
    font-size: 13px;
}

.marketing-content-daily-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 900;
}

.marketing-content-daily-table tr:last-child td {
    border-bottom: 0;
}

.marketing-content-daily-type {
    width: 150px;
    color: #0f172a;
}

.marketing-content-daily-total-cell {
    width: 110px;
}

.marketing-content-daily-total-input {
    width: 86px;
    height: 34px;
    border: 1px solid rgba(203, 213, 225, .95);
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: 900 13px/1.25 inherit;
    text-align: center;
    outline: none;
}

.marketing-content-daily-total-input:focus,
.marketing-content-daily-product input:focus {
    border-color: rgba(37, 99, 235, .45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.marketing-content-daily-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    gap: 7px;
}

.marketing-content-daily-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 32px;
    padding: 6px 7px;
    border: 1px solid rgba(148, 163, 184, .20);
    border-radius: 10px;
    background: rgba(248, 250, 252, .86);
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.marketing-content-daily-product input {
    width: 42px;
    height: 26px;
    border: 1px solid rgba(203, 213, 225, .95);
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: 900 12px/1.2 inherit;
    text-align: center;
    outline: none;
}

.marketing-content-daily-detail-total {
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.marketing-content-details-actions {
    padding-top: 12px;
}

@media (min-width: 760px) {
    .marketing-content-details-card {
        width: min(980px, calc(100vw - 42px));
    }
}

@media (max-width: 640px) {
    .marketing-content-input-wrap {
        gap: 3px;
    }

    .marketing-content-detail-btn {
        width: 16px;
        height: 16px;
        min-width: 16px;
        font-size: 9px;
    }

    .marketing-content-details-body {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* Daily Content Details: free-text details field */
.marketing-content-daily-detail-text {
    width: 100%;
    height: 34px;
    min-height: 34px;
    border: 1px solid rgba(203, 213, 225, .95);
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: 700 12px/1.25 inherit;
    outline: none;
    padding: 0 10px;
}

.marketing-content-daily-detail-text:focus {
    border-color: rgba(37, 99, 235, .45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

/* Invoice global link option */
.invoice-global-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
    cursor: pointer;
}

.invoice-global-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;
}

.invoice-global-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0 auto;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 10.5px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}


/* Invoice global option visibility fix */
.invoice-global-check-visible {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 10px;
    margin-top: 2px;
    padding: 11px 12px;
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #1e293b;
}

.invoice-global-check-visible span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invoice-global-check-visible strong {
    font-size: 13px;
    font-weight: 800;
}

.invoice-global-check-visible small {
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.invoice-global-check-visible input {
    margin-top: 2px;
}

/* Invoice number required + match indicator */
.invoice-number-field .invoice-number-control {
    position: relative;
    width: 100%;
}

.invoice-number-field .invoice-number-control input {
    padding-right: 42px;
}

.invoice-number-match-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: rgba(248, 250, 252, 0.95);
    color: #64748b;
}

.invoice-number-match-icon.is-found,
.invoice-number-match-icon.is-manual {
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(220, 252, 231, 0.98);
    color: #15803d;
}

.invoice-number-match-icon.is-missing {
    border-color: rgba(245, 158, 11, 0.42);
    background: rgba(255, 247, 237, 0.98);
    color: #b45309;
}

.invoice-number-match-icon.is-empty {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(254, 242, 242, 0.98);
    color: #dc2626;
}

.invoice-number-field:focus-within .invoice-number-match-icon {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Admin user disable / enable action */
.admin-users-table tr.is-disabled-user td {
    background: rgba(248, 250, 252, 0.86);
    color: #64748b;
}

.account-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.account-status-badge.disabled {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.mini-action-btn.disable-user {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.mini-action-btn.disable-user:hover {
    background: #ffedd5;
    border-color: #fdba74;
    color: #9a3412;
}

.mini-action-btn.enable-user {
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #047857;
}

.mini-action-btn.enable-user:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

/* Workspace Trash */
.workspace-section-title .workspace-section-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.workspace-section-title .workspace-section-tools #workspaceCounter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    font-size: 11px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    background: #fff;
}

.workspace-trash-btn {
    position: relative;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: rgba(226, 232, 240, .86);
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

.workspace-trash-btn svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.workspace-trash-btn em {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .65);
    font-size: 9px;
    line-height: 14px;
    font-style: normal;
    font-weight: 800;
    text-align: center;
}

.workspace-trash-btn:hover,
.workspace-trash-btn:focus-visible {
    transform: translateY(-1px);
    background: rgba(79, 70, 229, .18);
    border-color: rgba(129, 140, 248, .45);
    color: #fff;
    outline: none;
}

.workspace-trash-modal-card {
    width: min(720px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
}

.workspace-trash-list {
    display: grid;
    gap: 10px;
    padding: 18px 20px 8px;
    overflow: auto;
}

.workspace-trash-empty {
    border: 1px dashed var(--line);
    border-radius: 18px;
    padding: 22px;
    text-align: center;
    color: var(--muted);
    background: rgba(248, 250, 252, .72);
}

.workspace-trash-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}

.workspace-trash-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, .12);
    color: var(--primary);
    font-weight: 900;
}

.workspace-trash-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.workspace-trash-copy strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.25;
}

.workspace-trash-copy span,
.workspace-trash-copy small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.workspace-trash-actions .soft-btn.small,
.workspace-trash-actions .danger-btn.small {
    margin-top: 0;
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.workspace-trash-modal-actions {
    padding: 12px 20px 20px;
}

@media (max-width: 720px) {
    .workspace-trash-row {
        grid-template-columns: 36px minmax(0, 1fr);
    }
    .workspace-trash-avatar {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }
    .workspace-trash-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }
    .workspace-trash-actions .soft-btn.small,
    .workspace-trash-actions .danger-btn.small {
        flex: 1 1 130px;
    }
}
