/**
 * Work Better — New design app styles
 * Extracted from index.php. Complements Tailwind CSS (CDN).
 */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Instrument Sans', system-ui, sans-serif;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d5d1c9;
    border-radius: 3px;
}

/* Confirmation modal */
.confirm-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar */
.sidebar {
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar .sidebar-label {
    transition: opacity 0.15s ease, max-width 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    max-width: 200px;
    opacity: 1;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-label {
    opacity: 0;
    max-width: 0;
    margin: 0;
    padding: 0;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .sidebar-brand .brand-text {
    display: none;
}

.sidebar.collapsed nav a,
.sidebar.collapsed nav .pt-3 {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
}

.sidebar.collapsed nav a svg {
    margin: 0;
}

.sidebar.collapsed nav a .badge {
    display: none;
}

.sidebar.collapsed .sidebar-org {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .sidebar-org .org-text,
.sidebar.collapsed .sidebar-org svg:last-child {
    display: none;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .sidebar-user .user-text,
.sidebar.collapsed .sidebar-user svg:last-child {
    display: none;
}

.sidebar.collapsed .sidebar-section-head {
    justify-content: center;
}

.sidebar.collapsed .sidebar-section-head span,
.sidebar.collapsed .sidebar-section-head button {
    display: none;
}

.sidebar.collapsed .proj-dot {
    margin: 0;
}

.collapse-btn {
    position: absolute;
    top: 16px;
    right: -12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #d5d1c9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 1px 3px rgba(34, 31, 28, 0.08);
    transition: background 0.12s ease, transform 0.12s ease;
    color: #9a9182;
}

.collapse-btn:hover {
    background: #f3f1ed;
    color: #574f47;
}

.collapse-btn svg {
    transition: transform 0.2s ease;
}

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed !important;
        z-index: 50;
        height: 100vh;
        width: 260px !important;
    }

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

    .collapse-btn {
        display: none;
    }
}

.nav-item {
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.nav-item.active {
    background: rgba(34, 169, 158, 0.08);
    color: #198882;
}

/* Cards */
.task-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.task-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -4px rgba(34, 31, 28, 0.07), 0 2px 6px -2px rgba(34, 31, 28, 0.04);
    border-color: #d5d1c9;
}

.task-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg) scale(0.97);
    box-shadow: 0 12px 32px -4px rgba(34, 31, 28, 0.12);
}

/* Badge */
.badge {
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

/* Tags — WCAG AA compliant contrast */
.tag-design {
    background: #ede9fe;
    color: #5b21b6;
}

.tag-frontend {
    background: #dbeafe;
    color: #1e40af;
}

.tag-backend {
    background: #d2f7f0;
    color: #115e59;
}

.tag-bug {
    background: #fce7f3;
    color: #9d174d;
}

.tag-feature {
    background: #fde68a;
    color: #78350f;
}

.tag-docs {
    background: #e7e5e4;
    color: #44403c;
}

/* Grain */
.grain::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 9999;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
}

.fade-up {
    animation: fadeUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.05s;
}

.delay-2 {
    animation-delay: 0.1s;
}

.delay-3 {
    animation-delay: 0.15s;
}

.view-container {
    animation: fadeUp 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Misc */
.sidebar-overlay {
    transition: opacity 0.3s ease;
}

.avatar-stack > *:not(:first-child) {
    margin-left: -6px;
}

.search-box:focus-within {
    border-color: #22a99e;
    box-shadow: 0 0 0 3px rgba(34, 169, 158, 0.1);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stat-card:hover::after {
    opacity: 1;
}

/* Task check */
.task-check {
    width: 18px;
    height: 18px;
    border: 2px solid #d5d1c9;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-check:hover {
    border-color: #22a99e;
    background: rgba(34, 169, 158, 0.08);
}

.task-check.checked {
    border-color: #22a99e;
    background: #22a99e;
}

.task-check svg {
    width: 10px;
    height: 10px;
    color: white;
}

/* Blocked task: clock icon instead of checkbox */
.task-card .completion-waiting,
.list-row .completion-waiting,
.mobile-card .completion-waiting {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    color: #78716c;
}

.task-card .completion-waiting svg,
.list-row .completion-waiting svg,
.mobile-card .completion-waiting svg {
    width: 100%;
    height: 100%;
}

/* Task panel header: Mark as done / Done button */
.task-panel-done-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #186d6a;
    background: rgba(34, 169, 158, 0.12);
    border: 1.5px solid #22a99e;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
.task-panel-done-btn:hover {
    background: rgba(34, 169, 158, 0.2);
    border-color: #1a8a82;
    color: #145c59;
}
.task-panel-done-btn--checked {
    color: #fff;
    background: #22a99e;
    border-color: #22a99e;
}
.task-panel-done-btn--checked:hover {
    background: #1a8a82;
    border-color: #1a8a82;
    color: #fff;
}
.task-panel-done-btn-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
}
.task-panel-done-btn-icon svg {
    width: 14px;
    height: 14px;
    color: inherit;
}

@media (max-width: 767px) {
    .task-panel-done-btn {
        padding: 6px 8px;
        min-width: 0;
    }
    .task-panel-done-btn-text {
        display: none;
    }
    .task-panel-done-btn-icon,
    .task-panel-done-btn-icon svg {
        width: 16px;
        height: 16px;
    }
    .task-panel-task-num,
    .task-panel-section-label {
        display: none;
    }
}

/* View tabs */
.view-tab {
    position: relative;
    transition: color 0.15s ease;
    cursor: pointer;
}

.view-tab.active {
    color: #186d6a;
}

.view-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #22a99e;
    border-radius: 1px;
}

.view-tab:not(.active):hover {
    color: #574f47;
}

/* List */
.list-row {
    transition: background 0.1s ease;
}

.list-row:hover {
    background: #faf9f7;
}

.list-header-cell {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9a9182;
}

/* Timeline */
.tl-bar {
    height: 26px;
    border-radius: 6px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: filter 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.tl-bar:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Calendar */
.cal-day {
    min-height: 80px;
    transition: background 0.1s ease;
}

.cal-day:hover {
    background: #faf9f7;
}

.cal-day.today {
    background: rgba(34, 169, 158, 0.04);
}

.cal-task {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 0.12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.cal-task:hover {
    filter: brightness(0.93);
}

/* Priority */
.pri-urgent {
    color: #df5f20;
}

.pri-high {
    color: #ee7a3a;
}

.pri-medium {
    color: #22a99e;
}

.pri-low {
    color: #9a9182;
}

.pri-none {
    color: #d5d1c9;
}

/* Collapsible groups */
.group-toggle {
    cursor: pointer;
    user-select: none;
}

.group-toggle .chevron {
    transition: transform 0.15s ease;
}

.group-toggle.collapsed .chevron {
    transform: rotate(0deg);
}

/* Board horizontal scroll: top scrollbar mirror */
.board-h-scroll-wrapper {
    display: flex;
    flex-direction: column;
}
.board-scroll-top {
    overflow-x: scroll;
    overflow-y: hidden;
    height: 14px;
    margin-bottom: 2px;
    flex-shrink: 0;
}
.board-scroll-track {
    height: 1px;
    pointer-events: none;
}
.board-scroll-body {
    flex: 1;
    min-height: 0;
}

/* Drag-and-drop */
.board-col.drag-over {
    background: rgba(34, 169, 158, 0.04);
    border-radius: 12px;
    outline: 2px dashed #a9ede2;
    outline-offset: -2px;
}

.board-drop-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #22a99e;
    border-radius: 1px;
    pointer-events: none;
    z-index: 10;
}

.board-drop-indicator::before {
    content: '';
    position: absolute;
    left: -3px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22a99e;
}

.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 999;
    opacity: 0.9;
    transform: rotate(3deg);
    box-shadow: 0 12px 32px rgba(34, 31, 28, 0.15);
}

/* List drag-and-drop */
.drag-handle {
    opacity: 0;
    cursor: grab;
    transition: opacity 0.12s ease;
    touch-action: none;
    color: #b8b2a5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.list-row:hover .drag-handle,
.mobile-card:hover .drag-handle {
    opacity: 1;
}

.drag-handle:hover {
    color: #827869;
}

.drag-handle:active {
    cursor: grabbing;
}

.list-row.dragging,
.mobile-card.dragging {
    opacity: 0.35;
    background: #edfcf9;
}

.drop-indicator {
    position: absolute;
    left: 40px;
    right: 16px;
    height: 2px;
    background: #22a99e;
    border-radius: 1px;
    pointer-events: none;
    z-index: 10;
}

.drop-indicator::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22a99e;
}

.list-section-body {
    position: relative;
}

.list-section-drop {
    transition: background 0.15s ease;
}

.list-section-drop.section-drag-over {
    background: rgba(34, 169, 158, 0.04);
}

/* Inline creation */
.inline-create {
    border: 1px dashed #d5d1c9;
    border-radius: 12px;
    padding: 10px 14px;
    background: #fff;
    transition: border-color 0.15s ease;
}

.inline-create:focus-within {
    border-color: #22a99e;
    border-style: solid;
    box-shadow: 0 0 0 3px rgba(34, 169, 158, 0.08);
}

.inline-create input {
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    color: #403b37;
    width: 100%;
    font-family: inherit;
}

.inline-create input::placeholder {
    color: #b8b2a5;
}

/* Inline title edit (board / list / timeline) */
.inline-title-input {
    width: 100%;
    min-width: 0;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid #a8a29e;
    border-radius: 4px;
    padding: 2px 6px;
    outline: none;
}

.inline-editing .inline-title-input {
    display: block;
}

/* Detail panel */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(34, 31, 28, 0.18);
    z-index: 60;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.detail-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(580px, 100vw);
    background: #fff;
    z-index: 61;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.01s linear;
    box-shadow: -8px 0 30px rgba(34, 31, 28, 0.08);
    display: flex;
    flex-direction: column;
}

