* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    background: #fff;
    color: #202124;
}

/* LOGIN */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #f8f9fa; }
.login-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.15); width: 320px; }
.login-box h1 { text-align: center; color: #1a73e8; margin: 0 0 4px; }
.login-box .subtitle { text-align: center; color: #5f6368; font-size: 13px; margin-bottom: 20px; }
.login-box label { display: block; font-size: 13px; margin: 12px 0 4px; color: #5f6368; }
.login-box input { width: 100%; padding: 10px; border: 1px solid #dadce0; border-radius: 4px; font-size: 14px; }
.login-box button { width: 100%; margin-top: 20px; padding: 10px; background: #1a73e8; color: #fff; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; }
.login-box button:hover { background: #1765cc; }
.alert-error { background: #fce8e6; color: #c5221f; padding: 8px 12px; border-radius: 4px; font-size: 13px; }

/* APP LAYOUT */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid #e8eaed; }
.brand { font-size: 20px; font-weight: 500; color: #1a73e8; }
.user-menu { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #5f6368; }
.logout-link { color: #1a73e8; text-decoration: none; }

.body-wrap { display: flex; height: calc(100vh - 53px); }
.sidebar { width: 260px; border-right: 1px solid #e8eaed; padding: 16px 8px; overflow-y: auto; }
.views { display: flex; flex-direction: column; margin-bottom: 20px; }
.view-link { padding: 10px 14px; border-radius: 20px; text-decoration: none; color: #202124; font-size: 14px; margin-bottom: 2px; }
.view-link.active, .view-link:hover { background: #e8f0fe; color: #1a73e8; }

.lists-title { font-size: 11px; color: #5f6368; font-weight: 600; letter-spacing: .5px; padding: 8px 14px; }
.list-menu { list-style: none; margin: 0; padding: 0; }
.list-menu li { display: flex; align-items: center; justify-content: space-between; border-radius: 20px; margin-bottom: 2px; }
.list-menu li a { flex: 1; padding: 10px 14px; text-decoration: none; color: #202124; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-menu li.active { background: #e8f0fe; }
.list-menu li.active a { color: #1a73e8; }
.list-menu li:hover { background: #f1f3f4; }
.del-list-btn { background: none; border: none; color: #5f6368; cursor: pointer; font-size: 16px; padding: 0 12px; visibility: hidden; }
.list-menu li:hover .del-list-btn { visibility: visible; }
.add-list-btn { background: none; border: none; color: #1a73e8; font-size: 14px; padding: 10px 14px; cursor: pointer; text-align: left; width: 100%; }
.add-list-btn:hover { background: #f1f3f4; border-radius: 20px; }

.main-content { flex: 1; padding: 24px 40px; max-width: 720px; overflow-y: auto; }
.view-title { font-size: 22px; font-weight: 400; margin: 0 0 20px; }

.add-task-row { display: flex; align-items: center; border: 1px solid #dadce0; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.add-icon { color: #1a73e8; font-size: 18px; margin-right: 12px; }
.add-task-row input { border: none; outline: none; flex: 1; font-size: 14px; }

.task-container { display: flex; flex-direction: column; }
.task-row { display: flex; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid #f1f3f4; cursor: pointer; }
.task-row:hover { background: #f8f9fa; }
.task-row input[type=checkbox] { margin-right: 14px; margin-top: 3px; width: 18px; height: 18px; accent-color: #1a73e8; cursor: pointer; }
.task-main { flex: 1; }
.task-title { font-size: 14px; }
.task-row.completed .task-title { text-decoration: line-through; color: #5f6368; }
.task-meta { font-size: 12px; color: #5f6368; margin-top: 2px; }
.task-meta.overdue { color: #c5221f; }
.subtasks-wrap { margin-left: 32px; }
.subtask-add-inline { font-size: 13px; color: #1a73e8; margin-left: 32px; cursor: pointer; padding: 6px 0; }
.empty-state { color: #5f6368; font-size: 14px; padding: 30px 4px; text-align: center; }
.loading { color: #5f6368; font-size: 14px; padding: 20px 4px; }
.completed-divider { font-size: 13px; color: #5f6368; margin: 16px 0 8px; padding-top: 8px; border-top: 1px solid #f1f3f4; }
.list-label { font-size: 11px; color: #1a73e8; background: #e8f0fe; border-radius: 10px; padding: 2px 8px; margin-left: 6px; }

/* TASK PANEL */
.task-panel { position: fixed; top: 0; right: 0; width: 360px; height: 100vh; background: #fff; box-shadow: -2px 0 8px rgba(0,0,0,.15); padding: 16px 20px; transition: transform .2s; z-index: 50; }
.task-panel.hidden { transform: translateX(100%); }
.panel-header button { background: none; border: none; font-size: 20px; cursor: pointer; color: #5f6368; }
.panel-body { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.panel-body input[type=text], .panel-body textarea, .panel-body input[type=date] {
    border: none; border-bottom: 1px solid #dadce0; padding: 8px 2px; font-size: 15px; outline: none; resize: vertical;
}
.panel-body input[type=text]:focus, .panel-body textarea:focus, .panel-body input[type=date]:focus { border-bottom-color: #1a73e8; }
#panelTitle { font-size: 16px; font-weight: 500; }
.subtask-section { margin-top: 10px; border-top: 1px solid #f1f3f4; padding-top: 10px; }
.subtask-title { font-size: 12px; color: #5f6368; font-weight: 600; margin-bottom: 6px; }
#subtaskList { list-style: none; padding: 0; margin: 0 0 8px; }
#subtaskList li { display: flex; align-items: center; padding: 4px 0; font-size: 14px; }
#subtaskList li input[type=checkbox] { margin-right: 8px; }
#subtaskList li.completed span { text-decoration: line-through; color: #5f6368; }
.delete-btn { margin-top: 20px; background: none; border: 1px solid #dadce0; color: #c5221f; padding: 8px; border-radius: 4px; cursor: pointer; }
.delete-btn:hover { background: #fce8e6; }

@media (max-width: 720px) {
    .sidebar { display: none; }
    .main-content { padding: 16px; }
    .task-panel { width: 100%; }
}
