body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 20px; height: 100vh; box-sizing: border-box; background-color: #0079bf; background-size: cover; background-position: center; background-attachment: fixed; transition: background 0.3s;}
.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
#app-title { margin: 0; color: white; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); cursor: pointer; padding: 5px 10px; border-radius: 5px; transition: background 0.2s; }
#app-title:hover { background-color: rgba(255, 255, 255, 0.2); }
#app-title::after { content: " ✏️"; font-size: 14px; opacity: 0; transition: opacity 0.2s; }
#app-title:hover::after { opacity: 1; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;}
.icon-btn { background-color: rgba(255,255,255,0.2); color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; font-weight: bold; transition: 0.2s; backdrop-filter: blur(4px); font-size: 13px;}
.icon-btn:hover { background-color: rgba(255,255,255,0.4); }

.dropdown { position: relative; display: inline-block; z-index: 1000; }
.dropdown-content { display: none; position: absolute; right: 0; background-color: #f4f5f7; min-width: 180px; box-shadow: 0 8px 16px rgba(0,0,0,0.3); border-radius: 6px; overflow: hidden; margin-top: 5px;}
.dropdown-content a { color: #172b4d; padding: 12px 16px; text-decoration: none; display: block; font-size: 13px; font-weight: 600; border-bottom: 1px solid #dfe1e6;}
.dropdown-content a:hover { background-color: #ebecf0; }
.dropdown:hover .dropdown-content { display: block; }

#board-container { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; align-items: flex-start; height: calc(100% - 80px); }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 60vh; text-align: center; color: white; background: rgba(0,0,0,0.4); border-radius: 12px; backdrop-filter: blur(5px);}
.empty-state h2 { font-size: 28px; margin-bottom: 10px; text-shadow: 1px 1px 3px rgba(0,0,0,0.5);}
.empty-state p { font-size: 16px; margin-bottom: 20px; max-width: 500px; line-height: 1.5; color: #f4f5f7; padding: 0 15px;}
.restore-btn-large { background: #d04437; color: white; border: none; padding: 15px 30px; font-size: 18px; border-radius: 8px; cursor: pointer; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: 0.2s; width: 90%; max-width: 350px;}
.restore-btn-large:hover { background: #ff5630; transform: scale(1.05);}
.start-fresh-btn { background: transparent; color: white; border: 1px solid white; padding: 10px 20px; margin-top: 15px; border-radius: 8px; cursor: pointer; transition: 0.2s; width: 90%; max-width: 350px;}
.start-fresh-btn:hover { background: rgba(255,255,255,0.2); }

.board { background-color: #ebecf0; border-radius: 8px; width: 300px; min-width: 300px; padding: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.3); display: flex; flex-direction: column; max-height: 100%; opacity: 0.96; transition: all 0.2s ease-in-out;}
.board-header { font-weight: bold; padding: 10px; margin-bottom: 10px; color: #172b4d; cursor: grab; display: flex; justify-content: space-between; align-items: center; }
.board-header:active { cursor: grabbing; }

.board.collapsed { min-width: 32px !important; width: 32px !important; padding: 10px 0 !important; background-color: rgba(235, 236, 240, 0.85) !important; border-radius: 6px; box-shadow: inset 4px 0 0 #0079bf !important; align-items: center; cursor: pointer;}
.board.collapsed:hover { background-color: rgba(235, 236, 240, 1) !important; box-shadow: inset 6px 0 0 #005282 !important; }
.board.collapsed .board-header { flex-direction: column; justify-content: flex-start; height: 100%; margin: 0; padding: 0; cursor: pointer; }
.board.collapsed .board-title-text { writing-mode: vertical-rl; transform: rotate(180deg); margin-top: 5px; color: #172b4d; font-weight: 700; letter-spacing: 1.5px; font-size: 13px; white-space: nowrap; }

.action-group { display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; position: relative; z-index: 10; flex-shrink: 0; }
.board-header:hover .action-group, .task:hover .action-group { opacity: 1; }
.action-btn { background: transparent; border: none; color: #6b778c; cursor: pointer; border-radius: 3px; padding: 4px 6px; font-size: 14px; }
.action-btn:hover { background: #091e4214; color: #172b4d; }
.action-btn.delete:hover { color: #d04437; }

.task-list { min-height: 30px; overflow-y: auto; flex-grow: 1; padding-left: 2px; padding-right: 2px; padding-bottom: 25px; }
.task { background-color: white; padding: 10px; margin-bottom: 8px; border-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); cursor: grab; display: flex; flex-direction: column; position: relative; border-left: 5px solid transparent; transition: transform 0.1s, box-shadow 0.1s; }
.task:active { cursor: grabbing; }

.priority-1 { border-left-color: #61bd4f; } 
.priority-2 { border-left-color: #f2d600; } 
.priority-3 { border-left-color: #ff9f1a; } 
.priority-4 { border-left-color: #eb5a46; } 

.task-top-row { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; gap: 8px; }
.task-text { word-wrap: break-word; flex-grow: 1; cursor: pointer; font-size: 15px; color: #172b4d; line-height: 1.4; font-weight: 600;}
.task-text:hover { text-decoration: underline; color: #005282;}

.inline-time-input {
    background: rgba(9, 30, 66, 0.04); border: 1px solid transparent; border-radius: 4px;
    font-size: 11px; color: #5e6c84; padding: 2px 4px; cursor: pointer; font-family: inherit;
    font-weight: 600; transition: 0.2s; width: fit-content;
}
.inline-time-input:hover { background: rgba(9, 30, 66, 0.08); color: #172b4d; }
.inline-time-input:focus { border-color: #0079bf; outline: none; background: white; }

.deadline-badge { font-size: 12px; color: #eb5a46; background: #ffeae6; padding: 2px 6px; border-radius: 3px; display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-weight: 600; width: fit-content; cursor: pointer;}
.deadline-badge:hover { background: #ffc4ba; }
.task-badges { font-size: 12px; color: #5e6c84; margin-top: 8px; display: flex; gap: 10px; align-items: center; }
.badge { display: flex; align-items: center; gap: 4px; }
.badge.green { color: #00875a; font-weight: bold; }
.sortable-ghost { opacity: 0.4; background-color: #c8cdd8; }

.add-task-btn, .add-board-btn { border: none; cursor: pointer; text-align: left; font-size: 14px; }
.add-task-btn { display: block; width: 100%; padding: 8px; margin-top: 10px; background-color: transparent; color: #5e6c84; border-radius: 5px; }
.add-task-btn:hover { background-color: #dadce2; color: #172b4d; }
.add-board-btn { background-color: rgba(0, 0, 0, 0.3); border-radius: 8px; width: 300px; min-width: 300px; padding: 15px; color: white; font-weight: bold; transition: 0.2s; backdrop-filter: blur(4px);}
.add-board-btn:hover { background-color: rgba(0, 0, 0, 0.5); }

.floating-actions { position: fixed; bottom: 30px; right: 30px; display: flex; flex-direction: column; gap: 15px; z-index: 900;}
.float-btn { width: 50px; height: 50px; border-radius: 50%; border: none; font-size: 24px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.2s; display: flex; justify-content: center; align-items: center; text-decoration: none;}
.float-btn:hover { transform: scale(1.1); }
.donate-btn { background-color: #ff9f1a; color: white; }
.feedback-btn { background-color: white; color: #172b4d; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(3px);}
.modal-content { background: #f4f5f7; width: 600px; max-height: 90vh; border-radius: 8px; padding: 20px; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(0,0,0,0.3); overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.modal-title { font-size: 20px; color: #172b4d; margin: 0; font-weight: 600; width: 90%; word-wrap: break-word;}
.close-modal-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: #6b778c; line-height: 1; }
.close-modal-btn:hover { color: #172b4d; }
.task-timestamp { font-size: 12px; color: #5e6c84; font-style: italic; margin-bottom: 20px; }
.detail-section { margin-bottom: 20px; background: white; padding: 15px; border-radius: 6px; border: 1px solid #dfe1e6; box-shadow: 0 1px 2px rgba(0,0,0,0.05);}
.detail-section h3 { font-size: 15px; color: #172b4d; margin-top: 0; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;}

.modal-title-input { font-size: 20px; color: #172b4d; margin: 0; font-weight: 600; width: 85%; border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 4px 8px; font-family: inherit;}
.modal-title-input:hover { border-color: #dfe1e6; background: white;}
.modal-title-input:focus { border-color: #0079bf; background: white; outline: none;}

.priority-select { width: 100%; padding: 8px; border-radius: 4px; border: 1px solid #dfe1e6; font-size: 14px; font-family: inherit; color: #172b4d; background-color: #fafbfc; cursor: pointer; box-sizing: border-box;}
.priority-select:focus { outline: none; border-color: #0079bf; }

.task-desc-input { width: 100%; min-height: 40px; padding: 10px; border-radius: 4px; border: 1px solid #dfe1e6; resize: none; overflow: hidden; font-family: inherit; font-size: 14px; box-sizing: border-box; background: #fafbfc; transition: border 0.2s; line-height: 1.5;}
.task-desc-input:focus { border-color: #0079bf; outline: none; background: white;}

/* CSS MỚI: Textarea subtask 1 dòng */
.subtask-desc { min-height: 30px !important; height: 30px !important; padding: 6px 10px !important; line-height: 1.4; border: 1px dashed transparent !important; background: transparent !important; transition: all 0.2s;}
.subtask-desc:hover { border-color: #dfe1e6 !important; background: white !important;}
.subtask-desc:focus { border-color: #0079bf !important; background: white !important; outline: none;}

.subtask-item { display: flex; align-items: center; justify-content: space-between; background: #fafbfc; padding: 8px 12px; border-radius: 4px; margin-bottom: 8px; border: 1px solid #dfe1e6; }
.subtask-left { display: flex; align-items: center; gap: 10px; flex-grow: 1; overflow: hidden;}
.subtask-checkbox { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0;}
.subtask-text { font-size: 14px; color: #172b4d; }
.subtask-text.done { text-decoration: line-through; color: #8993a4; }
.add-subtask-box { display: flex; gap: 10px; margin-top: 10px; }
.subtask-input { flex-grow: 1; padding: 8px 12px; border: 1px solid #dfe1e6; border-radius: 4px; font-size: 14px;}
.btn-primary { background: #0079bf; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: bold;}
.btn-primary:hover { background: #026aa7; }
.archive-section { margin-bottom: 20px; }
.archive-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; background: white; margin-bottom: 8px; border-radius: 4px; border: 1px solid #dfe1e6;}

@media (max-width: 768px) {
    body { padding: 10px; }
    .top-header { flex-direction: column; align-items: stretch; gap: 15px; }
    .header-actions { justify-content: flex-start; }
    .board { min-width: 85vw; width: 85vw; }
    .add-board-btn { min-width: 85vw; width: 85vw; }
    .modal-content { width: 95% !important; padding: 15px; box-sizing: border-box; }
    .floating-actions { bottom: 15px; right: 15px; gap: 10px; }
    .float-btn { width: 40px; height: 40px; font-size: 18px; }
    .action-group { opacity: 1; background: rgba(255,255,255,0.8); border-radius: 4px;} 
    .action-btn { font-size: 16px; padding: 6px 8px; } 
    .modal-title-input { font-size: 18px; }
}