.detail-panel.open {
    transform: translateX(0);
}

.detail-panel.focus {
    width: 100vw !important;
    right: 0;
    background: #fff;
    box-shadow: none;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.detail-panel.focus #detailContent {
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    background: #fff;
    border-left: 1px solid #eae8e3;
    border-right: 1px solid #eae8e3;
}

.detail-panel.focus .focus-only {
    display: block;
}

.detail-panel:not(.focus) .focus-only {
    display: none;
}

.resize-handle {
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 5;
    transition: background 0.12s ease;
}

.resize-handle:hover,
.resize-handle.active {
    background: rgba(34, 169, 158, 0.25);
}

.detail-panel.focus .resize-handle {
    display: none;
}

/* Custom datepicker */
.dp-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f3f1ed;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.12s ease;
    min-height: 30px;
    flex: 1;
}

.dp-trigger:hover {
    background: #edeae4;
}

.dp-trigger.active {
    border-color: #22a99e;
    background: #fff;
}

.dp-trigger .dp-icon {
    width: 14px;
    height: 14px;
    color: #9a9182;
    flex-shrink: 0;
}

.dp-trigger .dp-text {
    font-size: 0.8125rem;
    color: #4a443e;
    white-space: nowrap;
}

.dp-trigger .dp-arrow {
    font-size: 0.65rem;
    color: #b8b2a5;
    margin: 0 2px;
}

