/* Tasks: the list (rows instead of a grid), the task page with its right panel, to-dos and history. */

/* ---------- Shared pieces ---------- */
.priority-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    vertical-align: middle;
}

.priority-bars .bar {
    width: 4px;
    border-radius: 1px;
    background: color-mix(in srgb, var(--muted-foreground) 22%, transparent);
}

.priority-bars .bar-1 { height: 5px; }
.priority-bars .bar-2 { height: 7px; }
.priority-bars .bar-3 { height: 9px; }
.priority-bars .bar-4 { height: 11px; }
.priority-bars .bar-5 { height: 14px; }
.priority-bars .bar-1.on { background: #99a1b7; }
.priority-bars .bar-2.on { background: #f6c000; }
.priority-bars .bar-3.on { background: #f6a700; }
.priority-bars .bar-4.on { background: #f8590b; }
.priority-bars .bar-5.on { background: #e0201c; }

.priority-choice {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    flex: none;
}

.user-avatar.empty {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--muted-foreground);
}

.task-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--status-color);
    font-size: 1.15rem;
    flex: none;
}

.task-status.with-name span {
    color: var(--foreground);
    font-size: 0.85rem;
}

.task-private {
    color: var(--muted-foreground);
    font-size: 0.9em;
    margin-right: 0.25rem;
}

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

.task-chip {
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.task-chip:hover {
    border-color: var(--primary);
}

.task-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.task-chip.small {
    padding: 0 0.45rem;
    font-size: 0.7rem;
    margin-left: 0.35rem;
    cursor: default;
}

/* ---------- The list ---------- */
.task-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.task-quick {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.task-searchbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.task-search {
    position: relative;
    flex: 1 1 260px;
    max-width: 420px;
}

.task-search i {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
}

.task-search input {
    padding-left: 2rem;
    width: 100%;
}

.task-state {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    overflow: hidden;
}

.task-state button {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    background: var(--background);
    color: var(--foreground);
    border-right: 1px solid var(--border);
}

.task-state button:last-child {
    border-right: none;
}

.task-state button.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.task-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.task-count {
    margin-left: auto;
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

.task-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: start;
}

.task-layout.with-filters {
    grid-template-columns: 260px 1fr;
}

.task-filters {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.task-filters .k-form-field {
    margin: 0;
}

.task-filter-checks {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-filter-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.task-list-area {
    min-width: 0;
}

.task-bulkbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
    background: color-mix(in srgb, var(--primary) 7%, var(--background));
    border-radius: 0.5rem;
}

.task-list {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    overflow: hidden;
}

.task-list-head,
.task-row {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) minmax(8rem, 14rem) 9.5rem 8rem 7rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
}

.task-list-head {
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border);
}

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

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

.task-row:hover {
    background: color-mix(in srgb, var(--muted) 60%, transparent);
}

.task-row.selected {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.task-row.closed .task-title {
    color: var(--muted-foreground);
}

.task-main {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.task-main .task-status {
    margin-top: 0.1rem;
}

.task-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.task-title {
    font-weight: 600;
    color: var(--foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-main:hover .task-title {
    color: var(--primary);
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    font-size: 0.78rem;
    color: var(--muted-foreground);
}

.task-meta i {
    margin-right: 0.2rem;
}

.task-todos.done {
    color: #17c653;
}

.task-status-name {
    font-weight: 500;
}

.task-due {
    font-size: 0.82rem;
    white-space: nowrap;
}

.task-due i {
    margin-right: 0.3rem;
    color: var(--muted-foreground);
}

.task-due.overdue {
    color: var(--destructive);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--destructive);
    text-underline-offset: 3px;
}

.task-due.overdue i {
    color: var(--destructive);
}

.task-user,
.task-priority {
    display: flex;
    justify-content: center;
}

.task-head-user,
.task-head-priority {
    text-align: center;
}

.task-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--muted-foreground);
}

.task-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.task-more {
    padding: 0.6rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* A list without tick boxes (the start page). */
.task-list-head.no-check,
.task-row.no-check {
    grid-template-columns: minmax(0, 1fr) minmax(8rem, 14rem) 9.5rem 8rem 7rem;
}

.task-more a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
}

/* ---------- The start page: four counters that are also the list's filters ---------- */
.home-title {
    align-items: center;
}

.home-counters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.home-counter {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.8rem 1rem;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--background);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.home-counter:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.home-counter.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.home-counter-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.home-counter-value {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--foreground);
}

.home-counter.overdue .home-counter-label i,
.home-counter.overdue .home-counter-value {
    color: #f8285a;
}

.home-counter.today .home-counter-label i { color: #f6b100; }
.home-counter.week .home-counter-label i,
.home-counter.open .home-counter-label i { color: var(--primary); }

.home-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--foreground);
}

.home-list-head a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary);
}

