/* ==================== РНП Tasks v3.0 CSS ==================== */
:root {
    --primary: #0079bf;
    --primary-dark: #026aa7;
    --success: #61bd4f;
    --warning: #f2d600;
    --danger: #eb5a46;
    --orange: #ff9f1a;
    --bg: #0079bf;
    --sidebar-bg: #026aa7;
    --card-bg: #fff;
    --text: #172b4d;
    --text-light: #5e6c84;
    --border: #dfe1e6;
    --hover: rgba(9,30,66,0.08);
    --shadow: 0 1px 0 rgba(9,30,66,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,0.15);
    backdrop-filter: blur(4px);
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    z-index: 100;
}

.header-left, .header-right { display: flex; align-items: center; gap: 8px; }
.header-center { flex: 1; display: flex; justify-content: center; }

.menu-btn, .header-btn {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.2);
    border: none; border-radius: 4px;
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.menu-btn:hover, .header-btn:hover { background: rgba(255,255,255,0.3); }
.menu-btn i, .header-btn i { width: 18px; height: 18px; }
.header-btn.active { background: rgba(255,255,255,0.4); }

.board-title {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #fff; font-weight: 700; font-size: 18px;
    cursor: pointer; max-width: 300px;
}
.board-title:hover { background: rgba(255,255,255,0.3); }
.board-title i { width: 16px; height: 16px; opacity: 0; transition: opacity 0.2s; }
.board-title:hover i { opacity: 1; }
.board-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== SYNC STATUS ===== */
.sync-status {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: #61bd4f;
    padding: 4px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    transition: color 0.3s;
}
.sync-status i { width: 14px; height: 14px; }
.sync-status.spin i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== USER AVATAR ===== */
.user-avatar {
    width: 32px; height: 32px;
    background: #ddd; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    color: var(--text); cursor: pointer;
    transition: transform 0.2s;
}
.user-avatar:hover { transform: scale(1.1); }

/* ===== SEARCH BAR ===== */
#search-bar {
    display: none;
    position: fixed; top: 48px; left: 0; right: 0;
    padding: 12px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 99;
    align-items: center; gap: 12px;
}
#search-bar.show { display: flex; }
#search-bar > i { width: 20px; height: 20px; color: var(--text-light); flex-shrink: 0; }
#search-bar input {
    flex: 1; padding: 10px 16px;
    border: 2px solid var(--border); border-radius: 8px;
    font-size: 14px; outline: none;
}
#search-bar input:focus { border-color: var(--primary); }
#search-bar button {
    width: 36px; height: 36px;
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
#search-bar button i { width: 20px; height: 20px; color: var(--text-light); }

/* ===== FILTER BAR ===== */
#filter-bar {
    display: none;
    position: fixed; top: 48px; left: 0; right: 0;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 98;
    align-items: center; gap: 8px;
    flex-wrap: wrap;
}
#filter-bar.show { display: flex; }

.filter-label { font-size: 13px; font-weight: 600; color: var(--text-light); margin-right: 4px; }

.filter-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px;
    background: #f4f5f7; border: 1px solid var(--border); border-radius: 20px;
    font-size: 13px; color: var(--text);
    cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { background: #ebecf0; }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-btn i { width: 14px; height: 14px; }

.filter-btn-clear {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px;
    background: none; border: 1px solid var(--border); border-radius: 20px;
    font-size: 13px; color: var(--text-light);
    cursor: pointer; margin-left: auto;
}
.filter-btn-clear:hover { background: var(--hover); }
.filter-btn-clear i { width: 14px; height: 14px; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; top: 0; left: -280px;
    width: 280px; height: 100vh;
    background: var(--sidebar-bg);
    z-index: 200;
    transition: left 0.3s ease;
    overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column;
}
.sidebar.show { left: 0; }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 199;
}
.sidebar.show ~ .sidebar-overlay { display: block; }

.sidebar-back-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 12px; color: #fff; text-decoration: none;
    border-radius: 4px; margin-bottom: 20px; font-size: 14px;
}
.sidebar-back-btn:hover { background: rgba(255,255,255,0.1); }
.sidebar-back-btn i { width: 18px; height: 18px; }