.dp-trigger .dp-placeholder {
    font-size: 0.8125rem;
    color: #b8b2a5;
}

.dp-trigger .dp-clear {
    width: 14px;
    height: 14px;
    color: #b8b2a5;
    margin-left: auto;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.1s ease;
}

.dp-trigger .dp-clear:hover {
    color: #df5f20;
}

.dp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 80;
    background: #fff;
    border: 1px solid #eae8e3;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(34, 31, 28, 0.12);
    padding: 12px;
    min-width: 280px;
    margin-top: 4px;
}

/* Assignee custom dropdown */
.assignee-trigger .assignee-trigger-text {
    font-size: 0.8125rem;
    color: #4a443e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assignee-dropdown {
    padding: 8px 0;
    min-width: 240px;
    right: 0;
    left: auto;
}

.assignee-search-input {
    display: block;
    width: calc(100% - 16px);
    margin: 0 8px 6px;
    padding: 6px 10px;
    font-size: 0.8125rem;
    border: 1px solid #e0dcd6;
    border-radius: 6px;
    outline: none;
    color: #4a443e;
    background: #faf9f7;
    transition: border-color 0.15s ease;
}

.assignee-search-input:focus {
    border-color: #22a99e;
}

.assignee-dropdown-list {
    max-height: 220px;
    overflow-y: auto;
}

.assignee-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    cursor: pointer;
    transition: background 0.12s ease;
    font-size: 0.8125rem;
    color: #4a443e;
}

.assignee-dropdown-item:hover {
    background: #f3f1ed;
}

.assignee-dropdown-item.selected {
    background: #edfcf9;
    color: #186d6a;
}

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

.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.dp-header button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9a9182;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.1s ease;
}

.dp-header button:hover {
    background: #f3f1ed;
    color: #574f47;
}

.dp-header .dp-month {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #231f1c;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    text-align: center;
}

.dp-grid .dp-dow {
    font-size: 0.6rem;
    font-weight: 600;
    color: #b8b2a5;
    text-transform: uppercase;
    padding: 4px 0;
    letter-spacing: 0.05em;
}