/* Phones: the filters go above the list and the due date column is hidden (it shows on the task). */
@media (max-width: 720px) {
    .task-layout.with-filters {
        grid-template-columns: 1fr;
    }

    .task-list-head,
    .task-row {
        grid-template-columns: 1.75rem minmax(0, 1fr) 3rem 2.5rem;
    }

    .task-list-head.no-check,
    .task-row.no-check {
        grid-template-columns: minmax(0, 1fr) 3rem 2.5rem;
    }

    .home-counters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .home-counter {
        padding: 0.6rem 0.75rem;
    }

    .home-counter-value {
        font-size: 1.3rem;
    }

    .task-head-due,
    .task-due,
    .task-head-customer,
    .task-customer-col {
        display: none;
    }
}

/* ---------- The task page ---------- */
.task-saved-note {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--muted-foreground);
}

.task-saved-note i {
    color: #17c653;
    margin-right: 0.25rem;
}

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

@media (max-width: 960px) {
    .task-page {
        grid-template-columns: 1fr;
    }
}

.task-page-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.task-page-title h1 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.task-page-title h1 small {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--muted-foreground);
    margin-left: 0.3rem;
}

.task-page-title .task-status {
    font-size: 1.5rem;
}

.task-title-edit {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.task-title-edit input {
    flex: 1;
    font-size: 1.05rem;
}

.task-page-sub {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin: 0.2rem 0 0.6rem;
}

.task-tabs {
    margin-top: 0.5rem;
}

.task-section {
    margin-bottom: 1.25rem;
}

.task-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--foreground);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    margin-bottom: 0.6rem;
}

.task-description {
    padding: 0.25rem 0;
}

.task-panel {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.task-panel-field > label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 0.2rem;
}

.task-panel-field .k-form-field {
    margin: 0;
}

.task-panel-assignee {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-panel-assignee span:not(.user-avatar) {
    flex: 1;
}

.task-panel-due {
    display: flex;
    gap: 0.25rem;
}

.task-overdue-tag {
    color: var(--destructive);
    font-weight: 600;
    margin-left: 0.3rem;
}

/* ---------- To-dos ---------- */
.todos {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: flex-start;
}

.todo-list {
    width: 100%;
}

.todo-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.todo-head > i {
    color: var(--primary);
}

.todo-progress-text {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.todo-tools {
    margin-left: auto;
    display: inline-flex;
    opacity: 0;
    transition: opacity 0.15s;
}

.todo-head:hover .todo-tools,
.todo-item:hover .todo-tools {
    opacity: 1;
}

/* Touch screens have no hover: the tools stay visible. */
@media (hover: none) {
    .todo-tools {
        opacity: 1;
    }
}

.todo-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--muted);
    margin: 0.35rem 0 0.4rem;
    overflow: hidden;
}

.todo-progress span {
    display: block;
    height: 100%;
    background: #17c653;
    transition: width 0.2s;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.2rem 0.25rem;
    border-radius: 0.3rem;
    min-height: 2rem;
}

.todo-item:hover {
    background: var(--muted);
}

.todo-item.done .todo-text {
    color: var(--muted-foreground);
}

.todo-done-by {
    font-size: 0.72rem;
    color: var(--muted-foreground);
}

.todo-inline {
    display: flex;
    gap: 0.4rem;
    flex: 1;
    align-items: center;
}

.todo-inline input {
    flex: 1;
}

.todo-add {
    margin: 0.3rem 0 0 1.75rem;
}

.todo-add input {
    width: 100%;
    max-width: 480px;
}

.todo-new-list {
    width: 100%;
    max-width: 480px;
}

