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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

button,
input,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 80px;
    text-align: center;
}

.login-box h1 {
    margin-bottom: 24px;
    font-size: 28px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background: #555;
}

.error {
    color: #d32f2f;
    margin-bottom: 16px;
}

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

header h1 {
    font-size: 28px;
}

.logout {
    color: #666;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.logout:hover {
    color: #333;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab {
    padding: 8px 16px;
    background: #eee;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.tab:hover {
    background: #ddd;
}

.tab.active {
    background: #333;
    color: #fff;
}

#add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

#add-form input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#add-form button {
    padding: 12px 24px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

#add-form button:hover {
    background: #555;
}

#todo-list {
    list-style: none;
}

.todo-item {
    background: #fff;
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.todo-main {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    cursor: pointer;
}

.todo-title {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 16px;
    cursor: pointer;
}

.todo-title:hover {
    color: #666;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: #999;
}

.todo-archive,
.todo-restore {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    flex: 0 0 auto;
}

.todo-archive:hover {
    background: #f5f5f5;
    color: #333;
}

.todo-restore:hover {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.todo-details {
    padding: 0 12px 12px 44px;
    color: #666;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 16px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

.timestamp {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