.dp-grid .dp-day {
    font-size: 0.75rem;
    padding: 6px 2px;
    border-radius: 6px;
    cursor: pointer;
    color: #4a443e;
    transition: all 0.1s ease;
    position: relative;
}

.dp-grid .dp-day:hover {
    background: #edfcf9;
    color: #186d6a;
}

.dp-grid .dp-day.other {
    color: #d5d1c9;
}

.dp-grid .dp-day.today {
    font-weight: 700;
    color: #186d6a;
}

.dp-grid .dp-day.today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #22a99e;
}

.dp-grid .dp-day.selected {
    background: #22a99e;
    color: #fff;
    font-weight: 600;
}

.dp-grid .dp-day.selected::after {
    display: none;
}

.dp-grid .dp-day.in-range {
    background: #d2f7f0;
    color: #186d6a;
    border-radius: 0;
}

.dp-grid .dp-day.range-start {
    background: #22a99e;
    color: #fff;
    border-radius: 6px 0 0 6px;
}

.dp-grid .dp-day.range-end {
    background: #22a99e;
    color: #fff;
    border-radius: 0 6px 6px 0;
}

.dp-grid .dp-day.range-start.range-end {
    border-radius: 6px;
}

.dp-options {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eae8e3;
}

.dp-toggle {
    position: relative;
    width: 32px;
    height: 18px;
    border-radius: 9px;
    background: #d5d1c9;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.dp-toggle.on {
    background: #22a99e;
}

.dp-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dp-toggle.on::after {
    transform: translateX(14px);
}

.dp-today-btn {
    font-size: 0.7rem;
    color: #22a99e;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.1s ease;
    border: none;
    background: none;
}

.dp-today-btn:hover {
    background: #edfcf9;
}

/* Project settings modal */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(34, 31, 28, 0.3);
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.settings-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.settings-modal {
    background: #fff;
    border-radius: 16px;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(34, 31, 28, 0.15);
    transform: scale(0.97);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-overlay.open .settings-modal {
    transform: scale(1);
}

/* User Settings modal: same overlay + card as project/section modals, with inner nav + content */
.user-settings-modal {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 64px);
    width: min(640px, calc(100vw - 32px));
}

.user-settings-modal .user-settings-body {
    min-height: 0;
}

.user-settings-nav-item {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    color: #827869;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.user-settings-nav-item:hover {
    background-color: #f3f1ed;
    color: #4a443e;
}

.user-settings-nav-item.active {
    background-color: #edfcf9;
    color: #198882;
    font-weight: 600;
}

.user-settings-main .settings-section {
    display: none;
}

.user-settings-main .settings-section.active {
    display: block;
}

.user-settings-main .settings-section.hidden {
    display: none !important;
}

/* Avatar in User Settings Profile tab */
.user-settings-main .avatar-upload-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.user-settings-main .avatar-preview {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22a99e 0%, #198882 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-settings-main .avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

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

.settings-field label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9a9182;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-input {
    font-size: 0.8125rem;
    background: #f3f1ed;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 12px;
    color: #4a443e;
    outline: none;
    transition: border-color 0.15s ease, background 0.12s ease;
    font-family: inherit;
    width: 100%;
}

.settings-input:focus {
    border-color: #22a99e;
    background: #fff;
}

textarea.settings-input {
    min-height: 72px;
    resize: vertical;
    line-height: 1.5;
}

.settings-color {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.12s ease, transform 0.1s ease;
}

.settings-color:hover {
    transform: scale(1.15);
}

.settings-color.active {
    border-color: #231f1c;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #231f1c;
}

.settings-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f1ed;
}

.settings-member:last-child {
    border-bottom: none;
}

/* New project modal: members list rows with aligned columns */
.new-project-member-row {
    display: grid;
    grid-template-columns: 1fr 5.5rem auto;
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f1ed;
}
.new-project-member-row:last-child {
    border-bottom: none;
}
.new-project-member-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.new-project-member-role {
    text-align: left;
    font-size: 0.75rem;
}

.detail-select {
    font-size: 0.8125rem;
    background: #f3f1ed;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 4px 10px;
    color: #4a443e;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239a9182' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 26px;
}

.detail-select:focus {
    border-color: #22a99e;
}

.detail-description {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #4a443e;
    min-height: 72px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    width: 100%;
    font-family: inherit;
    resize: none;
    overflow-y: hidden;
    background: #faf9f7;
}