/* ---------- History ---------- */
.task-history-title {
    font-weight: 600;
    margin: 0.5rem 0;
}

.task-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    margin-bottom: 1.25rem;
}

.task-history-table th,
.task-history-table td {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.task-history-table th {
    color: var(--muted-foreground);
    font-weight: 600;
    background: var(--muted);
}

.task-history-table tr.current td {
    background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.task-history-note {
    white-space: pre-wrap;
}

.task-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.83rem;
}

.task-history-list > li {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}

.task-history-list ul {
    list-style: none;
    margin: 0.2rem 0 0 1rem;
    padding: 0;
    color: var(--muted-foreground);
}

.task-history-when {
    color: var(--muted-foreground);
    margin-right: 0.5rem;
}

.task-history-who {
    font-weight: 600;
    margin-right: 0.3rem;
}

.task-history-old {
    text-decoration: line-through;
}

.task-history-list i {
    margin: 0 0.3rem;
}

/* ---------- Time ---------- */
.task-timer {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.7rem;
}

.task-timer-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.task-timer-clock {
    font-variant-numeric: tabular-nums;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--destructive);
}

.task-timer-total {
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.task-timer-total strong {
    color: var(--foreground);
}

.todo-progress.over span {
    background: var(--destructive);
}

.task-timer-other {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.task-time-add {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.task-time-add .k-form-field {
    margin: 0;
}

.task-time-note {
    flex: 1 1 200px;
}

.task-time-note input {
    width: 100%;
}

.task-time-users {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.task-time-user {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.task-time-user.total {
    margin-left: auto;
}

.task-time-tools {
    white-space: nowrap;
    text-align: right;
}

/* ---------- Saved views ---------- */
.menu-badge {
    margin-left: auto;
    min-width: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25rem;
}

.selected .menu-badge {
    background: color-mix(in srgb, var(--primary-foreground) 25%, transparent);
    color: inherit;
}

.task-chip.saved {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
}

.task-chip.saved i {
    font-size: 0.75rem;
}

.task-chip-separator {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    margin: 0 0.2rem;
}

.task-view-owner {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--muted-foreground);
    margin-left: 0.5rem;
}

.task-view-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

/* ---------- Notifications (the blue bell) ---------- */
.notif {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #1b84ff;
    background: color-mix(in srgb, #1b84ff 10%, transparent);
    border: 1px solid color-mix(in srgb, #1b84ff 22%, transparent);
    transition: background 0.15s;
}

/* The icon's own size (Keenicons sets one on the icon itself). */
.notif-bell i {
    font-size: 1.3rem;
    line-height: 1;
}

.notif-bell:hover,
.notif-bell[aria-expanded="true"] {
    background: color-mix(in srgb, #1b84ff 20%, transparent);
}

/* The unread count: a small red pill on the bell's upper-right edge, the bell stays visible. */
.notif-count {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f8285a;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--background);
    pointer-events: none;
}

/* A gentle ring while there is something unread. */
.notif-bell.has-unread i {
    animation: notif-ring 2.5s ease-in-out 1;
    transform-origin: 50% 10%;
}

@keyframes notif-ring {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(14deg); }
    20%, 40% { transform: rotate(-14deg); }
    50% { transform: rotate(0); }
}

.notif-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 41;
    width: 400px;
    max-width: calc(100vw - 32px);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.15);
    display: flex;
    flex-direction: column;
    max-height: min(560px, calc(100vh - 80px));
}

@media (max-width: 480px) {
    .notif-panel {
        position: fixed;
        top: 58px;
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
    }
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.9rem 0.4rem;
}

.notif-title {
    font-weight: 600;
    font-size: 1rem;
}

.notif-link {
    color: var(--primary);
    font-size: 0.8rem;
    background: none;
}

.notif-link:hover {
    text-decoration: underline;
}

.notif-tabs {
    display: flex;
    gap: 1rem;
    padding: 0 0.9rem;
    border-bottom: 1px solid var(--border);
}

.notif-tabs button {
    padding: 0.4rem 0;
    font-size: 0.82rem;
    color: var(--muted-foreground);
    border-bottom: 2px solid transparent;
    background: none;
}

.notif-tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.notif-list {
    overflow-y: auto;
    flex: 1;
}

.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

.notif-empty i {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
}

.notif-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
}

.notif-item.unread {
    background: color-mix(in srgb, #1b84ff 6%, transparent);
}

.notif-item-main {
    flex: 1;
    display: flex;
    gap: 0.65rem;
    padding: 0.7rem 0.4rem 0.7rem 0.9rem;
    text-align: left;
    background: none;
    min-width: 0;
    color: var(--foreground);
    font-size: 0.83rem;
}

.notif-item-main:hover {
    background: var(--muted);
}

.notif-system {
    background: var(--muted);
    color: var(--muted-foreground);
}

.notif-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.notif-quote {
    color: var(--muted-foreground);
    border-left: 2px solid var(--border);
    padding-left: 0.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-when {
    font-size: 0.72rem;
    color: var(--muted-foreground);
}

.notif-when i {
    margin-right: 0.3rem;
}

.notif-eye {
    padding: 0.7rem 0.75rem;
    color: var(--muted-foreground);
    background: none;
}

.notif-eye:hover {
    color: var(--primary);
}

.notif-dot {
    position: absolute;
    left: 0.3rem;
    top: 1.3rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1b84ff;
}

.notif-foot {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
}

.notif-foot a {
    color: var(--primary);
}

.notif-page {
    max-width: 760px;
}

.notif-page-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.notif-list-page {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.notif-settings-link {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--primary);
}

.notif-settings {
    max-width: 760px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.notif-setting {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.notif-setting:last-child {
    border-bottom: none;
}

.notif-setting-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, #1b84ff 12%, transparent);
    color: #1b84ff;
    flex: none;
}

.notif-setting-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.notif-setting-text span {
    color: var(--muted-foreground);
    font-size: 0.78rem;
}

/* ---------- Files ---------- */
.file-editor-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.3rem 0.1rem 0;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.file-editor-attach {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    background: var(--background);
    color: var(--foreground);
    font-size: 0.78rem;
}

.file-editor-attach:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

/* Pictures in comments and descriptions: never wider than the text, click to open full size. */
.comment-body img,
.comment-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 0.3rem;
    border: 1px solid var(--border);
}

.task-files-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1.1rem;
    margin-bottom: 1rem;
    border: 2px dashed var(--border);
    border-radius: 0.6rem;
    color: var(--muted-foreground);
    text-align: center;
    cursor: pointer;
}

.task-files-drop:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.task-files-drop i {
    font-size: 1.6rem;
}

.task-files-drop small {
    font-size: 0.72rem;
}

/* The real file input covers the box, so a click or a drop anywhere on it works. */
.task-files-drop input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.task-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.75rem;
}

.task-file {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--background);
}

.task-file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 2.4rem;
}