.sidebar-section { margin-bottom: 24px; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; }

.sidebar-section h3 {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 12px; padding: 0 8px;
}
.sidebar-section h3 i { width: 16px; height: 16px; }

.board-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 4px;
    cursor: pointer; color: #fff; font-size: 14px;
    transition: background 0.2s;
}
.board-item:hover { background: rgba(255,255,255,0.1); }
.board-item.active { background: rgba(255,255,255,0.2); }

.board-item-color { width: 24px; height: 20px; border-radius: 4px; flex-shrink: 0; }
.board-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.board-item-star {
    width: 24px; height: 24px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.board-item:hover .board-item-star { opacity: 1; }
.board-item-star.starred { color: #f2d600; opacity: 1; }
.board-item-star i { width: 16px; height: 16px; }

.add-board-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; width: 100%;
    background: rgba(255,255,255,0.1);
    border: none; border-radius: 4px;
    color: #fff; font-size: 14px;
    cursor: pointer; margin-top: 8px;
}
.add-board-btn:hover { background: rgba(255,255,255,0.2); }
.add-board-btn i { width: 18px; height: 18px; }
.add-board-btn.danger-link { color: #ff7979; }
.add-board-btn.danger-link:hover { background: rgba(255,100,100,0.15); }

.empty-text { font-size: 13px; color: rgba(255,255,255,0.5); padding: 8px 12px; }

/* ===== BOARD ===== */
.board-container {
    position: fixed; top: 48px; left: 0; right: 0; bottom: 0;
    overflow-x: auto; overflow-y: hidden;
    padding: 12px;
}

.board { display: flex; gap: 12px; height: 100%; padding-bottom: 12px; }

/* ===== LIST ===== */
.list {
    flex-shrink: 0; width: 272px;
    max-height: calc(100vh - 100px);
    background: #ebecf0; border-radius: 8px;
    display: flex; flex-direction: column;
}

.list-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; cursor: grab;
}
.list-header:active { cursor: grabbing; }

.list-title {
    font-size: 14px; font-weight: 600;
    color: var(--text);
    padding: 4px 8px;
    border: 2px solid transparent; border-radius: 4px;
    background: transparent; outline: none; flex: 1;
}
.list-title:focus { background: #fff; border-color: var(--primary); }

.list-count {
    font-size: 12px; color: var(--text-light);
    background: rgba(9,30,66,0.08);
    padding: 2px 8px; border-radius: 10px;
    margin: 0 8px;
}

.list-menu-btn {
    width: 28px; height: 28px;
    background: none; border: none; border-radius: 4px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
}
.list-menu-btn:hover { background: rgba(9,30,66,0.08); }
.list-menu-btn i { width: 18px; height: 18px; }

.list-cards {
    flex: 1; overflow-y: auto;
    padding: 0 8px 8px; min-height: 8px;
}
.list-cards.drag-over { background: rgba(0,0,0,0.05); border-radius: 4px; }

/* ===== CARD ===== */
.card {
    background: #fff; border-radius: 8px;
    padding: 8px; margin-bottom: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    overflow: hidden;
}
.card:hover { background: #f4f5f7; }
.card.dragging { opacity: 0.5; transform: rotate(3deg); }

.card-priority-bar {
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px; border-radius: 8px 8px 0 0;
}

.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.card-label {
    height: 8px; min-width: 40px; border-radius: 4px;
    display: flex; align-items: center;
    padding: 0 4px;
}
.card-label span {
    font-size: 10px; color: #fff;
    font-weight: 600; line-height: 8px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.card-title { font-size: 14px; color: var(--text); margin-bottom: 8px; word-wrap: break-word; }

.card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-badge {
    display: flex; align-items: center; gap: 3px;
    font-size: 12px; color: var(--text-light);
    padding: 2px 6px; border-radius: 4px;
}
.card-badge i { width: 14px; height: 14px; }
.card-badge.due-overdue { background: var(--danger); color: #fff; }
.card-badge.due-soon { background: var(--warning); color: var(--text); }
.card-badge.due-complete { background: var(--success); color: #fff; }
.card-badge.priority-badge { font-weight: 700; font-size: 11px; }

.card-members { display: flex; justify-content: flex-end; margin-top: 8px; }
.card-member {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: #fff;
    margin-left: -4px; border: 2px solid #fff;
}

/* ===== ADD CARD / LIST ===== */
.add-card-btn, .add-list-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 12px;
    background: none; border: none; border-radius: 8px;
    font-size: 14px; color: var(--text-light);
    cursor: pointer; text-align: left;
}
.add-card-btn:hover { background: rgba(9,30,66,0.08); color: var(--text); }
.add-card-btn i, .add-list-btn i { width: 18px; height: 18px; }

.add-list {
    flex-shrink: 0; width: 272px;
    background: rgba(255,255,255,0.24);
    border-radius: 8px; padding: 8px;
    height: fit-content;
}
.add-list-btn { color: #fff !important; }
.add-list-btn:hover { background: rgba(255,255,255,0.12) !important; }

.add-card-form, .add-list-form { padding: 8px; display: none; }
.add-card-form.show, .add-list-form.show { display: block; }

.add-card-form textarea {
    width: 100%; padding: 10px;
    border: none; border-radius: 4px;
    font-size: 14px; resize: none; min-height: 60px;
    box-shadow: var(--shadow); margin-bottom: 8px;
    font-family: inherit;
}

.add-list-form input {
    width: 100%; padding: 10px;
    border: 2px solid var(--primary); border-radius: 4px;
    font-size: 14px; margin-bottom: 8px;
}

.add-card-actions, .add-list-actions { display: flex; gap: 8px; align-items: center; }

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 16px; border: none; border-radius: 4px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background 0.2s;
}
.btn i { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-sm i { width: 14px; height: 14px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-cancel {
    width: 32px; height: 32px;
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #42526e; border-radius: 4px;
}
.btn-cancel:hover { background: rgba(9,30,66,0.08); }
.btn-icon {
    width: 28px; height: 28px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 4px;
    cursor: pointer; color: var(--text-light);
}
.btn-icon:hover { background: var(--hover); }

/* ===== CARD MODAL ===== */
#card-modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 300; overflow-y: auto;
    padding: 48px 8px;
}
#card-modal.show { display: block; }

.card-modal-content {
    background: #f4f5f7; border-radius: 8px;
    max-width: 768px; margin: 0 auto;
    position: relative;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px;
    background: rgba(0,0,0,0.1); border: none;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #42526e; z-index: 10;
}
.modal-close:hover { background: rgba(0,0,0,0.2); }
.modal-close i { width: 20px; height: 20px; }

.modal-header {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 48px 16px 16px;
    background: #fff; border-radius: 8px 8px 0 0;
}
.modal-icon { width: 24px; height: 24px; color: #42526e; flex-shrink: 0; margin-top: 4px; }

.modal-title {
    font-size: 20px; font-weight: 600; color: var(--text);
    background: none; border: 2px solid transparent;
    border-radius: 4px; width: 100%;
    padding: 4px 8px; margin: -4px -8px;
}
.modal-title:focus { outline: none; background: #fff; border-color: var(--primary); }
.modal-subtitle { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.modal-body { display: flex; gap: 16px; padding: 16px; }
.modal-main { flex: 1; min-width: 0; }

.modal-sidebar { width: 180px; flex-shrink: 0; }
.modal-sidebar h5 {
    font-size: 12px; font-weight: 600; color: var(--text-light);
    margin: 16px 0 8px; text-transform: uppercase;
}
.modal-sidebar h5:first-child { margin-top: 0; }
.modal-sidebar button {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 12px;
    background: #091e420a; border: none; border-radius: 4px;
    font-size: 14px; color: var(--text);
    cursor: pointer; text-align: left; margin-bottom: 4px;
}
.modal-sidebar button:hover { background: #091e4214; }
.modal-sidebar button i { width: 16px; height: 16px; }
.modal-sidebar button.danger { color: var(--danger); }
.modal-sidebar button.danger:hover { background: #ffebe6; }

.modal-section { margin-bottom: 24px; }
.modal-section h4 {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; color: var(--text);
    margin-bottom: 12px;
}
.modal-section h4 i { width: 18px; height: 18px; color: #42526e; }

/* Modal row (priority + recurrence) */
.modal-row { display: flex; gap: 16px; }
.modal-field { flex: 1; }
.modal-field select {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 4px;
    font-size: 14px; background: #fff; cursor: pointer;
}
.modal-field select:focus { outline: none; border-color: var(--primary); }

/* Due row */
.due-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.due-row input[type="datetime-local"] {
    padding: 8px 12px; border: 1px solid var(--border);
    border-radius: 4px; font-size: 14px;
}
.due-row input[type="datetime-local"]:focus { outline: none; border-color: var(--primary); }
.due-complete-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; color: var(--text); cursor: pointer;
}
.due-complete-label input { width: 18px; height: 18px; cursor: pointer; }

/* Labels display */
.labels-display { display: flex; flex-wrap: wrap; gap: 4px; }
.modal-label {
    padding: 4px 12px; border-radius: 4px;
    font-size: 12px; font-weight: 600; color: #fff;
    cursor: pointer; min-width: 32px; text-align: center;
}
.modal-label:hover { opacity: 0.8; }

/* Members display */
.members-display { display: flex; flex-wrap: wrap; gap: 4px; }
.modal-member {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; color: #fff;
    cursor: pointer;
}
.modal-member:hover { opacity: 0.8; }

/* Description */
.modal-desc {
    width: 100%; min-height: 100px; padding: 12px;
    border: 1px solid var(--border); border-radius: 4px;
    font-size: 14px; font-family: inherit; resize: vertical;
    background: #fff;
}
.modal-desc:focus { outline: none; border-color: var(--primary); }

/* ===== CHECKLISTS ===== */
.checklist {
    background: #fff; border-radius: 4px;
    padding: 12px; margin-bottom: 12px;
    border: 1px solid var(--border);
}
.checklist-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
}
.checklist-header i { width: 18px; height: 18px; color: var(--text-light); }
.checklist-title { flex: 1; font-size: 14px; font-weight: 600; }

.checklist-progress {
    height: 8px; background: #ebecf0;
    border-radius: 4px; overflow: hidden; margin-bottom: 12px;
}
.checklist-progress-bar { height: 100%; background: var(--success); transition: width 0.3s; }

.checklist-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; border-bottom: 1px solid #ebecf0;
}
.checklist-item:last-of-type { border-bottom: none; }
.checklist-item input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.checklist-item span { flex: 1; font-size: 14px; }
.checklist-item span.done { text-decoration: line-through; color: var(--text-light); }
.checklist-item-delete { opacity: 0; transition: opacity 0.2s; }
.checklist-item:hover .checklist-item-delete { opacity: 1; }

.add-checklist-item { padding: 8px 0; }
.add-checklist-item input {
    width: 100%; padding: 8px;
    border: 1px solid var(--border); border-radius: 4px;
    font-size: 14px;
}
.add-checklist-item input:focus { outline: none; border-color: var(--primary); }

/* ===== COMMENTS ===== */
.add-comment { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.add-comment textarea {
    flex: 1; min-width: 200px; padding: 10px;
    border: 1px solid var(--border); border-radius: 4px;
    font-size: 14px; resize: none; font-family: inherit;
}
.add-comment textarea:focus { outline: none; border-color: var(--primary); }

.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #ebecf0; }
.comment:last-child { border-bottom: none; }
.avatar-small {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-size: 14px; font-weight: 600; color: var(--text); }
.comment-date { font-size: 12px; color: var(--text-light); margin-left: 8px; }
.comment-text {
    font-size: 14px; line-height: 1.5;
    background: #fff; padding: 8px 12px;
    border-radius: 4px; margin-top: 4px;
}
.comment-actions { margin-top: 4px; }
.comment-actions a { font-size: 12px; color: var(--text-light); cursor: pointer; text-decoration: underline; }
.comment-actions a:hover { color: var(--danger); }

/* ===== PICKER POPUPS (labels, members) ===== */
.picker-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff; border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    min-width: 300px; max-width: 90vw;
    max-height: 80vh; overflow-y: auto;
    z-index: 400;
}
.picker-popup.show { display: block; }
.picker-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.picker-header h4 { font-size: 14px; color: var(--text-light); }
.picker-header button {
    width: 28px; height: 28px;
    background: none; border: none; cursor: pointer;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
}
.picker-header button:hover { background: var(--hover); }
.picker-body { padding: 12px; }

.label-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 4px; cursor: pointer;
    margin-bottom: 4px;
}
.label-item:hover { background: var(--hover); }
.label-item-check { width: 20px; text-align: center; }
.label-item-check i { width: 16px; height: 16px; color: var(--text); }
.label-item-color {
    flex: 1; height: 32px; border-radius: 4px;
    display: flex; align-items: center; padding: 0 12px;
    color: #fff; font-size: 14px; font-weight: 500;
}
.label-color-opt { transition: transform 0.1s; border: 2px solid transparent; }
.label-color-opt:hover { transform: scale(1.15); }
.label-color-opt.selected { border-color: var(--text); }

.member-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px; border-radius: 4px; cursor: pointer;
}
.member-item:hover { background: var(--hover); }
.member-item-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; color: #fff;
}
.member-item-name { flex: 1; font-size: 14px; }
.member-item-check { width: 20px; }
.member-item-check i { width: 16px; height: 16px; color: var(--success); }

/* ===== LIST MENU POPUP ===== */
.list-menu-popup {
    background: #fff; border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    min-width: 200px; z-index: 500;
    overflow: hidden;
}
.list-menu-popup button {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 16px;
    background: none; border: none;
    font-size: 14px; color: var(--text);
    cursor: pointer; text-align: left;
}
.list-menu-popup button:hover { background: var(--hover); }
.list-menu-popup button.active { background: #e4f0ff; color: var(--primary); }
.list-menu-popup button i { width: 18px; height: 18px; color: #42526e; }
.list-menu-popup button.danger { color: var(--danger); }
.list-menu-popup button.danger i { color: var(--danger); }
.list-menu-popup .popup-divider,
.sort-menu-popup .popup-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== USER MENU ===== */
.user-menu {
    display: none;
    position: fixed; top: 56px; right: 8px;
    background: #fff; border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    min-width: 280px; z-index: 150; overflow: hidden;
}
.user-menu.active { display: block; }
.user-menu-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; background: #f4f5f7;
}
.user-menu-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700;
}
.user-menu-name { font-size: 16px; font-weight: 600; color: var(--text); }
.user-menu-email { font-size: 13px; color: var(--text-light); }
.user-menu-divider { height: 1px; background: var(--border); }
.user-menu-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 12px 16px;
    background: none; border: none; font-size: 14px;
    color: var(--text); cursor: pointer;
    text-decoration: none; text-align: left;
}
.user-menu-item:hover { background: var(--hover); }
.user-menu-item i { width: 18px; height: 18px; color: var(--text-light); }
.user-menu-logout { color: var(--danger); }
.user-menu-logout i { color: var(--danger); }

/* ===== TOAST ===== */
#toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232; color: #fff;
    padding: 12px 24px; border-radius: 8px;
    font-size: 14px; opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000; max-width: calc(100% - 32px);
    pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .board-title { max-width: 150px; font-size: 16px; }
    .header-center { display: none; }
    .list { width: 280px; }
}

@media (max-width: 600px) {
    .card-modal-content { margin: 16px 0; border-radius: 0; }
    #card-modal { padding: 0; }
    .modal-body { flex-direction: column; }
    .modal-sidebar {
        width: 100%;
        display: flex; flex-wrap: wrap; gap: 8px;
    }
    .modal-sidebar button { flex: 1; min-width: 120px; }
    .modal-sidebar h5 { width: 100%; }
    .modal-row { flex-direction: column; gap: 0; }
    .due-row { flex-direction: column; align-items: flex-start; }
    .filter-btn span { display: none; }
    .add-comment { flex-direction: column; }
    .add-comment .btn { align-self: flex-end; }
}

/* ===== TIME RANGE IN MODAL ===== */
.time-range-inputs {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.time-label {
    font-size: 13px; color: #6b778c;
    display: flex; align-items: center; gap: 6px;
}
.time-label input[type="time"] {
    padding: 6px 10px; border: 1px solid #dfe1e6; border-radius: 4px;
    font-size: 14px; background: #fafbfc; color: #172b4d;
}
.time-label input[type="time"]:focus { outline: none; border-color: var(--primary); }
.time-dash { color: #6b778c; font-size: 18px; }
.time-range-duration { font-size: 12px; color: #6b778c; margin-top: 4px; }
.btn-icon-sm {
    width: 28px; height: 28px; border: none; background: #ebecf0;
    border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
    color: #6b778c; flex-shrink: 0;
}
.btn-icon-sm:hover { background: #dfe1e6; }
.btn-icon-sm i { width: 14px; height: 14px; }
.time-range-badge { background: rgba(0,121,191,0.1) !important; color: var(--primary) !important; font-weight: 600; }

/* ===== DESKTOP CALENDAR VIEW ===== */
.calendar-view-desktop {
    display: none; position: fixed; top: 48px; left: 0; right: 0; bottom: 0;
    background: #fff; overflow-y: auto; z-index: 50;
}
.calendar-view-desktop.show { display: block; }
.cal-desktop-header {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 20px; border-bottom: 1px solid #ebecf0;
    background: #fff; position: sticky; top: 0; z-index: 10;
}
.cal-desktop-header h2 { flex: 1; font-size: 18px; font-weight: 600; color: #172b4d; margin: 0; }
.cal-nav-btn {
    width: 32px; height: 32px; background: #f4f5f7;
    border: none; border-radius: 4px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.cal-nav-btn:hover { background: #ebecf0; }
.cal-nav-btn i { width: 18px; height: 18px; color: #42526e; }
.cal-desktop-body { padding: 16px 20px; }
.header-btn.active { background: rgba(255,255,255,0.3); }

/* Calendar time grid */
.cal-time-grid { position: relative; margin-left: 60px; margin-right: 16px; }
.cal-hour-label {
    position: absolute; left: -56px; width: 50px;
    font-size: 12px; color: #6b778c; font-weight: 500;
    text-align: right; transform: translateY(-8px);
}
.cal-hour-line { position: absolute; left: 0; right: 0; height: 1px; background: #ebecf0; }
.cal-now-line { position: absolute; left: -8px; right: 0; height: 2px; background: var(--danger); z-index: 5; }
.cal-now-line::before {
    content: ''; position: absolute; left: -5px; top: -4px;
    width: 10px; height: 10px; background: var(--danger); border-radius: 50%;
}
.cal-task-block {
    position: absolute; left: 4px; right: 16px;
    border-radius: 6px; padding: 4px 10px;
    overflow: hidden; cursor: pointer; z-index: 2;
    transition: box-shadow 0.2s;
}
.cal-task-block:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.cal-task-time { font-size: 11px; font-weight: 700; color: #5e6c84; }
.cal-task-title { font-size: 13px; font-weight: 500; color: #172b4d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Calendar unscheduled / empty */
.cal-unscheduled { padding: 16px 0; border-top: 2px solid #ebecf0; margin-left: 60px; margin-top: 8px; }
.cal-unscheduled h4 { font-size: 13px; color: #5e6c84; margin: 0 0 8px 0; display: flex; align-items: center; gap: 6px; }
.cal-unscheduled h4 i { width: 16px; height: 16px; }
.cal-unscheduled-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #f4f5f7; border-radius: 6px;
    margin-bottom: 4px; cursor: pointer; font-size: 14px; color: #172b4d;
}
.cal-unscheduled-item:hover { background: #ebecf0; }
.cal-us-time { font-size: 12px; font-weight: 600; color: #5e6c84; min-width: 40px; }
.cal-empty {
    text-align: center; padding: 60px 20px; color: #6b778c;
}
.cal-empty i { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.5; }
.cal-empty p { font-size: 16px; margin: 0; }