.detail-description:focus {
    border-color: #22a99e;
    background: #fff;
}

.comment-bubble {
    background: #f6f5f3;
    border-radius: 10px;
    border-top-left-radius: 2px;
    padding: 8px 12px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #4a443e;
}

.comment-input {
    resize: none;
    border: 1px solid #d5d1c9;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.15s ease;
    width: 100%;
    font-family: inherit;
    color: #4a443e;
}

.comment-input:focus {
    border-color: #22a99e;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #eae8e3;
}

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

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(34, 31, 28, 0.12);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s ease forwards;
    max-width: 340px;
}

.toast.removing {
    animation: toastOut 0.25s ease forwards;
}

.toast-success {
    background: #072b2b;
    color: #a9ede2;
}

.toast-info {
    background: #403b37;
    color: #eae8e3;
}

/* Keyboard focus ring */
.task-card.kb-focus {
    outline: 2px solid #22a99e;
    outline-offset: 2px;
}

/* Mobile card list */
@media (max-width: 768px) {
    .cal-day {
        min-height: 60px;
    }

    .mobile-card {
        background: #fff;
        border: 1px solid #eae8e3;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 8px;
        transition: background 0.1s ease;
    }

    .mobile-card:active {
        background: #faf9f7;
    }
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ========== Login / Register modal (auth-modern.js) ========== */
#loginModal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#loginModal.login-modal-visible {
    opacity: 1;
    visibility: visible;
}

#loginModal .login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #faf9f7 0%, #f3f1ed 50%, #edfcf9 100%);
}

#loginContainer {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 24px;
    margin-top: auto;
    margin-bottom: auto;
    flex-shrink: 0;
}

#loginContainer.login-container-signup {
    max-width: 560px;
}

.login-modal-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(34, 31, 28, 0.12), 0 0 0 1px rgba(34, 31, 28, 0.06);
    padding: 40px 36px;
}

.login-modal-card.login-card-signup {
    padding: 36px 32px;
}

.login-panel-hidden {
    display: none !important;
}

.login-modal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.login-modal-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #198882 0%, #22a99e 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal-brand-text {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #403b37;
    letter-spacing: -0.02em;
}

.login-modal-beta {
    font-size: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    color: #22a99e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-left: 4px;
}

.login-modal-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #403b37;
    margin: 0 0 4px 0;
}

.login-modal-subtitle {
    font-size: 0.875rem;
    color: #9a9182;
    margin: 0 0 20px 0;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.login-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #574f47;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.login-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9375rem;
    color: #403b37;
    background: #faf9f7;
    border: 1px solid transparent;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    font-family: inherit;
}

.login-input::placeholder {
    color: #b8b2a5;
}

.login-input:focus {
    border-color: #22a99e;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 169, 158, 0.1);
}

.login-error {
    font-size: 0.8125rem;
    color: #df5f20;
    background: #fef3c7;
    padding: 10px 12px;
    border-radius: 8px;
    display: none;
    margin-bottom: 12px;
}

.login-error.visible {
    display: block;
}

.login-submit {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #198882 0%, #22a99e 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
    font-family: inherit;
    margin-top: 4px;
}

.login-submit:hover:not(:disabled) {
    filter: brightness(1.05);
}

.login-submit:active:not(:disabled) {
    transform: scale(0.99);
}

.login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-switch {
    font-size: 0.875rem;
    color: #6b6257;
    margin: 16px 0 0 0;
    text-align: center;
}

.login-link {
    color: #198882;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
}

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

/* Password strength (auth-modern.js classes) */
.login-strength-fill {
    display: block;
    height: 4px;
    border-radius: 2px;
    width: 0;
    transition: width 0.2s ease, background 0.2s ease;
    background: #e8e4df;
}

.login-strength-fill.strength-weak {
    width: 33%;
    background: #df5f20;
}

.login-strength-fill.strength-medium {
    width: 66%;
    background: #d97706;
}

.login-strength-fill.strength-strong {
    width: 100%;
    background: #198882;
}

.login-strength-label {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 48px;
}

.login-strength-label.strength-weak {
    color: #df5f20;
}

.login-strength-label.strength-medium {
    color: #d97706;
}

.login-strength-label.strength-strong {
    color: #198882;
}

.login-password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.login-password-strength .login-strength-fill {
    flex: 1;
}

#registerPasswordMatchHint.hidden {
    display: none !important;
}

#registerPasswordMatchHint.match {
    color: #198882;
    font-size: 0.75rem;
    margin-top: 4px;
}