.task-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-file-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0.6rem;
    min-width: 0;
}

.task-file-name {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-file-name:hover {
    color: var(--primary);
}

.task-file-meta {
    font-size: 0.72rem;
    color: var(--muted-foreground);
}

.task-file-tag {
    align-self: flex-start;
    font-size: 0.68rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: color-mix(in srgb, #7239ea 12%, transparent);
    color: #7239ea;
}

.task-file .task-file-delete {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    background: var(--background);
}

/* ---------- The task panel: every field the same height and text size ---------- */
.task-panel-due {
    align-items: center;
}

.task-panel-due > .k-datetimepicker {
    flex: 1;
    min-width: 0;
}

/* The small "no due date" cross: square, the height of the field, so the row is not taller than the others. */
.task-panel-due > .k-button {
    width: 22px;
    height: 22px;
    min-width: 22px;
    padding: 0;
    flex: none;
}

.task-panel-due > .k-button i {
    font-size: 0.7rem;
}

/* Status and priority: the icon inside the box must not make it taller. */
.task-panel .k-picker .task-status,
.task-panel .k-picker .priority-choice {
    font-size: 0.9rem;
    line-height: 1;
}

.task-panel .k-picker .task-status.with-name span,
.task-panel .k-picker .priority-choice {
    font-size: inherit;
}

.task-panel .k-picker .priority-choice {
    font-size: 11.6px;
}

.task-panel .k-picker .task-status.with-name span {
    font-size: 11.6px;
}

/* Private: the same text size as the other fields, the explanation small under it. */
.task-panel .labeled-checkbox {
    margin: 0;
}

.task-panel .labeled-checkbox .k-checkbox-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
}

.task-panel .labeled-checkbox .field-hint {
    display: block;
    margin: 0.15rem 0 0 1.6rem;
    font-size: 0.72rem;
    line-height: 1.3;
    color: var(--muted-foreground);
}

.task-panel .labeled-checkbox .k-checkbox {
    width: 14px;
    height: 14px;
}

.task-panel .labeled-checkbox > span {
    gap: 0.45rem;
}

.task-panel .labeled-checkbox .field-hint {
    margin-left: calc(14px + 0.45rem);
}

.task-panel-assignee > span:not(.user-avatar) {
    font-size: 0.85rem;
    font-weight: 500;
}

.task-panel-assignee .user-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.62rem;
}

/* ---------- Templates ---------- */
.template-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}

.template-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--background);
}

.template-card.inactive {
    opacity: 0.65;
}

.template-card-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.8rem 0.9rem 0.5rem;
    color: inherit;
    text-decoration: none;
    flex: 1;
}

.template-card-name {
    font-weight: 600;
    color: var(--foreground);
}

.template-card-main:hover .template-card-name {
    color: var(--primary);
}

.template-card-desc {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.template-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.9rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.2rem;
}

.template-card-meta i {
    margin-right: 0.25rem;
}

.template-inactive {
    font-size: 0.7rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--muted);
    color: var(--muted-foreground);
    margin-left: 0.4rem;
}

.template-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem;
    border-top: 1px solid var(--border);
}

.template-card-actions > :first-child {
    margin-right: auto;
}

.template-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.6rem;
}

@media (max-width: 720px) {
    .template-head {
        grid-template-columns: 1fr;
    }
}

.template-help {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-bottom: 0.8rem;
}

.template-help summary {
    cursor: pointer;
    color: var(--primary);
}

.template-help ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.15rem 1rem;
    margin: 0.4rem 0;
    padding: 0;
    list-style: none;
}

.template-help code {
    background: var(--muted);
    padding: 0 0.3rem;
    border-radius: 0.25rem;
    color: var(--foreground);
}

.template-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.template-item {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--background);
    padding: 0.7rem 0.8rem;
}

.template-item-head {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
}

.template-item-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    margin-bottom: 0.15rem;
}

.template-item-title {
    flex: 1;
    min-width: 0;
}

.template-item-title .k-form-field,
.template-item-fields .k-form-field,
.template-item-texts .k-form-field,
.template-head .k-form-field {
    margin: 0;
}

.template-item-tools {
    display: inline-flex;
    margin-bottom: 0.1rem;
}

.template-item-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.template-item-texts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

@media (max-width: 720px) {
    .template-item-texts {
        grid-template-columns: 1fr;
    }
}

.template-item-summary {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.template-create {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* ---------- Automatic tasks ---------- */
.schedule-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

.schedule-item.inactive {
    opacity: 0.6;
}

.schedule-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: inherit;
    text-decoration: none;
}

.schedule-item-name {
    font-weight: 600;
    color: var(--foreground);
}

.schedule-item-name i {
    color: var(--primary);
    margin-right: 0.4rem;
}

.schedule-item-main:hover .schedule-item-name {
    color: var(--primary);
}

.schedule-item-runs {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.78rem;
    white-space: nowrap;
}

.schedule-error {
    font-size: 0.75rem;
    color: var(--destructive);
}

.schedule-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 960px) {
    .schedule-page {
        grid-template-columns: 1fr;
    }
}

.schedule-section {
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--background);
    padding: 0.8rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.schedule-section h3 {
    font-weight: 600;
    margin: 0;
}

.schedule-section .k-form-field {
    margin: 0;
}

.schedule-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.schedule-freq,
.schedule-days {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    overflow: hidden;
    align-self: flex-start;
}

.schedule-freq button,
.schedule-days button {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    background: var(--background);
    color: var(--foreground);
    border-right: 1px solid var(--border);
}

.schedule-days button {
    padding: 0.3rem 0.55rem;
}

.schedule-freq button:last-child,
.schedule-days button:last-child {
    border-right: none;
}