#registerPasswordMatchHint.mismatch {
    color: #df5f20;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Company picker */
.login-company-pick-btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #403b37;
    background: #faf9f7;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.login-company-pick-btn:hover {
    background: #edfcf9;
    border-color: #22a99e;
}

#companyPickerList {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-signup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.login-signup-grid .login-field-full {
    grid-column: 1 / -1;
}

/* Signup form two-column layout: reduces vertical height on short screens */
.login-form-signup-two-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.login-form-signup-two-col .login-field-full,
.login-form-signup-two-col .login-signup-grid {
    margin-bottom: 16px;
}

.login-form-signup-two-col .login-signup-grid .login-field {
    margin-bottom: 0;
}

.login-form-signup-two-col .login-submit {
    margin-top: 4px;
}

.login-success-msg {
    text-align: center;
    padding: 24px 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #574f47;
}

/* ===== MY TASKS LIST – TASK MEMBERS COLUMN (kissing avatars) ===== */
.list-view-access-cell {
    display: flex;
    align-items: center;
    min-width: 0;
}
.list-view-access-avatars-empty {
    color: #9ca3af;
    font-size: 13px;
}
.list-view-access-avatars-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}
.list-view-access-avatars-inner .list-view-access-avatar-wrap {
    flex-shrink: 0;
}
.list-view-access-avatars-inner .list-view-access-avatar-wrap .avatar {
    border: 2px solid #fff;
    width: 20px !important;
    height: 20px !important;
    font-size: 9px !important;
    flex-shrink: 0;
    box-sizing: content-box;
}
.list-view-access-avatar-wrap {
    position: relative;
    display: inline-flex;
}
.list-view-access-avatar-wrap .avatar {
    cursor: default;
}
.list-view-access-avatar-overflow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #4f46e5;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    box-sizing: content-box;
    cursor: default;
    flex-shrink: 0;
}

/* ===== MY TASKS LIST – PROJECTS COLUMN ===== */
.list-view-projecten-cell {
    max-width: 140px;
    display: flex;
    align-items: center;
    min-width: 0;
}
.list-view-projecten-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}
.list-view-project-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f3f1ed;
    border: 1px solid #d5d1c9;
    font-size: 11px;
    color: #574f47;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    transition: background 0.15s;
}
.list-view-project-chip:hover {
    background: #eae8e3;
}

/* ===== USER HOVER CARD ===== */
.user-avatar-hover-trigger {
    position: relative;
    display: inline-flex;
}

.user-hover-card {
    position: fixed;
    z-index: 1100;
    min-width: 220px;
    max-width: 300px;
    padding: 14px 16px;
    background-color: #ffffff;
    border-radius: 10px;
    border-left: 4px solid #22a99e;
    box-shadow: 0 8px 24px rgba(64, 59, 55, 0.12), 0 0 1px rgba(64, 59, 55, 0.08);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-hover-card.user-hover-card-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.user-hover-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-hover-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.user-hover-card-avatar.user-hover-card-avatar-initials {
    background: #6b6257;
}

.user-hover-card-avatar.user-1 { background: #22a99e; }
.user-hover-card-avatar.user-2 { background: #7c3aed; }
.user-hover-card-avatar.user-3 { background: #06b6d4; }
.user-hover-card-avatar.user-4 { background: #ec4899; }
.user-hover-card-avatar.user-5 { background: #ee7a3a; }
.user-hover-card-avatar.user-6 { background: #198882; }

.user-hover-card-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-hover-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-hover-card-name {
    font-size: 14px;
    font-weight: 500;
    color: #4a443e;
    line-height: 1.3;
    word-break: break-word;
}

.user-hover-card-name-link {
    color: #198882;
    text-decoration: none;
}

.user-hover-card-name-link:hover {
    color: #186d6a;
    text-decoration: underline;
}

.user-hover-card-email {
    font-size: 12px;
    color: #6b6257;
    line-height: 1.3;
    word-break: break-word;
}

.user-hover-card-email.user-hover-card-email-empty {
    display: none;
}

.user-hover-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid #e8e5df;
}

.user-hover-card-body.user-hover-card-body-empty {
    display: none;
}

.user-hover-card-job {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b6257;
    line-height: 1.3;
}

.user-hover-card-job.user-hover-card-job-empty {
    display: none;
}

.user-hover-card-description {
    font-size: 12px;
    color: #4a443e;
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.user-hover-card-description.user-hover-card-description-empty {
    display: none;
}