.schedule-freq button.active,
.schedule-days button.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.schedule-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.schedule-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 5rem;
    cursor: pointer;
}

.schedule-note {
    font-size: 0.72rem;
    color: var(--muted-foreground);
}

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

.schedule-preview {
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--primary) 6%, transparent);
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
}

.schedule-preview-rule {
    font-weight: 600;
}

.schedule-preview-rule i {
    color: var(--primary);
    margin-right: 0.35rem;
}

.schedule-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.6rem;
    margin-top: 0.35rem;
    color: var(--muted-foreground);
}

.schedule-preview-date {
    color: var(--foreground);
}

.schedule-preview-none {
    color: var(--destructive);
    margin-top: 0.3rem;
}

/* ---------- Template page: explanation and the "when" sentence ---------- */
.template-how {
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
    background: color-mix(in srgb, var(--primary) 5%, var(--background));
    border-radius: 0.6rem;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.83rem;
}

.template-how-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.template-how-title i {
    color: var(--primary);
}

.template-how ol {
    margin: 0;
    padding-left: 1.2rem;
    list-style: decimal;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.template-how code,
.template-codes code {
    background: var(--muted);
    padding: 0 0.3rem;
    border-radius: 0.25rem;
}

.template-codes {
    margin-top: 0.25rem;
    color: var(--muted-foreground);
}

.template-codes summary {
    cursor: pointer;
    color: var(--primary);
}

.template-codes ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.1rem 1rem;
    margin: 0.3rem 0;
    padding: 0;
    list-style: none;
}

.template-items-title {
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.template-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.template-block {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.65rem;
}

.template-block-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 0.4rem;
}

.template-block .template-item-fields {
    margin-top: 0;
}

.template-item-body .template-item-texts {
    margin-top: 0;
}

.template-when {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.template-when-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.83rem;
}

.template-when-label {
    width: 3.5rem;
    font-weight: 600;
}

.template-when-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted-foreground);
    cursor: pointer;
}

.template-when-time {
    width: 105px;
}

.template-when-note {
    font-size: 0.72rem;
    color: var(--muted-foreground);
}

.template-item-example {
    display: flex;
    gap: 0.45rem;
    align-items: flex-start;
    margin-top: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.4rem;
    background: var(--muted);
    font-size: 0.78rem;
    color: var(--muted-foreground);
}

.template-item-example i {
    margin-top: 0.15rem;
    color: var(--primary);
}

.template-item-example strong {
    color: var(--foreground);
}

/* ---------- Create tasks from a template (dialog) ---------- */
.template-create-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.template-create-grid .k-form-field {
    margin: 0;
}

@media (max-width: 600px) {
    .template-create-grid {
        grid-template-columns: 1fr;
    }
}

.template-create-items {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    max-height: 340px;
    overflow-y: auto;
}

.template-create-items-head {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.7rem;
    background: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
}

.template-create-item {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

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

.template-create-item:hover {
    background: color-mix(in srgb, var(--muted) 60%, transparent);
}

.template-create-item.off .template-create-item-text {
    opacity: 0.5;
}

.template-create-item input {
    margin-top: 0.15rem;
}

.template-create-item-text {
    display: flex;
    flex-direction: column;
    font-size: 0.83rem;
}

.template-create-item-text span {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ---------- Sorting by the column titles of the task list ---------- */
.task-sort-head {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.task-sort-head:hover {
    color: var(--foreground);
}

.task-sort-head.active {
    color: var(--primary);
}

.task-sort-head i {
    font-size: 0.7rem;
}

/* ---------- Language switch in the user menu ---------- */
.lang-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.lang-switch-buttons {
    display: inline-flex;
    padding: 2px;
    border-radius: 999px;
    background: var(--muted);
    border: 1px solid var(--border);
}

.lang-switch-buttons button {
    min-width: 32px;
    padding: 2px 8px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--muted-foreground);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.lang-switch-buttons button:hover {
    color: var(--primary);
}

.lang-switch-buttons button.active {
    background: var(--background);
    color: var(--primary);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

/* ---------- Calendar (/tasks/calendar) ---------- */

.cal-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.cal-filter {
    width: 220px;
    margin: 0;
}

.cal-loading {
    display: inline-flex;
    align-items: center;
}

.cal-warning {
    border: 1px solid var(--destructive);
    color: var(--destructive);
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* The task inside the scheduler's item box: a status-coloured edge, number in front. */
.k-scheduler .cal-event {
    background: var(--background);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0.35rem;
    box-shadow: none;
}

.k-scheduler .cal-event .k-event-actions,
.k-scheduler .cal-event .k-resize-handle {
    display: none;
}

.cal-item {
    height: 100%;
    padding: 0.1rem 0.4rem;
    border-left: 4px solid var(--cal-status);
    border-radius: 0.35rem 0 0 0.35rem;
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.cal-item-number {
    color: var(--muted-foreground);
    font-weight: 600;
}

.k-scheduler .cal-event:hover {
    border-color: var(--primary);
}

.k-scheduler .cal-overdue {
    border-color: var(--destructive);
    background: color-mix(in srgb, var(--destructive) 8%, var(--background));
}

.k-scheduler .cal-closed {
    opacity: 0.55;
}

/* The card shown on hover. */
.cal-tooltip .k-tooltip {
    background: var(--background);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
    padding: 0;
}

.cal-tooltip .k-callout {
    color: var(--background);
}

.cal-card {
    padding: 0.75rem 0.9rem;
    font-size: 0.82rem;
}

.cal-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.cal-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.cal-card-title small {
    color: var(--muted-foreground);
    font-weight: 500;
}

.cal-card-fields {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 0.75rem;
    margin: 0 0 0.75rem;
}

.cal-card-fields dt {
    color: var(--muted-foreground);
    font-weight: 400;
}

.cal-card-fields dd {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.cal-card-muted {
    color: var(--muted-foreground);
}

.cal-card-overdue {
    color: var(--destructive);
    font-weight: 600;
}

.cal-card-actions {
    display: flex;
    justify-content: flex-end;
}

/* No office-hours toggle or shading: every hour looks the same. */
.cal-wrap .k-scheduler-footer {
    display: none;
}

.cal-wrap .k-scheduler .k-nonwork-hour {
    background-color: transparent;
}

/* "Now": a dot and a thin line at the current time, in today's column. */
.cal-wrap .k-scheduler-body {
    position: relative;
}

.cal-now {
    position: absolute;
    height: 0;
    border-top: 2px solid var(--primary);
    z-index: 5;
    pointer-events: none;
}

.cal-now::before {
    content: "";
    position: absolute;
    left: -6px;
    top: -7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
}

/* Administration > Lists: a task status's colour and icon. */
.list-look {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-icon {
    font-size: 1.05rem;
    margin-right: 0.35rem;
    vertical-align: -2px;
}

.cal-heading {
    font-weight: 600;
    font-size: 1rem;
    padding: 0 0.5rem;
    white-space: nowrap;
}

/* Notification settings: a column for the bell and one for e-mail. */
.notif-setting-head {
    cursor: default;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: var(--muted, #f9f9f9);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
}

.notif-setting-col {
    width: 84px;
    display: inline-flex;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}

.notif-setting-head .notif-setting-col {
    cursor: default;
}

/* E-mail settings: the latest e-mails. */
.email-recent-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem 0;
}

.email-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    background: color-mix(in srgb, #f6b100 15%, transparent);
    color: #b88300;
}

.email-status-1 {
    background: color-mix(in srgb, #17c653 15%, transparent);
    color: #0f8a3a;
}

.email-status-2 {
    background: color-mix(in srgb, #f8285a 15%, transparent);
    color: #d81a48;
}

.email-settings .details-layout {
    display: block;
    max-width: 1100px;
}

/* ---------- Reports ---------- */
.report-period {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* The arrows: square, the height of the boxes, level with them. */
.report-period > .k-button {
    height: 24px;
    width: 24px;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.report-period .k-form-field {
    margin: 0;
}

.report-period-preset {
    width: 170px;
}

.report-period-date {
    width: 150px;
}

.report-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.report-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--card, #fff);
}

.report-kpi strong {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
}

.report-kpi span {
    font-size: 0.78rem;
    color: var(--muted-foreground);
}

.report-chart {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background: var(--card, #fff);
}

.report-user {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
}

.report-user:hover,
.report-task:hover {
    color: var(--primary);
}

.report-task {
    color: inherit;
}

.report-private {
    color: var(--muted-foreground);
    font-style: italic;
}

.report-hours {
    font-weight: 600;
    color: var(--primary);
}

.report-minutes {
    color: var(--muted-foreground);
    font-size: 0.8rem;
}

.report-user-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.report-back {
    color: var(--muted-foreground);
    font-size: 1rem;
}

.report-back:hover {
    color: var(--primary);
}

/* The calendar's "Show completed": level with the filters, in their text size. */
.cal-toolbar .labeled-checkbox {
    margin: 0;
}

.cal-toolbar .labeled-checkbox > span {
    gap: 0.45rem;
}

.cal-toolbar .labeled-checkbox .k-checkbox {
    width: 14px;
    height: 14px;
}

.cal-toolbar .labeled-checkbox .k-checkbox-label {
    font-size: 0.8rem;
    color: var(--foreground);
    cursor: pointer;
}

/* Time per customer: the users of a customer, with a bar for their share. */
.report-users {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--card, #fff);
    margin-bottom: 0.75rem;
    padding: 0.25rem 0;
}

.report-users-row {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 140px 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 0.9rem;
    color: inherit;
}

.report-users-row:hover {
    background: var(--muted, #f9f9f9);
}

.report-users-bar {
    height: 8px;
    border-radius: 4px;
    background: color-mix(in srgb, #1b84ff 10%, transparent);
    overflow: hidden;
}

.report-users-bar > span {
    display: block;
    height: 100%;
    background: #1b84ff;
    border-radius: 4px;
}

/* The task list's Customer column: the customer, and the project under it. */
.task-customer-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 0.8rem;
}

.task-customer-name,
.task-project-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-project-name {
    font-size: 0.72rem;
    color: var(--muted-foreground);
}

.task-project-name i {
    margin-right: 0.25rem;
}

/* Phones: no Customer column (it shows on the task). After the rule above, so it wins. */
@media (max-width: 720px) {
    .task-customer-col {
        display: none;
    }
}

/* The task list's buttons on the right (Save view, pin, delete view, From template, New task): spaced apart. */
.task-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ---------- The task list's saved views drop-down ---------- */
.views-menu {
    position: relative;
    display: inline-flex;
}

.views-menu > .task-chip {
    cursor: pointer;
}

.views-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    width: 280px;
    max-height: 420px;
    overflow-y: auto;
    padding: 0.35rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}

.views-menu-group {
    padding: 0.45rem 0.6rem 0.2rem;
    font-size: 0.7rem;
    color: var(--muted-foreground);
}

.views-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.35rem 0.6rem;
    border: none;
    background: none;
    border-radius: 0.4rem;
    color: var(--foreground);
    font-size: 0.8rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.views-menu-item:hover {
    background: var(--muted, #f1f1f4);
}

.views-menu-item.active {
    background: color-mix(in srgb, #1b84ff 10%, transparent);
    color: #1b84ff;
}

.views-menu-item.danger {
    color: #f8285a;
}

.views-menu-item i {
    width: 1rem;
    flex: 0 0 1rem;
    font-size: 0.85rem;
    color: inherit;
    opacity: 0.8;
}

.views-menu-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.views-menu-name small {
    color: var(--muted-foreground);
    font-size: 0.72rem;
}

.views-menu-count {
    font-size: 0.72rem;
    color: var(--muted-foreground);
}

.views-menu-item.active .views-menu-count {
    color: inherit;
}

.views-menu-sep {
    border-top: 1px solid var(--border);
    margin: 0.35rem 0;
}

.views-menu-empty {
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
    color: var(--muted-foreground);
}

/* The task number in front of the title in the task list. */
.task-number {
    color: var(--muted-foreground);
    font-weight: 500;
    margin-right: 0.35rem;
    font-variant-numeric: tabular-nums;
}

/* The task page: the number in front of the title, same size, quieter; space before the tabs now that the
   "Opened ... by" line is gone (it is in History). */
.task-page-number {
    color: var(--muted-foreground);
    font-weight: 500;
    margin-right: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.task-page-title {
    margin-bottom: 0.6rem;
}
